[Armadeus-commitlog] armadeus branch, master, updated. release-3.2-506-g31cfdef
Brought to you by:
sszy
|
From: Fabien M <fa...@us...> - 2010-06-25 16:26:40
|
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 31cfdef71c95d991a4bf41d72a68a64744b89692 (commit)
via 96e188bcc108ff176542c980f55bdabe8d2f6627 (commit)
via 6e8b9a7a9275fb90146b8962fb2ab70abe4ed25a (commit)
from 8fdf22c35b3fb338b5eb523a37bcd31521aa82b0 (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 31cfdef71c95d991a4bf41d72a68a64744b89692
Merge: 96e188bcc108ff176542c980f55bdabe8d2f6627 8fdf22c35b3fb338b5eb523a37bcd31521aa82b0
Author: Fabien Marteau <fab...@ar...>
Date: Fri Jun 25 18:26:01 2010 +0200
Merge branch 'master' of ssh://fabm@armadeus.git.sourceforge.net/gitroot/armadeus/armadeus
commit 96e188bcc108ff176542c980f55bdabe8d2f6627
Author: Fabien Marteau <fab...@ar...>
Date: Fri Jun 25 18:25:44 2010 +0200
parenthesis
commit 6e8b9a7a9275fb90146b8962fb2ab70abe4ed25a
Author: Fabien Marteau <fab...@ar...>
Date: Fri Jun 25 18:03:20 2010 +0200
[linux] adding_as5011_joystick_driver
-----------------------------------------------------------------------
Summary of changes:
...ing_mangling_capability_on_i2c_mxc_driver.patch | 118 ++++++++---
...us-joystick-adding_as5011_joystick_driver.patch | 241 ++++++++++++++++++++
2 files changed, 332 insertions(+), 27 deletions(-)
create mode 100644 buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/359-armadeus-joystick-adding_as5011_joystick_driver.patch
diff --git a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/358-armadeus-imx-adding_mangling_capability_on_i2c_mxc_driver.patch b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/358-armadeus-imx-adding_mangling_capability_on_i2c_mxc_driver.patch
index ed1cd95..4b0d46d 100644
--- a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/358-armadeus-imx-adding_mangling_capability_on_i2c_mxc_driver.patch
+++ b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/358-armadeus-imx-adding_mangling_capability_on_i2c_mxc_driver.patch
@@ -4,8 +4,8 @@ Signed-off-by: Fabien Marteau <fab...@ar...>
Index: linux-2.6.29.6/drivers/i2c/busses/i2c-mxc.c
===================================================================
---- linux-2.6.29.6.orig/drivers/i2c/busses/i2c-mxc.c 2010-06-23 17:56:23.000000000 +0200
-+++ linux-2.6.29.6/drivers/i2c/busses/i2c-mxc.c 2010-06-24 09:42:49.000000000 +0200
+--- linux-2.6.29.6.orig/drivers/i2c/busses/i2c-mxc.c 2010-06-25 18:19:38.000000000 +0200
++++ linux-2.6.29.6/drivers/i2c/busses/i2c-mxc.c 2010-06-25 18:23:43.000000000 +0200
@@ -45,6 +45,7 @@
struct clk *clk;
bool low_power;
@@ -14,7 +14,18 @@ Index: linux-2.6.29.6/drivers/i2c/busses/i2c-mxc.c
} imx_i2c_device;
/*
-@@ -118,7 +119,13 @@
+@@ -99,7 +100,9 @@
+ */
+ for (;;) {
+ unsigned int sr = readw(dev->membase + MXC_I2SR);
+- if ((sr & MXC_I2SR_IBB) == 0) break;
++ if ((sr & MXC_I2SR_IBB) == 0) {
++ break;
++ }
+ if (retry-- <= 0) {
+ #ifdef I2C_DEBUG
+ printk(KERN_DEBUG "Bus busy\n");
+@@ -118,7 +121,13 @@
*/
static int imx_i2c_wait_for_tc(imx_i2c_device * dev, int trans_flag)
{
@@ -29,21 +40,22 @@ Index: linux-2.6.29.6/drivers/i2c/busses/i2c-mxc.c
while (retry-- && !transfer_done) {
wait_event_interruptible_timeout(dev->wq,
-@@ -138,8 +145,11 @@
+@@ -138,8 +147,12 @@
#ifdef I2C_DEBUG
printk(KERN_DEBUG "Data not transmitted\n");
#endif
- return -1;
- }
-+ if (trans_flag & I2C_M_IGNORE_NAK)
-+ return 0;
-+ else
-+ return -1;
++ if (trans_flag & I2C_M_IGNORE_NAK) {
++ return 0;
++ } else {
++ return -1;
++ }
+ }
return 0;
}
-@@ -156,7 +166,9 @@
+@@ -156,7 +169,9 @@
* in the data register
*/
addr_trans = msg->addr << 1;
@@ -54,7 +66,7 @@ Index: linux-2.6.29.6/drivers/i2c/busses/i2c-mxc.c
addr_trans |= 0x01;
}
-@@ -196,7 +208,9 @@
+@@ -196,7 +211,9 @@
* in the data register
*/
addr_trans = msg->addr << 1;
@@ -65,7 +77,30 @@ Index: linux-2.6.29.6/drivers/i2c/busses/i2c-mxc.c
addr_trans |= 0x01;
}
cr = readw(dev->membase + MXC_I2CR);
-@@ -245,10 +259,16 @@
+@@ -227,17 +244,19 @@
+ /*
+ * Clear the TXAK bit to gen an ack when receiving only one byte.
+ */
+- if (len == 1)
++ if (len == 1) {
+ cr |= MXC_I2CR_TXAK;
+- else
++ } else {
+ cr &= ~MXC_I2CR_TXAK;
++ }
+
+ writew(cr, dev->membase + MXC_I2CR);
+ /*
+ * Dummy read only at the end of an address cycle
+ */
+- if (addr_comp > 0)
++ if (addr_comp > 0) {
+ readw(dev->membase + MXC_I2DR);
++ }
+
+ for (i = 0; i < len; i++) {
+ /* Wait for data transmission to complete */
+@@ -245,14 +264,21 @@
imx_i2c_stop(dev);
return -1;
}
@@ -83,8 +118,25 @@ Index: linux-2.6.29.6/drivers/i2c/busses/i2c-mxc.c
+ }
writew(cr, dev->membase + MXC_I2CR);
} else if (i == (len - 1)) {
- if (last)
-@@ -352,6 +372,7 @@
+- if (last)
++ if (last) {
+ imx_i2c_stop(dev);
++ }
+ }
+ /* Read the data */
+ *buf++ = readw(dev->membase + MXC_I2DR);
+@@ -333,8 +359,9 @@
+ return -EREMOTEIO;
+ }
+
+- if (num < 1)
++ if (num < 1) {
+ return 0;
++ }
+
+ imx_i2c_module_en(dev, msgs[0].flags);
+ sr = readw(dev->membase + MXC_I2SR);
+@@ -352,6 +379,7 @@
tx_success = false;
for (i = 0; i < num && ret >= 0; i++) {
addr_comp = 0;
@@ -92,7 +144,7 @@ Index: linux-2.6.29.6/drivers/i2c/busses/i2c-mxc.c
/*
* Send the slave address and transfer direction in the
* address cycle
-@@ -372,17 +393,18 @@
+@@ -372,16 +400,18 @@
* changed or the transfer direction changed
*/
if ((msgs[i].addr != msgs[i - 1].addr) ||
@@ -104,23 +156,24 @@ Index: linux-2.6.29.6/drivers/i2c/busses/i2c-mxc.c
- imx_i2c_stop(dev);
- imx_i2c_module_dis(dev);
- return -EREMOTEIO;
+- }
+- addr_comp = 1;
+ ((msgs[i].flags & I2C_M_RD) !=
-+ (msgs[i - 1].flags & I2C_M_RD)))
-+ if ((msgs[i].flags & I2C_M_NOSTART) == 0) {
-+ imx_i2c_repstart(dev, &msgs[i]);
-+ /* Wait for the address cycle to complete */
-+ if (imx_i2c_wait_for_tc(dev, msgs[i].flags)) {
-+ imx_i2c_stop(dev);
-+ imx_i2c_module_dis(dev);
-+ return -EREMOTEIO;
++ (msgs[i - 1].flags & I2C_M_RD))) {
++ if ((msgs[i].flags & I2C_M_NOSTART) == 0) {
++ imx_i2c_repstart(dev, &msgs[i]);
++ /* Wait for the address cycle to complete */
++ if (imx_i2c_wait_for_tc(dev, msgs[i].flags)) {
++ imx_i2c_stop(dev);
++ imx_i2c_module_dis(dev);
++ return -EREMOTEIO;
++ }
+ }
- }
- addr_comp = 1;
-- }
++ addr_comp = 1;
+ }
}
- /* Transfer the data */
-@@ -414,7 +436,7 @@
+@@ -414,7 +444,7 @@
*/
static u32 imx_i2c_func(struct i2c_adapter *adap)
{
@@ -129,3 +182,14 @@ Index: linux-2.6.29.6/drivers/i2c/busses/i2c-mxc.c
}
/*
+@@ -505,8 +535,9 @@
+ {
+ imx_i2c_device *mxcdev = platform_get_drvdata(pdev);
+
+- if (mxcdev == NULL)
++ if (mxcdev == NULL) {
+ return -1;
++ }
+
+ mxcdev->low_power = false;
+ mxcdev->pdata->init(pdev);
diff --git a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/359-armadeus-joystick-adding_as5011_joystick_driver.patch b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/359-armadeus-joystick-adding_as5011_joystick_driver.patch
new file mode 100644
index 0000000..71598d7
--- /dev/null
+++ b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/359-armadeus-joystick-adding_as5011_joystick_driver.patch
@@ -0,0 +1,241 @@
+Adding Austria Microsystem AS5011 joystick driver
+
+Signed-off-by: Fabien Marteau <fab...@ar...>
+
+Index: linux-2.6.29.6/drivers/input/joystick/as5011.c
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ linux-2.6.29.6/drivers/input/joystick/as5011.c 2010-06-25 17:58:01.000000000 +0200
+@@ -0,0 +1,200 @@
++/*
++ * Copyright (c) 2010 Fabien Marteau <fab...@ar...>
++ *
++ * Sponsored by ARMadeus Systems
++ */
++
++/*
++ * Driver for Austria Microsystems joysticks AS5011
++ */
++
++/*
++ * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
++ */
++
++#include <linux/module.h>
++#include <linux/init.h>
++#include <linux/slab.h>
++#include <linux/i2c.h>
++#include <linux/string.h>
++#include <linux/list.h>
++#include <linux/sysfs.h>
++#include <linux/ctype.h>
++#include <linux/hwmon-sysfs.h>
++
++#include <linux/types.h>
++#include <linux/errno.h>
++#include <linux/kernel.h>
++#include <linux/input.h>
++#include <linux/interrupt.h>
++#include <linux/mutex.h>
++
++#include <linux/input.h>
++#include <linux/gpio.h>
++
++#include <linux/as5011.h>
++#define DRIVER_DESC "Driver for Austria Microsystems AS5011 joystick"
++
++MODULE_AUTHOR("Fabien Marteau <fab...@ar...>");
++MODULE_DESCRIPTION(DRIVER_DESC);
++MODULE_LICENSE("GPL");
++
++#define SIZE_NAME 30
++/*
++ * input operations
++ */
++
++static irqreturn_t button_interrupt(int irq, void *dev_id)
++{
++ struct as5011_platform_data *plat_dat = (struct as5011_platform_data *)dev_id;
++ int ret;
++ ret = gpio_get_value(plat_dat->button_gpio);
++ input_report_key(plat_dat->input_dev, BTN_0, 1);
++ input_sync(plat_dat->input_dev);
++ return IRQ_HANDLED;
++}
++
++/*
++ * I2C bus operation
++ */
++static int as5011_probe(struct i2c_client *client, const struct i2c_device_id *id)
++{
++ struct as5011_platform_data *plat_dat = client->dev.platform_data;
++ int retval = 0;
++
++ if (!i2c_check_functionality(client->adapter,I2C_FUNC_PROTOCOL_MANGLING)) {
++ dev_err(&client->dev,
++ "i2c bus does not support protocol mangling, as5011 can't work\n");
++ retval = -ENODEV;
++ goto i2c_protocol_error;
++ }
++
++ plat_dat->input_dev = input_allocate_device();
++ if (plat_dat->input_dev < 0) {
++ dev_err(&client->dev,
++ "not enough memory for input devices structure\n");
++ retval = -ENOMEM;
++ goto input_allocate_device_error;
++ }
++
++ plat_dat->input_dev->evbit[0] = BIT_MASK(EV_KEY);
++ plat_dat->input_dev->keybit[BIT_WORD(BTN_0)] = BIT_MASK(BTN_0);
++
++ plat_dat->button_irq_name = (unsigned char *)kmalloc(sizeof(unsigned char)*SIZE_NAME, GFP_KERNEL);
++ if (plat_dat->button_irq_name == NULL)
++ {
++ dev_err(&client->dev,
++ "not enough memory for input devices irq name\n");
++ retval = -ENOMEM;
++ goto input_allocate_device_name_error;
++ }
++
++
++ retval = snprintf(plat_dat->button_irq_name, SIZE_NAME, "as5011_%d_button", plat_dat->num);
++ if (retval < 0)
++ {
++ dev_err(&client->dev, "as5011: Failed to give button irq name\n");
++ retval = -1; //FIXME:Â find the right code
++ goto button_irq_name_error;
++ }
++
++ if (request_irq(plat_dat->button_irq, button_interrupt,
++ 0, plat_dat->button_irq_name, (void *)plat_dat)) {
++ dev_err(&client->dev, "as5011: Can't allocate irq %d\n",
++ plat_dat->button_irq);
++ retval = -EBUSY;
++ goto request_irq_error;
++ }
++
++ retval = input_register_device(plat_dat->input_dev);
++ if (retval) {
++ dev_err(&client->dev, "as5011: Failed to register device\n");
++ retval = -1; //FIXME:Â find the right code
++ goto input_register_device_error;
++ }
++
++ retval = plat_dat->init_gpio();
++ if (retval < 0) {
++ dev_err(&client->dev, "as5011: Failed to init gpios\n");
++ retval = -1; //FIXME:Â find the right code
++ goto init_gpio_error;
++ }
++
++
++
++ printk(KERN_DEBUG "as5011 probed\n");//XXX
++ return 0;
++
++ /* Error management */
++
++ plat_dat->exit_gpio();
++init_gpio_error:
++ input_unregister_device(plat_dat->input_dev);
++input_register_device_error:
++ free_irq(plat_dat->button_irq, button_interrupt);
++request_irq_error:
++button_irq_name_error:
++ kfree(plat_dat->button_irq_name);
++input_allocate_device_name_error:
++ input_free_device(plat_dat->input_dev);
++input_allocate_device_error:
++i2c_protocol_error:
++ return retval;
++}
++static int as5011_remove(struct i2c_client *client)
++{
++ struct as5011_platform_data *plat_dat = client->dev.platform_data;
++
++ input_unregister_device(plat_dat->input_dev);
++ free_irq(plat_dat->button_irq, plat_dat);
++ kfree(plat_dat->button_irq_name);
++ input_free_device(plat_dat->input_dev);
++ plat_dat->exit_gpio();
++
++ printk(KERN_DEBUG "as5011_remove\n");//XXX
++ return 0;
++}
++static const struct i2c_device_id as5011_id[] = {
++ { "as5011", 0 },
++ { }
++};
++
++static struct i2c_driver as5011_driver = {
++ .driver = {
++ .name = "as5011",
++ },
++ .probe = as5011_probe,
++ .remove = as5011_remove,
++ .id_table = as5011_id,
++};
++
++/*
++ * Module initialization
++ */
++
++static int __init as5011_init(void)
++{
++ printk(KERN_DEBUG "as5011_init\n");//XXX
++ return i2c_add_driver(&as5011_driver);
++}
++
++static void __exit as5011_exit(void)
++{
++ printk(KERN_DEBUG "as5011_exit\n");//XXX
++ i2c_del_driver(&as5011_driver);
++}
++
++module_init(as5011_init);
++module_exit(as5011_exit);
+Index: linux-2.6.29.6/drivers/input/joystick/Kconfig
+===================================================================
+--- linux-2.6.29.6.orig/drivers/input/joystick/Kconfig 2010-06-24 15:11:45.000000000 +0200
++++ linux-2.6.29.6/drivers/input/joystick/Kconfig 2010-06-24 15:15:16.000000000 +0200
+@@ -254,6 +254,15 @@
+ To compile this driver as a module, choose M here: the
+ module will be called amijoy.
+
++config JOYSTICK_AS5011
++ tristate "Austria Microsystem AS5011 joystick"
++ depends on I2C
++ help
++ Say Y here if you have an AS5011 digital joystick.
++
++ To compile this driver as a module, choose M here: the
++ module will be called as5011.
++
+ config JOYSTICK_JOYDUMP
+ tristate "Gameport data dumper"
+ select GAMEPORT
+Index: linux-2.6.29.6/drivers/input/joystick/Makefile
+===================================================================
+--- linux-2.6.29.6.orig/drivers/input/joystick/Makefile 2010-06-24 15:11:05.000000000 +0200
++++ linux-2.6.29.6/drivers/input/joystick/Makefile 2010-06-24 15:11:27.000000000 +0200
+@@ -7,6 +7,7 @@
+ obj-$(CONFIG_JOYSTICK_A3D) += a3d.o
+ obj-$(CONFIG_JOYSTICK_ADI) += adi.o
+ obj-$(CONFIG_JOYSTICK_AMIGA) += amijoy.o
++obj-$(CONFIG_JOYSTICK_AS5011) += as5011.o
+ obj-$(CONFIG_JOYSTICK_ANALOG) += analog.o
+ obj-$(CONFIG_JOYSTICK_COBRA) += cobra.o
+ obj-$(CONFIG_JOYSTICK_DB9) += db9.o
hooks/post-receive
--
armadeus
|