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 updates from Dmitry Torokhov:
 "Updates for the input subsystem.  You will get an new drivers for
  Hyper-V synthetic keyboard and for Neonode zForce touchscreens, plus a
  bunch of driver fixes and cleanups"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (49 commits)
  Revert "Input: ALPS - add support for model found on Dell XT2"
  arm: dts: am335x sk: add touchscreen support
  Input: ti_am335x_tsc - fix spelling mistake in TSC/ADC DT binding
  Input: cyttsp4 - replace IS_ERR and PTR_ERR with PTR_ERR_OR_ZERO
  Input: mma8450 - add missing i2c_set_clientdata() in mma8450_probe()
  Input: mpu3050 - add missing i2c_set_clientdata() in mpu3050_probe()
  Input: tnetv107x-keypad - make irqs signed for error handling
  Input: add driver for Neonode zForce based touchscreens
  Input: sh_keysc - enable the driver on all ARM platforms
  Input: remove a redundant max() call
  Input: mousedev - allow disabling even without CONFIG_EXPERT
  Input: allow deselecting serio drivers even without CONFIG_EXPERT
  Input: i8042 - add PNP modaliases
  Input: evdev - fall back to vmalloc for client event buffer
  Input: cypress_ps2 - do not consider data bad if palm is detected
  Input: cypress_ps2 - remove useless cast
  Input: fix PWM-related undefined reference errors
  Input: ALPS - change secondary device's name
  Input: wacom - not all multi-interface devices support touch
  Input: nspire-keypad - add missing clk_disable_unprepare() on error path
  ...
  • Loading branch information
torvalds committed Nov 16, 2013
2 parents db0b2d0 + 4224909 commit 4937e2a
Show file tree
Hide file tree
Showing 47 changed files with 1,585 additions and 128 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Required properties:
ti,wires: Wires refer to application modes i.e. 4/5/8 wire touchscreen
support on the platform.
ti,x-plate-resistance: X plate resistance
ti,coordiante-readouts: The sequencer supports a total of 16
ti,coordinate-readouts: The sequencer supports a total of 16
programmable steps each step is used to
read a single coordinate. A single
readout is enough but multiple reads can
Expand Down
3 changes: 3 additions & 0 deletions Documentation/input/gamepad.txt
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,14 @@ D-Pad:
BTN_DPAD_*
Analog buttons are reported as:
ABS_HAT0X and ABS_HAT0Y
(for ABS values negative is left/up, positive is right/down)

Analog-Sticks:
The left analog-stick is reported as ABS_X, ABS_Y. The right analog stick is
reported as ABS_RX, ABS_RY. Zero, one or two sticks may be present.
If analog-sticks provide digital buttons, they are mapped accordingly as
BTN_THUMBL (first/left) and BTN_THUMBR (second/right).
(for ABS values negative is left/up, positive is right/down)

Triggers:
Trigger buttons can be available as digital or analog buttons or both. User-
Expand All @@ -138,6 +140,7 @@ Triggers:
ABS_HAT2X (right/ZR) and BTN_TL2 or ABS_HAT2Y (left/ZL).
If only one trigger-button combination is present (upper+lower), they are
reported as "right" triggers (BTN_TR/ABS_HAT1X).
(ABS trigger values start at 0, pressure is reported as positive values)

Menu-Pad:
Menu buttons are always digital and are mapped according to their location
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/boot/dts/am335x-evm.dts
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,7 @@
tsc {
ti,wires = <4>;
ti,x-plate-resistance = <200>;
ti,coordiante-readouts = <5>;
ti,coordinate-readouts = <5>;
ti,wire-config = <0x00 0x11 0x22 0x33>;
};

Expand Down
10 changes: 10 additions & 0 deletions arch/arm/boot/dts/am335x-evmsk.dts
Original file line number Diff line number Diff line change
Expand Up @@ -485,3 +485,13 @@
tx-num-evt = <1>;
rx-num-evt = <1>;
};

&tscadc {
status = "okay";
tsc {
ti,wires = <4>;
ti,x-plate-resistance = <200>;
ti,coordinate-readouts = <5>;
ti,wire-config = <0x00 0x11 0x22 0x33>;
};
};
2 changes: 1 addition & 1 deletion drivers/input/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ config INPUT_MATRIXKMAP
comment "Userland interfaces"

