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:

 - a new GPIO bit-banging driver implementing PS/2 protocol

 - a new power key driver for Rockchip RK805 PMIC

 - bunch of patches constifying various device ID structures

 - Elan I2C touchpad driver now supports devices with 2 buttons

 - other assorted fixes

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (76 commits)
  Input: byd - make array seq static, reduces object code size
  Input: xilinx_ps2 - fix multiline comment style
  Input: pxa27x_keypad - handle return value of clk_prepare_enable
  Input: tegra-kbc - handle return value of clk_prepare_enable
  Input: PS/2 gpio bit banging driver for serio bus
  Input: xen-kbdfront - enable auto repeat for xen keyboard frontend driver
  Input: ambakmi - constify amba_id
  Input: atmel_mxt_ts - add support for reset line
  Input: atmel_mxt_ts - use more managed resources
  Input: wacom_w8001 - constify serio_device_id
  Input: tsc40 - constify serio_device_id
  Input: touchwin - constify serio_device_id
  Input: touchright - constify serio_device_id
  Input: touchit213 - constify serio_device_id
  Input: penmount - constify serio_device_id
  Input: mtouch - constify serio_device_id
  Input: inexio - constify serio_device_id
  Input: hampshire - constify serio_device_id
  Input: gunze - constify serio_device_id
  Input: fujitsu_ts - constify serio_device_id
  ...
  • Loading branch information
torvalds committed Sep 7, 2017
2 parents dfd9e6d + a6cbfa1 commit 9d71941
Show file tree
Hide file tree
Showing 80 changed files with 947 additions and 190 deletions.
2 changes: 2 additions & 0 deletions Documentation/devicetree/bindings/input/atmel,maxtouch.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ Optional properties for main touchpad device:
experiment to determine which bit corresponds to which input. Use
KEY_RESERVED for unused padding values.

- reset-gpios: GPIO specifier for the touchscreen's reset pin (active low)

Example:

touch@4b {
Expand Down
23 changes: 23 additions & 0 deletions Documentation/devicetree/bindings/serio/ps2-gpio.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Device-Tree binding for ps/2 gpio device

Required properties:
- compatible = "ps2-gpio"
- data-gpios: the data pin
- clk-gpios: the clock pin
- interrupts: Should trigger on the falling edge of the clock line.

Optional properties:
- write-enable: Indicates whether write function is provided
to serio device. Possibly providing the write fn will not work, because
of the tough timing requirements.

Example nodes:

ps2@0 {
compatible = "ps2-gpio";
interrupt-parent = <&gpio>;
interrupts = <23 IRQ_TYPE_EDGE_FALLING>;
data-gpios = <&gpio 24 GPIO_ACTIVE_HIGH>;
clk-gpios = <&gpio 23 GPIO_ACTIVE_HIGH>;
write-enable;
};
5 changes: 5 additions & 0 deletions Documentation/gpio/drivers-on-gpio.txt
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ hardware descriptions such as device tree or ACPI:
NAND flash MTD subsystem and provides chip access and partition parsing like
any other NAND driving hardware.

- ps2-gpio: drivers/input/serio/ps2-gpio.c is used to drive a PS/2 (IBM) serio
bus, data and clock line, by bit banging two GPIO lines. It will appear as
any other serio bus to the system and makes it possible to connect drivers
for e.g. keyboards and other PS/2 protocol based devices.

Apart from this there are special GPIO drivers in subsystems like MMC/SD to
read card detect and write protect GPIO lines, and in the TTY serial subsystem
to emulate MCTRL (modem control) signals CTS/RTS by using two GPIO lines. The
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-pxa/raumfeld.c
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ static struct gpiod_lookup_table raumfeld_rotary_gpios_table = {
},
};

