Commit 01191849 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab Committed by Dmitry Torokhov

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: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent 9b0ce690
......@@ -28,22 +28,22 @@ 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.
one axis in 4 steps and emits the current tilt via two GPIOs::
static int sg060_tilt_enable(struct device *dev) {
static int sg060_tilt_enable(struct device *dev) {
/* code to enable the sensors */
};
};
static void sg060_tilt_disable(struct device *dev) {
static void sg060_tilt_disable(struct device *dev) {
/* code to disable the sensors */
};
};
static struct gpio sg060_tilt_gpios[] = {
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[] = {
static struct gpio_tilt_state sg060_tilt_states[] = {
{
.gpios = (0 << 1) | (0 << 0),
.axes = (int[]) {
......@@ -65,9 +65,9 @@ static struct gpio_tilt_state sg060_tilt_states[] = {
3, /* 270 degrees */
},
},
};
};
static struct gpio_tilt_axis sg060_tilt_axes[] = {
static struct gpio_tilt_axis sg060_tilt_axes[] = {
{
.axis = ABS_RY,
.min = 0,
......@@ -75,9 +75,9 @@ static struct gpio_tilt_axis sg060_tilt_axes[] = {
.fuzz = 0,
.flat = 0,
},
};
};
static struct gpio_tilt_platform_data sg060_tilt_pdata= {
static struct gpio_tilt_platform_data sg060_tilt_pdata= {
.gpios = sg060_tilt_gpios,
.nr_gpios = ARRAY_SIZE(sg060_tilt_gpios),
......@@ -92,12 +92,12 @@ static struct gpio_tilt_platform_data sg060_tilt_pdata= {
.poll_interval = 1000,
.enable = sg060_tilt_enable,
.disable = sg060_tilt_disable,
};
};
static struct platform_device sg060_device_tilt = {
static struct platform_device sg060_device_tilt = {
.name = "gpio-tilt-polled",
.id = -1,
.dev = {
.platform_data = &sg060_tilt_pdata,
},
};
};
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment