summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2011-10-12Input: force feedback - potential integer wrap in input_ff_create()Dan Carpenter
The problem here is that max_effects can wrap on 32 bits systems. We'd allocate a smaller amount of data than sizeof(struct ff_device). The call to kcalloc() on the next line would fail but it would write the NULL return outside of the memory we just allocated causing data corruption. The call path is that uinput_setup_device() get ->ff_effects_max from the user and sets the value in the ->private_data struct. From there it is: -> uinput_ioctl_handler() -> uinput_create_device() -> input_ff_create(dev, udev->ff_effects_max); I've also changed ff_effects_max so it's an unsigned int instead of a signed int as a cleanup. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2011-10-11Input: tsc2007 - make sure that X plate resistance is specifiedPhilip Rakity
Abort driver initialization if X plate resistance was not specified in platform data as it will cause pressure to be always calculated as 0, and making userspace ignore touch coordinates. Signed-off-by: Philip Rakity <prakity@marvell.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2011-10-10Input: serio_raw - fix memory leak when closing char deviceDmitry Torokhov
Apparently we never freed memory allocated when users open our char devices nor removed old users from the list of connected clients. Also unregister misc device immediately upon disconnecting the port instead of waiting until last user drops off (refcounting in misc device code will make sure needed pieces stay around while they are needed) and make sure we are not holing holding serio_raw_mutex when registering/unregistering misc device. This should fix potential deadlock between serio_raw and misc device code uncovered by lockdep and reported by Thomas Tuttle. Reviewed-by: Wanlong Gao <gaowanlong@cn.fujitsu.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2011-10-10Input: serio_raw - kick clients when disconnecting portDmitry Torokhov
Send SIGIO/POLL_HUP and otherwise wake up waiters when corresponding serio port is being disconnected. Also check if port is dead in serio_raw_poll and signal POLLHUP|POLLERR. This should speed up process of releasing dead devices by userspace applications. Reviewed-by: Wanlong Gao <gaowanlong@cn.fujitsu.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2011-10-10Input: serio_raw - explicitly mark disconnected ports as deadDmitry Torokhov
Instead of relying on setting serio_raw->serio to NULL upon disconnecting ports mark them explicitly as "dead". Also take and carry reference to underlying serio port to make sure it does not go away until we are done with it. Reviewed-by: Wanlong Gao <gaowanlong@cn.fujitsu.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2011-10-10Input: serio_raw - fix coding style issuesDmitry Torokhov
This makes checkpatch.pl happy with the driver Reviewed-by: Wanlong Gao <gaowanlong@cn.fujitsu.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2011-10-10Input: serio_raw - use dev_*() for messagesDmitry Torokhov
This will ensure our reporting is consistent with the rest of the system. Reviewed-by: Wanlong Gao <gaowanlong@cn.fujitsu.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2011-10-10Input: serio_raw - use bool for boolean dataDmitry Torokhov
Reviewed-by: Wanlong Gao <gaowanlong@cn.fujitsu.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2011-10-10Input: serio_raw - perform proper locking when adding clients to listDmitry Torokhov
Make sure we hold serio lock when adding clients to client list so that we do not race with serio_raw_release() removing clients from the same list. Reviewed-by: Wanlong Gao <gaowanlong@cn.fujitsu.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2011-10-10Input: serio_raw - rename serio_raw_list to serio_raw_clientDmitry Torokhov
'serio_raw_list' and 'list' names do not accurately represent their objects and are extremely confusing when reading the code. Let's use better suited names. Reviewed-by: Wanlong Gao <gaowanlong@cn.fujitsu.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2011-10-10Input: serio_raw - use kref instead of rolling out its own refcountingDmitry Torokhov
Reviewed-by: Wanlong Gao <gaowanlong@cn.fujitsu.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2011-10-10Input: psmouse - switch to using dev_*() for messagesDmitry Torokhov
This will ensure our reporting is consistent with the rest of the system and we do not refer to obsolete source file names. Reviewed-by: Wanlong Gao <gaowanlong@cn.fujitsu.com> Reviewed-by: JJ Ding <dgdunix@gmail.com> Reviewed-by: Daniel Kurtz <djkurtz@chromium.org> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2011-10-10Input: wacom - correct max Y value on medium bamboosChris Bagwell
Medium size Bamboo P&T driver reused max X/Y form older Bamboo 1 medium size tablets and never updated to real value. Actual active area of tablet is slightly larger in Y direction. Signed-off-by: Chris Bagwell <chris@cnpbagwell.com> Acked-by: Ping Cheng <pingc@wacom.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2011-10-10Input: wacom - add ABS_DISTANCE to Bamboo Pen reportsChris Bagwell
Tablet reports a distance of 0 right at highest point possible to be in proximity and distance_max when touching tablet. Inverse the distance since user land has no way of knowing ABS_DISTANCE is not distance from tablet. Signed-off-by: Chris Bagwell <chris@cnpbagwell.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2011-10-10Input: wacom - remove unneeded touch pressure initializationChris Bagwell
These were left in during removal of touch pressure reports but not needed now. Signed-off-by: Chris Bagwell <chris@cnpbagwell.com> Reviewed-by: Ping Cheng <pingc@wacom.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2011-10-06Input: lm8323 - wrap suspend and resume in CONFIG_PM_SLEEPDmitry Torokhov
CONFIG_PM is defined when CONFIG_PM_SLEEP or CONFIG_PM_RUNTIME is defined, however suspend and resume methods are only valid in the context of CONFIG_PM_SLEEP. If only CONFIG_PM_RUNTIME is defined we get the following warning (courtesy of Geerts randconfig builds): lm8323.c: warning: 'lm8323_resume' defined but not used Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2011-10-06Input: ad7879-i2c - wrap suspend and resume in CONFIG_PM_SLEEPDmitry Torokhov
CONFIG_PM is defined when CONFIG_PM_SLEEP or CONFIG_PM_RUNTIME is defined, however suspend and resume methods are only valid in the context of CONFIG_PM_SLEEP. If only CONFIG_PM_RUNTIME is defined we get the following warning (courtesy of Geerts randconfig builds): ad7879-i2c.c: warning: 'ad7879_i2c_resume' defined but not used Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2011-10-06Input: synaptics_i2c - wrap suspend and resume in CONFIG_PM_SLEEPDmitry Torokhov
CONFIG_PM is defined when CONFIG_PM_SLEEP or CONFIG_PM_RUNTIME is defined, however suspend and resume methods are only valid in context of CONFIG_PM_SLEEP. If only CONFIG_PM_RUNTIME is defined we get the following warning (courtesy of Geerts randconfig builds): synaptics_i2c.c: warning: 'synaptics_i2c_resume' defined but not used Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2011-10-06Input: mma8450 - silence some 'uninitialized variable' warningsDmitry Torokhov
Sometimes GCC is not smart enough to recognize that x, y and z are always used properly initialized in mma8450_poll(). Let's rearrange the code a bit to help GCC. Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2011-10-06Input: atmel_mxt_ts - use snprintf for sysfs attribute show methodDaniel Kurtz
Sysfs attribute show methods are always passed a buffer of length PAGE_SIZE. To keep from overwriting this buffer and causing havoc, use snprintf() to guarantee we never write more than the buffer can hold. In addition, at least for my touchscreen, the number and size of objects was far too big to fit in a single 4K page. Therefore, this patch also trims some redundant framing text to leave more room for actual data. Signed-off-by: Daniel Kurtz <djkurtz@chromium.org> Acked-by: Nick Dyer <nick.dyer@itdev.co.uk> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2011-10-05Input: wacom - make LED status readable through sysfsPing Cheng
Reviewed-by: Eduard Hasenleithner <eduard@hasenleithner.at> Tested-by: Eduard Hasenleithner <eduard@hasenleithner.at> Signed-off-by: Ping Cheng <pingc@wacom.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2011-10-05Input: wacom - add LED support for Cintiq 21ux2Ping Cheng
Cintiq 21ux2 has two sets of four LEDs on right and left side of the tablet, respectively. Reviewed-by: Eduard Hasenleithner <eduard@hasenleithner.at> Tested-by: Eduard Hasenleithner <eduard@hasenleithner.at> Signed-off-by: Ping Cheng <pingc@wacom.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2011-10-05Input: wacom - don't expose LED inactive optionPing Cheng
The LED also indicates the status of the tablet. Don't turn it off. Reviewed-by: Eduard Hasenleithner <eduard@hasenleithner.at> Tested-by: Eduard Hasenleithner <eduard@hasenleithner.at> Signed-off-by: Ping Cheng <pingc@wacom.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2011-10-05Input: wacom - lower the LED luminancePing Cheng
The LED luminance level is normally lower when no button is pressed. Reviewed-by: Eduard Hasenleithner <eduard@hasenleithner.at> Tested-by: Eduard Hasenleithner <eduard@hasenleithner.at> Signed-off-by: Ping Cheng <pingc@wacom.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2011-09-28Input: add a driver for TSC-40 serial touchscreenSebastian Andrzej Siewior
This patch adds the TSC-40 serial touchscreen driver and should be compatible with TSC-10 and TSC-25. The driver was written by Linutronix on behalf of Bachmann electronic GmbH. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2011-09-20Input: adxl34x - documentation cleanupMichael Tandy
This patch clarifies a few bits of documentation in the header file for the adxl34x driver. Signed-off-by: Michael Tandy <lkml@mkt.me.uk> Acked-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2011-09-20Input: gpio_keys - use of_property_read_u32()Tobias Klauser
Use the of_property_read_u32() helper function to retrieve u32 values from the device tree. Also do not pass the len parameter to of_get_property if it isn't checked afterwards. Signed-off-by: Tobias Klauser <tklauser@distanz.ch> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2011-09-20Input: penmount - simplify unregister procedureDmitry Torokhov
Since touchscreen driver does not handle any events to be sent to the device we can close serio port first and then unregister the input device. Tested-by: John Sung <penmount.touch@gmail.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2011-09-20Input: penmount - rework handling of different protocolsDmitry Torokhov
Instead of having one large switch based on product ID use pointer to function actually doing protocol decoding. Tested-by: John Sung <penmount.touch@gmail.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2011-09-20Input: penmount - add PenMount 6250 supportJohn Sung
Add multi touch support for PenMount 6250 touch controller. Signed-off-by: John Sung <penmount.touch@gmail.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2011-09-20Input: penmount - add PenMount 3000 supportJohn Sung
Add dual touch support for PenMount 3000 touch controller. Signed-off-by: John Sung <penmount.touch@gmail.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2011-09-20Input: penmount - add PenMount 6000 supportJohn Sung
Add support for PenMount 6000 touch controller. Signed-off-by: John Sung <penmount.touch@gmail.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2011-09-20Input: penmount - fix the protocolJohn Sung
The MSB and LSB of the XY axis value are switched according to the PenMount 9000 protocol. The driver name is also changed from penmountlpc, since it is not for LPC interface at all. Signed-off-by: John Sung <penmount.touch@gmail.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2011-09-20Input: elantech - remove module parameter force_elantechJJ Ding
This essentially reverts commit f81bc788ff91d4efd4baf88b2c29713838caa8e5. With recent work on elantech driver, I believe we now have complete support for all elantech touchpads. So remove this hack. Signed-off-by: JJ Ding <jj_ding@emc.com.tw> Reviewed-by: Éric Piel <eric.piel@tremplin-utc.net> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2011-09-20Input: elantech - better support all those v2 variantsJJ Ding
V2 hardware has many variants. This patch adddresses two issues: - some model also has debounce packets, but with a different signature than v3. Now we just check debounce for all v2 hardware. - due to different scanning methods the hardware uses, x and y ranges have to be calculated differently. And for some specific versions, we can just see them as custom-made, so set {x, y} the same values as Windows driver does. Signed-off-by: JJ Ding <jj_ding@emc.com.tw> Tested-by: Richard Schütz <r.schtz@t-online.de> Reviewed-by: Éric Piel <eric.piel@tremplin-utc.net> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2011-09-09Input: elantech - add v4 hardware supportJJ Ding
v4 hardware is a true multitouch capable touchpad (up to 5 fingers). The packet format is quite complex, please see protocol document for reference. Signed-off-by: JJ Ding <jj_ding@emc.com.tw> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2011-09-09Input: elantech - add v3 hardware supportJJ Ding
v3 hardware's packet format is almost identical to v2 (one/three finger touch), except when sensing two finger touch, the hardware sends 12 bytes of data. Signed-off-by: JJ Ding <jj_ding@emc.com.tw> Acked-by: Daniel Kurtz <djkurtz@chromium.org> Acked-by: Éric Piel <eric.piel@tremplin-utc.net> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2011-09-09Input: elantech - clean up elantech_initJJ Ding
Group property setting code into elantech_set_properties. Signed-off-by: JJ Ding <jj_ding@emc.com.tw> Acked-by: Daniel Kurtz <djkurtz@chromium.org> Acked-by: Éric Piel <eric.piel@tremplin-utc.net> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2011-09-09Input: elantech - packet checking for v2 hardwareJJ Ding
For v2 hardware, there is no real parity check, but we can still check some constant bits for data integrity. Also rename elantech_check_parity_v1 to elantech_packet_check_v1 to make these packet checking function names consistent. Signed-off-by: JJ Ding <jj_ding@emc.com.tw> Acked-by: Daniel Kurtz <djkurtz@chromium.org> Acked-by: Éric Piel <eric.piel@tremplin-utc.net> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2011-09-09Input: elantech - remove ETP_EDGE_FUZZ_V2JJ Ding
Don't try to be too clever and remove ETP_EDGE_FUZZ_V2. X, Y ranges should be just the raw resolution of the device. Otherwise, they can cause underflow on the Y axis. Suggested-by: Éric Piel <eric.piel@tremplin-utc.net> Signed-off-by: JJ Ding <jj_ding@emc.com.tw> Acked-by: Daniel Kurtz <djkurtz@chromium.org> Acked-by: Éric Piel <eric.piel@tremplin-utc.net> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2011-09-09Input: elantech - use firmware provided x, y rangesJJ Ding
With newer hardware, the touchpad provides range info. Let's use it. Signed-off-by: JJ Ding <jj_ding@emc.com.tw> Acked-by: Daniel Kurtz <djkurtz@chromium.org> Acked-by: Éric Piel <eric.piel@tremplin-utc.net> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2011-09-09Input: elantech - get rid of ETP_2FT_* in elantech.hJJ Ding
For two finger touches the coordinate of each finger gets reported separately but with reduced resolution. With this change, we now have the same range for ST and MT data and scale MT data because it has lower resolution to match ST. Suggested-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: JJ Ding <jj_ding@emc.com.tw> Acked-by: Daniel Kurtz <djkurtz@chromium.org> Acked-by: Éric Piel <eric.piel@tremplin-utc.net> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2011-09-09Input: elantech - correct x, y value range for v2 hardwareJJ Ding
x, y values are actually 12-bit long. Also update protocol document to reflect the change. Signed-off-by: JJ Ding <jj_ding@emc.com.tw> Acked-by: Daniel Kurtz <djkurtz@chromium.org> Acked-by: Éric Piel <eric.piel@tremplin-utc.net> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2011-09-09Input: twl6040-vibra - fix compiler warningRandy Dunlap
Fix warning from Geert's build summary emails by changing "if" to "ifdef". Thsi should fix the following: drivers/input/misc/twl6040-vibra.c:231:5: warning: "CONFIG_PM_SLEEP" is not defined Builds cleanly with CONFIG_PM_SLEEP enabled or disabled. Signed-off-by: Randy Dunlap <rdunlap@xenotime.net> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2011-09-09Input: tegra-kbc - tighten lockingDmitry Torokhov
Take spinlock when entering ISR and timer routine to ensure that we do not race while enabling/disabling FIFO interrupts. Also we do not need to take teh spinlock in tegra_kbc_startremove() since interrupt is completely disabled. Tested-by: Rakesh Iyer <riyer@nvidia.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2011-09-09Input: tegra-kbc - fix wakeup from suspendRakesh Iyer
For wakeup to be reliable, kbc needs to be in interrupt mode before suspend. Created common routine to control the FIFO interrupt. Added synchronization to ensure orderly suspend. Signed-off-by: Rakesh Iyer <riyer@nvidia.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2011-09-08Input: tc3589x-keypad - fix section mismatch warningHarvey Yang
WARNING: drivers/input/keyboard/built-in.o(.text+0xb55b): Section mismatch in reference from the function tc3589x_keypad_open() to the function .devinit.text:tc3589x_keypad_init_key_hardware() The function tc3589x_keypad_open() references the function __devinit tc3589x_keypad_init_key_hardware(). This is often because tc3589x_keypad_open lacks a __devinit annotation or the annotation of tc3589x_keypad_init_key_hardware is wrong. Signed-off-by: Harvey Yang <harvey.huawei.yang@gmail.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2011-09-07Input: remove IRQF_DISABLED from driversYong Zhang
This flag is a NOOP and can be removed now. Signed-off-by: Yong Zhang <yong.zhang0@gmail.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2011-09-07Input: wacom - add Intuos4 LED and OLED controlEduard Hasenleithner
This commit enables control of the LEDs and OLED displays found on the Wacom Intuos4 M, L, and XL. For this purpose, a new "wacom_led" attribute group is added to the sysfs entry of the USB device. This "wacom_led" group only shows up when the correct device (M, L, or XL) is detected. The attributes are described in Documentation/ABI/testing/sysfs-wacom Signed-off-by: Eduard Hasenleithner <eduard@hasenleithner.at> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2011-09-07Merge commit 'v3.1-rc4' into nextDmitry Torokhov