[Armadeus-commitlog] SF.net SVN: armadeus:[935] trunk
Brought to you by:
sszy
|
From: <ar...@us...> - 2008-12-08 13:25:56
|
Revision: 935
http://armadeus.svn.sourceforge.net/armadeus/?rev=935&view=rev
Author: artemys
Date: 2008-12-08 13:25:52 +0000 (Mon, 08 Dec 2008)
Log Message:
-----------
[LINUX] Makes max1027 driver compiles again with Linux 2.6.23.1
Modified Paths:
--------------
trunk/buildroot/target/device/armadeus/apf9328/apf9328-linux-2.6.23.1.config
trunk/target/linux/modules/max1027/max1027.c
Added Paths:
-----------
trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.23.1/linux-2.6.23.1-063-armadeus-max1027-add_max1027_include.patch
Modified: trunk/buildroot/target/device/armadeus/apf9328/apf9328-linux-2.6.23.1.config
===================================================================
--- trunk/buildroot/target/device/armadeus/apf9328/apf9328-linux-2.6.23.1.config 2008-12-07 15:48:43 UTC (rev 934)
+++ trunk/buildroot/target/device/armadeus/apf9328/apf9328-linux-2.6.23.1.config 2008-12-08 13:25:52 UTC (rev 935)
@@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.23.1
-# Thu Oct 30 12:23:07 2008
+# Mon Dec 8 13:53:53 2008
#
CONFIG_ARM=y
CONFIG_SYS_SUPPORTS_APM_EMULATION=y
@@ -832,7 +832,7 @@
CONFIG_ARMADEUS_GPIO_DRIVER=m
CONFIG_ARMADEUS_PPDEV_DRIVER=m
CONFIG_ARMADEUS_KEYPAD_DRIVER=m
-# CONFIG_ARMADEUS_FAST_MAX1027 is not set
+CONFIG_ARMADEUS_MAX1027=m
#
# FPGA related
Added: trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.23.1/linux-2.6.23.1-063-armadeus-max1027-add_max1027_include.patch
===================================================================
--- trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.23.1/linux-2.6.23.1-063-armadeus-max1027-add_max1027_include.patch (rev 0)
+++ trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.23.1/linux-2.6.23.1-063-armadeus-max1027-add_max1027_include.patch 2008-12-08 13:25:52 UTC (rev 935)
@@ -0,0 +1,67 @@
+--- linux-2.6.23.1.ref/include/linux/spi/max1027.h 2008-11-18 06:04:39.000000000 +0100
++++ linux-2.6.23.1/include/linux/spi/max1027.h 2008-11-18 06:04:39.000000000 +0100
+@@ -0,0 +1,64 @@
++/*
++ * include/linux/spi/max1027.h
++ *
++ * 8x10bits ADC
++ *
++ * Copyright (c) 2008 Armadeus Systems
++ *
++ * This package is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License as published by
++ * the Free Software Foundation; either version 2 of the License, or
++ * (at your option) any later version.
++ *
++ * This package is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this package; if not, write to the Free Software
++ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
++ */
++
++#ifndef __LINUX_SPI_MAX1027_H
++#define __LINUX_SPI_MAX1027_H
++
++#define SCAN_MODE_00 0
++#define SCAN_MODE_01 1
++#define SCAN_MODE_10 2
++#define SCAN_MODE_11 3
++
++#define MAX1027_CONV_CHSEL(x) ((x&0x0f)<<3)
++#define MAX1027_CONV_SCAN(x) ((x&0x03)<<1)
++#define GET_SCAN_MODE(conv) ( (conv & 0x06) >> 1 )
++#define MAX1027_CONV_TEMP 0x01
++
++#define MAX1027_SETUP_CLKSEL(x) ((x&0x03)<<4)
++#define MAX1027_SETUP_REFSEL(x) ((x&0x03)<<2)
++#define MAX1027_SETUP_DIFFSEL(x) (x&0x03)
++
++#define MAX1027_AVG_AVGON(x) ((x&0x01)<<4)
++#define MAX1027_AVG_NAVG(x) ((x&0x03)<<2)
++#define MAX1027_AVG_NSCAN(x) (x&0x03)
++
++/* All channels and temperature are scanned per conversion */
++#define MAX1027_CONV_DEFAULT (MAX1027_CONV_CHSEL(6) | \
++ MAX1027_CONV_SCAN(0) | MAX1027_CONV_TEMP)
++/* Internal clock and reference stays on */
++#define MAX1027_SETUP_DEFAULT (MAX1027_SETUP_CLKSEL(0) | \
++ MAX1027_SETUP_REFSEL(2))
++/* Averaging Off */
++#define MAX1027_AVG_DEFAULT ( MAX1027_AVG_AVGON(0) )
++
++struct spi_device;
++struct max1027_config {
++ u8 conv; /* initial conversion register value*/
++ u8 setup; /* initial setup register value */
++ u8 avg; /* initial average register value */
++ int cnvst_pin; /*gpio to start conversion. -1 for software start */
++ int (*init)(struct spi_device *spi);
++ int (*exit)(struct spi_device *spi);
++};
++
++
++#endif /* __LINUX_SPI_MAX1027_H */
Modified: trunk/target/linux/modules/max1027/max1027.c
===================================================================
--- trunk/target/linux/modules/max1027/max1027.c 2008-12-07 15:48:43 UTC (rev 934)
+++ trunk/target/linux/modules/max1027/max1027.c 2008-12-08 13:25:52 UTC (rev 935)
@@ -29,9 +29,11 @@
#include <linux/interrupt.h> /* request_irq */
#include <linux/version.h>
#include <linux/spi/max1027.h>
-#include <mach/gpio.h>
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)
#include <linux/cdev.h> /* struct class_device */
+#include <asm/arch/gpio.h>
+#else
+#include <mach/gpio.h>
#endif
#include <linux/device.h>
#include <linux/err.h>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|