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:
 "The first round of updates for the input subsystem.

  A few new drivers (power button handler for AXP20x PMIC, tps65218
  power button driver, sun4i keys driver, regulator haptic driver, NI
  Ettus Research USRP E3x0 button, Alwinner A10/A20 PS/2 controller).

  Updates to Synaptics and ALPS touchpad drivers (with more to come
  later), brand new Focaltech PS/2 support, update to Cypress driver to
  handle Gen5 (in addition to Gen3) devices, and number of other fixups
  to various drivers as well as input core"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (54 commits)
  Input: elan_i2c - fix wrong %p extension
  Input: evdev - do not queue SYN_DROPPED if queue is empty
  Input: gscps2 - fix MODULE_DEVICE_TABLE invocation
  Input: synaptics - use dmax in input_mt_assign_slots
  Input: pxa27x_keypad - remove unnecessary ARM includes
  Input: ti_am335x_tsc - replace delta filtering with median filtering
  ARM: dts: AM335x: Make charge delay a DT parameter for TSC
  Input: ti_am335x_tsc - read charge delay from DT
  Input: ti_am335x_tsc - remove udelay in interrupt handler
  Input: ti_am335x_tsc - interchange touchscreen and ADC steps
  Input: MT - add support for balanced slot assignment
  Input: drv2667 - remove wrong and unneeded drv2667-haptics modalias
  Input: drv260x - remove wrong and unneeded drv260x-haptics modalias
  Input: cap11xx - remove wrong and unneeded cap11xx modalias
  Input: sun4i-ts - add support for touchpanel controller on A31
  Input: serio - add support for Alwinner A10/A20 PS/2 controller
  Input: gtco - use sign_extend32() for sign extension
  Input: elan_i2c - verify firmware signature applying it
  Input: elantech - remove stale comment from Kconfig
  Input: cyapa - off by one in cyapa_update_fw_store()
  ...
  • Loading branch information
Linus Torvalds committed Feb 11, 2015
2 parents e0c8453 + 4ba24fe commit 718749d
Show file tree
Hide file tree
Showing 61 changed files with 7,963 additions and 1,308 deletions.
11 changes: 11 additions & 0 deletions Documentation/ABI/testing/sysfs-driver-input-axp-pek
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
What: /sys/class/input/input(x)/device/startup
Date: March 2014
Contact: Carlo Caione <carlo@caione.org>
Description: Startup time in us. Board is powered on if the button is pressed
for more than <startup_time>

What: /sys/class/input/input(x)/device/shutdown
Date: March 2014
Contact: Carlo Caione <carlo@caione.org>
Description: Shutdown time in us. Board is powered off if the button is pressed
for more than <shutdown_time>
25 changes: 25 additions & 0 deletions Documentation/devicetree/bindings/input/e3x0-button.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
National Instruments Ettus Research USRP E3x0 button driver

This module is part of the NI Ettus Research USRP E3x0 SDR.

This module provides a simple power button event via two interrupts.

Required properties:
- compatible: should be one of the following
- "ettus,e3x0-button": For devices such as the NI Ettus Research USRP E3x0
- interrupt-parent:
- a phandle to the interrupt controller that it is attached to.
- interrupts: should be one of the following
- <0 30 1>, <0 31 1>: For devices such as the NI Ettus Research USRP E3x0
- interrupt-names: should be one of the following
- "press", "release": For devices such as the NI Ettus Research USRP E3x0

Note: Interrupt numbers might vary depending on the FPGA configuration.

Example:
button {
compatible = "ettus,e3x0-button";
interrupt-parent = <&intc>;
interrupts = <0 30 1>, <0 31 1>;
interrupt-names = "press", "release";
}
21 changes: 21 additions & 0 deletions Documentation/devicetree/bindings/input/regulator-haptic.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
* Regulator Haptic Device Tree Bindings

Required Properties:
- compatible : Should be "regulator-haptic"
- haptic-supply : Power supply to the haptic motor.
[*] refer Documentation/devicetree/bindings/regulator/regulator.txt

- max-microvolt : The maximum voltage value supplied to the haptic motor.
[The unit of the voltage is a micro]

- min-microvolt : The minimum voltage value supplied to the haptic motor.
[The unit of the voltage is a micro]

Example:

haptics {
compatible = "regulator-haptic";
haptic-supply = <&motor_regulator>;
max-microvolt = <2700000>;
min-microvolt = <1100000>;
};
62 changes: 62 additions & 0 deletions Documentation/devicetree/bindings/input/sun4i-lradc-keys.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
Allwinner sun4i low res adc attached tablet keys
------------------------------------------------

Required properties:
- compatible: "allwinner,sun4i-a10-lradc-keys"
- reg: mmio address range of the chip
- interrupts: interrupt to which the chip is connected
- vref-supply: powersupply for the lradc reference voltage

Each key is represented as a sub-node of "allwinner,sun4i-a10-lradc-keys":

Required subnode-properties:
- label: Descriptive name of the key.
- linux,code: Keycode to emit.
- channel: Channel this key is attached to, mut be 0 or 1.
- voltage: Voltage in µV at lradc input when this key is pressed.

Example:

#include <dt-bindings/input/input.h>

