[PATCH] input: joystick: Adding Austria Microsystem AS5011 joystick driver (third version)

Previous thread: [PATCH] Update atime from future. by yangsheng on Tuesday, January 4, 2011 - 2:08 am. (1 message)

Next thread: [PATCH] tracing, perf : add cpu hotplug trace events by Vincent Guittot on Tuesday, January 4, 2011 - 2:50 am. (1 message)
From: Fabien Marteau
Date: Tuesday, January 4, 2011 - 2:47 am

Driver for EasyPoint AS5011 2 axis joystick chip. This chip is plugged
 on an I2C bus. It has been tested on ARM processor (i.MX27).

Third version, according to Dmitry Torokhov and Trilok Soni comments.


Signed-off-by: Fabien Marteau <fabien.marteau@armadeus.com>
---
 drivers/input/joystick/Kconfig  |    9 +
 drivers/input/joystick/Makefile |    1 +
 drivers/input/joystick/as5011.c |  377 +++++++++++++++++++++++++++++++++++++++
 include/linux/as5011.h          |   35 ++++
 4 files changed, 422 insertions(+), 0 deletions(-)
 create mode 100644 drivers/input/joystick/as5011.c
 create mode 100644 include/linux/as5011.h

diff --git a/drivers/input/joystick/Kconfig b/drivers/input/joystick/Kconfig
index 5b59616..5fad03e 100644
--- a/drivers/input/joystick/Kconfig
+++ b/drivers/input/joystick/Kconfig
@@ -255,6 +255,15 @@ config JOYSTICK_AMIGA
 	  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
diff --git a/drivers/input/joystick/Makefile b/drivers/input/joystick/Makefile
index f3a8cbe..92dc0de 100644
--- a/drivers/input/joystick/Makefile
+++ b/drivers/input/joystick/Makefile
@@ -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
diff --git a/drivers/input/joystick/as5011.c b/drivers/input/joystick/as5011.c
new file mode 100644
index 0000000..066a125
--- /dev/null
+++ b/drivers/input/joystick/as5011.c
@@ -0,0 +1,377 @@
+/*
+ * Copyright (c) 2010, 2011 ...
From: Trilok Soni
Date: Tuesday, January 4, 2011 - 4:01 am

Hi Fabien,




Are you using anything from this file? Please audit this list and remove

I don't find anybody using these #defines. Please remove the defines which


I don't find gpio_request call for this gpio anywhere in this driver. I prefer
that we do that for each gpio we use in the driver itself. Only muxing stuff

I prefer that i2c_read wrapper here would return the actual error code instead,
and have one function argument to return the "x, y" co-ordinates, that way




Would you prefer to move some of the initialization of the chip except
reset of controller to open() call, so that if there is no user of this


These private stuff should not be part of your platform data structure. When we say
platform data meaning that it will be all public with "const". Please allocate
local data structure in the probe itself with these private members. You can refer
other drivers.


---Trilok Soni

-- 
Sent by a consultant of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
--

Previous thread: [PATCH] Update atime from future. by yangsheng on Tuesday, January 4, 2011 - 2:08 am. (1 message)

Next thread: [PATCH] tracing, perf : add cpu hotplug trace events by Vincent Guittot on Tuesday, January 4, 2011 - 2:50 am. (1 message)