diff options
Diffstat (limited to 'drivers/i2c')
-rw-r--r-- | drivers/i2c/busses/Kconfig | 5 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-i801.c | 5 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-parport-light.c | 9 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-parport.c | 9 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-parport.h | 2 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-sis96x.c | 8 | ||||
-rw-r--r-- | drivers/i2c/chips/ds1374.c | 16 | ||||
-rw-r--r-- | drivers/i2c/chips/m41t00.c | 24 |
8 files changed, 47 insertions, 31 deletions
diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig index 089c6f5b24de..d6d44946a283 100644 --- a/drivers/i2c/busses/Kconfig +++ b/drivers/i2c/busses/Kconfig | |||
@@ -286,7 +286,10 @@ config I2C_PARPORT | |||
286 | This driver is a replacement for (and was inspired by) an older | 286 | This driver is a replacement for (and was inspired by) an older |
287 | driver named i2c-philips-par. The new driver supports more devices, | 287 | driver named i2c-philips-par. The new driver supports more devices, |
288 | and makes it easier to add support for new devices. | 288 | and makes it easier to add support for new devices. |
289 | 289 | ||
290 | An adapter type parameter is now mandatory. Please read the file | ||
291 | Documentation/i2c/busses/i2c-parport for details. | ||
292 | |||
290 | Another driver exists, named i2c-parport-light, which doesn't depend | 293 | Another driver exists, named i2c-parport-light, which doesn't depend |
291 | on the parport driver. This is meant for embedded systems. Don't say | 294 | on the parport driver. This is meant for embedded systems. Don't say |
292 | Y here if you intend to say Y or M there. | 295 | Y here if you intend to say Y or M there. |
diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c index 8e0f3158215f..dfca74933625 100644 --- a/drivers/i2c/busses/i2c-i801.c +++ b/drivers/i2c/busses/i2c-i801.c | |||
@@ -478,6 +478,11 @@ static s32 i801_access(struct i2c_adapter * adap, u16 addr, | |||
478 | ret = i801_transaction(); | 478 | ret = i801_transaction(); |
479 | } | 479 | } |
480 | 480 | ||
481 | /* Some BIOSes don't like it when PEC is enabled at reboot or resume | ||
482 | time, so we forcibly disable it after every transaction. */ | ||
483 | if (hwpec) | ||
484 | outb_p(0, SMBAUXCTL); | ||
485 | |||
481 | if(block) | 486 | if(block) |
482 | return ret; | 487 | return ret; |
483 | if(ret) | 488 | if(ret) |
diff --git a/drivers/i2c/busses/i2c-parport-light.c b/drivers/i2c/busses/i2c-parport-light.c index c63025a4c861..e09ebbb2f9f0 100644 --- a/drivers/i2c/busses/i2c-parport-light.c +++ b/drivers/i2c/busses/i2c-parport-light.c | |||
@@ -121,9 +121,14 @@ static struct i2c_adapter parport_adapter = { | |||
121 | 121 | ||
122 | static int __init i2c_parport_init(void) | 122 | static int __init i2c_parport_init(void) |
123 | { | 123 | { |
124 | if (type < 0 || type >= ARRAY_SIZE(adapter_parm)) { | 124 | if (type < 0) { |
125 | printk(KERN_WARNING "i2c-parport: adapter type unspecified\n"); | ||
126 | return -ENODEV; | ||
127 | } | ||
128 | |||
129 | if (type >= ARRAY_SIZE(adapter_parm)) { | ||
125 | printk(KERN_WARNING "i2c-parport: invalid type (%d)\n", type); | 130 | printk(KERN_WARNING "i2c-parport: invalid type (%d)\n", type); |
126 | type = 0; | 131 | return -ENODEV; |
127 | } | 132 | } |
128 | 133 | ||
129 | if (base == 0) { | 134 | if (base == 0) { |
diff --git a/drivers/i2c/busses/i2c-parport.c b/drivers/i2c/busses/i2c-parport.c index 7e2e8cd1c14a..934bd55bae15 100644 --- a/drivers/i2c/busses/i2c-parport.c +++ b/drivers/i2c/busses/i2c-parport.c | |||
@@ -241,9 +241,14 @@ static struct parport_driver i2c_parport_driver = { | |||
241 | 241 | ||
242 | static int __init i2c_parport_init(void) | 242 | static int __init i2c_parport_init(void) |
243 | { | 243 | { |
244 | if (type < 0 || type >= ARRAY_SIZE(adapter_parm)) { | 244 | if (type < 0) { |
245 | printk(KERN_WARNING "i2c-parport: adapter type unspecified\n"); | ||
246 | return -ENODEV; | ||
247 | } | ||
248 | |||
249 | if (type >= ARRAY_SIZE(adapter_parm)) { | ||
245 | printk(KERN_WARNING "i2c-parport: invalid type (%d)\n", type); | 250 | printk(KERN_WARNING "i2c-parport: invalid type (%d)\n", type); |
246 | type = 0; | 251 | return -ENODEV; |
247 | } | 252 | } |
248 | 253 | ||
249 | return parport_register_driver(&i2c_parport_driver); | 254 | return parport_register_driver(&i2c_parport_driver); |
diff --git a/drivers/i2c/busses/i2c-parport.h b/drivers/i2c/busses/i2c-parport.h index d702e5e0388d..9ddd816d5d0f 100644 --- a/drivers/i2c/busses/i2c-parport.h +++ b/drivers/i2c/busses/i2c-parport.h | |||
@@ -90,7 +90,7 @@ static struct adapter_parm adapter_parm[] = { | |||
90 | }, | 90 | }, |
91 | }; | 91 | }; |
92 | 92 | ||
93 | static int type; | 93 | static int type = -1; |
94 | module_param(type, int, 0); | 94 | module_param(type, int, 0); |
95 | MODULE_PARM_DESC(type, | 95 | MODULE_PARM_DESC(type, |
96 | "Type of adapter:\n" | 96 | "Type of adapter:\n" |
diff --git a/drivers/i2c/busses/i2c-sis96x.c b/drivers/i2c/busses/i2c-sis96x.c index 3024907cdafe..1a73c0532fc7 100644 --- a/drivers/i2c/busses/i2c-sis96x.c +++ b/drivers/i2c/busses/i2c-sis96x.c | |||
@@ -43,13 +43,6 @@ | |||
43 | #include <linux/init.h> | 43 | #include <linux/init.h> |
44 | #include <asm/io.h> | 44 | #include <asm/io.h> |
45 | 45 | ||
46 | /* | ||
47 | HISTORY: | ||
48 | 2003-05-11 1.0.0 Updated from lm_sensors project for kernel 2.5 | ||
49 | (was i2c-sis645.c from lm_sensors 2.7.0) | ||
50 | */ | ||
51 | #define SIS96x_VERSION "1.0.0" | ||
52 | |||
53 | /* base address register in PCI config space */ | 46 | /* base address register in PCI config space */ |
54 | #define SIS96x_BAR 0x04 | 47 | #define SIS96x_BAR 0x04 |
55 | 48 | ||
@@ -337,7 +330,6 @@ static struct pci_driver sis96x_driver = { | |||
337 | 330 | ||
338 | static int __init i2c_sis96x_init(void) | 331 | static int __init i2c_sis96x_init(void) |
339 | { | 332 | { |
340 | printk(KERN_INFO "i2c-sis96x version %s\n", SIS96x_VERSION); | ||
341 | return pci_register_driver(&sis96x_driver); | 333 | return pci_register_driver(&sis96x_driver); |
342 | } | 334 | } |
343 | 335 | ||
diff --git a/drivers/i2c/chips/ds1374.c b/drivers/i2c/chips/ds1374.c index 03d09ed5ec2c..4630f1969a09 100644 --- a/drivers/i2c/chips/ds1374.c +++ b/drivers/i2c/chips/ds1374.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <linux/rtc.h> | 27 | #include <linux/rtc.h> |
28 | #include <linux/bcd.h> | 28 | #include <linux/bcd.h> |
29 | #include <linux/mutex.h> | 29 | #include <linux/mutex.h> |
30 | #include <linux/workqueue.h> | ||
30 | 31 | ||
31 | #define DS1374_REG_TOD0 0x00 | 32 | #define DS1374_REG_TOD0 0x00 |
32 | #define DS1374_REG_TOD1 0x01 | 33 | #define DS1374_REG_TOD1 0x01 |
@@ -139,7 +140,7 @@ ulong ds1374_get_rtc_time(void) | |||
139 | return t1; | 140 | return t1; |
140 | } | 141 | } |
141 | 142 | ||
142 | static void ds1374_set_tlet(ulong arg) | 143 | static void ds1374_set_work(void *arg) |
143 | { | 144 | { |
144 | ulong t1, t2; | 145 | ulong t1, t2; |
145 | int limit = 10; /* arbitrary retry limit */ | 146 | int limit = 10; /* arbitrary retry limit */ |
@@ -168,17 +169,18 @@ static void ds1374_set_tlet(ulong arg) | |||
168 | 169 | ||
169 | static ulong new_time; | 170 | static ulong new_time; |
170 | 171 | ||
171 | static DECLARE_TASKLET_DISABLED(ds1374_tasklet, ds1374_set_tlet, | 172 | static struct workqueue_struct *ds1374_workqueue; |
172 | (ulong) & new_time); | 173 | |
174 | static DECLARE_WORK(ds1374_work, ds1374_set_work, &new_time); | ||
173 | 175 | ||
174 | int ds1374_set_rtc_time(ulong nowtime) | 176 | int ds1374_set_rtc_time(ulong nowtime) |
175 | { | 177 | { |
176 | new_time = nowtime; | 178 | new_time = nowtime; |
177 | 179 | ||
178 | if (in_interrupt()) | 180 | if (in_interrupt()) |
179 | tasklet_schedule(&ds1374_tasklet); | 181 | queue_work(ds1374_workqueue, &ds1374_work); |
180 | else | 182 | else |
181 | ds1374_set_tlet((ulong) & new_time); | 183 | ds1374_set_work(&new_time); |
182 | 184 | ||
183 | return 0; | 185 | return 0; |
184 | } | 186 | } |
@@ -204,6 +206,8 @@ static int ds1374_probe(struct i2c_adapter *adap, int addr, int kind) | |||
204 | client->adapter = adap; | 206 | client->adapter = adap; |
205 | client->driver = &ds1374_driver; | 207 | client->driver = &ds1374_driver; |
206 | 208 | ||
209 | ds1374_workqueue = create_singlethread_workqueue("ds1374"); | ||
210 | |||
207 | if ((rc = i2c_attach_client(client)) != 0) { | 211 | if ((rc = i2c_attach_client(client)) != 0) { |
208 | kfree(client); | 212 | kfree(client); |
209 | return rc; | 213 | return rc; |
@@ -227,7 +231,7 @@ static int ds1374_detach(struct i2c_client *client) | |||
227 | 231 | ||
228 | if ((rc = i2c_detach_client(client)) == 0) { | 232 | if ((rc = i2c_detach_client(client)) == 0) { |
229 | kfree(i2c_get_clientdata(client)); | 233 | kfree(i2c_get_clientdata(client)); |
230 | tasklet_kill(&ds1374_tasklet); | 234 | destroy_workqueue(ds1374_workqueue); |
231 | } | 235 | } |
232 | return rc; | 236 | return rc; |
233 | } | 237 | } |
diff --git a/drivers/i2c/chips/m41t00.c b/drivers/i2c/chips/m41t00.c index b5aabe7cf792..99ab4ec34390 100644 --- a/drivers/i2c/chips/m41t00.c +++ b/drivers/i2c/chips/m41t00.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include <linux/rtc.h> | 25 | #include <linux/rtc.h> |
26 | #include <linux/bcd.h> | 26 | #include <linux/bcd.h> |
27 | #include <linux/mutex.h> | 27 | #include <linux/mutex.h> |
28 | #include <linux/workqueue.h> | ||
28 | 29 | ||
29 | #include <asm/time.h> | 30 | #include <asm/time.h> |
30 | #include <asm/rtc.h> | 31 | #include <asm/rtc.h> |
@@ -111,7 +112,7 @@ m41t00_get_rtc_time(void) | |||
111 | } | 112 | } |
112 | 113 | ||
113 | static void | 114 | static void |
114 | m41t00_set_tlet(ulong arg) | 115 | m41t00_set(void *arg) |
115 | { | 116 | { |
116 | struct rtc_time tm; | 117 | struct rtc_time tm; |
117 | ulong nowtime = *(ulong *)arg; | 118 | ulong nowtime = *(ulong *)arg; |
@@ -130,13 +131,13 @@ m41t00_set_tlet(ulong arg) | |||
130 | if ((i2c_smbus_write_byte_data(save_client, 0, tm.tm_sec & 0x7f) < 0) | 131 | if ((i2c_smbus_write_byte_data(save_client, 0, tm.tm_sec & 0x7f) < 0) |
131 | || (i2c_smbus_write_byte_data(save_client, 1, tm.tm_min & 0x7f) | 132 | || (i2c_smbus_write_byte_data(save_client, 1, tm.tm_min & 0x7f) |
132 | < 0) | 133 | < 0) |
133 | || (i2c_smbus_write_byte_data(save_client, 2, tm.tm_hour & 0x7f) | 134 | || (i2c_smbus_write_byte_data(save_client, 2, tm.tm_hour & 0x3f) |
134 | < 0) | 135 | < 0) |
135 | || (i2c_smbus_write_byte_data(save_client, 4, tm.tm_mday & 0x7f) | 136 | || (i2c_smbus_write_byte_data(save_client, 4, tm.tm_mday & 0x3f) |
136 | < 0) | 137 | < 0) |
137 | || (i2c_smbus_write_byte_data(save_client, 5, tm.tm_mon & 0x7f) | 138 | || (i2c_smbus_write_byte_data(save_client, 5, tm.tm_mon & 0x1f) |
138 | < 0) | 139 | < 0) |
139 | || (i2c_smbus_write_byte_data(save_client, 6, tm.tm_year & 0x7f) | 140 | || (i2c_smbus_write_byte_data(save_client, 6, tm.tm_year & 0xff) |
140 | < 0)) | 141 | < 0)) |
141 | 142 | ||
142 | dev_warn(&save_client->dev,"m41t00: can't write to rtc chip\n"); | 143 | dev_warn(&save_client->dev,"m41t00: can't write to rtc chip\n"); |
@@ -145,9 +146,9 @@ m41t00_set_tlet(ulong arg) | |||
145 | return; | 146 | return; |
146 | } | 147 | } |
147 | 148 | ||
148 | static ulong new_time; | 149 | static ulong new_time; |
149 | 150 | static struct workqueue_struct *m41t00_wq; | |
150 | DECLARE_TASKLET_DISABLED(m41t00_tasklet, m41t00_set_tlet, (ulong)&new_time); | 151 | static DECLARE_WORK(m41t00_work, m41t00_set, &new_time); |
151 | 152 | ||
152 | int | 153 | int |
153 | m41t00_set_rtc_time(ulong nowtime) | 154 | m41t00_set_rtc_time(ulong nowtime) |
@@ -155,9 +156,9 @@ m41t00_set_rtc_time(ulong nowtime) | |||
155 | new_time = nowtime; | 156 | new_time = nowtime; |
156 | 157 | ||
157 | if (in_interrupt()) | 158 | if (in_interrupt()) |
158 | tasklet_schedule(&m41t00_tasklet); | 159 | queue_work(m41t00_wq, &m41t00_work); |
159 | else | 160 | else |
160 | m41t00_set_tlet((ulong)&new_time); | 161 | m41t00_set(&new_time); |
161 | 162 | ||
162 | return 0; | 163 | return 0; |
163 | } | 164 | } |
@@ -189,6 +190,7 @@ m41t00_probe(struct i2c_adapter *adap, int addr, int kind) | |||
189 | return rc; | 190 | return rc; |
190 | } | 191 | } |
191 | 192 | ||
193 | m41t00_wq = create_singlethread_workqueue("m41t00"); | ||
192 | save_client = client; | 194 | save_client = client; |
193 | return 0; | 195 | return 0; |
194 | } | 196 | } |
@@ -206,7 +208,7 @@ m41t00_detach(struct i2c_client *client) | |||
206 | 208 | ||
207 | if ((rc = i2c_detach_client(client)) == 0) { | 209 | if ((rc = i2c_detach_client(client)) == 0) { |
208 | kfree(client); | 210 | kfree(client); |
209 | tasklet_kill(&m41t00_tasklet); | 211 | destroy_workqueue(m41t00_wq); |
210 | } | 212 | } |
211 | return rc; | 213 | return rc; |
212 | } | 214 | } |