Skip to content

Commit 62d5bdf

Browse files
committed
Merge branch 'synaptics-rmi4' into next
Bring in support for devices using Synaptics RMI4 protocol, including RMI4 bus, 2D sensor and button handlers, and SPI and I2C interface drivers.
2 parents e52d839 + 48147b9 commit 62d5bdf

File tree

25 files changed

+6618
-0
lines changed

25 files changed

+6618
-0
lines changed
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
Synaptics RMI4 2D Sensor Device Binding
2+
3+
The Synaptics RMI4 core is able to support RMI4 devices using different
4+
transports and different functions. This file describes the device tree
5+
bindings for devices which contain 2D sensors using Function 11 or
6+
Function 12. Complete documentation for transports and other functions
7+
can be found in:
8+
Documentation/devicetree/bindings/input/rmi4.
9+
10+
RMI4 Function 11 and Function 12 are for 2D touch position sensing.
11+
Additional documentation for F11 can be found at:
12+
http://www.synaptics.com/sites/default/files/511-000136-01-Rev-E-RMI4-Interfacing-Guide.pdf
13+
14+
Optional Touch Properties:
15+
Description in Documentation/devicetree/bindings/input/touch
16+
- touchscreen-inverted-x
17+
- touchscreen-inverted-y
18+
- touchscreen-swapped-x-y
19+
- touchscreen-x-mm
20+
- touchscreen-y-mm
21+
22+
Optional Properties:
23+
- syna,clip-x-low: Sets a minimum value for X.
24+
- syna,clip-y-low: Sets a minimum value for Y.
25+
- syna,clip-x-high: Sets a maximum value for X.
26+
- syna,clip-y-high: Sets a maximum value for Y.
27+
- syna,offset-x: Add an offset to X.
28+
- syna,offset-y: Add an offset to Y.
29+
- syna,delta-x-threshold: Set the minimum distance on the X axis required
30+
to generate an interrupt in reduced reporting
31+
mode.
32+
- syna,delta-y-threshold: Set the minimum distance on the Y axis required
33+
to generate an interrupt in reduced reporting
34+
mode.
35+
- syna,sensor-type: Set the sensor type. 1 for touchscreen 2 for touchpad.
36+
- syna,disable-report-mask: Mask for disabling posiiton reporting. Used to
37+
disable reporing absolute position data.
38+
- syna,rezero-wait-ms: Time in miliseconds to wait after issuing a rezero
39+
command.
40+
41+
42+
Example of a RMI4 I2C device with F11:
43+
Example:
44+
&i2c1 {
45+
rmi4-i2c-dev@2c {
46+
compatible = "syna,rmi4-i2c";
47+
48+
...
49+
50+
rmi4-f11@11 {
51+
reg = <0x11>;
52+
touchscreen-inverted-y;
53+
syna,sensor-type = <2>;
54+
};
55+
};
56+
};
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
Synaptics RMI4 F01 Device Binding
2+
3+
The Synaptics RMI4 core is able to support RMI4 devices using different
4+
transports and different functions. This file describes the device tree
5+
bindings for devices which contain Function 1. Complete documentation
6+
for transports and other functions can be found in:
7+
Documentation/devicetree/bindings/input/rmi4.
8+
9+
Additional documentation for F01 can be found at:
10+
http://www.synaptics.com/sites/default/files/511-000136-01-Rev-E-RMI4-Interfacing-Guide.pdf
11+
12+
Optional Properties:
13+
- syna,nosleep-mode: If set the device will run at full power without sleeping.
14+
nosleep has 3 modes, 0 will not change the default
15+
setting, 1 will disable nosleep (allow sleeping),
16+
and 2 will enable nosleep (disabling sleep).
17+
- syna,wakeup-threshold: Defines the amplitude of the disturbance to the
18+
background capacitance that will cause the
19+
device to wake from dozing.
20+
- syna,doze-holdoff-ms: The delay to wait after the last finger lift and the
21+
first doze cycle.
22+
- syna,doze-interval-ms: The time period that the device sleeps between finger
23+
activity.
24+
25+
26+
Example of a RMI4 I2C device with F01:
27+
Example:
28+
&i2c1 {
29+
rmi4-i2c-dev@2c {
30+
compatible = "syna,rmi4-i2c";
31+
32+
...
33+
34+
rmi4-f01@1 {
35+
reg = <0x1>;
36+
syna,nosleep-mode = <1>;
37+
};
38+
};
39+
};
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
Synaptics RMI4 I2C Device Binding
2+
3+
The Synaptics RMI4 core is able to support RMI4 devices using different
4+
transports and different functions. This file describes the device tree
5+
bindings for devices using the I2C transport driver. Complete documentation
6+
for other transports and functions can be found in
7+
Documentation/devicetree/bindings/input/rmi4.
8+
9+
Required Properties:
10+
- compatible: syna,rmi4-i2c
11+
- reg: I2C address
12+
- #address-cells: Set to 1 to indicate that the function child nodes
13+
consist of only on uint32 value.
14+
- #size-cells: Set to 0 to indicate that the function child nodes do not
15+
have a size property.
16+
17+
Optional Properties:
18+
- interrupts: interrupt which the rmi device is connected to.
19+
- interrupt-parent: The interrupt controller.
20+
See Documentation/devicetree/bindings/interrupt-controller/interrupts.txt
21+
22+
- syna,reset-delay-ms: The number of milliseconds to wait after resetting the
23+
device.
24+
25+
Function Parameters:
26+
Parameters specific to RMI functions are contained in child nodes of the rmi device
27+
node. Documentation for the parameters of each function can be found in:
28+
Documentation/devicetree/bindings/input/rmi4/rmi_f*.txt.
29+
30+
31+
32+
Example:
33+
&i2c1 {
34+
rmi4-i2c-dev@2c {
35+
compatible = "syna,rmi4-i2c";
36+
reg = <0x2c>;
37+
#address-cells = <1>;
38+
#size-cells = <0>;
39+
interrupt-parent = <&gpio>;
40+
interrupts = <4 2>;
41+
42+
rmi4-f01@1 {
43+
reg = <0x1>;
44+
syna,nosleep-mode = <1>;
45+
};
46+
47+
rmi4-f11@11 {
48+
reg = <0x11>;
49+
touchscreen-inverted-y;
50+
syna,sensor-type = <2>;
51+
};
52+
};
53+
};
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
Synaptics RMI4 SPI Device Binding
2+
3+
The Synaptics RMI4 core is able to support RMI4 devices using different
4+
transports and different functions. This file describes the device tree
5+
bindings for devices using the SPI transport driver. Complete documentation
6+
for other transports and functions can be found in
7+
Documentation/devicetree/bindings/input/rmi4.
8+
9+
Required Properties:
10+
- compatible: syna,rmi4-spi
11+
- reg: Chip select address for the device
12+
- #address-cells: Set to 1 to indicate that the function child nodes
13+
consist of only on uint32 value.
14+
- #size-cells: Set to 0 to indicate that the function child nodes do not
15+
have a size property.
16+
17+
Optional Properties:
18+
- interrupts: interrupt which the rmi device is connected to.
19+
- interrupt-parent: The interrupt controller.
20+
See Documentation/devicetree/bindings/interrupt-controller/interrupts.txt
21+
22+
- spi-rx-delay-us: microsecond delay after a read transfer.
23+
- spi-tx-delay-us: microsecond delay after a write transfer.
24+
25+
Function Parameters:
26+
Parameters specific to RMI functions are contained in child nodes of the rmi device
27+
node. Documentation for the parameters of each function can be found in:
28+
Documentation/devicetree/bindings/input/rmi4/rmi_f*.txt.
29+
30+
31+
32+
Example:
33+
spi@7000d800 {
34+
rmi4-spi-dev@0 {
35+
compatible = "syna,rmi4-spi";
36+
reg = <0x0>;
37+
#address-cells = <1>;
38+
#size-cells = <0>;
39+
spi-max-frequency = <4000000>;
40+
spi-cpha;
41+
spi-cpol;
42+
interrupt-parent = <&gpio>;
43+
interrupts = <TEGRA_GPIO(K, 2) 0x2>;
44+
spi-rx-delay-us = <30>;
45+
46+
rmi4-f01@1 {
47+
reg = <0x1>;
48+
syna,nosleep-mode = <1>;
49+
};
50+
51+
rmi4-f11@11 {
52+
reg = <0x11>;
53+
touchscreen-inverted-y;
54+
syna,sensor-type = <2>;
55+
};
56+
};
57+
};

