From bd3ce6556072bdc8ea66dfd5448e184f189bdc7f Mon Sep 17 00:00:00 2001 From: H Hartley Sweeten Date: Fri, 17 Apr 2009 20:12:35 -0700 Subject: Input: rotary_encoder - add support for REL_* axes The rotary encoder driver only supports returning input events for ABS_* axes, this adds support for REL_* axes. The relative axis input event is reported as -1 for each counter-clockwise step and +1 for each clockwise step. The ability to clamp the position of ABS_* axes between 0 and a maximum of "steps" has also been added. Signed-off-by: H Hartley Sweeten Signed-off-by: Daniel Mack Signed-off-by: Dmitry Torokhov --- include/linux/rotary_encoder.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/linux/rotary_encoder.h b/include/linux/rotary_encoder.h index 12d63a30c34..215278b8df2 100644 --- a/include/linux/rotary_encoder.h +++ b/include/linux/rotary_encoder.h @@ -8,6 +8,8 @@ struct rotary_encoder_platform_data { unsigned int gpio_b; unsigned int inverted_a; unsigned int inverted_b; + bool relative_axis; + bool rollover; }; #endif /* __ROTARY_ENCODER_H__ */ -- cgit v1.2.3 From 7e044e056a6aa0dc695db50461d7b326fde15e8b Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Sat, 9 May 2009 16:08:05 -0700 Subject: Input: serio - do not use deprecated dev.power.power_state Signed-off-by: Dmitry Torokhov --- include/linux/gameport.h | 3 ++- include/linux/serio.h | 9 ++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/linux/gameport.h b/include/linux/gameport.h index 0cd825f7363..1bc08541c2b 100644 --- a/include/linux/gameport.h +++ b/include/linux/gameport.h @@ -11,6 +11,7 @@ #ifdef __KERNEL__ #include +#include #include #include #include @@ -62,7 +63,7 @@ struct gameport_driver { struct device_driver driver; - unsigned int ignore; + bool ignore; }; #define to_gameport_driver(d) container_of(d, struct gameport_driver, driver) diff --git a/include/linux/serio.h b/include/linux/serio.h index e0417e4d3f1..126d24c9eaa 100644 --- a/include/linux/serio.h +++ b/include/linux/serio.h @@ -15,6 +15,7 @@ #ifdef __KERNEL__ +#include #include #include #include @@ -28,7 +29,10 @@ struct serio { char name[32]; char phys[32]; - unsigned int manual_bind; + bool manual_bind; + bool registered; /* port has been fully registered with driver core */ + bool suspended; /* port is suspended */ + struct serio_device_id id; @@ -47,7 +51,6 @@ struct serio { struct mutex drv_mutex; /* protects serio->drv so attributes can pin driver */ struct device dev; - unsigned int registered; /* port has been fully registered with driver core */ struct list_head node; }; @@ -58,7 +61,7 @@ struct serio_driver { char *description; struct serio_device_id *id_table; - unsigned int manual_bind; + bool manual_bind; void (*write_wakeup)(struct serio *); irqreturn_t (*interrupt)(struct serio *, unsigned char, unsigned int); -- cgit v1.2.3 From a48b2d4a0091904b4cf57d667adc2faf689750d3 Mon Sep 17 00:00:00 2001 From: Felipe Balbi Date: Fri, 15 May 2009 20:12:47 -0700 Subject: Input: introduce lm8323 keypad driver lm8323 is the keypad driver used in n810 device. [akpm@linux-foundation.org: coding-style fixes] [dtor@mail.ru: various cleanups] Signed-off-by: Felipe Balbi Reviewed-by: Trilok Soni Signed-off-by: Andrew Morton Signed-off-by: Dmitry Torokhov --- include/linux/i2c/lm8323.h | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 include/linux/i2c/lm8323.h (limited to 'include') diff --git a/include/linux/i2c/lm8323.h b/include/linux/i2c/lm8323.h new file mode 100644 index 00000000000..478d668bc59 --- /dev/null +++ b/include/linux/i2c/lm8323.h @@ -0,0 +1,46 @@ +/* + * lm8323.h - Configuration for LM8323 keypad driver. + * + * 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 (version 2 of the License only). + * + * 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 + */ + +#ifndef __LINUX_LM8323_H +#define __LINUX_LM8323_H + +#include + +/* + * Largest keycode that the chip can send, plus one, + * so keys can be mapped directly at the index of the + * LM8323 keycode instead of subtracting one. + */ +#define LM8323_KEYMAP_SIZE (0x7f + 1) + +#define LM8323_NUM_PWMS 3 + +struct lm8323_platform_data { + int debounce_time; /* Time to watch for key bouncing, in ms. */ + int active_time; /* Idle time until sleep, in ms. */ + + int size_x; + int size_y; + bool repeat; + const unsigned short *keymap; + + const char *pwm_names[LM8323_NUM_PWMS]; + + const char *name; /* Device name. */ +}; + +#endif /* __LINUX_LM8323_H */ -- cgit v1.2.3 From 86579a4cccf18a2ddbf7de8fc5a0f5d9b94ed76d Mon Sep 17 00:00:00 2001 From: Michael Roth Date: Mon, 18 May 2009 16:04:44 -0700 Subject: Input: ads7846 - support swapping x and y axes Signed-off-by: Michael Roth Signed-off-by: Dmitry Torokhov --- include/linux/spi/ads7846.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/linux/spi/ads7846.h b/include/linux/spi/ads7846.h index 2ea20320c09..51948eb6927 100644 --- a/include/linux/spi/ads7846.h +++ b/include/linux/spi/ads7846.h @@ -17,6 +17,7 @@ struct ads7846_platform_data { u16 vref_mv; /* external vref value, milliVolts */ bool keep_vref_on; /* set to keep vref on for differential * measurements as well */ + bool swap_xy; /* swap x and y axes */ /* Settling time of the analog signals; a function of Vcc and the * capacitance on the X/Y drivers. If set to non-zero, two samples -- cgit v1.2.3 From cbf806dd9302f3ff27ba496dae474b9da6b58873 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Wed, 27 May 2009 06:22:58 -0700 Subject: Input: ucb1400 - move static function from header into core it's a little too large for static line. The ts is currently the only mainline user but Marek Vasut claims that there is a battery driver in an ARM tree which also needs this function. Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Dmitry Torokhov --- include/linux/ucb1400.h | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) (limited to 'include') diff --git a/include/linux/ucb1400.h b/include/linux/ucb1400.h index 970473bf8d5..ed889f4168f 100644 --- a/include/linux/ucb1400.h +++ b/include/linux/ucb1400.h @@ -134,28 +134,13 @@ static inline void ucb1400_adc_enable(struct snd_ac97 *ac97) ucb1400_reg_write(ac97, UCB_ADC_CR, UCB_ADC_ENA); } -static unsigned int ucb1400_adc_read(struct snd_ac97 *ac97, u16 adc_channel, - int adcsync) -{ - unsigned int val; - - if (adcsync) - adc_channel |= UCB_ADC_SYNC_ENA; - - ucb1400_reg_write(ac97, UCB_ADC_CR, UCB_ADC_ENA | adc_channel); - ucb1400_reg_write(ac97, UCB_ADC_CR, UCB_ADC_ENA | adc_channel | - UCB_ADC_START); - - while (!((val = ucb1400_reg_read(ac97, UCB_ADC_DATA)) - & UCB_ADC_DAT_VALID)) - schedule_timeout_uninterruptible(1); - - return val & UCB_ADC_DAT_MASK; -} - static inline void ucb1400_adc_disable(struct snd_ac97 *ac97) { ucb1400_reg_write(ac97, UCB_ADC_CR, 0); } + +unsigned int ucb1400_adc_read(struct snd_ac97 *ac97, u16 adc_channel, + int adcsync); + #endif -- cgit v1.2.3 From ec20a022aa24fc63d3ab59584cb1e5aa9a21d46c Mon Sep 17 00:00:00 2001 From: Tero Saarni Date: Wed, 10 Jun 2009 23:27:24 -0700 Subject: Input: synaptics - add support for reporting x/y resolution Synaptics uses anisotropic coordinate system. On some wide touchpads vertical resolution can be twice as high as horizontal which causes unequal sensitivity on x/y directions. Add support for reading the resolution with EVIOCGABS ioctl. Signed-off-by: Tero Saarni Signed-off-by: Dmitry Torokhov --- include/linux/input.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/linux/input.h b/include/linux/input.h index 6fed4f6a9c9..8b3bc3e0d14 100644 --- a/include/linux/input.h +++ b/include/linux/input.h @@ -53,6 +53,7 @@ struct input_absinfo { __s32 maximum; __s32 fuzz; __s32 flat; + __s32 resolution; }; #define EVIOCGVERSION _IOR('E', 0x01, int) /* get driver version */ @@ -1109,6 +1110,7 @@ struct input_dev { int absmin[ABS_MAX + 1]; int absfuzz[ABS_MAX + 1]; int absflat[ABS_MAX + 1]; + int absres[ABS_MAX + 1]; int (*open)(struct input_dev *dev); void (*close)(struct input_dev *dev); -- cgit v1.2.3