Input/Joystick Driver: add support AD7142 joystick driver (v2)
Subsystems (3)
PATCH 1/1 Input/Joystick Driver: add support AD7142 joystick driver (v2)
v1-v2:
- Remove depends on Blackfin
- Add module information to Kconfig
- Fixup duplicated Signed-off-by
--- drivers/input/joystick/Kconfig | 9 + drivers/input/joystick/Makefile | 1 + drivers/input/joystick/ad7142.c | 447 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 457 insertions(+), 0 deletions(-) create mode 100644 drivers/input/joystick/ad7142.c
drivers/input/joystick/Kconfig +9 -0
@@ -282,4 +282,13 @@ config JOYSTICK_XPAD_LEDS This option enables support for the LED which surrounds the Big X on XBox 360 controller. +config JOYSTICK_AD7142 + tristate "Analog Devices AD7142 Joystick support" + depends on I2C + ---help--- + Say Y here if you want to support an AD7142 joystick + + To compile this driver as a module, choose M here: the + module will be called ad7142. + endif
drivers/input/joystick/Makefile +1 -0
@@ -5,6 +5,7 @@ # Each configuration option enables a list of files. obj-$(CONFIG_JOYSTICK_A3D) += a3d.o +obj-$(CONFIG_JOYSTICK_AD7142) += ad7142.o obj-$(CONFIG_JOYSTICK_ADI) += adi.o obj-$(CONFIG_JOYSTICK_AMIGA) += amijoy.o obj-$(CONFIG_JOYSTICK_ANALOG) += analog.o
drivers/input/joystick/ad7142.c new file +447 -0
447 lines not on this page · raw message
Signature · 1 line
1.5.4.3
Dmitry Torokhov
maintainerHi Bryan,
drivers/input/joystick/ad7142.c line 379
Quoted 9 lines · Bryan Wu
drivers/input/joystick/ad7142.c new file +9
-0+ input->keybit[BIT_WORD (BTN_BASE )] =BIT_MASK (BTN_BASE ) | +BIT_MASK (BTN_BASE2 ) | +BIT_MASK (BTN_BASE3 ) | +BIT_MASK (BTN_BASE4 ); + input->keybit[BIT_WORD (KEY_UP )] |=BIT_MASK (KEY_UP ) | +BIT_MASK (KEY_DOWN ) | +BIT_MASK (KEY_LEFT ) | +BIT_MASK (KEY_RIGHT ); +
Why don't you use REL_X/REL_Y to report directional movement? Using buttons for that is pretty unusual.
Signature · 6 lines
Dmitry _______________________________________________ i2c mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/i2c
Quoted 14 lines · Dmitry Torokhov
Hi Bryan,
drivers/input/joystick/ad7142.c line 379
Quoted 9 lines · Bryan Wu
drivers/input/joystick/ad7142.c new file +9
-0+ input->keybit[BIT_WORD (BTN_BASE )] =BIT_MASK (BTN_BASE ) | +BIT_MASK (BTN_BASE2 ) | +BIT_MASK (BTN_BASE3 ) | +BIT_MASK (BTN_BASE4 ); + input->keybit[BIT_WORD (KEY_UP )] |=BIT_MASK (KEY_UP ) | +BIT_MASK (KEY_DOWN ) | +BIT_MASK (KEY_LEFT ) | +BIT_MASK (KEY_RIGHT ); +
Quoted 3 lines
Why don't you use REL_X/REL_Y to report directional movement? Using buttons for that is pretty unusual.
In our development board, it includes UP/DOWN/LEFT/RIGHT 4 buttons. So this driver matches this.
Please found some information about the hardware as below:
http://docs.blackfin.uclinux.org/doku.php?id=capacitance_touch_sensors&s[]=ad7142
Thanks
-Bryan
Dmitry Torokhov
maintainerQuoted 16 lines · Bryan Wu
Quoted 14 lines · Dmitry Torokhov
Hi Bryan,
Quoted 9 lines · Bryan Wu
drivers/input/joystick/ad7142.c new file +9
-0+ input->keybit[BIT_WORD (BTN_BASE )] =BIT_MASK (BTN_BASE ) | +BIT_MASK (BTN_BASE2 ) | +BIT_MASK (BTN_BASE3 ) | +BIT_MASK (BTN_BASE4 ); + input->keybit[BIT_WORD (KEY_UP )] |=BIT_MASK (KEY_UP ) | +BIT_MASK (KEY_DOWN ) | +BIT_MASK (KEY_LEFT ) | +BIT_MASK (KEY_RIGHT ); +
Quoted 8 lines
Quoted 3 lines
Why don't you use REL_X/REL_Y to report directional movement? Using buttons for that is pretty unusual.
In our development board, it includes UP/DOWN/LEFT/RIGHT 4 buttons. So this driver matches this.
Please found some information about the hardware as below:
http://docs.blackfin.uclinux.org/doku.php?id=capacitance_touch_sensors&s[]=ad7142
What is the expected behaviur when a person touches one of these buttons? Is it generatig a left/rigth mouse button clocks or moving a pointer in some direction? Judging by the category of the devices you are placing it in (joystick) it seems that latter is what you want, therefore it should generate REL_X and REL_Y events. Otherwise it should probably be called a button driver and live either in drivers/input/keyboard or driver/input/misc. Do you agree?
Thanks.
Signature · 1 line
Dmitry
Re: [PATCH 1/1] Input/Joystick Driver: add support AD7142 joystickdriver (v2)
On Fri 25 Apr 2008 11:39, Dmitry Torokhov pondered:
Quoted 13 lines · Bryan Wu
Quoted 4 lines
Quoted 2 lines · Dmitry Torokhov
Hi Bryan,
Quoted 8 lines
Quoted 3 lines
Why don't you use REL_X/REL_Y to report directional movement? Using buttons for that is pretty unusual.
In our development board, it includes UP/DOWN/LEFT/RIGHT 4 buttons. So this driver matches this.
Please found some information about the hardware as below:
Quoted 5 lines
http://docs.blackfin.uclinux.org/doku.php?id=capacitance_touch_sensors&s
[]=ad7142What is the expected behaviur when a person touches one of these buttons?
It depends on the design of the button on the target hardware. They can be pretty much any number of different shapes and sizes. Buttons, wheels, scroll-bar, joypad, and touchpad shapes can be laid out as traces on the sensor PCB. While we tested/wrote something for what we had hardware to verify, it is not restricted to this.
As Bryan indicated - have a look at:
http://docs.blackfin.uclinux.org/doku.php?id=capacitance_touch_sensors#overview
for a variety of options.
Quoted 6 lines
Is it generatig a left/rigth mouse button clocks or moving a pointer in some direction? Judging by the category of the devices you are placing it in (joystick) it seems that latter is what you want, therefore it should generate
REL_XandREL_Yevents. Otherwise it should probably be called a button driver and live either indrivers/input/keyboardor driver/input/misc. Do you agree?
If someone makes a joypad, it is a joypad. If someone makes a button, it is a button. The specific ad7142_work function will need to be modified to match the hardware design.
So, I am not sure where it should live - maybe driver/input/misc since it can be so many different things. The issue (in my mind) is how it gets exposed to userspace. If someone makes a joypad - they want it to show up as a joystick, so they don't have to modify any standard userspace applications to use it.
-Robin
Quoted 27 lines · Dmitry Torokhov
Quoted 16 lines · Bryan Wu
Quoted 14 lines · Dmitry Torokhov
Hi Bryan,
Quoted 9 lines · Bryan Wu
drivers/input/joystick/ad7142.c new file +9
-0+ input->keybit[BIT_WORD (BTN_BASE )] =BIT_MASK (BTN_BASE ) | +BIT_MASK (BTN_BASE2 ) | +BIT_MASK (BTN_BASE3 ) | +BIT_MASK (BTN_BASE4 ); + input->keybit[BIT_WORD (KEY_UP )] |=BIT_MASK (KEY_UP ) | +BIT_MASK (KEY_DOWN ) | +BIT_MASK (KEY_LEFT ) | +BIT_MASK (KEY_RIGHT ); +Quoted 8 lines
Quoted 3 lines
Why don't you use REL_X/REL_Y to report directional movement? Using buttons for that is pretty unusual.
In our development board, it includes UP/DOWN/LEFT/RIGHT 4 buttons. So this driver matches this.
Please found some information about the hardware as below:
http://docs.blackfin.uclinux.org/doku.php?id=capacitance_touch_sensors&s[]=ad7142
Quoted 8 lines
What is the expected behaviur when a person touches one of these buttons? Is it generatig a left/rigth mouse button clocks or moving a pointer in some direction? Judging by the category of the devices you are placing it in (joystick) it seems that latter is what you want, therefore it should generate
REL_XandREL_Yevents. Otherwise it should probably be called a button driver and live either indrivers/input/keyboardor driver/input/misc. Do you agree?
AD7142 is a chip for input devices over i2c interface. So it can be a joystick, joypad or other input devices.
And this driver is an example for real product driver developers.
Maybe drivers/input/misc is OK for this driver.
Thanks
-Bryan