static struct property_entry raumfeld_rotary_properties[] = {
static const struct property_entry raumfeld_rotary_properties[] __initconst = {
PROPERTY_ENTRY_INTEGER("rotary-encoder,steps-per-period", u32, 24),
PROPERTY_ENTRY_INTEGER("linux,axis", u32, REL_X),
PROPERTY_ENTRY_INTEGER("rotary-encoder,relative_axis", u32, 1),
Expand Down
6 changes: 3 additions & 3 deletions drivers/input/input.c
Original file line number Diff line number Diff line change
Expand Up @@ -1398,7 +1398,7 @@ static struct attribute *input_dev_attrs[] = {
NULL
};

static struct attribute_group input_dev_attr_group = {
static const struct attribute_group input_dev_attr_group = {
.attrs = input_dev_attrs,
};

Expand All @@ -1425,7 +1425,7 @@ static struct attribute *input_dev_id_attrs[] = {
NULL
};

static struct attribute_group input_dev_id_attr_group = {
static const struct attribute_group input_dev_id_attr_group = {
.name = "id",
.attrs = input_dev_id_attrs,
};
Expand Down Expand Up @@ -1495,7 +1495,7 @@ static struct attribute *input_dev_caps_attrs[] = {
NULL
};

static struct attribute_group input_dev_caps_attr_group = {
static const struct attribute_group input_dev_caps_attr_group = {
.name = "capabilities",
.attrs = input_dev_caps_attrs,
};
Expand Down
2 changes: 1 addition & 1 deletion drivers/input/joystick/iforce/iforce-serio.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ static void iforce_serio_disconnect(struct serio *serio)
kfree(iforce);
}

static struct serio_device_id iforce_serio_ids[] = {
static const struct serio_device_id iforce_serio_ids[] = {
{
.type = SERIO_RS232,
.proto = SERIO_IFORCE,
Expand Down
2 changes: 1 addition & 1 deletion drivers/input/joystick/iforce/iforce-usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ static void iforce_usb_disconnect(struct usb_interface *intf)
kfree(iforce);
}

static struct usb_device_id iforce_usb_ids [] = {
static const struct usb_device_id iforce_usb_ids[] = {
{ USB_DEVICE(0x044f, 0xa01c) }, /* Thrustmaster Motor Sport GT */
{ USB_DEVICE(0x046d, 0xc281) }, /* Logitech WingMan Force */
{ USB_DEVICE(0x046d, 0xc291) }, /* Logitech WingMan Formula Force */
Expand Down
2 changes: 1 addition & 1 deletion drivers/input/joystick/magellan.c
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ static int magellan_connect(struct serio *serio, struct serio_driver *drv)
* The serio driver structure.
*/

static struct serio_device_id magellan_serio_ids[] = {
static const struct serio_device_id magellan_serio_ids[] = {
{
.type = SERIO_RS232,
.proto = SERIO_MAGELLAN,
Expand Down
2 changes: 1 addition & 1 deletion drivers/input/joystick/spaceball.c
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ static int spaceball_connect(struct serio *serio, struct serio_driver *drv)
* The serio driver structure.
*/

static struct serio_device_id spaceball_serio_ids[] = {
static const struct serio_device_id spaceball_serio_ids[] = {
{
.type = SERIO_RS232,
.proto = SERIO_SPACEBALL,
Expand Down
2 changes: 1 addition & 1 deletion drivers/input/joystick/spaceorb.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ static int spaceorb_connect(struct serio *serio, struct serio_driver *drv)
* The serio driver structure.
*/

static struct serio_device_id spaceorb_serio_ids[] = {
static const struct serio_device_id spaceorb_serio_ids[] = {
{
.type = SERIO_RS232,
.proto = SERIO_SPACEORB,
Expand Down
2 changes: 1 addition & 1 deletion drivers/input/joystick/stinger.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ static int stinger_connect(struct serio *serio, struct serio_driver *drv)
* The serio driver structure.
*/

static struct serio_device_id stinger_serio_ids[] = {
static const struct serio_device_id stinger_serio_ids[] = {
{
.type = SERIO_RS232,
.proto = SERIO_STINGER,
Expand Down
2 changes: 1 addition & 1 deletion drivers/input/joystick/twidjoy.c
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ static int twidjoy_connect(struct serio *serio, struct serio_driver *drv)
* The serio driver structure.
*/

static struct serio_device_id twidjoy_serio_ids[] = {
static const struct serio_device_id twidjoy_serio_ids[] = {
{
.type = SERIO_RS232,
.proto = SERIO_TWIDJOY,
Expand Down
2 changes: 1 addition & 1 deletion drivers/input/joystick/warrior.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ static int warrior_connect(struct serio *serio, struct serio_driver *drv)
* The serio driver structure.
*/

static struct serio_device_id warrior_serio_ids[] = {
static const struct serio_device_id warrior_serio_ids[] = {
{
.type = SERIO_RS232,
.proto = SERIO_WARRIOR,
Expand Down
2 changes: 1 addition & 1 deletion drivers/input/joystick/xpad.c
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ static const signed short xpad_abs_triggers[] = {
#define XPAD_XBOXONE_VENDOR(vend) \
{ XPAD_XBOXONE_VENDOR_PROTOCOL(vend, 208) }

static struct usb_device_id xpad_table[] = {
static const struct usb_device_id xpad_table[] = {
{ USB_INTERFACE_INFO('X', 'B', 0) }, /* X-Box USB-IF not approved class */
XPAD_XBOX360_VENDOR(0x044f), /* Thrustmaster X-Box 360 controllers */
XPAD_XBOX360_VENDOR(0x045e), /* Microsoft X-Box 360 controllers */
Expand Down
2 changes: 1 addition & 1 deletion drivers/input/joystick/zhenhua.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ static int zhenhua_connect(struct serio *serio, struct serio_driver *drv)
* The serio driver structure.
*/

static struct serio_device_id zhenhua_serio_ids[] = {
static const struct serio_device_id zhenhua_serio_ids[] = {
{
.type = SERIO_RS232,
.proto = SERIO_ZHENHUA,
Expand Down
2 changes: 1 addition & 1 deletion drivers/input/keyboard/atkbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1270,7 +1270,7 @@ static int atkbd_reconnect(struct serio *serio)
return retval;
}

static struct serio_device_id atkbd_serio_ids[] = {
static const struct serio_device_id atkbd_serio_ids[] = {
{
.type = SERIO_8042,
.proto = SERIO_ANY,
Expand Down
2 changes: 1 addition & 1 deletion drivers/input/keyboard/gpio_keys.c
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ static struct attribute *gpio_keys_attrs[] = {
NULL,
};

static struct attribute_group gpio_keys_attr_group = {
static const struct attribute_group gpio_keys_attr_group = {
.attrs = gpio_keys_attrs,
};

Expand Down
2 changes: 1 addition & 1 deletion drivers/input/keyboard/hil_kbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ static int hil_dev_connect(struct serio *serio, struct serio_driver *drv)
return error;
}

static struct serio_device_id hil_dev_ids[] = {
static const struct serio_device_id hil_dev_ids[] = {
{
.type = SERIO_HIL_MLC,
.proto = SERIO_HIL,
Expand Down
2 changes: 1 addition & 1 deletion drivers/input/keyboard/lkkbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@ static void lkkbd_disconnect(struct serio *serio)
kfree(lk);
}

static struct serio_device_id lkkbd_serio_ids[] = {
static const struct serio_device_id lkkbd_serio_ids[] = {
{
.type = SERIO_RS232,
.proto = SERIO_LKKBD,
Expand Down
2 changes: 1 addition & 1 deletion drivers/input/keyboard/newtonkbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ static void nkbd_disconnect(struct serio *serio)
kfree(nkbd);
}

static struct serio_device_id nkbd_serio_ids[] = {
static const struct serio_device_id nkbd_serio_ids[] = {
{
.type = SERIO_RS232,
.proto = SERIO_NEWTON,
Expand Down
15 changes: 10 additions & 5 deletions drivers/input/keyboard/pxa27x_keypad.c
Original file line number Diff line number Diff line change
Expand Up @@ -644,9 +644,12 @@ static void pxa27x_keypad_config(struct pxa27x_keypad *keypad)
static int pxa27x_keypad_open(struct input_dev *dev)
{
struct pxa27x_keypad *keypad = input_get_drvdata(dev);

int ret;
/* Enable unit clock */
clk_prepare_enable(keypad->clk);
ret = clk_prepare_enable(keypad->clk);
if (ret)
return ret;

pxa27x_keypad_config(keypad);

return 0;
Expand Down Expand Up @@ -683,6 +686,7 @@ static int pxa27x_keypad_resume(struct device *dev)
struct platform_device *pdev = to_platform_device(dev);
struct pxa27x_keypad *keypad = platform_get_drvdata(pdev);
struct input_dev *input_dev = keypad->input_dev;
int ret = 0;

/*
* If the keypad is used as wake up source, the clock is not turned
Expand All @@ -695,14 +699,15 @@ static int pxa27x_keypad_resume(struct device *dev)

if (input_dev->users) {
/* Enable unit clock */
clk_prepare_enable(keypad->clk);
pxa27x_keypad_config(keypad);
ret = clk_prepare_enable(keypad->clk);
if (!ret)
pxa27x_keypad_config(keypad);
}

mutex_unlock(&input_dev->mutex);
}

return 0;
return ret;
}
#endif

Expand Down
2 changes: 1 addition & 1 deletion drivers/input/keyboard/stowaway.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ static void skbd_disconnect(struct serio *serio)
kfree(skbd);
}

static struct serio_device_id skbd_serio_ids[] = {
static const struct serio_device_id skbd_serio_ids[] = {
{
.type = SERIO_RS232,
.proto = SERIO_STOWAWAY,
Expand Down
2 changes: 1 addition & 1 deletion drivers/input/keyboard/sunkbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ static void sunkbd_disconnect(struct serio *serio)
kfree(sunkbd);
}

static struct serio_device_id sunkbd_serio_ids[] = {
static const struct serio_device_id sunkbd_serio_ids[] = {
{
.type = SERIO_RS232,
.proto = SERIO_SUNKBD,
Expand Down
5 changes: 4 additions & 1 deletion drivers/input/keyboard/tegra-kbc.c
Original file line number Diff line number Diff line change
Expand Up @@ -370,8 +370,11 @@ static int tegra_kbc_start(struct tegra_kbc *kbc)
{
unsigned int debounce_cnt;
u32 val = 0;
int ret;

clk_prepare_enable(kbc->clk);
ret = clk_prepare_enable(kbc->clk);
if (ret)
return ret;

/* Reset the KBC controller to clear all previous status.*/
reset_control_assert(kbc->rst);
Expand Down
2 changes: 1 addition & 1 deletion drivers/input/keyboard/xtkbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ static void xtkbd_disconnect(struct serio *serio)
kfree(xtkbd);
}

static struct serio_device_id xtkbd_serio_ids[] = {
static const struct serio_device_id xtkbd_serio_ids[] = {
{
.type = SERIO_XT,
.proto = SERIO_ANY,
Expand Down
11 changes: 11 additions & 0 deletions drivers/input/misc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,17 @@ config INPUT_PWM_BEEPER
To compile this driver as a module, choose M here: the module will be
called pwm-beeper.

config INPUT_RK805_PWRKEY
tristate "Rockchip RK805 PMIC power key support"
depends on MFD_RK808
help
Select this option to enable power key driver for RK805.

If unsure, say N.

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

config INPUT_GPIO_ROTARY_ENCODER
tristate "Rotary encoders connected to GPIO pins"
depends on GPIOLIB || COMPILE_TEST
Expand Down
1 change: 1 addition & 0 deletions drivers/input/misc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ obj-$(CONFIG_INPUT_REGULATOR_HAPTIC) += regulator-haptic.o
obj-$(CONFIG_INPUT_RETU_PWRBUTTON) += retu-pwrbutton.o
obj-$(CONFIG_INPUT_AXP20X_PEK) += axp20x-pek.o
obj-$(CONFIG_INPUT_GPIO_ROTARY_ENCODER) += rotary_encoder.o
obj-$(CONFIG_INPUT_RK805_PWRKEY) += rk805-pwrkey.o
obj-$(CONFIG_INPUT_SGI_BTNS) += sgi_btns.o
obj-$(CONFIG_INPUT_SIRFSOC_ONKEY) += sirfsoc-onkey.o
obj-$(CONFIG_INPUT_SOC_BUTTON_ARRAY) += soc_button_array.o
Expand Down
2 changes: 1 addition & 1 deletion drivers/input/misc/ati_remote2.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ static const struct kernel_param_ops param_ops_mode_mask = {
module_param(mode_mask, mode_mask, 0644);
MODULE_PARM_DESC(mode_mask, "Bitmask of modes to accept <4:PC><3:AUX4><2:AUX3><1:AUX2><0:AUX1>");

static struct usb_device_id ati_remote2_id_table[] = {
static const struct usb_device_id ati_remote2_id_table[] = {
{ USB_DEVICE(0x0471, 0x0602) }, /* ATI Remote Wonder II */
{ }
};
Expand Down
Loading

0 comments on commit 9d71941

Please sign in to comment.