[Armadeus-commitlog] armadeus branch, master, updated. release-3.3-13-gf579f7f
Brought to you by:
sszy
|
From: Fabien M <fa...@us...> - 2010-08-19 10:02:18
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "armadeus".
The branch, master has been updated
via f579f7f283d6abb0e31a1d45b01cda7c955d6778 (commit)
via e3d6ea509e23b4e4a5ca5dd4b69b6f5882a352e9 (commit)
from 2f7e48754eb4f9ff1c070d9b8bd2413abaa73b06 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit f579f7f283d6abb0e31a1d45b01cda7c955d6778
Author: Fabien Marteau <fab...@ar...>
Date: Thu Aug 19 12:01:43 2010 +0200
[linux] adding platform module for as1531
commit e3d6ea509e23b4e4a5ca5dd4b69b6f5882a352e9
Author: Fabien Marteau <fab...@ar...>
Date: Thu Aug 19 11:59:11 2010 +0200
[linux] Print channel value in milivolt
-----------------------------------------------------------------------
Summary of changes:
...363-armadeus-ADC-Adding_AS1531_adc_driver.patch | 34 +++++-
target/linux/modules/Kconfig | 2 +
target/linux/modules/Makefile | 2 +-
target/linux/modules/as1531_platform/Kconfig | 11 ++
.../modules/{max9768 => as1531_platform}/Makefile | 4 +-
target/linux/modules/as1531_platform/as1531_plat.c | 116 ++++++++++++++++++++
6 files changed, 159 insertions(+), 10 deletions(-)
create mode 100644 target/linux/modules/as1531_platform/Kconfig
copy target/linux/modules/{max9768 => as1531_platform}/Makefile (79%)
mode change 100644 => 100755
create mode 100644 target/linux/modules/as1531_platform/as1531_plat.c
diff --git a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/363-armadeus-ADC-Adding_AS1531_adc_driver.patch b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/363-armadeus-ADC-Adding_AS1531_adc_driver.patch
index fdab75f..06e86e3 100644
--- a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/363-armadeus-ADC-Adding_AS1531_adc_driver.patch
+++ b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/363-armadeus-ADC-Adding_AS1531_adc_driver.patch
@@ -6,7 +6,7 @@ Signed-off-by: Fabien Marteau <fab...@ar...>
Index: linux-2.6.29.6/drivers/hwmon/as1531.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.29.6/drivers/hwmon/as1531.c 2010-08-18 17:43:10.000000000 +0200
++++ linux-2.6.29.6/drivers/hwmon/as1531.c 2010-08-19 10:34:37.000000000 +0200
@@ -0,0 +1,298 @@
+/*
+ * as1531.c
@@ -43,7 +43,7 @@ Index: linux-2.6.29.6/drivers/hwmon/as1531.c
+#include <linux/spi/spi.h>
+
+#define AS1531_SPI_SPEED 64941
-+#define AS1531_MAX_VALUE 4095
++#define AS1531_MAX_VALUE 2500
+
+#define AS1531_START_BIT 0x80
+#define AS1531_CHAN0 (0<<4)
@@ -175,7 +175,7 @@ Index: linux-2.6.29.6/drivers/hwmon/as1531.c
+ if (status < 0)
+ goto out;
+
-+ status = sprintf(buf, "%d\n", ret_value);
++ status = sprintf(buf, "%d\n", ret_value*2500/4096);
+out:
+ mutex_unlock(&adc->lock);
+ return status;
@@ -308,8 +308,8 @@ Index: linux-2.6.29.6/drivers/hwmon/as1531.c
+MODULE_DESCRIPTION("Driver for AS1531 ADC");
Index: linux-2.6.29.6/drivers/hwmon/Kconfig
===================================================================
---- linux-2.6.29.6.orig/drivers/hwmon/Kconfig 2010-08-17 16:24:13.000000000 +0200
-+++ linux-2.6.29.6/drivers/hwmon/Kconfig 2010-08-17 16:45:26.000000000 +0200
+--- linux-2.6.29.6.orig/drivers/hwmon/Kconfig 2009-03-24 00:12:14.000000000 +0100
++++ linux-2.6.29.6/drivers/hwmon/Kconfig 2010-08-19 09:58:10.000000000 +0200
@@ -93,6 +93,14 @@
This driver can also be built as a module. If so, the module
will be called adcxx.
@@ -327,8 +327,8 @@ Index: linux-2.6.29.6/drivers/hwmon/Kconfig
depends on I2C
Index: linux-2.6.29.6/drivers/hwmon/Makefile
===================================================================
---- linux-2.6.29.6.orig/drivers/hwmon/Makefile 2010-08-17 16:24:10.000000000 +0200
-+++ linux-2.6.29.6/drivers/hwmon/Makefile 2010-08-17 16:45:55.000000000 +0200
+--- linux-2.6.29.6.orig/drivers/hwmon/Makefile 2009-03-24 00:12:14.000000000 +0100
++++ linux-2.6.29.6/drivers/hwmon/Makefile 2010-08-19 09:58:10.000000000 +0200
@@ -18,6 +18,7 @@
obj-$(CONFIG_SENSORS_AD7414) += ad7414.o
obj-$(CONFIG_SENSORS_AD7418) += ad7418.o
@@ -337,3 +337,23 @@ Index: linux-2.6.29.6/drivers/hwmon/Makefile
obj-$(CONFIG_SENSORS_ADM1021) += adm1021.o
obj-$(CONFIG_SENSORS_ADM1025) += adm1025.o
obj-$(CONFIG_SENSORS_ADM1026) += adm1026.o
+Index: linux-2.6.29.6/Documentation/hwmon/as1531
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ linux-2.6.29.6/Documentation/hwmon/as1531 2010-08-19 10:14:41.000000000 +0200
+@@ -0,0 +1,15 @@
++Kernel driver as1531
++====================
++
++Supported chips:
++ * Austriamicrosystems AS1531
++ Datasheet: http://www.austriamicrosystems.com/eng/Products/Data-Converters/A-D-Converter/AS1531
++
++Author:
++ Fabien Marteau <fab...@ar...>
++
++Description
++-----------
++
++This driver implements support for the Austriamicrosystems AS1531
++12bits 8channels Analog to Digital Converter.
diff --git a/target/linux/modules/Kconfig b/target/linux/modules/Kconfig
index 5b72c11..82abbe5 100644
--- a/target/linux/modules/Kconfig
+++ b/target/linux/modules/Kconfig
@@ -15,6 +15,8 @@ comment "Misc."
source "drivers/armadeus/generic/Kconfig"
+source "drivers/armadeus/as1531_platform/Kconfig"
+
source "drivers/armadeus/gpio/Kconfig"
source "drivers/armadeus/imxlkeypad/Kconfig"
diff --git a/target/linux/modules/Makefile b/target/linux/modules/Makefile
index c548550..6e14e40 100755
--- a/target/linux/modules/Makefile
+++ b/target/linux/modules/Makefile
@@ -9,7 +9,7 @@ ifneq ($(KERNELRELEASE),)
# Part executed when called from kernel build system:
obj-$(CONFIG_ARMADEUS_DRIVERS) += gpio/ pwm/ backlight/ isp1761/ \
- imxlkeypad/ fpga/ max1027/ max9768/ display/
+ imxlkeypad/ fpga/ max1027/ max9768/ display/ as1531_platform/
else
diff --git a/target/linux/modules/as1531_platform/Kconfig b/target/linux/modules/as1531_platform/Kconfig
new file mode 100644
index 0000000..2b06294
--- /dev/null
+++ b/target/linux/modules/as1531_platform/Kconfig
@@ -0,0 +1,11 @@
+#
+#
+
+config ARMADEUS_AS1531_PLAT
+ tristate "AS1531 platform data"
+ default n
+ depends on ARMADEUS_DRIVERS
+ select SENSORS_AS1531
+ ---help---
+ Specific platform data for as1531 plugged on apf27-Dev board
+ on SPI3.
diff --git a/target/linux/modules/max9768/Makefile b/target/linux/modules/as1531_platform/Makefile
old mode 100644
new mode 100755
similarity index 79%
copy from target/linux/modules/max9768/Makefile
copy to target/linux/modules/as1531_platform/Makefile
index d60e4f4..34154bf
--- a/target/linux/modules/max9768/Makefile
+++ b/target/linux/modules/as1531_platform/Makefile
@@ -1,11 +1,11 @@
#
-# Makefile for the Armadeus MAX9768 custom driver
+# Makefile for the Armadeus specific as1531 platform module
#
# Part executed when called from kernel build system:
ifneq ($(KERNELRELEASE),)
-obj-$(CONFIG_ARMADEUS_MAX9768) += max9768.o
+obj-$(CONFIG_ARMADEUS_AS1531_PLAT) += as1531_plat.o
# Part executed when called from standard make in this directory:
# (preferably use Makefile in parent directory)
diff --git a/target/linux/modules/as1531_platform/as1531_plat.c b/target/linux/modules/as1531_platform/as1531_plat.c
new file mode 100644
index 0000000..8222353
--- /dev/null
+++ b/target/linux/modules/as1531_platform/as1531_plat.c
@@ -0,0 +1,116 @@
+/*
+ * as1531.c
+ *
+ * Platform data for driver as1531.
+ *
+ * Copyright (c) 2010 Fabien Marteau <fab...@ar...>
+ * sponsored by ARMadeus Systems.
+ *
+ * This program 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 program 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 program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/device.h>
+#include <linux/err.h>
+#include <linux/sysfs.h>
+#include <linux/hwmon.h>
+#include <linux/hwmon-sysfs.h>
+#include <linux/mutex.h>
+#include <linux/spi/spi.h>
+#include <linux/platform_device.h>
+#include <mach/common.h>
+#include <mach/hardware.h>
+#include <mach/iomux-mx1-mx2.h>
+#include <mach/gpio.h>
+#include <../mach-imx/include/mach/spi_imx.h>
+
+#define AS1531_CS (GPIO_PORTE | 21)
+/* spi3*/
+#define AS1531_SPI_BUS_NUM 2
+
+
+struct spi_device *as1531_spi_dev;
+
+static int as1531_pins[] = {
+ (AS1531_CS | GPIO_OUT | GPIO_GPIO),
+};
+
+static int as1531_init_gpio(void)
+{
+ gpio_set_value(AS1531_CS, 1);
+ return mxc_gpio_setup_multiple_pins(as1531_pins, ARRAY_SIZE(as1531_pins), "as1531");
+}
+
+/* Chip select command for as1531 */
+static void as1531_cs(u32 command)
+{
+ if (command == SPI_CS_DEASSERT)
+ gpio_set_value(AS1531_CS, 1);
+ else
+ gpio_set_value(AS1531_CS, 0);
+}
+
+static struct spi_imx_chip as1531_hw = {
+ .cs_control = as1531_cs,
+};
+
+static struct spi_board_info spi_as1531_board[] = {
+ {
+ .modalias = "as1531",
+ .controller_data = &as1531_hw,
+ .max_speed_hz = 1000000, /* 1MHz */
+ .bus_num = AS1531_SPI_BUS_NUM,
+ .mode = SPI_MODE_3,
+ .chip_select = 0,
+ .platform_data = NULL,
+ }
+};
+
+
+static int __init init_as1531_plat(void)
+{
+ if (as1531_init_gpio() < 0)
+ {
+ printk(KERN_ERR "Can't initialize gpio CS for as1531 spi\n");
+ return -1;
+ }
+
+ as1531_spi_dev = spi_new_device(
+ spi_busnum_to_master(AS1531_SPI_BUS_NUM),
+ spi_as1531_board);
+ if (as1531_spi_dev == NULL) {
+ printk(KERN_ERR "Can't register as1531_spi_dev\n");
+ goto register_error;
+ }
+
+ return 0;
+register_error:
+ return -1;
+}
+
+static void __exit exit_as1531_plat(void)
+{
+ spi_unregister_device(as1531_spi_dev);
+}
+
+module_init(init_as1531_plat);
+module_exit(exit_as1531_plat);
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Fabien Marteau <fab...@ar...>");
+MODULE_DESCRIPTION("Platform data for AS1531 ADC");
+
hooks/post-receive
--
armadeus
|