diff options
author | Linus Torvalds <torvalds@woody.osdl.org> | 2007-01-06 03:09:14 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2007-01-06 03:09:14 -0500 |
commit | 91f7b5c41811154706448b2bf500000cbbfa96ba (patch) | |
tree | 9a4cdbd7f4863ff5f5a031b9f7ae9f0c89739fa3 /drivers | |
parent | af3e095a1fb42bac32355d5d59ce93f8b4e59a3e (diff) | |
parent | 81ffbc04a8ea06c4bea534154f49ed598013ee6b (diff) |
Merge branch 'i2c-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6
* 'i2c-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6:
i2c/m41t00: Do not forget to write year
i2c-mv64xxx: Fix random oops at boot
i2c: Migration aids for i2c_adapter.dev removal
i2c-pnx: Add entry to MAINTAINERS
i2c-pnx: Fix interrupt handler, get rid of EARLY config option
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/i2c/busses/Kconfig | 9 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-mv64xxx.c | 4 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-pnx.c | 7 | ||||
-rw-r--r-- | drivers/i2c/chips/m41t00.c | 1 | ||||
-rw-r--r-- | drivers/i2c/i2c-core.c | 28 |
5 files changed, 28 insertions, 21 deletions
diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig index e1989f3a2684..9367c4cfe936 100644 --- a/drivers/i2c/busses/Kconfig +++ b/drivers/i2c/busses/Kconfig | |||
@@ -564,13 +564,4 @@ config I2C_PNX | |||
564 | This driver can also be built as a module. If so, the module | 564 | This driver can also be built as a module. If so, the module |
565 | will be called i2c-pnx. | 565 | will be called i2c-pnx. |
566 | 566 | ||
567 | config I2C_PNX_EARLY | ||
568 | bool "Early initialization for I2C on PNXxxxx" | ||
569 | depends on I2C_PNX=y | ||
570 | help | ||
571 | Under certain circumstances one may need to make sure I2C on PNXxxxx | ||
572 | is initialized earlier than some other driver that depends on it | ||
573 | (for instance, that might be USB in case of PNX4008). With this | ||
574 | option turned on you can guarantee that. | ||
575 | |||
576 | endmenu | 567 | endmenu |
diff --git a/drivers/i2c/busses/i2c-mv64xxx.c b/drivers/i2c/busses/i2c-mv64xxx.c index bbc8e3a7ff55..490173611d6b 100644 --- a/drivers/i2c/busses/i2c-mv64xxx.c +++ b/drivers/i2c/busses/i2c-mv64xxx.c | |||
@@ -529,6 +529,8 @@ mv64xxx_i2c_probe(struct platform_device *pd) | |||
529 | platform_set_drvdata(pd, drv_data); | 529 | platform_set_drvdata(pd, drv_data); |
530 | i2c_set_adapdata(&drv_data->adapter, drv_data); | 530 | i2c_set_adapdata(&drv_data->adapter, drv_data); |
531 | 531 | ||
532 | mv64xxx_i2c_hw_init(drv_data); | ||
533 | |||
532 | if (request_irq(drv_data->irq, mv64xxx_i2c_intr, 0, | 534 | if (request_irq(drv_data->irq, mv64xxx_i2c_intr, 0, |
533 | MV64XXX_I2C_CTLR_NAME, drv_data)) { | 535 | MV64XXX_I2C_CTLR_NAME, drv_data)) { |
534 | dev_err(&drv_data->adapter.dev, | 536 | dev_err(&drv_data->adapter.dev, |
@@ -542,8 +544,6 @@ mv64xxx_i2c_probe(struct platform_device *pd) | |||
542 | goto exit_free_irq; | 544 | goto exit_free_irq; |
543 | } | 545 | } |
544 | 546 | ||
545 | mv64xxx_i2c_hw_init(drv_data); | ||
546 | |||
547 | return 0; | 547 | return 0; |
548 | 548 | ||
549 | exit_free_irq: | 549 | exit_free_irq: |
diff --git a/drivers/i2c/busses/i2c-pnx.c b/drivers/i2c/busses/i2c-pnx.c index de0bca77e926..17376feb1acc 100644 --- a/drivers/i2c/busses/i2c-pnx.c +++ b/drivers/i2c/busses/i2c-pnx.c | |||
@@ -305,8 +305,7 @@ static int i2c_pnx_master_rcv(struct i2c_adapter *adap) | |||
305 | return 0; | 305 | return 0; |
306 | } | 306 | } |
307 | 307 | ||
308 | static irqreturn_t | 308 | static irqreturn_t i2c_pnx_interrupt(int irq, void *dev_id) |
309 | i2c_pnx_interrupt(int irq, void *dev_id, struct pt_regs *regs) | ||
310 | { | 309 | { |
311 | u32 stat, ctl; | 310 | u32 stat, ctl; |
312 | struct i2c_adapter *adap = dev_id; | 311 | struct i2c_adapter *adap = dev_id; |
@@ -699,10 +698,6 @@ MODULE_AUTHOR("Vitaly Wool, Dennis Kovalev <source@mvista.com>"); | |||
699 | MODULE_DESCRIPTION("I2C driver for Philips IP3204-based I2C busses"); | 698 | MODULE_DESCRIPTION("I2C driver for Philips IP3204-based I2C busses"); |
700 | MODULE_LICENSE("GPL"); | 699 | MODULE_LICENSE("GPL"); |
701 | 700 | ||
702 | #ifdef CONFIG_I2C_PNX_EARLY | ||
703 | /* We need to make sure I2C is initialized before USB */ | 701 | /* We need to make sure I2C is initialized before USB */ |
704 | subsys_initcall(i2c_adap_pnx_init); | 702 | subsys_initcall(i2c_adap_pnx_init); |
705 | #else | ||
706 | mudule_init(i2c_adap_pnx_init); | ||
707 | #endif | ||
708 | module_exit(i2c_adap_pnx_exit); | 703 | module_exit(i2c_adap_pnx_exit); |
diff --git a/drivers/i2c/chips/m41t00.c b/drivers/i2c/chips/m41t00.c index 420377c86422..3fcb646e2073 100644 --- a/drivers/i2c/chips/m41t00.c +++ b/drivers/i2c/chips/m41t00.c | |||
@@ -209,6 +209,7 @@ m41t00_set(void *arg) | |||
209 | buf[m41t00_chip->hour] = (buf[m41t00_chip->hour] & ~0x3f) | (hour& 0x3f); | 209 | buf[m41t00_chip->hour] = (buf[m41t00_chip->hour] & ~0x3f) | (hour& 0x3f); |
210 | buf[m41t00_chip->day] = (buf[m41t00_chip->day] & ~0x3f) | (day & 0x3f); | 210 | buf[m41t00_chip->day] = (buf[m41t00_chip->day] & ~0x3f) | (day & 0x3f); |
211 | buf[m41t00_chip->mon] = (buf[m41t00_chip->mon] & ~0x1f) | (mon & 0x1f); | 211 | buf[m41t00_chip->mon] = (buf[m41t00_chip->mon] & ~0x1f) | (mon & 0x1f); |
212 | buf[m41t00_chip->year] = year; | ||
212 | 213 | ||
213 | if (i2c_master_send(save_client, wbuf, 9) < 0) | 214 | if (i2c_master_send(save_client, wbuf, 9) < 0) |
214 | dev_err(&save_client->dev, "m41t00_set: Write error\n"); | 215 | dev_err(&save_client->dev, "m41t00_set: Write error\n"); |
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c index 3e31f1d265c9..b05378a3d673 100644 --- a/drivers/i2c/i2c-core.c +++ b/drivers/i2c/i2c-core.c | |||
@@ -95,16 +95,32 @@ struct device_driver i2c_adapter_driver = { | |||
95 | .bus = &i2c_bus_type, | 95 | .bus = &i2c_bus_type, |
96 | }; | 96 | }; |
97 | 97 | ||
98 | /* ------------------------------------------------------------------------- */ | ||
99 | |||
100 | /* I2C bus adapters -- one roots each I2C or SMBUS segment */ | ||
101 | |||
98 | static void i2c_adapter_class_dev_release(struct class_device *dev) | 102 | static void i2c_adapter_class_dev_release(struct class_device *dev) |
99 | { | 103 | { |
100 | struct i2c_adapter *adap = class_dev_to_i2c_adapter(dev); | 104 | struct i2c_adapter *adap = class_dev_to_i2c_adapter(dev); |
101 | complete(&adap->class_dev_released); | 105 | complete(&adap->class_dev_released); |
102 | } | 106 | } |
103 | 107 | ||
108 | static ssize_t i2c_adapter_show_name(struct class_device *cdev, char *buf) | ||
109 | { | ||
110 | struct i2c_adapter *adap = class_dev_to_i2c_adapter(cdev); | ||
111 | return sprintf(buf, "%s\n", adap->name); | ||
112 | } | ||
113 | |||
114 | static struct class_device_attribute i2c_adapter_attrs[] = { | ||
115 | __ATTR(name, S_IRUGO, i2c_adapter_show_name, NULL), | ||
116 | { }, | ||
117 | }; | ||
118 | |||
104 | struct class i2c_adapter_class = { | 119 | struct class i2c_adapter_class = { |
105 | .owner = THIS_MODULE, | 120 | .owner = THIS_MODULE, |
106 | .name = "i2c-adapter", | 121 | .name = "i2c-adapter", |
107 | .release = &i2c_adapter_class_dev_release, | 122 | .class_dev_attrs = i2c_adapter_attrs, |
123 | .release = &i2c_adapter_class_dev_release, | ||
108 | }; | 124 | }; |
109 | 125 | ||
110 | static ssize_t show_adapter_name(struct device *dev, struct device_attribute *attr, char *buf) | 126 | static ssize_t show_adapter_name(struct device *dev, struct device_attribute *attr, char *buf) |
@@ -175,8 +191,12 @@ int i2c_add_adapter(struct i2c_adapter *adap) | |||
175 | * If the parent pointer is not set up, | 191 | * If the parent pointer is not set up, |
176 | * we add this adapter to the host bus. | 192 | * we add this adapter to the host bus. |
177 | */ | 193 | */ |
178 | if (adap->dev.parent == NULL) | 194 | if (adap->dev.parent == NULL) { |
179 | adap->dev.parent = &platform_bus; | 195 | adap->dev.parent = &platform_bus; |
196 | printk(KERN_WARNING "**WARNING** I2C adapter driver [%s] " | ||
197 | "forgot to specify physical device; fix it!\n", | ||
198 | adap->name); | ||
199 | } | ||
180 | sprintf(adap->dev.bus_id, "i2c-%d", adap->nr); | 200 | sprintf(adap->dev.bus_id, "i2c-%d", adap->nr); |
181 | adap->dev.driver = &i2c_adapter_driver; | 201 | adap->dev.driver = &i2c_adapter_driver; |
182 | adap->dev.release = &i2c_adapter_dev_release; | 202 | adap->dev.release = &i2c_adapter_dev_release; |