config INPUT_MOUSEDEV
tristate "Mouse interface" if EXPERT
tristate "Mouse interface"
default y
help
Say Y here if you want your mouse to be accessible as char devices
Expand Down
16 changes: 12 additions & 4 deletions drivers/input/evdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
#include <linux/poll.h>
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/vmalloc.h>
#include <linux/mm.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/input/mt.h>
Expand Down Expand Up @@ -369,7 +371,11 @@ static int evdev_release(struct inode *inode, struct file *file)
mutex_unlock(&evdev->mutex);

evdev_detach_client(evdev, client);
kfree(client);

if (is_vmalloc_addr(client))
vfree(client);
else
kfree(client);

evdev_close_device(evdev);

Expand All @@ -389,12 +395,14 @@ static int evdev_open(struct inode *inode, struct file *file)
{
struct evdev *evdev = container_of(inode->i_cdev, struct evdev, cdev);
unsigned int bufsize = evdev_compute_buffer_size(evdev->handle.dev);
unsigned int size = sizeof(struct evdev_client) +
bufsize * sizeof(struct input_event);
struct evdev_client *client;
int error;

client = kzalloc(sizeof(struct evdev_client) +
bufsize * sizeof(struct input_event),
GFP_KERNEL);
client = kzalloc(size, GFP_KERNEL | __GFP_NOWARN);
if (!client)
client = vzalloc(size);
if (!client)
return -ENOMEM;

Expand Down
2 changes: 1 addition & 1 deletion drivers/input/input.c
Original file line number Diff line number Diff line change
Expand Up @@ -2052,7 +2052,7 @@ int input_register_device(struct input_dev *dev)
if (dev->hint_events_per_packet < packet_size)
dev->hint_events_per_packet = packet_size;

dev->max_vals = max(dev->hint_events_per_packet, packet_size) + 2;
dev->max_vals = dev->hint_events_per_packet + 2;
dev->vals = kcalloc(dev->max_vals, sizeof(*dev->vals), GFP_KERNEL);
if (!dev->vals) {
error = -ENOMEM;
Expand Down
6 changes: 3 additions & 3 deletions drivers/input/keyboard/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Input core configuration
#
menuconfig INPUT_KEYBOARD
bool "Keyboards" if EXPERT || !X86
bool "Keyboards"
default y
help
Say Y here, and a list of supported keyboards will be displayed.
Expand Down Expand Up @@ -67,7 +67,7 @@ config KEYBOARD_ATARI
module will be called atakbd.

config KEYBOARD_ATKBD
tristate "AT keyboard" if EXPERT || !X86
tristate "AT keyboard"
default y
select SERIO
select SERIO_LIBPS2
Expand Down Expand Up @@ -525,7 +525,7 @@ config KEYBOARD_SUNKBD

config KEYBOARD_SH_KEYSC
tristate "SuperH KEYSC keypad support"
depends on SUPERH || ARCH_SHMOBILE
depends on SUPERH || ARM || COMPILE_TEST
help
Say Y here if you want to use a keypad attached to the KEYSC block
on SuperH processors such as sh7722 and sh7343.
Expand Down
1 change: 1 addition & 0 deletions drivers/input/keyboard/gpio_keys.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include <linux/gpio_keys.h>
#include <linux/workqueue.h>
#include <linux/gpio.h>
#include <linux/of.h>
#include <linux/of_platform.h>
#include <linux/of_gpio.h>
#include <linux/spinlock.h>
Expand Down
1 change: 1 addition & 0 deletions drivers/input/keyboard/gpio_keys_polled.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include <linux/platform_device.h>
#include <linux/gpio.h>
#include <linux/gpio_keys.h>
#include <linux/of.h>
#include <linux/of_platform.h>
#include <linux/of_gpio.h>

Expand Down
2 changes: 1 addition & 1 deletion drivers/input/keyboard/lpc32xx-keys.c
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ static struct platform_driver lpc32xx_kscan_driver = {
.name = DRV_NAME,
.owner = THIS_MODULE,
.pm = &lpc32xx_kscan_pm_ops,
.of_match_table = of_match_ptr(lpc32xx_kscan_match),
.of_match_table = lpc32xx_kscan_match,
}
};

Expand Down
6 changes: 4 additions & 2 deletions drivers/input/keyboard/nspire-keypad.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,10 @@ static int nspire_keypad_open(struct input_dev *input)
return error;

error = nspire_keypad_chip_init(keypad);
if (error)
if (error) {
clk_disable_unprepare(keypad->clk);
return error;
}

return 0;
}
Expand Down Expand Up @@ -267,7 +269,7 @@ static struct platform_driver nspire_keypad_driver = {
.driver = {
.name = "nspire-keypad",
.owner = THIS_MODULE,
.of_match_table = of_match_ptr(nspire_keypad_dt_match),
.of_match_table = nspire_keypad_dt_match,
},
.probe = nspire_keypad_probe,
};
Expand Down
1 change: 1 addition & 0 deletions drivers/input/keyboard/pxa27x_keypad.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include <linux/err.h>
#include <linux/input/matrix_keypad.h>
#include <linux/slab.h>
#include <linux/of.h>

