Skip to content

Commit

Permalink
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/git/dtor/input

Pull input layer updates from Dmitry Torokhov:
 - a bunch of new drivers (DA9052/53 touchscreenn controller, Synaptics
   Navpoint, LM8333 keypads, Wacom I2C touhscreen);
 - updates to existing touchpad drivers (ALPS, Sntelic);
 - Wacom driver now supports Intuos5;
 - device-tree bindings in numerous drivers;
 - other cleanups and fixes.

Fix annoying conflict in drivers/input/tablet/wacom_wac.c that I think
implies that the input layer device naming is broken, but let's see.  I
brough it up with Dmitry.

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (57 commits)
  Input: matrix-keymap - fix building keymaps
  Input: spear-keyboard - document DT bindings
  Input: spear-keyboard - add device tree bindings
  Input: matrix-keymap - wire up device tree support
  Input: matrix-keymap - uninline and prepare for device tree support
  Input: adp5588 - add support for gpio names
  Input: omap-keypad - dynamically handle register offsets
  Input: synaptics - fix compile warning
  MAINTAINERS: adjust input-related patterns
  Input: ALPS - switch to using input_mt_report_finger_count
  Input: ALPS - add semi-MT support for v4 protocol
  Input: Add Synaptics NavPoint (PXA27x SSP/SPI) driver
  Input: atmel_mxt_ts - dump each message on just 1 line
  Input: atmel_mxt_ts - do not read extra (checksum) byte
  Input: atmel_mxt_ts - verify object size in mxt_write_object
  Input: atmel_mxt_ts - only allow root to update firmware
  Input: atmel_mxt_ts - use CONFIG_PM_SLEEP
  Input: sentelic - report device's production serial number
  Input: tl6040-vibra - Device Tree support
  Input: evdev - properly handle read/write with count 0
  ...
  • Loading branch information
Linus Torvalds committed May 24, 2012
2 parents ab11ca3 + e644dae commit 2c01e7b
Show file tree
Hide file tree
Showing 106 changed files with 2,845 additions and 1,305 deletions.
15 changes: 8 additions & 7 deletions Documentation/ABI/testing/sysfs-driver-wacom
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ Contact: linux-input@vger.kernel.org
Description:
Attribute group for control of the status LEDs and the OLEDs.
This attribute group is only available for Intuos 4 M, L,
and XL (with LEDs and OLEDs) and Cintiq 21UX2 and Cintiq 24HD
(LEDs only). Therefore its presence implicitly signifies the
presence of said LEDs and OLEDs on the tablet device.
and XL (with LEDs and OLEDs), Intuos 5 (LEDs only), and Cintiq
21UX2 and Cintiq 24HD (LEDs only). Therefore its presence
implicitly signifies the presence of said LEDs and OLEDs on the
tablet device.

What: /sys/bus/usb/devices/<busnum>-<devnum>:<cfg>.<intf>/wacom_led/status0_luminance
Date: August 2011
Expand All @@ -48,10 +49,10 @@ What: /sys/bus/usb/devices/<busnum>-<devnum>:<cfg>.<intf>/wacom_led/status_led0
Date: August 2011
Contact: linux-input@vger.kernel.org
Description:
Writing to this file sets which one of the four (for Intuos 4)
or of the right four (for Cintiq 21UX2 and Cintiq 24HD) status
LEDs is active (0..3). The other three LEDs on the same side are
always inactive.
Writing to this file sets which one of the four (for Intuos 4
and Intuos 5) or of the right four (for Cintiq 21UX2 and Cintiq
24HD) status LEDs is active (0..3). The other three LEDs on the
same side are always inactive.

What: /sys/bus/usb/devices/<busnum>-<devnum>:<cfg>.<intf>/wacom_led/status_led1_select
Date: September 2011
Expand Down
20 changes: 20 additions & 0 deletions Documentation/devicetree/bindings/input/spear-keyboard.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
* SPEAr keyboard controller

