Commit eea43ed8 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull input layer updates from Dmitry Torokhov:

 - evdev interface has been adjusted to extend the life of timestamps on
   32 bit systems to the year of 2108

 - Synaptics RMI4 driver's PS/2 guest handling ha beed updated to
   improve chances of detecting trackpoints on the pass-through port

 - mms114 touchcsreen controller driver has been updated to support
   generic device properties and work with mms152 cntrollers

 - Goodix driver now supports generic touchscreen properties

 - couple of drivers for AVR32 architecture are gone as the architecture
   support has been removed from the kernel

 - gpio-tilt driver has been removed as there are no mainline users and
   the driver itself is using legacy APIs and relies on platform data

 - MODULE_LINECSE/MODULE_VERSION cleanups

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (45 commits)
  Input: goodix - use generic touchscreen_properties
  Input: mms114 - fix typo in definition
  Input: mms114 - use BIT() macro instead of explicit shifting
  Input: mms114 - replace mdelay with msleep
  Input: mms114 - add support for mms152
  Input: mms114 - drop platform data and use generic APIs
  Input: mms114 - mark as direct input device
  Input: mms114 - do not clobber interrupt trigger
  Input: edt-ft5x06 - fix error handling for factory mode on non-M06
  Input: stmfts - set IRQ_NOAUTOEN to the irq flag
  Input: auo-pixcir-ts - delete an unnecessary return statement
  Input: auo-pixcir-ts - remove custom log for a failed memory allocation
  Input: da9052_tsi - remove unused mutex
  Input: docs - use PROPERTY_ENTRY_U32() directly
  Input: synaptics-rmi4 - log when we create a guest serio port
  Input: synaptics-rmi4 - unmask F03 interrupts when port is opened
  Input: synaptics-rmi4 - do not delete interrupt memory too early
  Input: ad7877 - use managed resource allocations
  Input: stmfts,s6sy671 - add SPDX identifier
  Input: remove atmel-wm97xx touchscreen driver
  ...
parents f6cff79f d67ad78e
Loading
Loading
Loading
Loading
+21 −14
Original line number Diff line number Diff line
* MELFAS MMS114 touchscreen controller
* MELFAS MMS114/MMS152 touchscreen controller

Required properties:
- compatible: must be "melfas,mms114"
- compatible: should be one of:
	- "melfas,mms114"
	- "melfas,mms152"
- reg: I2C address of the chip
- interrupts: interrupt to which the chip is connected
- x-size: horizontal resolution of touchscreen
- y-size: vertical resolution of touchscreen
- touchscreen-size-x: See [1]
- touchscreen-size-y: See [1]

Optional properties:
- contact-threshold:
- moving-threshold:
- x-invert: invert X axis
- y-invert: invert Y axis
- touchscreen-fuzz-x: See [1]
- touchscreen-fuzz-y: See [1]
- touchscreen-fuzz-pressure: See [1]
- touchscreen-inverted-x: See [1]
- touchscreen-inverted-y: See [1]
- touchscreen-swapped-x-y: See [1]

[1]: Documentation/devicetree/bindings/input/touchscreen/touchscreen.txt

Example:

@@ -22,12 +28,13 @@ Example:
			compatible = "melfas,mms114";
			reg = <0x48>;
			interrupts = <39 0>;
			x-size = <720>;
			y-size = <1280>;
			contact-threshold = <10>;
			moving-threshold = <10>;
			x-invert;
			y-invert;
			touchscreen-size-x = <720>;
			touchscreen-size-y = <1280>;
			touchscreen-fuzz-x = <10>;
			touchscreen-fuzz-y = <10>;
			touchscreen-fuzz-pressure = <10>;
			touchscreen-inverted-x;
			touchscreen-inverted-y;
		};

		/* ... */
+2 −0
Original line number Diff line number Diff line
@@ -23,6 +23,8 @@ Optional properties:
- touchscreen-inverted-y  : See touchscreen.txt
- touchscreen-swapped-x-y : See touchscreen.txt
- silead,max-fingers	  : maximum number of fingers the touchscreen can detect
- silead,home-button	  : Boolean, set to true on devices which have a
			    capacitive home-button build into the touchscreen
- vddio-supply		  : regulator phandle for controller VDDIO
- avdd-supply		  : regulator phandle for controller AVDD

+0 −5
Original line number Diff line number Diff line
@@ -28,11 +28,6 @@ hardware descriptions such as device tree or ACPI:
- gpio-beeper: drivers/input/misc/gpio-beeper.c is used to provide a beep from
  an external speaker connected to a GPIO line.