#include <asm/mach/arch.h>
#include <asm/mach/map.h>
Expand Down
2 changes: 1 addition & 1 deletion drivers/input/keyboard/tegra-kbc.c
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@ static int tegra_kbc_probe(struct platform_device *pdev)
unsigned int keymap_rows;
const struct of_device_id *match;

match = of_match_device(of_match_ptr(tegra_kbc_of_match), &pdev->dev);
match = of_match_device(tegra_kbc_of_match, &pdev->dev);

kbc = devm_kzalloc(&pdev->dev, sizeof(*kbc), GFP_KERNEL);
if (!kbc) {
Expand Down
4 changes: 2 additions & 2 deletions drivers/input/keyboard/tnetv107x-keypad.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ struct keypad_data {
struct clk *clk;
struct device *dev;
spinlock_t lock;
u32 irq_press;
u32 irq_release;
int irq_press;
int irq_release;
int rows, cols, row_shift;
int debounce_ms, active_low;
u32 prev_keys[3];
Expand Down
4 changes: 2 additions & 2 deletions drivers/input/misc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ config INPUT_MAX8925_ONKEY

config INPUT_MAX8997_HAPTIC
tristate "MAXIM MAX8997 haptic controller support"
depends on HAVE_PWM && MFD_MAX8997
depends on PWM && HAVE_PWM && MFD_MAX8997
select INPUT_FF_MEMLESS
help
This option enables device driver support for the haptic controller
Expand Down Expand Up @@ -461,7 +461,7 @@ config INPUT_PCF8574

config INPUT_PWM_BEEPER
tristate "PWM beeper support"
depends on HAVE_PWM || PWM
depends on PWM && HAVE_PWM
help
Say Y here to get support for PWM based beeper devices.

Expand Down
1 change: 0 additions & 1 deletion drivers/input/misc/ad714x-spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ static int ad714x_spi_remove(struct spi_device *spi)
struct ad714x_chip *chip = spi_get_drvdata(spi);

ad714x_remove(chip);
spi_set_drvdata(spi, NULL);

return 0;
}
Expand Down
2 changes: 0 additions & 2 deletions drivers/input/misc/cobalt_btns.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ static int cobalt_buttons_probe(struct platform_device *pdev)
err_free_mem:
input_free_polled_device(poll_dev);
kfree(bdev);
dev_set_drvdata(&pdev->dev, NULL);
return error;
}

Expand All @@ -144,7 +143,6 @@ static int cobalt_buttons_remove(struct platform_device *pdev)
input_free_polled_device(bdev->poll_dev);
iounmap(bdev->reg);
kfree(bdev);
dev_set_drvdata(dev, NULL);

return 0;
}
Expand Down
4 changes: 3 additions & 1 deletion drivers/input/misc/mma8450.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ static void mma8450_close(struct input_polled_dev *dev)
* I2C init/probing/exit functions
*/
static int mma8450_probe(struct i2c_client *c,
const struct i2c_device_id *id)
const struct i2c_device_id *id)
{
struct input_polled_dev *idev;
struct mma8450 *m;
Expand Down Expand Up @@ -204,6 +204,8 @@ static int mma8450_probe(struct i2c_client *c,
goto err_free_mem;
}

i2c_set_clientdata(c, m);

return 0;

err_free_mem:
Expand Down
1 change: 1 addition & 0 deletions drivers/input/misc/mpu3050.c
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,7 @@ static int mpu3050_probe(struct i2c_client *client,

pm_runtime_enable(&client->dev);
pm_runtime_set_autosuspend_delay(&client->dev, MPU3050_AUTO_DELAY);
i2c_set_clientdata(client, sensor);

return 0;

Expand Down
1 change: 1 addition & 0 deletions drivers/input/misc/pwm-beeper.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include <linux/input.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/pwm.h>
#include <linux/slab.h>
Expand Down
1 change: 0 additions & 1 deletion drivers/input/misc/rb532_button.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ static int rb532_button_remove(struct platform_device *pdev)

input_unregister_polled_device(poll_dev);
input_free_polled_device(poll_dev);
dev_set_drvdata(&pdev->dev, NULL);

return 0;
}
Expand Down
1 change: 1 addition & 0 deletions drivers/input/misc/rotary_encoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include <linux/gpio.h>
#include <linux/rotary_encoder.h>
#include <linux/slab.h>
#include <linux/of.h>
#include <linux/of_platform.h>
#include <linux/of_gpio.h>

Expand Down
2 changes: 1 addition & 1 deletion drivers/input/misc/sirfsoc-onkey.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ static struct platform_driver sirfsoc_pwrc_driver = {
.name = "sirfsoc-pwrc",
.owner = THIS_MODULE,
.pm = &sirfsoc_pwrc_pm_ops,
.of_match_table = of_match_ptr(sirfsoc_pwrc_of_match),
.of_match_table = sirfsoc_pwrc_of_match,
}
};

Expand Down
26 changes: 18 additions & 8 deletions drivers/input/misc/uinput.c
Original file line number Diff line number Diff line change
Expand Up @@ -430,20 +430,30 @@ static int uinput_setup_device(struct uinput_device *udev,
return retval;
}

static ssize_t uinput_inject_event(struct uinput_device *udev,
const char __user *buffer, size_t count)
static ssize_t uinput_inject_events(struct uinput_device *udev,
const char __user *buffer, size_t count)
{
struct input_event ev;
size_t bytes = 0;

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

if (input_event_from_user(buffer, &ev))
return -EFAULT;
while (bytes + input_event_size() <= count) {
/*
* Note that even if some events were fetched successfully
* we are still going to return EFAULT instead of partial
* count to let userspace know that it got it's buffers
* all wrong.
*/
if (input_event_from_user(buffer + bytes, &ev))
return -EFAULT;

input_event(udev->dev, ev.type, ev.code, ev.value);
input_event(udev->dev, ev.type, ev.code, ev.value);
bytes += input_event_size();
}

return input_event_size();
return bytes;
}

static ssize_t uinput_write(struct file *file, const char __user *buffer,
Expand All @@ -460,7 +470,7 @@ static ssize_t uinput_write(struct file *file, const char __user *buffer,
return retval;

retval = udev->state == UIST_CREATED ?
uinput_inject_event(udev, buffer, count) :
uinput_inject_events(udev, buffer, count) :
uinput_setup_device(udev, buffer, count);

mutex_unlock(&udev->mutex);
Expand Down
3 changes: 1 addition & 2 deletions drivers/input/mouse/alps.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ static const struct alps_model_info alps_model_data[] = {
/* Dell Latitude E5500, E6400, E6500, Precision M4400 */
{ { 0x62, 0x02, 0x14 }, 0x00, ALPS_PROTO_V2, 0xcf, 0xcf,
ALPS_PASS | ALPS_DUALPOINT | ALPS_PS2_INTERLEAVED },
{ { 0x73, 0x00, 0x14 }, 0x00, ALPS_PROTO_V2, 0xcf, 0xcf, ALPS_DUALPOINT }, /* Dell XT2 */
{ { 0x73, 0x02, 0x50 }, 0x00, ALPS_PROTO_V2, 0xcf, 0xcf, ALPS_FOUR_BUTTONS }, /* Dell Vostro 1400 */
{ { 0x52, 0x01, 0x14 }, 0x00, ALPS_PROTO_V2, 0xff, 0xff,
ALPS_PASS | ALPS_DUALPOINT | ALPS_PS2_INTERLEAVED }, /* Toshiba Tecra A11-11L */
Expand Down Expand Up @@ -1793,7 +1792,7 @@ int alps_init(struct psmouse *psmouse)
snprintf(priv->phys, sizeof(priv->phys), "%s/input1", psmouse->ps2dev.serio->phys);
dev2->phys = priv->phys;
dev2->name = (priv->flags & ALPS_DUALPOINT) ?
"DualPoint Stick" : "PS/2 Mouse";
"DualPoint Stick" : "ALPS PS/2 Device";
dev2->id.bustype = BUS_I8042;
dev2->id.vendor = 0x0002;
dev2->id.product = PSMOUSE_ALPS;
Expand Down
Loading

0 comments on commit 4937e2a

Please sign in to comment.