Documentation/devicetree/bindings/input/touchscreen/touchscreen.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ Optional properties for Touchscreens:
1818
- touchscreen-inverted-y : Y axis is inverted (boolean)
1919
- touchscreen-swapped-x-y : X and Y axis are swapped (boolean)
2020
Swapping is done after inverting the axis
21+
- touchscreen-x-mm : horizontal length in mm of the touchscreen
22+
- touchscreen-y-mm : vertical length in mm of the touchscreen
2123

2224
Deprecated properties for Touchscreens:
2325
- x-size : deprecated name for touchscreen-size-x

Documentation/devicetree/bindings/spi/spi-bus.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ contain the following properties.
6161
used for MOSI. Defaults to 1 if not present.
6262
- spi-rx-bus-width - (optional) The bus width(number of data wires) that
6363
used for MISO. Defaults to 1 if not present.
64+
- spi-rx-delay-us - (optional) Microsecond delay after a read transfer.
65+
- spi-tx-delay-us - (optional) Microsecond delay after a write transfer.
6466

6567
Some SPI controllers and devices support Dual and Quad SPI transfer mode.
6668
It allows data in the SPI system to be transferred in 2 wires(DUAL) or 4 wires(QUAD).

Documentation/devicetree/bindings/vendor-prefixes.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ sprd Spreadtrum Communications Inc.
220220
st STMicroelectronics
221221
ste ST-Ericsson
222222
stericsson ST-Ericsson
223+
syna Synaptics Inc.
223224
synology Synology, Inc.
224225
tbs TBS Technologies
225226
tcl Toby Churchill Ltd.

