i2c-highlander.c (a3664b51c783aaa0dde1c95334d1a670d6d54590) i2c-highlander.c (90ab5ee94171b3e28de6bb42ee30b527014e0be7)
1/*
2 * Renesas Solutions Highlander FPGA I2C/SMBus support.
3 *
4 * Supported devices: R0P7780LC0011RL, R0P7785LC0011RL
5 *
6 * Copyright (C) 2008 Paul Mundt
7 * Copyright (C) 2008 Renesas Solutions Corp.
8 * Copyright (C) 2008 Atom Create Engineering Co., Ltd.

--- 38 unchanged lines hidden (view full) ---

47 struct i2c_adapter adapter;
48 struct completion cmd_complete;
49 unsigned long last_read_time;
50 int irq;
51 u8 *buf;
52 size_t buf_len;
53};
54
1/*
2 * Renesas Solutions Highlander FPGA I2C/SMBus support.
3 *
4 * Supported devices: R0P7780LC0011RL, R0P7785LC0011RL
5 *
6 * Copyright (C) 2008 Paul Mundt
7 * Copyright (C) 2008 Renesas Solutions Corp.
8 * Copyright (C) 2008 Atom Create Engineering Co., Ltd.

--- 38 unchanged lines hidden (view full) ---

47 struct i2c_adapter adapter;
48 struct completion cmd_complete;
49 unsigned long last_read_time;
50 int irq;
51 u8 *buf;
52 size_t buf_len;
53};
54
55static int iic_force_poll, iic_force_normal;
55static bool iic_force_poll, iic_force_normal;
56static int iic_timeout = 1000, iic_read_delay;
57
58static inline void highlander_i2c_irq_enable(struct highlander_i2c_dev *dev)
59{
60 iowrite16(ioread16(dev->base + SMCR) | SMCR_IEIC, dev->base + SMCR);
61}
62
63static inline void highlander_i2c_irq_disable(struct highlander_i2c_dev *dev)

--- 399 unchanged lines hidden (view full) ---

463 .name = "i2c-highlander",
464 .owner = THIS_MODULE,
465 },
466
467 .probe = highlander_i2c_probe,
468 .remove = __devexit_p(highlander_i2c_remove),
469};
470
56static int iic_timeout = 1000, iic_read_delay;
57
58static inline void highlander_i2c_irq_enable(struct highlander_i2c_dev *dev)
59{
60 iowrite16(ioread16(dev->base + SMCR) | SMCR_IEIC, dev->base + SMCR);
61}
62
63static inline void highlander_i2c_irq_disable(struct highlander_i2c_dev *dev)

--- 399 unchanged lines hidden (view full) ---

463 .name = "i2c-highlander",
464 .owner = THIS_MODULE,
465 },
466
467 .probe = highlander_i2c_probe,
468 .remove = __devexit_p(highlander_i2c_remove),
469};
470
471module_platform_driver(highlander_i2c_driver);
471static int __init highlander_i2c_init(void)
472{
473 return platform_driver_register(&highlander_i2c_driver);
474}
472
475
476static void __exit highlander_i2c_exit(void)
477{
478 platform_driver_unregister(&highlander_i2c_driver);
479}
480
481module_init(highlander_i2c_init);
482module_exit(highlander_i2c_exit);
483
473MODULE_AUTHOR("Paul Mundt");
474MODULE_DESCRIPTION("Renesas Highlander FPGA I2C/SMBus adapter");
475MODULE_LICENSE("GPL v2");
476
477module_param(iic_force_poll, bool, 0);
478module_param(iic_force_normal, bool, 0);
479module_param(iic_timeout, int, 0);
480module_param(iic_read_delay, int, 0);
481
482MODULE_PARM_DESC(iic_force_poll, "Force polling mode");
483MODULE_PARM_DESC(iic_force_normal,
484 "Force normal mode (100 kHz), default is fast mode (400 kHz)");
485MODULE_PARM_DESC(iic_timeout, "Set timeout value in msecs (default 1000 ms)");
486MODULE_PARM_DESC(iic_read_delay,
487 "Delay between data read cycles (default 0 ms)");
484MODULE_AUTHOR("Paul Mundt");
485MODULE_DESCRIPTION("Renesas Highlander FPGA I2C/SMBus adapter");
486MODULE_LICENSE("GPL v2");
487
488module_param(iic_force_poll, bool, 0);
489module_param(iic_force_normal, bool, 0);
490module_param(iic_timeout, int, 0);
491module_param(iic_read_delay, int, 0);
492
493MODULE_PARM_DESC(iic_force_poll, "Force polling mode");
494MODULE_PARM_DESC(iic_force_normal,
495 "Force normal mode (100 kHz), default is fast mode (400 kHz)");
496MODULE_PARM_DESC(iic_timeout, "Set timeout value in msecs (default 1000 ms)");
497MODULE_PARM_DESC(iic_read_delay,
498 "Delay between data read cycles (default 0 ms)");