diff options
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/blkdev.h | 1 | ||||
-rw-r--r-- | include/linux/i2c-id.h | 63 | ||||
-rw-r--r-- | include/linux/i2c.h | 126 | ||||
-rw-r--r-- | include/linux/i2c/tps65010.h | 156 | ||||
-rw-r--r-- | include/linux/ide.h | 61 | ||||
-rw-r--r-- | include/linux/m41t00.h | 50 |
6 files changed, 246 insertions, 211 deletions
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index bd20a4e8663a..49b7a4c31a6d 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
@@ -143,7 +143,6 @@ enum rq_cmd_type_bits { | |||
143 | * use REQ_TYPE_SPECIAL and use rq->cmd[0] with the range of driver | 143 | * use REQ_TYPE_SPECIAL and use rq->cmd[0] with the range of driver |
144 | * private REQ_LB opcodes to differentiate what type of request this is | 144 | * private REQ_LB opcodes to differentiate what type of request this is |
145 | */ | 145 | */ |
146 | REQ_TYPE_ATA_CMD, | ||
147 | REQ_TYPE_ATA_TASKFILE, | 146 | REQ_TYPE_ATA_TASKFILE, |
148 | REQ_TYPE_ATA_PC, | 147 | REQ_TYPE_ATA_PC, |
149 | }; | 148 | }; |
diff --git a/include/linux/i2c-id.h b/include/linux/i2c-id.h index c7a51a196f51..f922b060158b 100644 --- a/include/linux/i2c-id.h +++ b/include/linux/i2c-id.h | |||
@@ -33,23 +33,13 @@ | |||
33 | 33 | ||
34 | #define I2C_DRIVERID_MSP3400 1 | 34 | #define I2C_DRIVERID_MSP3400 1 |
35 | #define I2C_DRIVERID_TUNER 2 | 35 | #define I2C_DRIVERID_TUNER 2 |
36 | #define I2C_DRIVERID_VIDEOTEX 3 /* please rename */ | ||
37 | #define I2C_DRIVERID_TDA8425 4 /* stereo sound processor */ | 36 | #define I2C_DRIVERID_TDA8425 4 /* stereo sound processor */ |
38 | #define I2C_DRIVERID_TEA6420 5 /* audio matrix switch */ | 37 | #define I2C_DRIVERID_TEA6420 5 /* audio matrix switch */ |
39 | #define I2C_DRIVERID_TEA6415C 6 /* video matrix switch */ | 38 | #define I2C_DRIVERID_TEA6415C 6 /* video matrix switch */ |
40 | #define I2C_DRIVERID_TDA9840 7 /* stereo sound processor */ | 39 | #define I2C_DRIVERID_TDA9840 7 /* stereo sound processor */ |
41 | #define I2C_DRIVERID_SAA7111A 8 /* video input processor */ | 40 | #define I2C_DRIVERID_SAA7111A 8 /* video input processor */ |
42 | #define I2C_DRIVERID_SAA5281 9 /* videotext decoder */ | ||
43 | #define I2C_DRIVERID_SAA7112 10 /* video decoder, image scaler */ | ||
44 | #define I2C_DRIVERID_SAA7120 11 /* video encoder */ | ||
45 | #define I2C_DRIVERID_SAA7121 12 /* video encoder */ | ||
46 | #define I2C_DRIVERID_SAA7185B 13 /* video encoder */ | 41 | #define I2C_DRIVERID_SAA7185B 13 /* video encoder */ |
47 | #define I2C_DRIVERID_CH7003 14 /* digital pc to tv encoder */ | ||
48 | #define I2C_DRIVERID_PCF8574A 15 /* i2c expander - 8 bit in/out */ | ||
49 | #define I2C_DRIVERID_PCF8582C 16 /* eeprom */ | ||
50 | #define I2C_DRIVERID_AT24Cxx 17 /* eeprom 1/2/4/8/16 K */ | ||
51 | #define I2C_DRIVERID_TEA6300 18 /* audio mixer */ | 42 | #define I2C_DRIVERID_TEA6300 18 /* audio mixer */ |
52 | #define I2C_DRIVERID_BT829 19 /* pc to tv encoder */ | ||
53 | #define I2C_DRIVERID_TDA9850 20 /* audio mixer */ | 43 | #define I2C_DRIVERID_TDA9850 20 /* audio mixer */ |
54 | #define I2C_DRIVERID_TDA9855 21 /* audio mixer */ | 44 | #define I2C_DRIVERID_TDA9855 21 /* audio mixer */ |
55 | #define I2C_DRIVERID_SAA7110 22 /* video decoder */ | 45 | #define I2C_DRIVERID_SAA7110 22 /* video decoder */ |
@@ -60,42 +50,19 @@ | |||
60 | #define I2C_DRIVERID_TDA7432 27 /* Stereo sound processor */ | 50 | #define I2C_DRIVERID_TDA7432 27 /* Stereo sound processor */ |
61 | #define I2C_DRIVERID_TVMIXER 28 /* Mixer driver for tv cards */ | 51 | #define I2C_DRIVERID_TVMIXER 28 /* Mixer driver for tv cards */ |
62 | #define I2C_DRIVERID_TVAUDIO 29 /* Generic TV sound driver */ | 52 | #define I2C_DRIVERID_TVAUDIO 29 /* Generic TV sound driver */ |
63 | #define I2C_DRIVERID_DPL3518 30 /* Dolby decoder chip */ | ||
64 | #define I2C_DRIVERID_TDA9873 31 /* TV sound decoder chip */ | 53 | #define I2C_DRIVERID_TDA9873 31 /* TV sound decoder chip */ |
65 | #define I2C_DRIVERID_TDA9875 32 /* TV sound decoder chip */ | 54 | #define I2C_DRIVERID_TDA9875 32 /* TV sound decoder chip */ |
66 | #define I2C_DRIVERID_PIC16C54_PV9 33 /* Audio mux/ir receiver */ | 55 | #define I2C_DRIVERID_PIC16C54_PV9 33 /* Audio mux/ir receiver */ |
67 | |||
68 | #define I2C_DRIVERID_SBATT 34 /* Smart Battery Device */ | ||
69 | #define I2C_DRIVERID_SBS 35 /* SB System Manager */ | ||
70 | #define I2C_DRIVERID_VES1893 36 /* VLSI DVB-S decoder */ | ||
71 | #define I2C_DRIVERID_VES1820 37 /* VLSI DVB-C decoder */ | ||
72 | #define I2C_DRIVERID_SAA7113 38 /* video decoder */ | ||
73 | #define I2C_DRIVERID_TDA8444 39 /* octuple 6-bit DAC */ | ||
74 | #define I2C_DRIVERID_BT819 40 /* video decoder */ | 56 | #define I2C_DRIVERID_BT819 40 /* video decoder */ |
75 | #define I2C_DRIVERID_BT856 41 /* video encoder */ | 57 | #define I2C_DRIVERID_BT856 41 /* video encoder */ |
76 | #define I2C_DRIVERID_VPX3220 42 /* video decoder+vbi/vtxt */ | 58 | #define I2C_DRIVERID_VPX3220 42 /* video decoder+vbi/vtxt */ |
77 | #define I2C_DRIVERID_DRP3510 43 /* ADR decoder (Astra Radio) */ | ||
78 | #define I2C_DRIVERID_SP5055 44 /* Satellite tuner */ | ||
79 | #define I2C_DRIVERID_STV0030 45 /* Multipurpose switch */ | ||
80 | #define I2C_DRIVERID_SAA7108 46 /* video decoder, image scaler */ | ||
81 | #define I2C_DRIVERID_DS1307 47 /* DS1307 real time clock */ | ||
82 | #define I2C_DRIVERID_ADV7175 48 /* ADV 7175/7176 video encoder */ | 59 | #define I2C_DRIVERID_ADV7175 48 /* ADV 7175/7176 video encoder */ |
83 | #define I2C_DRIVERID_SAA7114 49 /* video decoder */ | 60 | #define I2C_DRIVERID_SAA7114 49 /* video decoder */ |
84 | #define I2C_DRIVERID_ZR36120 50 /* Zoran 36120 video encoder */ | ||
85 | #define I2C_DRIVERID_24LC32A 51 /* Microchip 24LC32A 32k EEPROM */ | ||
86 | #define I2C_DRIVERID_STM41T00 52 /* real time clock */ | ||
87 | #define I2C_DRIVERID_UDA1342 53 /* UDA1342 audio codec */ | ||
88 | #define I2C_DRIVERID_ADV7170 54 /* video encoder */ | 61 | #define I2C_DRIVERID_ADV7170 54 /* video encoder */ |
89 | #define I2C_DRIVERID_MAX1617 56 /* temp sensor */ | ||
90 | #define I2C_DRIVERID_SAA7191 57 /* video decoder */ | 62 | #define I2C_DRIVERID_SAA7191 57 /* video decoder */ |
91 | #define I2C_DRIVERID_INDYCAM 58 /* SGI IndyCam */ | 63 | #define I2C_DRIVERID_INDYCAM 58 /* SGI IndyCam */ |
92 | #define I2C_DRIVERID_BT832 59 /* CMOS camera video processor */ | ||
93 | #define I2C_DRIVERID_TDA9887 60 /* TDA988x IF-PLL demodulator */ | ||
94 | #define I2C_DRIVERID_OVCAMCHIP 61 /* OmniVision CMOS image sens. */ | 64 | #define I2C_DRIVERID_OVCAMCHIP 61 /* OmniVision CMOS image sens. */ |
95 | #define I2C_DRIVERID_TDA7313 62 /* TDA7313 audio processor */ | ||
96 | #define I2C_DRIVERID_MAX6900 63 /* MAX6900 real-time clock */ | 65 | #define I2C_DRIVERID_MAX6900 63 /* MAX6900 real-time clock */ |
97 | #define I2C_DRIVERID_SAA7114H 64 /* video decoder */ | ||
98 | #define I2C_DRIVERID_DS1374 65 /* DS1374 real time clock */ | ||
99 | #define I2C_DRIVERID_TDA9874 66 /* TV sound decoder */ | 66 | #define I2C_DRIVERID_TDA9874 66 /* TV sound decoder */ |
100 | #define I2C_DRIVERID_SAA6752HS 67 /* MPEG2 encoder */ | 67 | #define I2C_DRIVERID_SAA6752HS 67 /* MPEG2 encoder */ |
101 | #define I2C_DRIVERID_TVEEPROM 68 /* TV EEPROM */ | 68 | #define I2C_DRIVERID_TVEEPROM 68 /* TV EEPROM */ |
@@ -114,7 +81,6 @@ | |||
114 | #define I2C_DRIVERID_DS1672 81 /* Dallas/Maxim DS1672 RTC */ | 81 | #define I2C_DRIVERID_DS1672 81 /* Dallas/Maxim DS1672 RTC */ |
115 | #define I2C_DRIVERID_X1205 82 /* Xicor/Intersil X1205 RTC */ | 82 | #define I2C_DRIVERID_X1205 82 /* Xicor/Intersil X1205 RTC */ |
116 | #define I2C_DRIVERID_PCF8563 83 /* Philips PCF8563 RTC */ | 83 | #define I2C_DRIVERID_PCF8563 83 /* Philips PCF8563 RTC */ |
117 | #define I2C_DRIVERID_RS5C372 84 /* Ricoh RS5C372 RTC */ | ||
118 | #define I2C_DRIVERID_BT866 85 /* Conexant bt866 video encoder */ | 84 | #define I2C_DRIVERID_BT866 85 /* Conexant bt866 video encoder */ |
119 | #define I2C_DRIVERID_KS0127 86 /* Samsung ks0127 video decoder */ | 85 | #define I2C_DRIVERID_KS0127 86 /* Samsung ks0127 video decoder */ |
120 | #define I2C_DRIVERID_TLV320AIC23B 87 /* TI TLV320AIC23B audio codec */ | 86 | #define I2C_DRIVERID_TLV320AIC23B 87 /* TI TLV320AIC23B audio codec */ |
@@ -129,8 +95,6 @@ | |||
129 | #define I2C_DRIVERID_CS5345 96 /* cs5345 audio processor */ | 95 | #define I2C_DRIVERID_CS5345 96 /* cs5345 audio processor */ |
130 | 96 | ||
131 | #define I2C_DRIVERID_I2CDEV 900 | 97 | #define I2C_DRIVERID_I2CDEV 900 |
132 | #define I2C_DRIVERID_ARP 902 /* SMBus ARP Client */ | ||
133 | #define I2C_DRIVERID_ALERT 903 /* SMBus Alert Responder Client */ | ||
134 | 98 | ||
135 | /* IDs -- Use DRIVERIDs 1000-1999 for sensors. | 99 | /* IDs -- Use DRIVERIDs 1000-1999 for sensors. |
136 | These were originally in sensors.h in the lm_sensors package */ | 100 | These were originally in sensors.h in the lm_sensors package */ |
@@ -176,24 +140,16 @@ | |||
176 | 140 | ||
177 | /* --- Bit algorithm adapters */ | 141 | /* --- Bit algorithm adapters */ |
178 | #define I2C_HW_B_LP 0x010000 /* Parallel port Philips style */ | 142 | #define I2C_HW_B_LP 0x010000 /* Parallel port Philips style */ |
179 | #define I2C_HW_B_SER 0x010002 /* Serial line interface */ | ||
180 | #define I2C_HW_B_BT848 0x010005 /* BT848 video boards */ | 143 | #define I2C_HW_B_BT848 0x010005 /* BT848 video boards */ |
181 | #define I2C_HW_B_WNV 0x010006 /* Winnov Videums */ | ||
182 | #define I2C_HW_B_VIA 0x010007 /* Via vt82c586b */ | 144 | #define I2C_HW_B_VIA 0x010007 /* Via vt82c586b */ |
183 | #define I2C_HW_B_HYDRA 0x010008 /* Apple Hydra Mac I/O */ | 145 | #define I2C_HW_B_HYDRA 0x010008 /* Apple Hydra Mac I/O */ |
184 | #define I2C_HW_B_G400 0x010009 /* Matrox G400 */ | 146 | #define I2C_HW_B_G400 0x010009 /* Matrox G400 */ |
185 | #define I2C_HW_B_I810 0x01000a /* Intel I810 */ | 147 | #define I2C_HW_B_I810 0x01000a /* Intel I810 */ |
186 | #define I2C_HW_B_VOO 0x01000b /* 3dfx Voodoo 3 / Banshee */ | 148 | #define I2C_HW_B_VOO 0x01000b /* 3dfx Voodoo 3 / Banshee */ |
187 | #define I2C_HW_B_PPORT 0x01000c /* Primitive parallel port adapter */ | ||
188 | #define I2C_HW_B_SAVG 0x01000d /* Savage 4 */ | ||
189 | #define I2C_HW_B_SCX200 0x01000e /* Nat'l Semi SCx200 I2C */ | 149 | #define I2C_HW_B_SCX200 0x01000e /* Nat'l Semi SCx200 I2C */ |
190 | #define I2C_HW_B_RIVA 0x010010 /* Riva based graphics cards */ | 150 | #define I2C_HW_B_RIVA 0x010010 /* Riva based graphics cards */ |
191 | #define I2C_HW_B_IOC 0x010011 /* IOC bit-wiggling */ | 151 | #define I2C_HW_B_IOC 0x010011 /* IOC bit-wiggling */ |
192 | #define I2C_HW_B_TSUNA 0x010012 /* DEC Tsunami chipset */ | ||
193 | #define I2C_HW_B_OMAHA 0x010014 /* Omaha I2C interface (ARM) */ | ||
194 | #define I2C_HW_B_GUIDE 0x010015 /* Guide bit-basher */ | ||
195 | #define I2C_HW_B_IXP2000 0x010016 /* GPIO on IXP2000 systems */ | 152 | #define I2C_HW_B_IXP2000 0x010016 /* GPIO on IXP2000 systems */ |
196 | #define I2C_HW_B_IXP4XX 0x010017 /* GPIO on IXP4XX systems */ | ||
197 | #define I2C_HW_B_S3VIA 0x010018 /* S3Via ProSavage adapter */ | 153 | #define I2C_HW_B_S3VIA 0x010018 /* S3Via ProSavage adapter */ |
198 | #define I2C_HW_B_ZR36067 0x010019 /* Zoran-36057/36067 based boards */ | 154 | #define I2C_HW_B_ZR36067 0x010019 /* Zoran-36057/36067 based boards */ |
199 | #define I2C_HW_B_PCILYNX 0x01001a /* TI PCILynx I2C adapter */ | 155 | #define I2C_HW_B_PCILYNX 0x01001a /* TI PCILynx I2C adapter */ |
@@ -207,22 +163,11 @@ | |||
207 | #define I2C_HW_B_CX23885 0x010022 /* conexant 23885 based tv cards (bus1) */ | 163 | #define I2C_HW_B_CX23885 0x010022 /* conexant 23885 based tv cards (bus1) */ |
208 | 164 | ||
209 | /* --- PCF 8584 based algorithms */ | 165 | /* --- PCF 8584 based algorithms */ |
210 | #define I2C_HW_P_LP 0x020000 /* Parallel port interface */ | ||
211 | #define I2C_HW_P_ISA 0x020001 /* generic ISA Bus inteface card */ | ||
212 | #define I2C_HW_P_ELEK 0x020002 /* Elektor ISA Bus inteface card */ | 166 | #define I2C_HW_P_ELEK 0x020002 /* Elektor ISA Bus inteface card */ |
213 | 167 | ||
214 | /* --- PCA 9564 based algorithms */ | 168 | /* --- PCA 9564 based algorithms */ |
215 | #define I2C_HW_A_ISA 0x1a0000 /* generic ISA Bus interface card */ | 169 | #define I2C_HW_A_ISA 0x1a0000 /* generic ISA Bus interface card */ |
216 | 170 | ||
217 | /* --- ACPI Embedded controller algorithms */ | ||
218 | #define I2C_HW_ACPI_EC 0x1f0000 | ||
219 | |||
220 | /* --- MPC824x PowerPC adapters */ | ||
221 | #define I2C_HW_MPC824X 0x100001 /* Motorola 8240 / 8245 */ | ||
222 | |||
223 | /* --- MPC8xx PowerPC adapters */ | ||
224 | #define I2C_HW_MPC8XX_EPON 0x110000 /* Eponymous MPC8xx I2C adapter */ | ||
225 | |||
226 | /* --- PowerPC on-chip adapters */ | 171 | /* --- PowerPC on-chip adapters */ |
227 | #define I2C_HW_OCP 0x120000 /* IBM on-chip I2C adapter */ | 172 | #define I2C_HW_OCP 0x120000 /* IBM on-chip I2C adapter */ |
228 | 173 | ||
@@ -231,7 +176,6 @@ | |||
231 | 176 | ||
232 | /* --- SGI adapters */ | 177 | /* --- SGI adapters */ |
233 | #define I2C_HW_SGI_VINO 0x160000 | 178 | #define I2C_HW_SGI_VINO 0x160000 |
234 | #define I2C_HW_SGI_MACE 0x160001 | ||
235 | 179 | ||
236 | /* --- XSCALE on-chip adapters */ | 180 | /* --- XSCALE on-chip adapters */ |
237 | #define I2C_HW_IOP3XX 0x140000 | 181 | #define I2C_HW_IOP3XX 0x140000 |
@@ -255,17 +199,10 @@ | |||
255 | #define I2C_HW_SMBUS_W9968CF 0x04000d | 199 | #define I2C_HW_SMBUS_W9968CF 0x04000d |
256 | #define I2C_HW_SMBUS_OV511 0x04000e /* OV511(+) USB 1.1 webcam ICs */ | 200 | #define I2C_HW_SMBUS_OV511 0x04000e /* OV511(+) USB 1.1 webcam ICs */ |
257 | #define I2C_HW_SMBUS_OV518 0x04000f /* OV518(+) USB 1.1 webcam ICs */ | 201 | #define I2C_HW_SMBUS_OV518 0x04000f /* OV518(+) USB 1.1 webcam ICs */ |
258 | #define I2C_HW_SMBUS_OV519 0x040010 /* OV519 USB 1.1 webcam IC */ | ||
259 | #define I2C_HW_SMBUS_OVFX2 0x040011 /* Cypress/OmniVision FX2 webcam */ | 202 | #define I2C_HW_SMBUS_OVFX2 0x040011 /* Cypress/OmniVision FX2 webcam */ |
260 | #define I2C_HW_SMBUS_CAFE 0x040012 /* Marvell 88ALP01 "CAFE" cam */ | 203 | #define I2C_HW_SMBUS_CAFE 0x040012 /* Marvell 88ALP01 "CAFE" cam */ |
261 | #define I2C_HW_SMBUS_ALI1563 0x040013 | 204 | #define I2C_HW_SMBUS_ALI1563 0x040013 |
262 | 205 | ||
263 | /* --- ISA pseudo-adapter */ | ||
264 | #define I2C_HW_ISA 0x050000 | ||
265 | |||
266 | /* --- IPMB adapter */ | ||
267 | #define I2C_HW_IPMB 0x0c0000 | ||
268 | |||
269 | /* --- MCP107 adapter */ | 206 | /* --- MCP107 adapter */ |
270 | #define I2C_HW_MPC107 0x0d0000 | 207 | #define I2C_HW_MPC107 0x0d0000 |
271 | 208 | ||
diff --git a/include/linux/i2c.h b/include/linux/i2c.h index a100c9f8eb7c..76014f8f3c60 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h | |||
@@ -140,7 +140,6 @@ struct i2c_driver { | |||
140 | int (*command)(struct i2c_client *client,unsigned int cmd, void *arg); | 140 | int (*command)(struct i2c_client *client,unsigned int cmd, void *arg); |
141 | 141 | ||
142 | struct device_driver driver; | 142 | struct device_driver driver; |
143 | struct list_head list; | ||
144 | }; | 143 | }; |
145 | #define to_i2c_driver(d) container_of(d, struct i2c_driver, driver) | 144 | #define to_i2c_driver(d) container_of(d, struct i2c_driver, driver) |
146 | 145 | ||
@@ -155,12 +154,11 @@ struct i2c_driver { | |||
155 | * generic enough to hide second-sourcing and compatible revisions. | 154 | * generic enough to hide second-sourcing and compatible revisions. |
156 | * @adapter: manages the bus segment hosting this I2C device | 155 | * @adapter: manages the bus segment hosting this I2C device |
157 | * @driver: device's driver, hence pointer to access routines | 156 | * @driver: device's driver, hence pointer to access routines |
158 | * @usage_count: counts current number of users of this client | ||
159 | * @dev: Driver model device node for the slave. | 157 | * @dev: Driver model device node for the slave. |
160 | * @irq: indicates the IRQ generated by this device (if any) | 158 | * @irq: indicates the IRQ generated by this device (if any) |
161 | * @driver_name: Identifies new-style driver used with this device; also | 159 | * @driver_name: Identifies new-style driver used with this device; also |
162 | * used as the module name for hotplug/coldplug modprobe support. | 160 | * used as the module name for hotplug/coldplug modprobe support. |
163 | * @list: list of active/busy clients | 161 | * @list: list of active/busy clients (DEPRECATED) |
164 | * @released: used to synchronize client releases & detaches and references | 162 | * @released: used to synchronize client releases & detaches and references |
165 | * | 163 | * |
166 | * An i2c_client identifies a single device (i.e. chip) connected to an | 164 | * An i2c_client identifies a single device (i.e. chip) connected to an |
@@ -175,16 +173,16 @@ struct i2c_client { | |||
175 | char name[I2C_NAME_SIZE]; | 173 | char name[I2C_NAME_SIZE]; |
176 | struct i2c_adapter *adapter; /* the adapter we sit on */ | 174 | struct i2c_adapter *adapter; /* the adapter we sit on */ |
177 | struct i2c_driver *driver; /* and our access routines */ | 175 | struct i2c_driver *driver; /* and our access routines */ |
178 | int usage_count; /* How many accesses currently */ | ||
179 | /* to the client */ | ||
180 | struct device dev; /* the device structure */ | 176 | struct device dev; /* the device structure */ |
181 | int irq; /* irq issued by device (or -1) */ | 177 | int irq; /* irq issued by device (or -1) */ |
182 | char driver_name[KOBJ_NAME_LEN]; | 178 | char driver_name[KOBJ_NAME_LEN]; |
183 | struct list_head list; | 179 | struct list_head list; /* DEPRECATED */ |
184 | struct completion released; | 180 | struct completion released; |
185 | }; | 181 | }; |
186 | #define to_i2c_client(d) container_of(d, struct i2c_client, dev) | 182 | #define to_i2c_client(d) container_of(d, struct i2c_client, dev) |
187 | 183 | ||
184 | extern struct i2c_client *i2c_verify_client(struct device *dev); | ||
185 | |||
188 | static inline struct i2c_client *kobj_to_i2c_client(struct kobject *kobj) | 186 | static inline struct i2c_client *kobj_to_i2c_client(struct kobject *kobj) |
189 | { | 187 | { |
190 | struct device * const dev = container_of(kobj, struct device, kobj); | 188 | struct device * const dev = container_of(kobj, struct device, kobj); |
@@ -261,6 +259,12 @@ i2c_new_probed_device(struct i2c_adapter *adap, | |||
261 | struct i2c_board_info *info, | 259 | struct i2c_board_info *info, |
262 | unsigned short const *addr_list); | 260 | unsigned short const *addr_list); |
263 | 261 | ||
262 | /* For devices that use several addresses, use i2c_new_dummy() to make | ||
263 | * client handles for the extra addresses. | ||
264 | */ | ||
265 | extern struct i2c_client * | ||
266 | i2c_new_dummy(struct i2c_adapter *adap, u16 address, const char *type); | ||
267 | |||
264 | extern void i2c_unregister_device(struct i2c_client *); | 268 | extern void i2c_unregister_device(struct i2c_client *); |
265 | 269 | ||
266 | /* Mainboard arch_initcall() code should register all its I2C devices. | 270 | /* Mainboard arch_initcall() code should register all its I2C devices. |
@@ -319,8 +323,7 @@ struct i2c_adapter { | |||
319 | struct device dev; /* the adapter device */ | 323 | struct device dev; /* the adapter device */ |
320 | 324 | ||
321 | int nr; | 325 | int nr; |
322 | struct list_head clients; | 326 | struct list_head clients; /* DEPRECATED */ |
323 | struct list_head list; | ||
324 | char name[48]; | 327 | char name[48]; |
325 | struct completion dev_released; | 328 | struct completion dev_released; |
326 | }; | 329 | }; |
@@ -357,10 +360,10 @@ static inline void i2c_set_adapdata (struct i2c_adapter *dev, void *data) | |||
357 | * command line | 360 | * command line |
358 | */ | 361 | */ |
359 | struct i2c_client_address_data { | 362 | struct i2c_client_address_data { |
360 | unsigned short *normal_i2c; | 363 | const unsigned short *normal_i2c; |
361 | unsigned short *probe; | 364 | const unsigned short *probe; |
362 | unsigned short *ignore; | 365 | const unsigned short *ignore; |
363 | unsigned short **forces; | 366 | const unsigned short * const *forces; |
364 | }; | 367 | }; |
365 | 368 | ||
366 | /* Internal numbers to terminate lists */ | 369 | /* Internal numbers to terminate lists */ |
@@ -389,11 +392,8 @@ static inline int i2c_add_driver(struct i2c_driver *driver) | |||
389 | extern int i2c_attach_client(struct i2c_client *); | 392 | extern int i2c_attach_client(struct i2c_client *); |
390 | extern int i2c_detach_client(struct i2c_client *); | 393 | extern int i2c_detach_client(struct i2c_client *); |
391 | 394 | ||
392 | /* Should be used to make sure that client-struct is valid and that it | 395 | extern struct i2c_client *i2c_use_client(struct i2c_client *client); |
393 | is okay to access the i2c-client. | 396 | extern void i2c_release_client(struct i2c_client *client); |
394 | returns -ENODEV if client has gone in the meantime */ | ||
395 | extern int i2c_use_client(struct i2c_client *); | ||
396 | extern int i2c_release_client(struct i2c_client *); | ||
397 | 397 | ||
398 | /* call the i2c_client->command() of all attached clients with | 398 | /* call the i2c_client->command() of all attached clients with |
399 | * the given arguments */ | 399 | * the given arguments */ |
@@ -405,7 +405,7 @@ extern void i2c_clients_command(struct i2c_adapter *adap, | |||
405 | * specific address (unless a 'force' matched); | 405 | * specific address (unless a 'force' matched); |
406 | */ | 406 | */ |
407 | extern int i2c_probe(struct i2c_adapter *adapter, | 407 | extern int i2c_probe(struct i2c_adapter *adapter, |
408 | struct i2c_client_address_data *address_data, | 408 | const struct i2c_client_address_data *address_data, |
409 | int (*found_proc) (struct i2c_adapter *, int, int)); | 409 | int (*found_proc) (struct i2c_adapter *, int, int)); |
410 | 410 | ||
411 | extern struct i2c_adapter* i2c_get_adapter(int id); | 411 | extern struct i2c_adapter* i2c_get_adapter(int id); |
@@ -598,104 +598,93 @@ I2C_CLIENT_MODULE_PARM(probe, "List of adapter,address pairs to scan " \ | |||
598 | "additionally"); \ | 598 | "additionally"); \ |
599 | I2C_CLIENT_MODULE_PARM(ignore, "List of adapter,address pairs not to " \ | 599 | I2C_CLIENT_MODULE_PARM(ignore, "List of adapter,address pairs not to " \ |
600 | "scan"); \ | 600 | "scan"); \ |
601 | static struct i2c_client_address_data addr_data = { \ | 601 | const static struct i2c_client_address_data addr_data = { \ |
602 | .normal_i2c = normal_i2c, \ | 602 | .normal_i2c = normal_i2c, \ |
603 | .probe = probe, \ | 603 | .probe = probe, \ |
604 | .ignore = ignore, \ | 604 | .ignore = ignore, \ |
605 | .forces = forces, \ | 605 | .forces = forces, \ |
606 | } | 606 | } |
607 | 607 | ||
608 | #define I2C_CLIENT_FORCE_TEXT \ | ||
609 | "List of adapter,address pairs to boldly assume to be present" | ||
610 | |||
608 | /* These are the ones you want to use in your own drivers. Pick the one | 611 | /* These are the ones you want to use in your own drivers. Pick the one |
609 | which matches the number of devices the driver differenciates between. */ | 612 | which matches the number of devices the driver differenciates between. */ |
610 | #define I2C_CLIENT_INSMOD \ | 613 | #define I2C_CLIENT_INSMOD \ |
611 | I2C_CLIENT_MODULE_PARM(force, \ | 614 | I2C_CLIENT_MODULE_PARM(force, I2C_CLIENT_FORCE_TEXT); \ |
612 | "List of adapter,address pairs to boldly assume " \ | 615 | static const unsigned short * const forces[] = { force, NULL }; \ |
613 | "to be present"); \ | ||
614 | static unsigned short *forces[] = { \ | ||
615 | force, \ | ||
616 | NULL \ | ||
617 | }; \ | ||
618 | I2C_CLIENT_INSMOD_COMMON | 616 | I2C_CLIENT_INSMOD_COMMON |
619 | 617 | ||
620 | #define I2C_CLIENT_INSMOD_1(chip1) \ | 618 | #define I2C_CLIENT_INSMOD_1(chip1) \ |
621 | enum chips { any_chip, chip1 }; \ | 619 | enum chips { any_chip, chip1 }; \ |
622 | I2C_CLIENT_MODULE_PARM(force, "List of adapter,address pairs to " \ | 620 | I2C_CLIENT_MODULE_PARM(force, I2C_CLIENT_FORCE_TEXT); \ |
623 | "boldly assume to be present"); \ | ||
624 | I2C_CLIENT_MODULE_PARM_FORCE(chip1); \ | 621 | I2C_CLIENT_MODULE_PARM_FORCE(chip1); \ |
625 | static unsigned short *forces[] = { force, force_##chip1, NULL }; \ | 622 | static const unsigned short * const forces[] = { force, \ |
623 | force_##chip1, NULL }; \ | ||
626 | I2C_CLIENT_INSMOD_COMMON | 624 | I2C_CLIENT_INSMOD_COMMON |
627 | 625 | ||
628 | #define I2C_CLIENT_INSMOD_2(chip1, chip2) \ | 626 | #define I2C_CLIENT_INSMOD_2(chip1, chip2) \ |
629 | enum chips { any_chip, chip1, chip2 }; \ | 627 | enum chips { any_chip, chip1, chip2 }; \ |
630 | I2C_CLIENT_MODULE_PARM(force, "List of adapter,address pairs to " \ | 628 | I2C_CLIENT_MODULE_PARM(force, I2C_CLIENT_FORCE_TEXT); \ |
631 | "boldly assume to be present"); \ | ||
632 | I2C_CLIENT_MODULE_PARM_FORCE(chip1); \ | 629 | I2C_CLIENT_MODULE_PARM_FORCE(chip1); \ |
633 | I2C_CLIENT_MODULE_PARM_FORCE(chip2); \ | 630 | I2C_CLIENT_MODULE_PARM_FORCE(chip2); \ |
634 | static unsigned short *forces[] = { force, force_##chip1, \ | 631 | static const unsigned short * const forces[] = { force, \ |
635 | force_##chip2, NULL }; \ | 632 | force_##chip1, force_##chip2, NULL }; \ |
636 | I2C_CLIENT_INSMOD_COMMON | 633 | I2C_CLIENT_INSMOD_COMMON |
637 | 634 | ||
638 | #define I2C_CLIENT_INSMOD_3(chip1, chip2, chip3) \ | 635 | #define I2C_CLIENT_INSMOD_3(chip1, chip2, chip3) \ |
639 | enum chips { any_chip, chip1, chip2, chip3 }; \ | 636 | enum chips { any_chip, chip1, chip2, chip3 }; \ |
640 | I2C_CLIENT_MODULE_PARM(force, "List of adapter,address pairs to " \ | 637 | I2C_CLIENT_MODULE_PARM(force, I2C_CLIENT_FORCE_TEXT); \ |
641 | "boldly assume to be present"); \ | ||
642 | I2C_CLIENT_MODULE_PARM_FORCE(chip1); \ | 638 | I2C_CLIENT_MODULE_PARM_FORCE(chip1); \ |
643 | I2C_CLIENT_MODULE_PARM_FORCE(chip2); \ | 639 | I2C_CLIENT_MODULE_PARM_FORCE(chip2); \ |
644 | I2C_CLIENT_MODULE_PARM_FORCE(chip3); \ | 640 | I2C_CLIENT_MODULE_PARM_FORCE(chip3); \ |
645 | static unsigned short *forces[] = { force, force_##chip1, \ | 641 | static const unsigned short * const forces[] = { force, \ |
646 | force_##chip2, force_##chip3, \ | 642 | force_##chip1, force_##chip2, force_##chip3, NULL }; \ |
647 | NULL }; \ | ||
648 | I2C_CLIENT_INSMOD_COMMON | 643 | I2C_CLIENT_INSMOD_COMMON |
649 | 644 | ||
650 | #define I2C_CLIENT_INSMOD_4(chip1, chip2, chip3, chip4) \ | 645 | #define I2C_CLIENT_INSMOD_4(chip1, chip2, chip3, chip4) \ |
651 | enum chips { any_chip, chip1, chip2, chip3, chip4 }; \ | 646 | enum chips { any_chip, chip1, chip2, chip3, chip4 }; \ |
652 | I2C_CLIENT_MODULE_PARM(force, "List of adapter,address pairs to " \ | 647 | I2C_CLIENT_MODULE_PARM(force, I2C_CLIENT_FORCE_TEXT); \ |
653 | "boldly assume to be present"); \ | ||
654 | I2C_CLIENT_MODULE_PARM_FORCE(chip1); \ | 648 | I2C_CLIENT_MODULE_PARM_FORCE(chip1); \ |
655 | I2C_CLIENT_MODULE_PARM_FORCE(chip2); \ | 649 | I2C_CLIENT_MODULE_PARM_FORCE(chip2); \ |
656 | I2C_CLIENT_MODULE_PARM_FORCE(chip3); \ | 650 | I2C_CLIENT_MODULE_PARM_FORCE(chip3); \ |
657 | I2C_CLIENT_MODULE_PARM_FORCE(chip4); \ | 651 | I2C_CLIENT_MODULE_PARM_FORCE(chip4); \ |
658 | static unsigned short *forces[] = { force, force_##chip1, \ | 652 | static const unsigned short * const forces[] = { force, \ |
659 | force_##chip2, force_##chip3, \ | 653 | force_##chip1, force_##chip2, force_##chip3, \ |
660 | force_##chip4, NULL}; \ | 654 | force_##chip4, NULL}; \ |
661 | I2C_CLIENT_INSMOD_COMMON | 655 | I2C_CLIENT_INSMOD_COMMON |
662 | 656 | ||
663 | #define I2C_CLIENT_INSMOD_5(chip1, chip2, chip3, chip4, chip5) \ | 657 | #define I2C_CLIENT_INSMOD_5(chip1, chip2, chip3, chip4, chip5) \ |
664 | enum chips { any_chip, chip1, chip2, chip3, chip4, chip5 }; \ | 658 | enum chips { any_chip, chip1, chip2, chip3, chip4, chip5 }; \ |
665 | I2C_CLIENT_MODULE_PARM(force, "List of adapter,address pairs to " \ | 659 | I2C_CLIENT_MODULE_PARM(force, I2C_CLIENT_FORCE_TEXT); \ |
666 | "boldly assume to be present"); \ | ||
667 | I2C_CLIENT_MODULE_PARM_FORCE(chip1); \ | 660 | I2C_CLIENT_MODULE_PARM_FORCE(chip1); \ |
668 | I2C_CLIENT_MODULE_PARM_FORCE(chip2); \ | 661 | I2C_CLIENT_MODULE_PARM_FORCE(chip2); \ |
669 | I2C_CLIENT_MODULE_PARM_FORCE(chip3); \ | 662 | I2C_CLIENT_MODULE_PARM_FORCE(chip3); \ |
670 | I2C_CLIENT_MODULE_PARM_FORCE(chip4); \ | 663 | I2C_CLIENT_MODULE_PARM_FORCE(chip4); \ |
671 | I2C_CLIENT_MODULE_PARM_FORCE(chip5); \ | 664 | I2C_CLIENT_MODULE_PARM_FORCE(chip5); \ |
672 | static unsigned short *forces[] = { force, force_##chip1, \ | 665 | static const unsigned short * const forces[] = { force, \ |
673 | force_##chip2, force_##chip3, \ | 666 | force_##chip1, force_##chip2, force_##chip3, \ |
674 | force_##chip4, force_##chip5, \ | 667 | force_##chip4, force_##chip5, NULL }; \ |
675 | NULL }; \ | ||
676 | I2C_CLIENT_INSMOD_COMMON | 668 | I2C_CLIENT_INSMOD_COMMON |
677 | 669 | ||
678 | #define I2C_CLIENT_INSMOD_6(chip1, chip2, chip3, chip4, chip5, chip6) \ | 670 | #define I2C_CLIENT_INSMOD_6(chip1, chip2, chip3, chip4, chip5, chip6) \ |
679 | enum chips { any_chip, chip1, chip2, chip3, chip4, chip5, chip6 }; \ | 671 | enum chips { any_chip, chip1, chip2, chip3, chip4, chip5, chip6 }; \ |
680 | I2C_CLIENT_MODULE_PARM(force, "List of adapter,address pairs to " \ | 672 | I2C_CLIENT_MODULE_PARM(force, I2C_CLIENT_FORCE_TEXT); \ |
681 | "boldly assume to be present"); \ | ||
682 | I2C_CLIENT_MODULE_PARM_FORCE(chip1); \ | 673 | I2C_CLIENT_MODULE_PARM_FORCE(chip1); \ |
683 | I2C_CLIENT_MODULE_PARM_FORCE(chip2); \ | 674 | I2C_CLIENT_MODULE_PARM_FORCE(chip2); \ |
684 | I2C_CLIENT_MODULE_PARM_FORCE(chip3); \ | 675 | I2C_CLIENT_MODULE_PARM_FORCE(chip3); \ |
685 | I2C_CLIENT_MODULE_PARM_FORCE(chip4); \ | 676 | I2C_CLIENT_MODULE_PARM_FORCE(chip4); \ |
686 | I2C_CLIENT_MODULE_PARM_FORCE(chip5); \ | 677 | I2C_CLIENT_MODULE_PARM_FORCE(chip5); \ |
687 | I2C_CLIENT_MODULE_PARM_FORCE(chip6); \ | 678 | I2C_CLIENT_MODULE_PARM_FORCE(chip6); \ |
688 | static unsigned short *forces[] = { force, force_##chip1, \ | 679 | static const unsigned short * const forces[] = { force, \ |
689 | force_##chip2, force_##chip3, \ | 680 | force_##chip1, force_##chip2, force_##chip3, \ |
690 | force_##chip4, force_##chip5, \ | 681 | force_##chip4, force_##chip5, force_##chip6, NULL }; \ |
691 | force_##chip6, NULL }; \ | ||
692 | I2C_CLIENT_INSMOD_COMMON | 682 | I2C_CLIENT_INSMOD_COMMON |
693 | 683 | ||
694 | #define I2C_CLIENT_INSMOD_7(chip1, chip2, chip3, chip4, chip5, chip6, chip7) \ | 684 | #define I2C_CLIENT_INSMOD_7(chip1, chip2, chip3, chip4, chip5, chip6, chip7) \ |
695 | enum chips { any_chip, chip1, chip2, chip3, chip4, chip5, chip6, \ | 685 | enum chips { any_chip, chip1, chip2, chip3, chip4, chip5, chip6, \ |
696 | chip7 }; \ | 686 | chip7 }; \ |
697 | I2C_CLIENT_MODULE_PARM(force, "List of adapter,address pairs to " \ | 687 | I2C_CLIENT_MODULE_PARM(force, I2C_CLIENT_FORCE_TEXT); \ |
698 | "boldly assume to be present"); \ | ||
699 | I2C_CLIENT_MODULE_PARM_FORCE(chip1); \ | 688 | I2C_CLIENT_MODULE_PARM_FORCE(chip1); \ |
700 | I2C_CLIENT_MODULE_PARM_FORCE(chip2); \ | 689 | I2C_CLIENT_MODULE_PARM_FORCE(chip2); \ |
701 | I2C_CLIENT_MODULE_PARM_FORCE(chip3); \ | 690 | I2C_CLIENT_MODULE_PARM_FORCE(chip3); \ |
@@ -703,18 +692,16 @@ I2C_CLIENT_MODULE_PARM_FORCE(chip4); \ | |||
703 | I2C_CLIENT_MODULE_PARM_FORCE(chip5); \ | 692 | I2C_CLIENT_MODULE_PARM_FORCE(chip5); \ |
704 | I2C_CLIENT_MODULE_PARM_FORCE(chip6); \ | 693 | I2C_CLIENT_MODULE_PARM_FORCE(chip6); \ |
705 | I2C_CLIENT_MODULE_PARM_FORCE(chip7); \ | 694 | I2C_CLIENT_MODULE_PARM_FORCE(chip7); \ |
706 | static unsigned short *forces[] = { force, force_##chip1, \ | 695 | static const unsigned short * const forces[] = { force, \ |
707 | force_##chip2, force_##chip3, \ | 696 | force_##chip1, force_##chip2, force_##chip3, \ |
708 | force_##chip4, force_##chip5, \ | 697 | force_##chip4, force_##chip5, force_##chip6, \ |
709 | force_##chip6, force_##chip7, \ | 698 | force_##chip7, NULL }; \ |
710 | NULL }; \ | ||
711 | I2C_CLIENT_INSMOD_COMMON | 699 | I2C_CLIENT_INSMOD_COMMON |
712 | 700 | ||
713 | #define I2C_CLIENT_INSMOD_8(chip1, chip2, chip3, chip4, chip5, chip6, chip7, chip8) \ | 701 | #define I2C_CLIENT_INSMOD_8(chip1, chip2, chip3, chip4, chip5, chip6, chip7, chip8) \ |
714 | enum chips { any_chip, chip1, chip2, chip3, chip4, chip5, chip6, \ | 702 | enum chips { any_chip, chip1, chip2, chip3, chip4, chip5, chip6, \ |
715 | chip7, chip8 }; \ | 703 | chip7, chip8 }; \ |
716 | I2C_CLIENT_MODULE_PARM(force, "List of adapter,address pairs to " \ | 704 | I2C_CLIENT_MODULE_PARM(force, I2C_CLIENT_FORCE_TEXT); \ |
717 | "boldly assume to be present"); \ | ||
718 | I2C_CLIENT_MODULE_PARM_FORCE(chip1); \ | 705 | I2C_CLIENT_MODULE_PARM_FORCE(chip1); \ |
719 | I2C_CLIENT_MODULE_PARM_FORCE(chip2); \ | 706 | I2C_CLIENT_MODULE_PARM_FORCE(chip2); \ |
720 | I2C_CLIENT_MODULE_PARM_FORCE(chip3); \ | 707 | I2C_CLIENT_MODULE_PARM_FORCE(chip3); \ |
@@ -723,11 +710,10 @@ I2C_CLIENT_MODULE_PARM_FORCE(chip5); \ | |||
723 | I2C_CLIENT_MODULE_PARM_FORCE(chip6); \ | 710 | I2C_CLIENT_MODULE_PARM_FORCE(chip6); \ |
724 | I2C_CLIENT_MODULE_PARM_FORCE(chip7); \ | 711 | I2C_CLIENT_MODULE_PARM_FORCE(chip7); \ |
725 | I2C_CLIENT_MODULE_PARM_FORCE(chip8); \ | 712 | I2C_CLIENT_MODULE_PARM_FORCE(chip8); \ |
726 | static unsigned short *forces[] = { force, force_##chip1, \ | 713 | static const unsigned short * const forces[] = { force, \ |
727 | force_##chip2, force_##chip3, \ | 714 | force_##chip1, force_##chip2, force_##chip3, \ |
728 | force_##chip4, force_##chip5, \ | 715 | force_##chip4, force_##chip5, force_##chip6, \ |
729 | force_##chip6, force_##chip7, \ | 716 | force_##chip7, force_##chip8, NULL }; \ |
730 | force_##chip8, NULL }; \ | ||
731 | I2C_CLIENT_INSMOD_COMMON | 717 | I2C_CLIENT_INSMOD_COMMON |
732 | #endif /* __KERNEL__ */ | 718 | #endif /* __KERNEL__ */ |
733 | #endif /* _LINUX_I2C_H */ | 719 | #endif /* _LINUX_I2C_H */ |
diff --git a/include/linux/i2c/tps65010.h b/include/linux/i2c/tps65010.h new file mode 100644 index 000000000000..7021635ed6a0 --- /dev/null +++ b/include/linux/i2c/tps65010.h | |||
@@ -0,0 +1,156 @@ | |||
1 | /* linux/i2c/tps65010.h | ||
2 | * | ||
3 | * Functions to access TPS65010 power management device. | ||
4 | * | ||
5 | * Copyright (C) 2004 Dirk Behme <dirk.behme@de.bosch.com> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify it | ||
8 | * under the terms of the GNU General Public License as published by the | ||
9 | * Free Software Foundation; either version 2 of the License, or (at your | ||
10 | * option) any later version. | ||
11 | * | ||
12 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED | ||
13 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | ||
14 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN | ||
15 | * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
16 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
17 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | ||
18 | * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON | ||
19 | * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
20 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | ||
21 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
22 | * | ||
23 | * You should have received a copy of the GNU General Public License along | ||
24 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
25 | * 675 Mass Ave, Cambridge, MA 02139, USA. | ||
26 | */ | ||
27 | |||
28 | #ifndef __LINUX_I2C_TPS65010_H | ||
29 | #define __LINUX_I2C_TPS65010_H | ||
30 | |||
31 | /* | ||
32 | * ---------------------------------------------------------------------------- | ||
33 | * Registers, all 8 bits | ||
34 | * ---------------------------------------------------------------------------- | ||
35 | */ | ||
36 | |||
37 | #define TPS_CHGSTATUS 0x01 | ||
38 | # define TPS_CHG_USB (1 << 7) | ||
39 | # define TPS_CHG_AC (1 << 6) | ||
40 | # define TPS_CHG_THERM (1 << 5) | ||
41 | # define TPS_CHG_TERM (1 << 4) | ||
42 | # define TPS_CHG_TAPER_TMO (1 << 3) | ||
43 | # define TPS_CHG_CHG_TMO (1 << 2) | ||
44 | # define TPS_CHG_PRECHG_TMO (1 << 1) | ||
45 | # define TPS_CHG_TEMP_ERR (1 << 0) | ||
46 | #define TPS_REGSTATUS 0x02 | ||
47 | # define TPS_REG_ONOFF (1 << 7) | ||
48 | # define TPS_REG_COVER (1 << 6) | ||
49 | # define TPS_REG_UVLO (1 << 5) | ||
50 | # define TPS_REG_NO_CHG (1 << 4) /* tps65013 */ | ||
51 | # define TPS_REG_PG_LD02 (1 << 3) | ||
52 | # define TPS_REG_PG_LD01 (1 << 2) | ||
53 | # define TPS_REG_PG_MAIN (1 << 1) | ||
54 | # define TPS_REG_PG_CORE (1 << 0) | ||
55 | #define TPS_MASK1 0x03 | ||
56 | #define TPS_MASK2 0x04 | ||
57 | #define TPS_ACKINT1 0x05 | ||
58 | #define TPS_ACKINT2 0x06 | ||
59 | #define TPS_CHGCONFIG 0x07 | ||
60 | # define TPS_CHARGE_POR (1 << 7) /* 65010/65012 */ | ||
61 | # define TPS65013_AUA (1 << 7) /* 65011/65013 */ | ||
62 | # define TPS_CHARGE_RESET (1 << 6) | ||
63 | # define TPS_CHARGE_FAST (1 << 5) | ||
64 | # define TPS_CHARGE_CURRENT (3 << 3) | ||
65 | # define TPS_VBUS_500MA (1 << 2) | ||
66 | # define TPS_VBUS_CHARGING (1 << 1) | ||
67 | # define TPS_CHARGE_ENABLE (1 << 0) | ||
68 | #define TPS_LED1_ON 0x08 | ||
69 | #define TPS_LED1_PER 0x09 | ||
70 | #define TPS_LED2_ON 0x0a | ||
71 | #define TPS_LED2_PER 0x0b | ||
72 | #define TPS_VDCDC1 0x0c | ||
73 | # define TPS_ENABLE_LP (1 << 3) | ||
74 | #define TPS_VDCDC2 0x0d | ||
75 | #define TPS_VREGS1 0x0e | ||
76 | # define TPS_LDO2_ENABLE (1 << 7) | ||
77 | # define TPS_LDO2_OFF (1 << 6) | ||
78 | # define TPS_VLDO2_3_0V (3 << 4) | ||
79 | # define TPS_VLDO2_2_75V (2 << 4) | ||
80 | # define TPS_VLDO2_2_5V (1 << 4) | ||
81 | # define TPS_VLDO2_1_8V (0 << 4) | ||
82 | # define TPS_LDO1_ENABLE (1 << 3) | ||
83 | # define TPS_LDO1_OFF (1 << 2) | ||
84 | # define TPS_VLDO1_3_0V (3 << 0) | ||
85 | # define TPS_VLDO1_2_75V (2 << 0) | ||
86 | # define TPS_VLDO1_2_5V (1 << 0) | ||
87 | # define TPS_VLDO1_ADJ (0 << 0) | ||
88 | #define TPS_MASK3 0x0f | ||
89 | #define TPS_DEFGPIO 0x10 | ||
90 | |||
91 | /* | ||
92 | * ---------------------------------------------------------------------------- | ||
93 | * Macros used by exported functions | ||
94 | * ---------------------------------------------------------------------------- | ||
95 | */ | ||
96 | |||
97 | #define LED1 1 | ||
98 | #define LED2 2 | ||
99 | #define OFF 0 | ||
100 | #define ON 1 | ||
101 | #define BLINK 2 | ||
102 | #define GPIO1 1 | ||
103 | #define GPIO2 2 | ||
104 | #define GPIO3 3 | ||
105 | #define GPIO4 4 | ||
106 | #define LOW 0 | ||
107 | #define HIGH 1 | ||
108 | |||
109 | /* | ||
110 | * ---------------------------------------------------------------------------- | ||
111 | * Exported functions | ||
112 | * ---------------------------------------------------------------------------- | ||
113 | */ | ||
114 | |||
115 | /* Draw from VBUS: | ||
116 | * 0 mA -- DON'T DRAW (might supply power instead) | ||
117 | * 100 mA -- usb unit load (slowest charge rate) | ||
118 | * 500 mA -- usb high power (fast battery charge) | ||
119 | */ | ||
120 | extern int tps65010_set_vbus_draw(unsigned mA); | ||
121 | |||
122 | /* tps65010_set_gpio_out_value parameter: | ||
123 | * gpio: GPIO1, GPIO2, GPIO3 or GPIO4 | ||
124 | * value: LOW or HIGH | ||
125 | */ | ||
126 | extern int tps65010_set_gpio_out_value(unsigned gpio, unsigned value); | ||
127 | |||
128 | /* tps65010_set_led parameter: | ||
129 | * led: LED1 or LED2 | ||
130 | * mode: ON, OFF or BLINK | ||
131 | */ | ||
132 | extern int tps65010_set_led(unsigned led, unsigned mode); | ||
133 | |||
134 | /* tps65010_set_vib parameter: | ||
135 | * value: ON or OFF | ||
136 | */ | ||
137 | extern int tps65010_set_vib(unsigned value); | ||
138 | |||
139 | /* tps65010_set_low_pwr parameter: | ||
140 | * mode: ON or OFF | ||
141 | */ | ||
142 | extern int tps65010_set_low_pwr(unsigned mode); | ||
143 | |||
144 | /* tps65010_config_vregs1 parameter: | ||
145 | * value to be written to VREGS1 register | ||
146 | * Note: The complete register is written, set all bits you need | ||
147 | */ | ||
148 | extern int tps65010_config_vregs1(unsigned value); | ||
149 | |||
150 | /* tps65013_set_low_pwr parameter: | ||
151 | * mode: ON or OFF | ||
152 | */ | ||
153 | extern int tps65013_set_low_pwr(unsigned mode); | ||
154 | |||
155 | #endif /* __LINUX_I2C_TPS65010_H */ | ||
156 | |||
diff --git a/include/linux/ide.h b/include/linux/ide.h index 1e4409937ec3..27cb39de2ae2 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h | |||
@@ -107,7 +107,6 @@ typedef unsigned char byte; /* used everywhere */ | |||
107 | #define BAD_W_STAT (BAD_R_STAT | WRERR_STAT) | 107 | #define BAD_W_STAT (BAD_R_STAT | WRERR_STAT) |
108 | #define BAD_STAT (BAD_R_STAT | DRQ_STAT) | 108 | #define BAD_STAT (BAD_R_STAT | DRQ_STAT) |
109 | #define DRIVE_READY (READY_STAT | SEEK_STAT) | 109 | #define DRIVE_READY (READY_STAT | SEEK_STAT) |
110 | #define DATA_READY (DRQ_STAT) | ||
111 | 110 | ||
112 | #define BAD_CRC (ABRT_ERR | ICRC_ERR) | 111 | #define BAD_CRC (ABRT_ERR | ICRC_ERR) |
113 | 112 | ||
@@ -198,8 +197,11 @@ typedef struct hw_regs_s { | |||
198 | } hw_regs_t; | 197 | } hw_regs_t; |
199 | 198 | ||
200 | struct hwif_s * ide_find_port(unsigned long); | 199 | struct hwif_s * ide_find_port(unsigned long); |
200 | void ide_init_port_data(struct hwif_s *, unsigned int); | ||
201 | void ide_init_port_hw(struct hwif_s *, hw_regs_t *); | ||
201 | 202 | ||
202 | int ide_register_hw(hw_regs_t *, void (*)(struct hwif_s *), int, | 203 | struct ide_drive_s; |
204 | int ide_register_hw(hw_regs_t *, void (*)(struct ide_drive_s *), | ||
203 | struct hwif_s **); | 205 | struct hwif_s **); |
204 | 206 | ||
205 | void ide_setup_ports( hw_regs_t *hw, | 207 | void ide_setup_ports( hw_regs_t *hw, |
@@ -391,7 +393,6 @@ typedef struct ide_drive_s { | |||
391 | u8 state; /* retry state */ | 393 | u8 state; /* retry state */ |
392 | u8 waiting_for_dma; /* dma currently in progress */ | 394 | u8 waiting_for_dma; /* dma currently in progress */ |
393 | u8 unmask; /* okay to unmask other irqs */ | 395 | u8 unmask; /* okay to unmask other irqs */ |
394 | u8 bswap; /* byte swap data */ | ||
395 | u8 noflush; /* don't attempt flushes */ | 396 | u8 noflush; /* don't attempt flushes */ |
396 | u8 dsc_overlap; /* DSC overlap */ | 397 | u8 dsc_overlap; /* DSC overlap */ |
397 | u8 nice1; /* give potential excess bandwidth */ | 398 | u8 nice1; /* give potential excess bandwidth */ |
@@ -527,31 +528,26 @@ typedef struct hwif_s { | |||
527 | /* special host masking for drive selection */ | 528 | /* special host masking for drive selection */ |
528 | void (*maskproc)(ide_drive_t *, int); | 529 | void (*maskproc)(ide_drive_t *, int); |
529 | /* check host's drive quirk list */ | 530 | /* check host's drive quirk list */ |
530 | int (*quirkproc)(ide_drive_t *); | 531 | void (*quirkproc)(ide_drive_t *); |
531 | /* driver soft-power interface */ | 532 | /* driver soft-power interface */ |
532 | int (*busproc)(ide_drive_t *, int); | 533 | int (*busproc)(ide_drive_t *, int); |
533 | #endif | 534 | #endif |
534 | u8 (*mdma_filter)(ide_drive_t *); | 535 | u8 (*mdma_filter)(ide_drive_t *); |
535 | u8 (*udma_filter)(ide_drive_t *); | 536 | u8 (*udma_filter)(ide_drive_t *); |
536 | 537 | ||
537 | void (*fixup)(struct hwif_s *); | ||
538 | |||
539 | void (*ata_input_data)(ide_drive_t *, void *, u32); | 538 | void (*ata_input_data)(ide_drive_t *, void *, u32); |
540 | void (*ata_output_data)(ide_drive_t *, void *, u32); | 539 | void (*ata_output_data)(ide_drive_t *, void *, u32); |
541 | 540 | ||
542 | void (*atapi_input_bytes)(ide_drive_t *, void *, u32); | 541 | void (*atapi_input_bytes)(ide_drive_t *, void *, u32); |
543 | void (*atapi_output_bytes)(ide_drive_t *, void *, u32); | 542 | void (*atapi_output_bytes)(ide_drive_t *, void *, u32); |
544 | 543 | ||
544 | void (*dma_host_set)(ide_drive_t *, int); | ||
545 | int (*dma_setup)(ide_drive_t *); | 545 | int (*dma_setup)(ide_drive_t *); |
546 | void (*dma_exec_cmd)(ide_drive_t *, u8); | 546 | void (*dma_exec_cmd)(ide_drive_t *, u8); |
547 | void (*dma_start)(ide_drive_t *); | 547 | void (*dma_start)(ide_drive_t *); |
548 | int (*ide_dma_end)(ide_drive_t *drive); | 548 | int (*ide_dma_end)(ide_drive_t *drive); |
549 | int (*ide_dma_on)(ide_drive_t *drive); | ||
550 | void (*dma_off_quietly)(ide_drive_t *drive); | ||
551 | int (*ide_dma_test_irq)(ide_drive_t *drive); | 549 | int (*ide_dma_test_irq)(ide_drive_t *drive); |
552 | void (*ide_dma_clear_irq)(ide_drive_t *drive); | 550 | void (*ide_dma_clear_irq)(ide_drive_t *drive); |
553 | void (*dma_host_on)(ide_drive_t *drive); | ||
554 | void (*dma_host_off)(ide_drive_t *drive); | ||
555 | void (*dma_lost_irq)(ide_drive_t *drive); | 551 | void (*dma_lost_irq)(ide_drive_t *drive); |
556 | void (*dma_timeout)(ide_drive_t *drive); | 552 | void (*dma_timeout)(ide_drive_t *drive); |
557 | 553 | ||
@@ -874,14 +870,6 @@ extern int ide_do_drive_cmd(ide_drive_t *, struct request *, ide_action_t); | |||
874 | 870 | ||
875 | extern void ide_end_drive_cmd(ide_drive_t *, u8, u8); | 871 | extern void ide_end_drive_cmd(ide_drive_t *, u8, u8); |
876 | 872 | ||
877 | /* | ||
878 | * Issue ATA command and wait for completion. | ||
879 | * Use for implementing commands in kernel | ||
880 | * | ||
881 | * (ide_drive_t *drive, u8 cmd, u8 nsect, u8 feature, u8 sectors, u8 *buf) | ||
882 | */ | ||
883 | extern int ide_wait_cmd(ide_drive_t *, u8, u8, u8, u8, u8 *); | ||
884 | |||
885 | enum { | 873 | enum { |
886 | IDE_TFLAG_LBA48 = (1 << 0), | 874 | IDE_TFLAG_LBA48 = (1 << 0), |
887 | IDE_TFLAG_NO_SELECT_MASK = (1 << 1), | 875 | IDE_TFLAG_NO_SELECT_MASK = (1 << 1), |
@@ -934,6 +922,14 @@ enum { | |||
934 | IDE_TFLAG_IN_TF = IDE_TFLAG_IN_NSECT | | 922 | IDE_TFLAG_IN_TF = IDE_TFLAG_IN_NSECT | |
935 | IDE_TFLAG_IN_LBA, | 923 | IDE_TFLAG_IN_LBA, |
936 | IDE_TFLAG_IN_DEVICE = (1 << 29), | 924 | IDE_TFLAG_IN_DEVICE = (1 << 29), |
925 | IDE_TFLAG_HOB = IDE_TFLAG_OUT_HOB | | ||
926 | IDE_TFLAG_IN_HOB, | ||
927 | IDE_TFLAG_TF = IDE_TFLAG_OUT_TF | | ||
928 | IDE_TFLAG_IN_TF, | ||
929 | IDE_TFLAG_DEVICE = IDE_TFLAG_OUT_DEVICE | | ||
930 | IDE_TFLAG_IN_DEVICE, | ||
931 | /* force 16-bit I/O operations */ | ||
932 | IDE_TFLAG_IO_16BIT = (1 << 30), | ||
937 | }; | 933 | }; |
938 | 934 | ||
939 | struct ide_taskfile { | 935 | struct ide_taskfile { |
@@ -988,6 +984,10 @@ void ide_pktcmd_tf_load(ide_drive_t *, u32, u16, u8); | |||
988 | 984 | ||
989 | ide_startstop_t do_rw_taskfile(ide_drive_t *, ide_task_t *); | 985 | ide_startstop_t do_rw_taskfile(ide_drive_t *, ide_task_t *); |
990 | 986 | ||
987 | void task_end_request(ide_drive_t *, struct request *, u8); | ||
988 | |||
989 | u8 wait_drive_not_busy(ide_drive_t *); | ||
990 | |||
991 | int ide_raw_taskfile(ide_drive_t *, ide_task_t *, u8 *, u16); | 991 | int ide_raw_taskfile(ide_drive_t *, ide_task_t *, u8 *, u16); |
992 | int ide_no_data_taskfile(ide_drive_t *, ide_task_t *); | 992 | int ide_no_data_taskfile(ide_drive_t *, ide_task_t *); |
993 | 993 | ||
@@ -1015,10 +1015,9 @@ extern void do_ide_request(struct request_queue *); | |||
1015 | 1015 | ||
1016 | void ide_init_disk(struct gendisk *, ide_drive_t *); | 1016 | void ide_init_disk(struct gendisk *, ide_drive_t *); |
1017 | 1017 | ||
1018 | extern int ideprobe_init(void); | ||
1019 | |||
1020 | #ifdef CONFIG_IDEPCI_PCIBUS_ORDER | 1018 | #ifdef CONFIG_IDEPCI_PCIBUS_ORDER |
1021 | extern void ide_scan_pcibus(int scan_direction) __init; | 1019 | extern int ide_scan_direction; |
1020 | int __init ide_scan_pcibus(void); | ||
1022 | extern int __ide_pci_register_driver(struct pci_driver *driver, struct module *owner, const char *mod_name); | 1021 | extern int __ide_pci_register_driver(struct pci_driver *driver, struct module *owner, const char *mod_name); |
1023 | #define ide_pci_register_driver(d) __ide_pci_register_driver(d, THIS_MODULE, KBUILD_MODNAME) | 1022 | #define ide_pci_register_driver(d) __ide_pci_register_driver(d, THIS_MODULE, KBUILD_MODNAME) |
1024 | #else | 1023 | #else |
@@ -1095,6 +1094,8 @@ enum { | |||
1095 | /* unmask IRQs */ | 1094 | /* unmask IRQs */ |
1096 | IDE_HFLAG_UNMASK_IRQS = (1 << 25), | 1095 | IDE_HFLAG_UNMASK_IRQS = (1 << 25), |
1097 | IDE_HFLAG_ABUSE_SET_DMA_MODE = (1 << 26), | 1096 | IDE_HFLAG_ABUSE_SET_DMA_MODE = (1 << 26), |
1097 | /* host is CY82C693 */ | ||
1098 | IDE_HFLAG_CY82C693 = (1 << 27), | ||
1098 | }; | 1099 | }; |
1099 | 1100 | ||
1100 | #ifdef CONFIG_BLK_DEV_OFFBOARD | 1101 | #ifdef CONFIG_BLK_DEV_OFFBOARD |
@@ -1109,7 +1110,6 @@ struct ide_port_info { | |||
1109 | void (*init_iops)(ide_hwif_t *); | 1110 | void (*init_iops)(ide_hwif_t *); |
1110 | void (*init_hwif)(ide_hwif_t *); | 1111 | void (*init_hwif)(ide_hwif_t *); |
1111 | void (*init_dma)(ide_hwif_t *, unsigned long); | 1112 | void (*init_dma)(ide_hwif_t *, unsigned long); |
1112 | void (*fixup)(ide_hwif_t *); | ||
1113 | ide_pci_enablebit_t enablebits[2]; | 1113 | ide_pci_enablebit_t enablebits[2]; |
1114 | hwif_chipset_t chipset; | 1114 | hwif_chipset_t chipset; |
1115 | u8 extra; | 1115 | u8 extra; |
@@ -1147,7 +1147,9 @@ static inline u8 ide_max_dma_mode(ide_drive_t *drive) | |||
1147 | return ide_find_dma_mode(drive, XFER_UDMA_6); | 1147 | return ide_find_dma_mode(drive, XFER_UDMA_6); |
1148 | } | 1148 | } |
1149 | 1149 | ||
1150 | void ide_dma_off_quietly(ide_drive_t *); | ||
1150 | void ide_dma_off(ide_drive_t *); | 1151 | void ide_dma_off(ide_drive_t *); |
1152 | void ide_dma_on(ide_drive_t *); | ||
1151 | int ide_set_dma(ide_drive_t *); | 1153 | int ide_set_dma(ide_drive_t *); |
1152 | ide_startstop_t ide_dma_intr(ide_drive_t *); | 1154 | ide_startstop_t ide_dma_intr(ide_drive_t *); |
1153 | 1155 | ||
@@ -1158,10 +1160,7 @@ extern void ide_destroy_dmatable(ide_drive_t *); | |||
1158 | extern int ide_release_dma(ide_hwif_t *); | 1160 | extern int ide_release_dma(ide_hwif_t *); |
1159 | extern void ide_setup_dma(ide_hwif_t *, unsigned long, unsigned int); | 1161 | extern void ide_setup_dma(ide_hwif_t *, unsigned long, unsigned int); |
1160 | 1162 | ||
1161 | void ide_dma_host_off(ide_drive_t *); | 1163 | void ide_dma_host_set(ide_drive_t *, int); |
1162 | void ide_dma_off_quietly(ide_drive_t *); | ||
1163 | void ide_dma_host_on(ide_drive_t *); | ||
1164 | extern int __ide_dma_on(ide_drive_t *); | ||
1165 | extern int ide_dma_setup(ide_drive_t *); | 1164 | extern int ide_dma_setup(ide_drive_t *); |
1166 | extern void ide_dma_start(ide_drive_t *); | 1165 | extern void ide_dma_start(ide_drive_t *); |
1167 | extern int __ide_dma_end(ide_drive_t *); | 1166 | extern int __ide_dma_end(ide_drive_t *); |
@@ -1173,7 +1172,9 @@ extern void ide_dma_timeout(ide_drive_t *); | |||
1173 | static inline int ide_id_dma_bug(ide_drive_t *drive) { return 0; } | 1172 | static inline int ide_id_dma_bug(ide_drive_t *drive) { return 0; } |
1174 | static inline u8 ide_find_dma_mode(ide_drive_t *drive, u8 speed) { return 0; } | 1173 | static inline u8 ide_find_dma_mode(ide_drive_t *drive, u8 speed) { return 0; } |
1175 | static inline u8 ide_max_dma_mode(ide_drive_t *drive) { return 0; } | 1174 | static inline u8 ide_max_dma_mode(ide_drive_t *drive) { return 0; } |
1175 | static inline void ide_dma_off_quietly(ide_drive_t *drive) { ; } | ||
1176 | static inline void ide_dma_off(ide_drive_t *drive) { ; } | 1176 | static inline void ide_dma_off(ide_drive_t *drive) { ; } |
1177 | static inline void ide_dma_on(ide_drive_t *drive) { ; } | ||
1177 | static inline void ide_dma_verbose(ide_drive_t *drive) { ; } | 1178 | static inline void ide_dma_verbose(ide_drive_t *drive) { ; } |
1178 | static inline int ide_set_dma(ide_drive_t *drive) { return 1; } | 1179 | static inline int ide_set_dma(ide_drive_t *drive) { return 1; } |
1179 | #endif /* CONFIG_BLK_DEV_IDEDMA */ | 1180 | #endif /* CONFIG_BLK_DEV_IDEDMA */ |
@@ -1203,8 +1204,9 @@ extern void ide_unregister (unsigned int index); | |||
1203 | void ide_register_region(struct gendisk *); | 1204 | void ide_register_region(struct gendisk *); |
1204 | void ide_unregister_region(struct gendisk *); | 1205 | void ide_unregister_region(struct gendisk *); |
1205 | 1206 | ||
1206 | void ide_undecoded_slave(ide_hwif_t *); | 1207 | void ide_undecoded_slave(ide_drive_t *); |
1207 | 1208 | ||
1209 | int ide_device_add_all(u8 *idx); | ||
1208 | int ide_device_add(u8 idx[4]); | 1210 | int ide_device_add(u8 idx[4]); |
1209 | 1211 | ||
1210 | static inline void *ide_get_hwifdata (ide_hwif_t * hwif) | 1212 | static inline void *ide_get_hwifdata (ide_hwif_t * hwif) |
@@ -1302,4 +1304,9 @@ static inline ide_drive_t *ide_get_paired_drive(ide_drive_t *drive) | |||
1302 | return &hwif->drives[(drive->dn ^ 1) & 1]; | 1304 | return &hwif->drives[(drive->dn ^ 1) & 1]; |
1303 | } | 1305 | } |
1304 | 1306 | ||
1307 | static inline void ide_set_irq(ide_drive_t *drive, int on) | ||
1308 | { | ||
1309 | drive->hwif->OUTB(drive->ctl | (on ? 0 : 2), IDE_CONTROL_REG); | ||
1310 | } | ||
1311 | |||
1305 | #endif /* _IDE_H */ | 1312 | #endif /* _IDE_H */ |
diff --git a/include/linux/m41t00.h b/include/linux/m41t00.h deleted file mode 100644 index b423360ca38e..000000000000 --- a/include/linux/m41t00.h +++ /dev/null | |||
@@ -1,50 +0,0 @@ | |||
1 | /* | ||
2 | * Definitions for the ST M41T00 family of i2c rtc chips. | ||
3 | * | ||
4 | * Author: Mark A. Greer <mgreer@mvista.com> | ||
5 | * | ||
6 | * 2005, 2006 (c) MontaVista Software, Inc. This file is licensed under | ||
7 | * the terms of the GNU General Public License version 2. This program | ||
8 | * is licensed "as is" without any warranty of any kind, whether express | ||
9 | * or implied. | ||
10 | */ | ||
11 | |||
12 | #ifndef _M41T00_H | ||
13 | #define _M41T00_H | ||
14 | |||
15 | #define M41T00_DRV_NAME "m41t00" | ||
16 | #define M41T00_I2C_ADDR 0x68 | ||
17 | |||
18 | #define M41T00_TYPE_M41T00 0 | ||
19 | #define M41T00_TYPE_M41T81 81 | ||
20 | #define M41T00_TYPE_M41T85 85 | ||
21 | |||
22 | struct m41t00_platform_data { | ||
23 | u8 type; | ||
24 | u8 i2c_addr; | ||
25 | u8 sqw_freq; | ||
26 | }; | ||
27 | |||
28 | /* SQW output disabled, this is default value by power on */ | ||
29 | #define M41T00_SQW_DISABLE (0) | ||
30 | |||
31 | #define M41T00_SQW_32KHZ (1<<4) /* 32.768 KHz */ | ||
32 | #define M41T00_SQW_8KHZ (2<<4) /* 8.192 KHz */ | ||
33 | #define M41T00_SQW_4KHZ (3<<4) /* 4.096 KHz */ | ||
34 | #define M41T00_SQW_2KHZ (4<<4) /* 2.048 KHz */ | ||
35 | #define M41T00_SQW_1KHZ (5<<4) /* 1.024 KHz */ | ||
36 | #define M41T00_SQW_512HZ (6<<4) /* 512 Hz */ | ||
37 | #define M41T00_SQW_256HZ (7<<4) /* 256 Hz */ | ||
38 | #define M41T00_SQW_128HZ (8<<4) /* 128 Hz */ | ||
39 | #define M41T00_SQW_64HZ (9<<4) /* 64 Hz */ | ||
40 | #define M41T00_SQW_32HZ (10<<4) /* 32 Hz */ | ||
41 | #define M41T00_SQW_16HZ (11<<4) /* 16 Hz */ | ||
42 | #define M41T00_SQW_8HZ (12<<4) /* 8 Hz */ | ||
43 | #define M41T00_SQW_4HZ (13<<4) /* 4 Hz */ | ||
44 | #define M41T00_SQW_2HZ (14<<4) /* 2 Hz */ | ||
45 | #define M41T00_SQW_1HZ (15<<4) /* 1 Hz */ | ||
46 | |||
47 | extern ulong m41t00_get_rtc_time(void); | ||
48 | extern int m41t00_set_rtc_time(ulong nowtime); | ||
49 | |||
50 | #endif /* _M41T00_H */ | ||