diff options
author | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2017-04-04 20:42:27 -0400 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2017-04-05 18:44:17 -0400 |
commit | 0119184986e7ff67c4aae17a28ebee68e25b04c4 (patch) | |
tree | 30ba92d056c985f773159755b3f10f0417c8933a /Documentation/input | |
parent | 9b0ce690ff0516956b9fa200f626f74455cf9e86 (diff) |
Input: gpio-tilt - convert documentation into ReST format
This file require minimum adjustments to be a valid ReST file.
Do it, in order to be able to parse it with Sphinx.
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'Documentation/input')
-rw-r--r-- | Documentation/input/gpio-tilt.txt | 146 |
1 files changed, 73 insertions, 73 deletions
diff --git a/Documentation/input/gpio-tilt.txt b/Documentation/input/gpio-tilt.txt index 2cdfd9bcb1af..23de9eff6a34 100644 --- a/Documentation/input/gpio-tilt.txt +++ b/Documentation/input/gpio-tilt.txt | |||
@@ -28,76 +28,76 @@ Example: | |||
28 | -------- | 28 | -------- |
29 | 29 | ||
30 | Example configuration for a single TS1003 tilt switch that rotates around | 30 | Example configuration for a single TS1003 tilt switch that rotates around |
31 | one axis in 4 steps and emits the current tilt via two GPIOs. | 31 | one axis in 4 steps and emits the current tilt via two GPIOs:: |
32 | 32 | ||
33 | static int sg060_tilt_enable(struct device *dev) { | 33 | static int sg060_tilt_enable(struct device *dev) { |
34 | /* code to enable the sensors */ | 34 | /* code to enable the sensors */ |
35 | }; | 35 | }; |
36 | 36 | ||
37 | static void sg060_tilt_disable(struct device *dev) { | 37 | static void sg060_tilt_disable(struct device *dev) { |
38 | /* code to disable the sensors */ | 38 | /* code to disable the sensors */ |
39 | }; | 39 | }; |
40 | 40 | ||
41 | static struct gpio sg060_tilt_gpios[] = { | 41 | static struct gpio sg060_tilt_gpios[] = { |
42 | { SG060_TILT_GPIO_SENSOR1, GPIOF_IN, "tilt_sensor1" }, | 42 | { SG060_TILT_GPIO_SENSOR1, GPIOF_IN, "tilt_sensor1" }, |
43 | { SG060_TILT_GPIO_SENSOR2, GPIOF_IN, "tilt_sensor2" }, | 43 | { SG060_TILT_GPIO_SENSOR2, GPIOF_IN, "tilt_sensor2" }, |
44 | }; | 44 | }; |
45 | 45 | ||
46 | static struct gpio_tilt_state sg060_tilt_states[] = { | 46 | static struct gpio_tilt_state sg060_tilt_states[] = { |
47 | { | 47 | { |
48 | .gpios = (0 << 1) | (0 << 0), | 48 | .gpios = (0 << 1) | (0 << 0), |
49 | .axes = (int[]) { | 49 | .axes = (int[]) { |
50 | 0, | 50 | 0, |
51 | }, | 51 | }, |
52 | }, { | 52 | }, { |
53 | .gpios = (0 << 1) | (1 << 0), | 53 | .gpios = (0 << 1) | (1 << 0), |
54 | .axes = (int[]) { | 54 | .axes = (int[]) { |
55 | 1, /* 90 degrees */ | 55 | 1, /* 90 degrees */ |
56 | }, | 56 | }, |
57 | }, { | 57 | }, { |
58 | .gpios = (1 << 1) | (1 << 0), | 58 | .gpios = (1 << 1) | (1 << 0), |
59 | .axes = (int[]) { | 59 | .axes = (int[]) { |
60 | 2, /* 180 degrees */ | 60 | 2, /* 180 degrees */ |
61 | }, | 61 | }, |
62 | }, { | 62 | }, { |
63 | .gpios = (1 << 1) | (0 << 0), | 63 | .gpios = (1 << 1) | (0 << 0), |
64 | .axes = (int[]) { | 64 | .axes = (int[]) { |
65 | 3, /* 270 degrees */ | 65 | 3, /* 270 degrees */ |
66 | }, | 66 | }, |
67 | }, | 67 | }, |
68 | }; | 68 | }; |
69 | 69 | ||
70 | static struct gpio_tilt_axis sg060_tilt_axes[] = { | 70 | static struct gpio_tilt_axis sg060_tilt_axes[] = { |
71 | { | 71 | { |
72 | .axis = ABS_RY, | 72 | .axis = ABS_RY, |
73 | .min = 0, | 73 | .min = 0, |
74 | .max = 3, | 74 | .max = 3, |
75 | .fuzz = 0, | 75 | .fuzz = 0, |
76 | .flat = 0, | 76 | .flat = 0, |
77 | }, | 77 | }, |
78 | }; | 78 | }; |
79 | 79 | ||
80 | static struct gpio_tilt_platform_data sg060_tilt_pdata= { | 80 | static struct gpio_tilt_platform_data sg060_tilt_pdata= { |
81 | .gpios = sg060_tilt_gpios, | 81 | .gpios = sg060_tilt_gpios, |
82 | .nr_gpios = ARRAY_SIZE(sg060_tilt_gpios), | 82 | .nr_gpios = ARRAY_SIZE(sg060_tilt_gpios), |
83 | 83 | ||
84 | .axes = sg060_tilt_axes, | 84 | .axes = sg060_tilt_axes, |
85 | .nr_axes = ARRAY_SIZE(sg060_tilt_axes), | 85 | .nr_axes = ARRAY_SIZE(sg060_tilt_axes), |
86 | 86 | ||
87 | .states = sg060_tilt_states, | 87 | .states = sg060_tilt_states, |
88 | .nr_states = ARRAY_SIZE(sg060_tilt_states), | 88 | .nr_states = ARRAY_SIZE(sg060_tilt_states), |
89 | 89 | ||
90 | .debounce_interval = 100, | 90 | .debounce_interval = 100, |
91 | 91 | ||
92 | .poll_interval = 1000, | 92 | .poll_interval = 1000, |
93 | .enable = sg060_tilt_enable, | 93 | .enable = sg060_tilt_enable, |
94 | .disable = sg060_tilt_disable, | 94 | .disable = sg060_tilt_disable, |
95 | }; | 95 | }; |
96 | 96 | ||
97 | static struct platform_device sg060_device_tilt = { | 97 | static struct platform_device sg060_device_tilt = { |
98 | .name = "gpio-tilt-polled", | 98 | .name = "gpio-tilt-polled", |
99 | .id = -1, | 99 | .id = -1, |
100 | .dev = { | 100 | .dev = { |
101 | .platform_data = &sg060_tilt_pdata, | 101 | .platform_data = &sg060_tilt_pdata, |
102 | }, | 102 | }, |
103 | }; | 103 | }; |