aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c/busses
diff options
context:
space:
mode:
authorMarco Aurelio da Costa <costa@gamic.com>2009-03-28 16:34:44 -0400
committerJean Delvare <khali@linux-fr.org>2009-03-28 16:34:44 -0400
commiteff9ec95efaaf6b12d230f0ea7d3c295d3bc9d57 (patch)
tree741c1ec65283018583bc2a8d5577e3ce8c201994 /drivers/i2c/busses
parentbac3e7c2aa2575a1c71f6fa643499676ca7c12c3 (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/Kconfig8
-rw-r--r--drivers/i2c/busses/i2c-pca-isa.c14
-rw-r--r--drivers/i2c/busses/i2c-pca-platform.c9
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
619config I2C_PCA_ISA 619config 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
636config I2C_PCA_PLATFORM 636config 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 */
44static int clock = I2C_PCA_CON_59kHz; 44static int clock = 59000;
45 45
46static wait_queue_head_t pca_wait; 46static wait_queue_head_t pca_wait;
47 47
@@ -103,7 +103,7 @@ static struct i2c_algo_pca_data pca_isa_data = {
103static struct i2c_adapter pca_isa_ops = { 103static 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
198MODULE_AUTHOR("Ian Campbell <icampbell@arcom.com>"); 198MODULE_AUTHOR("Ian Campbell <icampbell@arcom.com>");
199MODULE_DESCRIPTION("ISA base PCA9564 driver"); 199MODULE_DESCRIPTION("ISA base PCA9564/PCA9665 driver");
200MODULE_LICENSE("GPL"); 200MODULE_LICENSE("GPL");
201 201
202module_param(base, ulong, 0); 202module_param(base, ulong, 0);
@@ -205,7 +205,13 @@ MODULE_PARM_DESC(base, "I/O base address");
205module_param(irq, int, 0); 205module_param(irq, int, 0);
206MODULE_PARM_DESC(irq, "IRQ"); 206MODULE_PARM_DESC(irq, "IRQ");
207module_param(clock, int, 0); 207module_param(clock, int, 0);
208MODULE_PARM_DESC(clock, "Clock rate as described in table 1 of PCA9564 datasheet"); 208MODULE_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
210module_init(pca_isa_init); 216module_init(pca_isa_init);
211module_exit(pca_isa_exit); 217module_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:
246e_alloc: 247e_alloc:
247 release_mem_region(res->start, res_len(res)); 248 release_mem_region(res->start, res_len(res));
248e_print: 249e_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
292MODULE_AUTHOR("Wolfram Sang <w.sang@pengutronix.de>"); 293MODULE_AUTHOR("Wolfram Sang <w.sang@pengutronix.de>");
293MODULE_DESCRIPTION("I2C-PCA9564 platform driver"); 294MODULE_DESCRIPTION("I2C-PCA9564/PCA9665 platform driver");
294MODULE_LICENSE("GPL"); 295MODULE_LICENSE("GPL");
295 296
296module_init(i2c_pca_pf_init); 297module_init(i2c_pca_pf_init);