]>
git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blob - include/linux/input/gpio_tilt.h
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _INPUT_GPIO_TILT_H
3 #define _INPUT_GPIO_TILT_H
6 * struct gpio_tilt_axis - Axis used by the tilt switch
7 * @axis: Constant describing the axis, e.g. ABS_X
8 * @min: minimum value for abs_param
9 * @max: maximum value for abs_param
10 * @fuzz: fuzz value for abs_param
11 * @flat: flat value for abs_param
13 struct gpio_tilt_axis
{
22 * struct gpio_tilt_state - state description
23 * @gpios: bitfield of gpio target-states for the value
24 * @axes: array containing the axes settings for the gpio state
25 * The array indizes must correspond to the axes defined
28 * This structure describes a supported axis settings
29 * and the necessary gpio-state which represent it.
31 * The n-th bit in the bitfield describes the state of the n-th GPIO
32 * from the gpios-array defined in gpio_regulator_config below.
34 struct gpio_tilt_state
{
40 * struct gpio_tilt_platform_data
41 * @gpios: Array containing the gpios determining the tilt state
42 * @nr_gpios: Number of gpios
43 * @axes: Array of gpio_tilt_axis descriptions
44 * @nr_axes: Number of axes
45 * @states: Array of gpio_tilt_state entries describing
46 * the gpio state for specific tilts
47 * @nr_states: Number of states available
48 * @debounce_interval: debounce ticks interval in msecs
49 * @poll_interval: polling interval in msecs - for polling driver only
50 * @enable: callback to enable the tilt switch
51 * @disable: callback to disable the tilt switch
53 * This structure contains gpio-tilt-switch configuration
54 * information that must be passed by platform code to the
55 * gpio-tilt input driver.
57 struct gpio_tilt_platform_data
{
61 struct gpio_tilt_axis
*axes
;
64 struct gpio_tilt_state
*states
;
67 int debounce_interval
;
69 unsigned int poll_interval
;
70 int (*enable
)(struct device
*dev
);
71 void (*disable
)(struct device
*dev
);