- gpio-tilt-polled: drivers/input/misc/gpio_tilt_polled.c provides tilt
  detection switches using GPIO, which is useful for your homebrewn pinball
  machine if for nothing else. It can detect different tilt angles of the
  monitored object.

- extcon-gpio: drivers/extcon/extcon-gpio.c is used when you need to read an
  external connector status, such as a headset line for an audio driver or an
  HDMI connector. It will provide a better userspace sysfs interface than GPIO.
+0 −103
Original line number Diff line number Diff line
Driver for tilt-switches connected via GPIOs
============================================

Generic driver to read data from tilt switches connected via gpios.
Orientation can be provided by one or more than one tilt switches,
i.e. each tilt switch providing one axis, and the number of axes
is also not limited.


Data structures
---------------

The array of struct gpio in the gpios field is used to list the gpios
that represent the current tilt state.

The array of struct gpio_tilt_axis describes the axes that are reported
to the input system. The values set therein are used for the
input_set_abs_params calls needed to init the axes.

The array of struct gpio_tilt_state maps gpio states to the corresponding
values to report. The gpio state is represented as a bitfield where the
bit-index corresponds to the index of the gpio in the struct gpio array.
In the same manner the values stored in the axes array correspond to
the elements of the gpio_tilt_axis-array.


Example
-------

Example configuration for a single TS1003 tilt switch that rotates around
one axis in 4 steps and emits the current tilt via two GPIOs::

    static int sg060_tilt_enable(struct device *dev) {
	    /* code to enable the sensors */
    };

    static void sg060_tilt_disable(struct device *dev) {
	    /* code to disable the sensors */
    };

    static struct gpio sg060_tilt_gpios[] = {
	    { SG060_TILT_GPIO_SENSOR1, GPIOF_IN, "tilt_sensor1" },
	    { SG060_TILT_GPIO_SENSOR2, GPIOF_IN, "tilt_sensor2" },
    };

    static struct gpio_tilt_state sg060_tilt_states[] = {
	    {
		    .gpios = (0 << 1) | (0 << 0),
		    .axes = (int[]) {
			    0,
		    },
	    }, {
		    .gpios = (0 << 1) | (1 << 0),
		    .axes = (int[]) {
			    1, /* 90 degrees */
		    },
	    }, {
		    .gpios = (1 << 1) | (1 << 0),
		    .axes = (int[]) {
			    2, /* 180 degrees */
		    },
	    }, {
		    .gpios = (1 << 1) | (0 << 0),
		    .axes = (int[]) {
			    3, /* 270 degrees */
		    },
	    },
    };

    static struct gpio_tilt_axis sg060_tilt_axes[] = {
	    {
		    .axis = ABS_RY,
		    .min = 0,
		    .max = 3,
		    .fuzz = 0,
		    .flat = 0,
	    },
    };

    static struct gpio_tilt_platform_data sg060_tilt_pdata= {
	    .gpios = sg060_tilt_gpios,
	    .nr_gpios = ARRAY_SIZE(sg060_tilt_gpios),

	    .axes = sg060_tilt_axes,
	    .nr_axes = ARRAY_SIZE(sg060_tilt_axes),

	    .states = sg060_tilt_states,
	    .nr_states = ARRAY_SIZE(sg060_tilt_states),

	    .debounce_interval = 100,

	    .poll_interval = 1000,
	    .enable = sg060_tilt_enable,
	    .disable = sg060_tilt_disable,
    };

    static struct platform_device sg060_device_tilt = {
	    .name = "gpio-tilt-polled",
	    .id = -1,
	    .dev = {
		    .platform_data = &sg060_tilt_pdata,
	    },
    };
+3 −3
Original line number Diff line number Diff line
@@ -108,9 +108,9 @@ example below:
	};

	static const struct property_entry rotary_encoder_properties[] __initconst = {
		PROPERTY_ENTRY_INTEGER("rotary-encoder,steps-per-period", u32, 24),
		PROPERTY_ENTRY_INTEGER("linux,axis",			  u32, ABS_X),
		PROPERTY_ENTRY_INTEGER("rotary-encoder,relative_axis",	  u32, 0),
		PROPERTY_ENTRY_U32("rotary-encoder,steps-per-period", 24),
		PROPERTY_ENTRY_U32("linux,axis",		      ABS_X),
		PROPERTY_ENTRY_U32("rotary-encoder,relative_axis",    0),
		{ },
	};

Loading