diff options
author | Marco Aurelio da Costa <costa@gamic.com> | 2009-03-28 16:34:44 -0400 |
---|---|---|
committer | Jean Delvare <khali@linux-fr.org> | 2009-03-28 16:34:44 -0400 |
commit | eff9ec95efaaf6b12d230f0ea7d3c295d3bc9d57 (patch) | |
tree | 741c1ec65283018583bc2a8d5577e3ce8c201994 /drivers/i2c/busses | |
parent | bac3e7c2aa2575a1c71f6fa643499676ca7c12c3 (diff) |
i2c-algo-pca: Add PCA9665 support
Add support for the PCA9665 I2C controller.
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Diffstat (limited to 'drivers/i2c/busses')
-rw-r--r-- | drivers/i2c/busses/Kconfig | 8 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-pca-isa.c | 14 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-pca-platform.c | 9 |
3 files changed, 19 insertions, 12 deletions
diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig index 7f95905bbb9d..68650643d116 100644 --- a/drivers/i2c/busses/Kconfig +++ b/drivers/i2c/busses/Kconfig | |||
@@ -617,12 +617,12 @@ config I2C_ELEKTOR | |||
617 | will be called i2c-elektor. | 617 | will be called i2c-elektor. |
618 | 618 | ||
619 | config I2C_PCA_ISA | 619 | config I2C_PCA_ISA |
620 | tristate "PCA9564 on an ISA bus" | 620 | tristate "PCA9564/PCA9665 on an ISA bus" |
621 | depends on ISA | 621 | depends on ISA |
622 | select I2C_ALGOPCA | 622 | select I2C_ALGOPCA |
623 | default n | 623 | default n |
624 | help | 624 | help |
625 | This driver supports ISA boards using the Philips PCA9564 | 625 | This driver supports ISA boards using the Philips PCA9564/PCA9665 |
626 | parallel bus to I2C bus controller. | 626 | parallel bus to I2C bus controller. |
627 | 627 | ||
628 | This driver can also be built as a module. If so, the module | 628 | This driver can also be built as a module. If so, the module |
@@ -634,11 +634,11 @@ config I2C_PCA_ISA | |||
634 | time). If unsure, say N. | 634 | time). If unsure, say N. |
635 | 635 | ||
636 | config I2C_PCA_PLATFORM | 636 | config I2C_PCA_PLATFORM |
637 | tristate "PCA9564 as platform device" | 637 | tristate "PCA9564/PCA9665 as platform device" |
638 | select I2C_ALGOPCA | 638 | select I2C_ALGOPCA |
639 | default n | 639 | default n |
640 | help | 640 | help |
641 | This driver supports a memory mapped Philips PCA9564 | 641 | This driver supports a memory mapped Philips PCA9564/PCA9665 |
642 | parallel bus to I2C bus controller. | 642 | parallel bus to I2C bus controller. |
643 | 643 | ||
644 | This driver can also be built as a module. If so, the module | 644 | This driver can also be built as a module. If so, the module |
diff --git a/drivers/i2c/busses/i2c-pca-isa.c b/drivers/i2c/busses/i2c-pca-isa.c index c420a7c0f3e4..0cc8017b3f64 100644 --- a/drivers/i2c/busses/i2c-pca-isa.c +++ b/drivers/i2c/busses/i2c-pca-isa.c | |||
@@ -41,7 +41,7 @@ static int irq = -1; | |||
41 | 41 | ||
42 | /* Data sheet recommends 59kHz for 100kHz operation due to variation | 42 | /* Data sheet recommends 59kHz for 100kHz operation due to variation |
43 | * in the actual clock rate */ | 43 | * in the actual clock rate */ |
44 | static int clock = I2C_PCA_CON_59kHz; | 44 | static int clock = 59000; |
45 | 45 | ||
46 | static wait_queue_head_t pca_wait; | 46 | static wait_queue_head_t pca_wait; |
47 | 47 | ||
@@ -103,7 +103,7 @@ static struct i2c_algo_pca_data pca_isa_data = { | |||
103 | static struct i2c_adapter pca_isa_ops = { | 103 | static struct i2c_adapter pca_isa_ops = { |
104 | .owner = THIS_MODULE, | 104 | .owner = THIS_MODULE, |
105 | .algo_data = &pca_isa_data, | 105 | .algo_data = &pca_isa_data, |
106 | .name = "PCA9564 ISA Adapter", | 106 | .name = "PCA9564/PCA9665 ISA Adapter", |
107 | .timeout = 100, | 107 | .timeout = 100, |
108 | }; | 108 | }; |
109 | 109 | ||
@@ -196,7 +196,7 @@ static void __exit pca_isa_exit(void) | |||
196 | } | 196 | } |
197 | 197 | ||
198 | MODULE_AUTHOR("Ian Campbell <icampbell@arcom.com>"); | 198 | MODULE_AUTHOR("Ian Campbell <icampbell@arcom.com>"); |
199 | MODULE_DESCRIPTION("ISA base PCA9564 driver"); | 199 | MODULE_DESCRIPTION("ISA base PCA9564/PCA9665 driver"); |
200 | MODULE_LICENSE("GPL"); | 200 | MODULE_LICENSE("GPL"); |
201 | 201 | ||
202 | module_param(base, ulong, 0); | 202 | module_param(base, ulong, 0); |
@@ -205,7 +205,13 @@ MODULE_PARM_DESC(base, "I/O base address"); | |||
205 | module_param(irq, int, 0); | 205 | module_param(irq, int, 0); |
206 | MODULE_PARM_DESC(irq, "IRQ"); | 206 | MODULE_PARM_DESC(irq, "IRQ"); |
207 | module_param(clock, int, 0); | 207 | module_param(clock, int, 0); |
208 | MODULE_PARM_DESC(clock, "Clock rate as described in table 1 of PCA9564 datasheet"); | 208 | MODULE_PARM_DESC(clock, "Clock rate in hertz.\n\t\t" |
209 | "For PCA9564: 330000,288000,217000,146000," | ||
210 | "88000,59000,44000,36000\n" | ||
211 | "\t\tFor PCA9665:\tStandard: 60300 - 100099\n" | ||
212 | "\t\t\t\tFast: 100100 - 400099\n" | ||
213 | "\t\t\t\tFast+: 400100 - 10000099\n" | ||
214 | "\t\t\t\tTurbo: Up to 1265800"); | ||
209 | 215 | ||
210 | module_init(pca_isa_init); | 216 | module_init(pca_isa_init); |
211 | module_exit(pca_isa_exit); | 217 | module_exit(pca_isa_exit); |
diff --git a/drivers/i2c/busses/i2c-pca-platform.c b/drivers/i2c/busses/i2c-pca-platform.c index 6bb15ad0a6b6..51d179bbddf9 100644 --- a/drivers/i2c/busses/i2c-pca-platform.c +++ b/drivers/i2c/busses/i2c-pca-platform.c | |||
@@ -172,8 +172,9 @@ static int __devinit i2c_pca_pf_probe(struct platform_device *pdev) | |||
172 | 172 | ||
173 | i2c->adap.nr = pdev->id >= 0 ? pdev->id : 0; | 173 | i2c->adap.nr = pdev->id >= 0 ? pdev->id : 0; |
174 | i2c->adap.owner = THIS_MODULE; | 174 | i2c->adap.owner = THIS_MODULE; |
175 | snprintf(i2c->adap.name, sizeof(i2c->adap.name), "PCA9564 at 0x%08lx", | 175 | snprintf(i2c->adap.name, sizeof(i2c->adap.name), |
176 | (unsigned long) res->start); | 176 | "PCA9564/PCA9665 at 0x%08lx", |
177 | (unsigned long) res->start); | ||
177 | i2c->adap.algo_data = &i2c->algo_data; | 178 | i2c->adap.algo_data = &i2c->algo_data; |
178 | i2c->adap.dev.parent = &pdev->dev; | 179 | i2c->adap.dev.parent = &pdev->dev; |
179 | i2c->adap.timeout = platform_data->timeout; | 180 | i2c->adap.timeout = platform_data->timeout; |
@@ -246,7 +247,7 @@ e_remap: | |||
246 | e_alloc: | 247 | e_alloc: |
247 | release_mem_region(res->start, res_len(res)); | 248 | release_mem_region(res->start, res_len(res)); |
248 | e_print: | 249 | e_print: |
249 | printk(KERN_ERR "Registering PCA9564 FAILED! (%d)\n", ret); | 250 | printk(KERN_ERR "Registering PCA9564/PCA9665 FAILED! (%d)\n", ret); |
250 | return ret; | 251 | return ret; |
251 | } | 252 | } |
252 | 253 | ||
@@ -290,7 +291,7 @@ static void __exit i2c_pca_pf_exit(void) | |||
290 | } | 291 | } |
291 | 292 | ||
292 | MODULE_AUTHOR("Wolfram Sang <w.sang@pengutronix.de>"); | 293 | MODULE_AUTHOR("Wolfram Sang <w.sang@pengutronix.de>"); |
293 | MODULE_DESCRIPTION("I2C-PCA9564 platform driver"); | 294 | MODULE_DESCRIPTION("I2C-PCA9564/PCA9665 platform driver"); |
294 | MODULE_LICENSE("GPL"); | 295 | MODULE_LICENSE("GPL"); |
295 | 296 | ||
296 | module_init(i2c_pca_pf_init); | 297 | module_init(i2c_pca_pf_init); |