aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/i2c
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/i2c')
-rw-r--r--include/linux/i2c/i2c-hid.h35
-rw-r--r--include/linux/i2c/pcf857x.h3
-rw-r--r--include/linux/i2c/twl.h73
3 files changed, 71 insertions, 40 deletions
diff --git a/include/linux/i2c/i2c-hid.h b/include/linux/i2c/i2c-hid.h
new file mode 100644
index 000000000000..60e411d764d4
--- /dev/null
+++ b/include/linux/i2c/i2c-hid.h
@@ -0,0 +1,35 @@
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/types.h>
16
17/**
18 * struct i2chid_platform_data - used by hid over i2c implementation.
19 * @hid_descriptor_address: i2c register where the HID descriptor is stored.
20 *
21 * Note that it is the responsibility of the platform driver (or the acpi 5.0
22 * driver) to setup the irq related to the gpio in the struct i2c_board_info.
23 * The platform driver should also setup the gpio according to the device:
24 *
25 * A typical example is the following:
26 * irq = gpio_to_irq(intr_gpio);
27 * hkdk4412_i2c_devs5[0].irq = irq; // store the irq in i2c_board_info
28 * gpio_request(intr_gpio, "elan-irq");
29 * s3c_gpio_setpull(intr_gpio, S3C_GPIO_PULL_UP);
30 */
31struct i2c_hid_platform_data {
32 u16 hid_descriptor_address;
33};
34
35#endif /* __LINUX_I2C_HID_H */
diff --git a/include/linux/i2c/pcf857x.h b/include/linux/i2c/pcf857x.h
index 781e6bd06c34..0767a2a6b2f1 100644
--- a/include/linux/i2c/pcf857x.h
+++ b/include/linux/i2c/pcf857x.h
@@ -10,7 +10,6 @@
10 * @setup: optional callback issued once the GPIOs are valid 10 * @setup: optional callback issued once the GPIOs are valid
11 * @teardown: optional callback issued before the GPIOs are invalidated 11 * @teardown: optional callback issued before the GPIOs are invalidated
12 * @context: optional parameter passed to setup() and teardown() 12 * @context: optional parameter passed to setup() and teardown()
13 * @irq: optional interrupt number
14 * 13 *
15 * In addition to the I2C_BOARD_INFO() state appropriate to each chip, 14 * In addition to the I2C_BOARD_INFO() state appropriate to each chip,
16 * the i2c_board_info used with the pcf875x driver must provide its 15 * the i2c_board_info used with the pcf875x driver must provide its
@@ -40,8 +39,6 @@ struct pcf857x_platform_data {
40 int gpio, unsigned ngpio, 39 int gpio, unsigned ngpio,
41 void *context); 40 void *context);
42 void *context; 41 void *context;
43
44 int irq;
45}; 42};
46 43
47#endif /* __LINUX_PCF857X_H */ 44#endif /* __LINUX_PCF857X_H */
diff --git a/include/linux/i2c/twl.h b/include/linux/i2c/twl.h
index 9a5e28462324..1ff54b114efc 100644
--- a/include/linux/i2c/twl.h
+++ b/include/linux/i2c/twl.h
@@ -39,52 +39,51 @@
39 * address each module uses within a given i2c slave. 39 * address each module uses within a given i2c slave.
40 */ 40 */
41 41
42/* Slave 0 (i2c address 0x48) */ 42enum twl4030_module_ids {
43#define TWL4030_MODULE_USB 0x00 43 TWL4030_MODULE_USB = 0, /* Slave 0 (i2c address 0x48) */
44 44 TWL4030_MODULE_AUDIO_VOICE, /* Slave 1 (i2c address 0x49) */
45/* Slave 1 (i2c address 0x49) */ 45 TWL4030_MODULE_GPIO,
46#define TWL4030_MODULE_AUDIO_VOICE 0x01 46 TWL4030_MODULE_INTBR,
47#define TWL4030_MODULE_GPIO 0x02 47 TWL4030_MODULE_PIH,
48#define TWL4030_MODULE_INTBR 0x03 48
49#define TWL4030_MODULE_PIH 0x04 49 TWL4030_MODULE_TEST,
50#define TWL4030_MODULE_TEST 0x05 50 TWL4030_MODULE_KEYPAD, /* Slave 2 (i2c address 0x4a) */
51 51 TWL4030_MODULE_MADC,
52/* Slave 2 (i2c address 0x4a) */ 52 TWL4030_MODULE_INTERRUPTS,
53#define TWL4030_MODULE_KEYPAD 0x06 53 TWL4030_MODULE_LED,
54#define TWL4030_MODULE_MADC 0x07 54
55#define TWL4030_MODULE_INTERRUPTS 0x08 55 TWL4030_MODULE_MAIN_CHARGE,
56#define TWL4030_MODULE_LED 0x09 56 TWL4030_MODULE_PRECHARGE,
57#define TWL4030_MODULE_MAIN_CHARGE 0x0A 57 TWL4030_MODULE_PWM0,
58#define TWL4030_MODULE_PRECHARGE 0x0B 58 TWL4030_MODULE_PWM1,
59#define TWL4030_MODULE_PWM0 0x0C 59 TWL4030_MODULE_PWMA,
60#define TWL4030_MODULE_PWM1 0x0D 60
61#define TWL4030_MODULE_PWMA 0x0E 61 TWL4030_MODULE_PWMB,
62#define TWL4030_MODULE_PWMB 0x0F 62 TWL5031_MODULE_ACCESSORY,
63 63 TWL5031_MODULE_INTERRUPTS,
64#define TWL5031_MODULE_ACCESSORY 0x10 64 TWL4030_MODULE_BACKUP, /* Slave 3 (i2c address 0x4b) */
65#define TWL5031_MODULE_INTERRUPTS 0x11 65 TWL4030_MODULE_INT,
66 66
67/* Slave 3 (i2c address 0x4b) */ 67 TWL4030_MODULE_PM_MASTER,
68#define TWL4030_MODULE_BACKUP 0x12 68 TWL4030_MODULE_PM_RECEIVER,
69#define TWL4030_MODULE_INT 0x13 69 TWL4030_MODULE_RTC,
70#define TWL4030_MODULE_PM_MASTER 0x14 70 TWL4030_MODULE_SECURED_REG,
71#define TWL4030_MODULE_PM_RECEIVER 0x15 71 TWL4030_MODULE_LAST,
72#define TWL4030_MODULE_RTC 0x16 72};
73#define TWL4030_MODULE_SECURED_REG 0x17
74 73
74/* Similar functionalities implemented in TWL4030/6030 */
75#define TWL_MODULE_USB TWL4030_MODULE_USB 75#define TWL_MODULE_USB TWL4030_MODULE_USB
76#define TWL_MODULE_AUDIO_VOICE TWL4030_MODULE_AUDIO_VOICE
77#define TWL_MODULE_PIH TWL4030_MODULE_PIH 76#define TWL_MODULE_PIH TWL4030_MODULE_PIH
78#define TWL_MODULE_MADC TWL4030_MODULE_MADC
79#define TWL_MODULE_MAIN_CHARGE TWL4030_MODULE_MAIN_CHARGE 77#define TWL_MODULE_MAIN_CHARGE TWL4030_MODULE_MAIN_CHARGE
80#define TWL_MODULE_PM_MASTER TWL4030_MODULE_PM_MASTER 78#define TWL_MODULE_PM_MASTER TWL4030_MODULE_PM_MASTER
81#define TWL_MODULE_PM_RECEIVER TWL4030_MODULE_PM_RECEIVER 79#define TWL_MODULE_PM_RECEIVER TWL4030_MODULE_PM_RECEIVER
82#define TWL_MODULE_RTC TWL4030_MODULE_RTC 80#define TWL_MODULE_RTC TWL4030_MODULE_RTC
83#define TWL_MODULE_PWM TWL4030_MODULE_PWM0 81#define TWL_MODULE_PWM TWL4030_MODULE_PWM0
82#define TWL_MODULE_LED TWL4030_MODULE_LED
84 83
85#define TWL6030_MODULE_ID0 0x0D 84#define TWL6030_MODULE_ID0 13
86#define TWL6030_MODULE_ID1 0x0E 85#define TWL6030_MODULE_ID1 14
87#define TWL6030_MODULE_ID2 0x0F 86#define TWL6030_MODULE_ID2 15
88 87
89#define GPIO_INTR_OFFSET 0 88#define GPIO_INTR_OFFSET 0
90#define KEYPAD_INTR_OFFSET 1 89#define KEYPAD_INTR_OFFSET 1