Linux-libre 5.4.47-gnu
[librecmc/linux-libre.git] / include / linux / platform_data / i2c-hid.h
1 /*
2  * HID over I2C protocol implementation
3  *
4  * Copyright (c) 2012 Benjamin Tissoires <benjamin.tissoires@gmail.com>
5  * Copyright (c) 2012 Ecole Nationale de l'Aviation Civile, France
6  *
7  * This file is subject to the terms and conditions of the GNU General Public
8  * License.  See the file COPYING in the main directory of this archive for
9  * more details.
10  */
11
12 #ifndef __LINUX_I2C_HID_H
13 #define __LINUX_I2C_HID_H
14
15 #include <linux/regulator/consumer.h>
16 #include <linux/types.h>
17
18 /**
19  * struct i2chid_platform_data - used by hid over i2c implementation.
20  * @hid_descriptor_address: i2c register where the HID descriptor is stored.
21  * @supplies: regulators for powering on the device.
22  * @post_power_delay_ms: delay after powering on before device is usable.
23  *
24  * Note that it is the responsibility of the platform driver (or the acpi 5.0
25  * driver, or the flattened device tree) to setup the irq related to the gpio in
26  * the struct i2c_board_info.
27  * The platform driver should also setup the gpio according to the device:
28  *
29  * A typical example is the following:
30  *      irq = gpio_to_irq(intr_gpio);
31  *      hkdk4412_i2c_devs5[0].irq = irq; // store the irq in i2c_board_info
32  *      gpio_request(intr_gpio, "elan-irq");
33  *      s3c_gpio_setpull(intr_gpio, S3C_GPIO_PULL_UP);
34  */
35 struct i2c_hid_platform_data {
36         u16 hid_descriptor_address;
37         struct regulator_bulk_data supplies[2];
38         int post_power_delay_ms;
39 };
40
41 #endif /* __LINUX_I2C_HID_H */