Required properties:
- compatible: "st,spear300-kbd"

Optional properties, in addition to those specified by the shared
matrix-keyboard bindings:
- autorepeat: bool: enables key autorepeat
- st,mode: keyboard mode: 0 - 9x9, 1 - 6x6, 2 - 2x2

Example:

kbd@fc400000 {
compatible = "st,spear300-kbd";
reg = <0xfc400000 0x100>;
linux,keymap = < 0x00030012
0x0102003a >;
autorepeat;
st,mode = <0>;
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
* NXP LPC32xx SoC Touchscreen Controller (TSC)

Required properties:
- compatible: must be "nxp,lpc3220-tsc"
- reg: physical base address of the controller and length of memory mapped
region.
- interrupts: The TSC/ADC interrupt

Example:

tsc@40048000 {
compatible = "nxp,lpc3220-tsc";
reg = <0x40048000 0x1000>;
interrupt-parent = <&mic>;
interrupts = <39 0>;
};
37 changes: 37 additions & 0 deletions Documentation/devicetree/bindings/input/twl6040-vibra.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
Vibra driver for the twl6040 family

The vibra driver is a child of the twl6040 MFD dirver.
Documentation/devicetree/bindings/mfd/twl6040.txt

Required properties:
- compatible : Must be "ti,twl6040-vibra";
- interrupts: 4, Vibra overcurrent interrupt
- vddvibl-supply: Regulator supplying the left vibra motor
- vddvibr-supply: Regulator supplying the right vibra motor
- vibldrv_res: Board specific left driver resistance
- vibrdrv_res: Board specific right driver resistance
- viblmotor_res: Board specific left motor resistance
- vibrmotor_res: Board specific right motor resistance

Optional properties:
- vddvibl_uV: If the vddvibl default voltage need to be changed
- vddvibr_uV: If the vddvibr default voltage need to be changed

Example:
/*
* 8-channel high quality low-power audio codec
* http://www.ti.com/lit/ds/symlink/twl6040.pdf
*/
twl6040: twl6040@4b {
...
twl6040_vibra: twl6040@1 {
compatible = "ti,twl6040-vibra";
interrupts = <4>;
vddvibl-supply = <&vbat>;
vddvibr-supply = <&vbat>;
vibldrv_res = <8>;
vibrdrv_res = <3>;
viblmotor_res = <10>;
vibrmotor_res = <10>;
};
};
2 changes: 2 additions & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -3465,6 +3465,8 @@ Q: http://patchwork.kernel.org/project/linux-input/list/
T: git git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input.git
S: Maintained
F: drivers/input/
F: include/linux/input.h
F: include/linux/input/

INPUT MULTITOUCH (MT) PROTOCOL
M: Henrik Rydberg <rydberg@euromail.se>
Expand Down
17 changes: 13 additions & 4 deletions drivers/input/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ config INPUT

if INPUT

config INPUT_OF_MATRIX_KEYMAP
depends on USE_OF
bool

config INPUT_FF_MEMLESS
tristate "Support for memoryless force-feedback devices"
help
Expand Down Expand Up @@ -68,6 +64,19 @@ config INPUT_SPARSEKMAP
To compile this driver as a module, choose M here: the
module will be called sparse-keymap.

config INPUT_MATRIXKMAP
tristate "Matrix keymap support library"
help
Say Y here if you are using a driver for an input
device that uses matrix keymap. This option is only
useful for out-of-tree drivers since in-tree drivers
select it automatically.

If unsure, say N.

To compile this driver as a module, choose M here: the
module will be called matrix-keymap.

comment "Userland interfaces"

config INPUT_MOUSEDEV
Expand Down
2 changes: 1 addition & 1 deletion drivers/input/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ input-core-y := input.o input-compat.o input-mt.o ff-core.o
obj-$(CONFIG_INPUT_FF_MEMLESS) += ff-memless.o
obj-$(CONFIG_INPUT_POLLDEV) += input-polldev.o
obj-$(CONFIG_INPUT_SPARSEKMAP) += sparse-keymap.o
obj-$(CONFIG_INPUT_MATRIXKMAP) += matrix-keymap.o

obj-$(CONFIG_INPUT_MOUSEDEV) += mousedev.o
obj-$(CONFIG_INPUT_JOYDEV) += joydev.o
Expand All @@ -24,4 +25,3 @@ obj-$(CONFIG_INPUT_TOUCHSCREEN) += touchscreen/
obj-$(CONFIG_INPUT_MISC) += misc/

obj-$(CONFIG_INPUT_APMPOWER) += apm-power.o
obj-$(CONFIG_INPUT_OF_MATRIX_KEYMAP) += of_keymap.o
69 changes: 43 additions & 26 deletions drivers/input/evdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,10 @@ static int evdev_grab(struct evdev *evdev, struct evdev_client *client)

static int evdev_ungrab(struct evdev *evdev, struct evdev_client *client)
{
if (evdev->grab != client)
struct evdev_client *grab = rcu_dereference_protected(evdev->grab,
lockdep_is_held(&evdev->mutex));

if (grab != client)
return -EINVAL;

rcu_assign_pointer(evdev->grab, NULL);
Expand Down Expand Up @@ -259,8 +262,7 @@ static int evdev_release(struct inode *inode, struct file *file)
struct evdev *evdev = client->evdev;

mutex_lock(&evdev->mutex);
if (evdev->grab == client)
evdev_ungrab(evdev, client);
evdev_ungrab(evdev, client);
mutex_unlock(&evdev->mutex);

evdev_detach_client(evdev, client);
Expand Down Expand Up @@ -343,7 +345,7 @@ static ssize_t evdev_write(struct file *file, const char __user *buffer,
struct input_event event;
int retval = 0;

if (count < input_event_size())
if (count != 0 && count < input_event_size())
return -EINVAL;

retval = mutex_lock_interruptible(&evdev->mutex);
Expand All @@ -355,7 +357,8 @@ static ssize_t evdev_write(struct file *file, const char __user *buffer,
goto out;
}

do {
while (retval + input_event_size() <= count) {

if (input_event_from_user(buffer + retval, &event)) {
retval = -EFAULT;
goto out;
Expand All @@ -364,7 +367,7 @@ static ssize_t evdev_write(struct file *file, const char __user *buffer,

input_inject_event(&evdev->handle,
event.type, event.code, event.value);
} while (retval + input_event_size() <= count);
}

out:
mutex_unlock(&evdev->mutex);
Expand Down Expand Up @@ -395,35 +398,49 @@ static ssize_t evdev_read(struct file *file, char __user *buffer,
struct evdev_client *client = file->private_data;
struct evdev *evdev = client->evdev;
struct input_event event;
int retval = 0;
size_t read = 0;
int error;

if (count < input_event_size())
if (count != 0 && count < input_event_size())
return -EINVAL;

if (!(file->f_flags & O_NONBLOCK)) {
retval = wait_event_interruptible(evdev->wait,
client->packet_head != client->tail ||
!evdev->exist);
if (retval)
return retval;
}
for (;;) {
if (!evdev->exist)
return -ENODEV;

if (!evdev->exist)
return -ENODEV;
if (client->packet_head == client->tail &&
(file->f_flags & O_NONBLOCK))
return -EAGAIN;

while (retval + input_event_size() <= count &&
evdev_fetch_next_event(client, &event)) {
/*
* count == 0 is special - no IO is done but we check
* for error conditions (see above).
*/
if (count == 0)
break;

if (input_event_to_user(buffer + retval, &event))
return -EFAULT;
while (read + input_event_size() <= count &&
evdev_fetch_next_event(client, &event)) {

retval += input_event_size();
}
if (input_event_to_user(buffer + read, &event))
return -EFAULT;

if (retval == 0 && (file->f_flags & O_NONBLOCK))
return -EAGAIN;
read += input_event_size();
}

return retval;
if (read)
break;

if (!(file->f_flags & O_NONBLOCK)) {
error = wait_event_interruptible(evdev->wait,
client->packet_head != client->tail ||
!evdev->exist);
if (error)
return error;
}
}

return read;
}

/* No kernel lock - fine */
Expand Down
13 changes: 1 addition & 12 deletions drivers/input/gameport/emu10k1-gp.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,15 +125,4 @@ static struct pci_driver emu_driver = {
.remove = __devexit_p(emu_remove),
};

static int __init emu_init(void)
{
return pci_register_driver(&emu_driver);
}

static void __exit emu_exit(void)
{
pci_unregister_driver(&emu_driver);
}

module_init(emu_init);
module_exit(emu_exit);
module_pci_driver(emu_driver);
16 changes: 2 additions & 14 deletions drivers/input/gameport/fm801-gp.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ static const struct pci_device_id fm801_gp_id_table[] = {
{ PCI_VENDOR_ID_FORTEMEDIA, PCI_DEVICE_ID_FM801_GP, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
{ 0 }
};
MODULE_DEVICE_TABLE(pci, fm801_gp_id_table);

static struct pci_driver fm801_gp_driver = {
.name = "FM801_gameport",
Expand All @@ -152,20 +153,7 @@ static struct pci_driver fm801_gp_driver = {
.remove = __devexit_p(fm801_gp_remove),
};

static int __init fm801_gp_init(void)
{
return pci_register_driver(&fm801_gp_driver);
}

static void __exit fm801_gp_exit(void)
{
pci_unregister_driver(&fm801_gp_driver);
}

module_init(fm801_gp_init);
module_exit(fm801_gp_exit);

MODULE_DEVICE_TABLE(pci, fm801_gp_id_table);
module_pci_driver(fm801_gp_driver);

MODULE_DESCRIPTION("FM801 gameport driver");
MODULE_AUTHOR("Takashi Iwai <tiwai@suse.de>");
Expand Down
13 changes: 1 addition & 12 deletions drivers/input/joystick/a3d.c
Original file line number Diff line number Diff line change
Expand Up @@ -413,15 +413,4 @@ static struct gameport_driver a3d_drv = {
.disconnect = a3d_disconnect,
};

static int __init a3d_init(void)
{
return gameport_register_driver(&a3d_drv);
}

static void __exit a3d_exit(void)
{
gameport_unregister_driver(&a3d_drv);
}

module_init(a3d_init);
module_exit(a3d_exit);
module_gameport_driver(a3d_drv);
17 changes: 1 addition & 16 deletions drivers/input/joystick/adi.c
Original file line number Diff line number Diff line change
Expand Up @@ -557,10 +557,6 @@ static void adi_disconnect(struct gameport *gameport)
kfree(port);
}

/*
* The gameport device structure.
*/

static struct gameport_driver adi_drv = {
.driver = {
.name = "adi",
Expand All @@ -570,15 +566,4 @@ static struct gameport_driver adi_drv = {
.disconnect = adi_disconnect,
};

static int __init adi_init(void)
{
return gameport_register_driver(&adi_drv);
}

static void __exit adi_exit(void)
{
gameport_unregister_driver(&adi_drv);
}

module_init(adi_init);
module_exit(adi_exit);
module_gameport_driver(adi_drv);
13 changes: 1 addition & 12 deletions drivers/input/joystick/cobra.c
Original file line number Diff line number Diff line change
Expand Up @@ -261,15 +261,4 @@ static struct gameport_driver cobra_drv = {
.disconnect = cobra_disconnect,
};

static int __init cobra_init(void)
{
return gameport_register_driver(&cobra_drv);
}

static void __exit cobra_exit(void)
{
gameport_unregister_driver(&cobra_drv);
}

module_init(cobra_init);
module_exit(cobra_exit);
module_gameport_driver(cobra_drv);
Loading

0 comments on commit 2c01e7b

Please sign in to comment.