drivers/input/Kconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,8 @@ source "drivers/input/touchscreen/Kconfig"
201201

202202
source "drivers/input/misc/Kconfig"
203203

204+
source "drivers/input/rmi4/Kconfig"
205+
204206
endif
205207

206208
menu "Hardware I/O ports"

drivers/input/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,5 @@ obj-$(CONFIG_INPUT_TOUCHSCREEN) += touchscreen/
2626
obj-$(CONFIG_INPUT_MISC) += misc/
2727

2828
obj-$(CONFIG_INPUT_APMPOWER) += apm-power.o
29+
30+
obj-$(CONFIG_RMI4_CORE) += rmi4/

drivers/input/rmi4/Kconfig

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
#
2+
# RMI4 configuration
3+
#
4+
config RMI4_CORE
5+
tristate "Synaptics RMI4 bus support"
6+
help
7+
Say Y here if you want to support the Synaptics RMI4 bus. This is
8+
required for all RMI4 device support.
9+
10+
If unsure, say Y.
11+
12+
config RMI4_I2C
13+
tristate "RMI4 I2C Support"
14+
depends on RMI4_CORE && I2C
15+
help
16+
Say Y here if you want to support RMI4 devices connected to an I2C
17+
bus.
18+
19+
If unsure, say Y.
20+
21+
config RMI4_SPI
22+
tristate "RMI4 SPI Support"
23+
depends on RMI4_CORE && SPI
24+
help
25+
Say Y here if you want to support RMI4 devices connected to a SPI
26+
bus.
27+
28+
If unsure, say N.
29+
30+
config RMI4_2D_SENSOR
31+
bool
32+
depends on RMI4_CORE
33+
34+
config RMI4_F11
35+
bool "RMI4 Function 11 (2D pointing)"
36+
select RMI4_2D_SENSOR
37+
depends on RMI4_CORE
38+
help
39+
Say Y here if you want to add support for RMI4 function 11.
40+
41+
Function 11 provides 2D multifinger pointing for touchscreens and
42+
touchpads. For sensors that support relative pointing, F11 also
43+
provides mouse input.
44+
45+
config RMI4_F12
46+
bool "RMI4 Function 12 (2D pointing)"
47+
select RMI4_2D_SENSOR
48+
depends on RMI4_CORE
49+
help
50+
Say Y here if you want to add support for RMI4 function 12.
51+
52+
Function 12 provides 2D multifinger pointing for touchscreens and
53+
touchpads. For sensors that support relative pointing, F12 also
54+
provides mouse input.
55+
56+
config RMI4_F30
57+
bool "RMI4 Function 30 (GPIO LED)"
58+
depends on RMI4_CORE
59+
help
60+
Say Y here if you want to add support for RMI4 function 30.
61+
62+
Function 30 provides GPIO and LED support for RMI4 devices. This
63+
includes support for buttons on TouchPads and ClickPads.

drivers/input/rmi4/Makefile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
obj-$(CONFIG_RMI4_CORE) += rmi_core.o
2+
rmi_core-y := rmi_bus.o rmi_driver.o rmi_f01.o
3+
4+
rmi_core-$(CONFIG_RMI4_2D_SENSOR) += rmi_2d_sensor.o
5+
6+
# Function drivers
7+
rmi_core-$(CONFIG_RMI4_F11) += rmi_f11.o
8+
rmi_core-$(CONFIG_RMI4_F12) += rmi_f12.o
9+
rmi_core-$(CONFIG_RMI4_F30) += rmi_f30.o
10+
11+
# Transports
12+
obj-$(CONFIG_RMI4_I2C) += rmi_i2c.o
13+
obj-$(CONFIG_RMI4_SPI) += rmi_spi.o

0 commit comments

Comments
 (0)