lradc: lradc@01c22800 {
compatible = "allwinner,sun4i-a10-lradc-keys";
reg = <0x01c22800 0x100>;
interrupts = <31>;
vref-supply = <&reg_vcc3v0>;

button@191 {
label = "Volume Up";
linux,code = <KEY_VOLUMEUP>;
channel = <0>;
voltage = <191274>;
};

button@392 {
label = "Volume Down";
linux,code = <KEY_VOLUMEDOWN>;
channel = <0>;
voltage = <392644>;
};

button@601 {
label = "Menu";
linux,code = <KEY_MENU>;
channel = <0>;
voltage = <601151>;
};

button@795 {
label = "Enter";
linux,code = <KEY_ENTER>;
channel = <0>;
voltage = <795090>;
};

button@987 {
label = "Home";
linux,code = <KEY_HOMEPAGE>;
channel = <0>;
voltage = <987387>;
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ sun4i resistive touchscreen controller
--------------------------------------

Required properties:
- compatible: "allwinner,sun4i-a10-ts"
- compatible: "allwinner,sun4i-a10-ts" or "allwinner,sun6i-a31-ts"
- reg: mmio address range of the chip
- interrupts: interrupt to which the chip is connected
- #thermal-sensor-cells: shall be 0

Optional properties:
- allwinner,ts-attached: boolean indicating that an actual touchscreen is
Expand All @@ -17,4 +18,5 @@ Example:
reg = <0x01c25000 0x100>;
interrupts = <29>;
allwinner,ts-attached;
#thermal-sensor-cells = <0>;
};
15 changes: 15 additions & 0 deletions Documentation/devicetree/bindings/input/touchscreen/ti-tsc-adc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,20 @@ Required properties:
ti,adc-channels: List of analog inputs available for ADC.
AIN0 = 0, AIN1 = 1 and so on till AIN7 = 7.

Optional properties:
- child "tsc"
ti,charge-delay: Length of touch screen charge delay step in terms of
ADC clock cycles. Charge delay value should be large
in order to avoid false pen-up events. This value
effects the overall sampling speed, hence need to be
kept as low as possible, while avoiding false pen-up
event. Start from a lower value, say 0x400, and
increase value until false pen-up events are avoided.
The pen-up detection happens immediately after the
charge step, so this does in fact function as a
hardware knob for adjusting the amount of "settling
time".

Example:
tscadc: tscadc@44e0d000 {
compatible = "ti,am3359-tscadc";
Expand All @@ -36,6 +50,7 @@ Example:
ti,x-plate-resistance = <200>;
ti,coordiante-readouts = <5>;
ti,wire-config = <0x00 0x11 0x22 0x33>;
ti,charge-delay = <0x400>;
};

adc {
Expand Down
17 changes: 17 additions & 0 deletions Documentation/devicetree/bindings/input/tps65218-pwrbutton.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Texas Instruments TPS65218 power button

This driver provides a simple power button event via an Interrupt.

Required properties:
- compatible: should be "ti,tps65218-pwrbutton"
- interrupts: should be one of the following
- <3 IRQ_TYPE_EDGE_BOTH>: For controllers compatible with tps65218

Example:

&tps {
power-button {
compatible = "ti,tps65218-pwrbutton";
interrupts = <3 IRQ_TYPE_EDGE_BOTH>;
};
};
23 changes: 23 additions & 0 deletions Documentation/devicetree/bindings/serio/allwinner,sun4i-ps2.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
* Device tree bindings for Allwinner A10, A20 PS2 host controller

A20 PS2 is dual role controller (PS2 host and PS2 device). These bindings are
for PS2 A10/A20 host controller. IBM compliant IBM PS2 and AT-compatible keyboard
and mouse can be connected.

Required properties:

- reg : Offset and length of the register set for the device.
- compatible : Should be as of the following:
- "allwinner,sun4i-a10-ps2"
- interrupts : The interrupt line connected to the PS2.
- clocks : The gate clk connected to the PS2.


Example:
ps20: ps2@0x01c2a000 {
compatible = "allwinner,sun4i-a10-ps2";
reg = <0x01c2a000 0x400>;
interrupts = <0 62 4>;
clocks = <&apb1_gates 6>;
status = "disabled";
};
1 change: 1 addition & 0 deletions Documentation/devicetree/bindings/vendor-prefixes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ epcos EPCOS AG
epfl Ecole Polytechnique Fédérale de Lausanne
epson Seiko Epson Corp.
est ESTeem Wireless Modems
ettus NI Ettus Research
eukrea Eukréa Electromatique
everest Everest Semiconductor Co. Ltd.
excito Excito
Expand Down
15 changes: 15 additions & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -3479,6 +3479,14 @@ M: "Maciej W. Rozycki" <macro@linux-mips.org>
S: Maintained
F: drivers/tty/serial/dz.*

E3X0 POWER BUTTON DRIVER
M: Moritz Fischer <moritz.fischer@ettus.com>
L: usrp-users@lists.ettus.com
W: http://www.ettus.com
S: Supported
F: drivers/input/misc/e3x0-button.c
F: Documentation/devicetree/bindings/input/e3x0-button.txt

E4000 MEDIA DRIVER
M: Antti Palosaari <crope@iki.fi>
L: linux-media@vger.kernel.org
Expand Down Expand Up @@ -9281,6 +9289,13 @@ F: arch/m68k/sun3*/
F: arch/m68k/include/asm/sun3*
F: drivers/net/ethernet/i825xx/sun3*

SUN4I LOW RES ADC ATTACHED TABLET KEYS DRIVER
M: Hans de Goede <hdegoede@redhat.com>
L: linux-input@vger.kernel.org
S: Maintained
F: Documentation/devicetree/bindings/input/sun4i-lradc-keys.txt
F: drivers/input/keyboard/sun4i-lradc-keys.c

SUNDANCE NETWORK DRIVER
M: Denis Kirjanov <kda@linux-powerpc.org>
L: netdev@vger.kernel.org
Expand Down
1 change: 1 addition & 0 deletions arch/arm/boot/dts/am335x-evm.dts
Original file line number Diff line number Diff line change
Expand Up @@ -648,6 +648,7 @@
ti,x-plate-resistance = <200>;
ti,coordinate-readouts = <5>;
ti,wire-config = <0x00 0x11 0x22 0x33>;
ti,charge-delay = <0x400>;
};

adc {
Expand Down
5 changes: 2 additions & 3 deletions drivers/iio/adc/ti_am335x_adc.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,19 +86,18 @@ static void tiadc_step_config(struct iio_dev *indio_dev)
{
struct tiadc_device *adc_dev = iio_priv(indio_dev);
unsigned int stepconfig;
int i, steps;
int i, steps = 0;

/*
* There are 16 configurable steps and 8 analog input
* lines available which are shared between Touchscreen and ADC.
*
* Steps backwards i.e. from 16 towards 0 are used by ADC
* Steps forwards i.e. from 0 towards 16 are used by ADC
* depending on number of input lines needed.
* Channel would represent which analog input
* needs to be given to ADC to digitalize data.
*/

steps = TOTAL_STEPS - adc_dev->channels;
if (iio_buffer_enabled(indio_dev))
stepconfig = STEPCONFIG_AVG_16 | STEPCONFIG_FIFO1
| STEPCONFIG_MODE_SWCNT;
Expand Down
71 changes: 46 additions & 25 deletions drivers/input/evdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,26 +62,6 @@ struct evdev_client {
struct input_event buffer[];
};

static int evdev_set_clk_type(struct evdev_client *client, unsigned int clkid)
{
switch (clkid) {

case CLOCK_REALTIME:
client->clk_type = EV_CLK_REAL;
break;
case CLOCK_MONOTONIC:
client->clk_type = EV_CLK_MONO;
break;
case CLOCK_BOOTTIME:
client->clk_type = EV_CLK_BOOT;
break;
default:
return -EINVAL;
}

return 0;
}

/* flush queued events of type @type, caller must hold client->buffer_lock */
static void __evdev_flush_queue(struct evdev_client *client, unsigned int type)
{
Expand Down Expand Up @@ -128,10 +108,8 @@ static void __evdev_flush_queue(struct evdev_client *client, unsigned int type)
client->head = head;
}

/* queue SYN_DROPPED event */
static void evdev_queue_syn_dropped(struct evdev_client *client)
static void __evdev_queue_syn_dropped(struct evdev_client *client)
{
unsigned long flags;
struct input_event ev;
ktime_t time;

Expand All @@ -146,8 +124,6 @@ static void evdev_queue_syn_dropped(struct evdev_client *client)
ev.code = SYN_DROPPED;
ev.value = 0;

spin_lock_irqsave(&client->buffer_lock, flags);

client->buffer[client->head++] = ev;
client->head &= client->bufsize - 1;

Expand All @@ -156,8 +132,53 @@ static void evdev_queue_syn_dropped(struct evdev_client *client)
client->tail = (client->head - 1) & (client->bufsize - 1);
client->packet_head = client->tail;
}
}

static void evdev_queue_syn_dropped(struct evdev_client *client)
{
unsigned long flags;

spin_lock_irqsave(&client->buffer_lock, flags);
__evdev_queue_syn_dropped(client);
spin_unlock_irqrestore(&client->buffer_lock, flags);
}

static int evdev_set_clk_type(struct evdev_client *client, unsigned int clkid)
{
unsigned long flags;

if (client->clk_type == clkid)
return 0;

switch (clkid) {

case CLOCK_REALTIME:
client->clk_type = EV_CLK_REAL;
break;
case CLOCK_MONOTONIC:
client->clk_type = EV_CLK_MONO;
break;
case CLOCK_BOOTTIME:
client->clk_type = EV_CLK_BOOT;
break;
default:
return -EINVAL;
}

/*
* Flush pending events and queue SYN_DROPPED event,
* but only if the queue is not empty.
*/
spin_lock_irqsave(&client->buffer_lock, flags);

if (client->head != client->tail) {
client->packet_head = client->head = client->tail;
__evdev_queue_syn_dropped(client);
}

spin_unlock_irqrestore(&client->buffer_lock, flags);

return 0;
}

static void __pass_event(struct evdev_client *client,
Expand Down
Loading

0 comments on commit 718749d

Please sign in to comment.