aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/devicetree/bindings/i2c/sirf-i2c.txt19
-rw-r--r--drivers/i2c/busses/Kconfig44
-rw-r--r--drivers/i2c/busses/Makefile4
-rw-r--r--drivers/i2c/busses/i2c-designware-platdrv.c2
-rw-r--r--drivers/i2c/busses/i2c-eg20t.c44
-rw-r--r--drivers/i2c/busses/i2c-imx.c5
-rw-r--r--drivers/i2c/busses/i2c-mpc.c63
-rw-r--r--drivers/i2c/busses/i2c-s3c2410.c14
-rw-r--r--drivers/i2c/busses/i2c-sirf.c459
-rw-r--r--drivers/i2c/busses/i2c-tegra.c1
-rw-r--r--drivers/i2c/busses/i2c-versatile.c10
-rw-r--r--drivers/i2c/busses/i2c-xlr.c278
-rw-r--r--include/linux/i2c/at24.h35
13 files changed, 912 insertions, 66 deletions
diff --git a/Documentation/devicetree/bindings/i2c/sirf-i2c.txt b/Documentation/devicetree/bindings/i2c/sirf-i2c.txt
new file mode 100644
index 000000000000..7baf9e133fa8
--- /dev/null
+++ b/Documentation/devicetree/bindings/i2c/sirf-i2c.txt
@@ -0,0 +1,19 @@
1I2C for SiRFprimaII platforms
2
3Required properties :
4- compatible : Must be "sirf,prima2-i2c"
5- reg: physical base address of the controller and length of memory mapped
6 region.
7- interrupts: interrupt number to the cpu.
8
9Optional properties:
10- clock-frequency : Constains desired I2C/HS-I2C bus clock frequency in Hz.
11 The absence of the propoerty indicates the default frequency 100 kHz.
12
13Examples :
14
15i2c0: i2c@b00e0000 {
16 compatible = "sirf,prima2-i2c";
17 reg = <0xb00e0000 0x10000>;
18 interrupts = <24>;
19};
diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
index 3101dd59e379..71c1b0a7535c 100644
--- a/drivers/i2c/busses/Kconfig
+++ b/drivers/i2c/busses/Kconfig
@@ -369,6 +369,21 @@ config I2C_DESIGNWARE_PCI
369 This driver can also be built as a module. If so, the module 369 This driver can also be built as a module. If so, the module
370 will be called i2c-designware-pci. 370 will be called i2c-designware-pci.
371 371
372config I2C_EG20T
373 tristate "Intel EG20T PCH/LAPIS Semicon IOH(ML7213/ML7223/ML7831) I2C"
374 depends on PCI
375 help
376 This driver is for PCH(Platform controller Hub) I2C of EG20T which
377 is an IOH(Input/Output Hub) for x86 embedded processor.
378 This driver can access PCH I2C bus device.
379
380 This driver also can be used for LAPIS Semiconductor IOH(Input/
381 Output Hub), ML7213, ML7223 and ML7831.
382 ML7213 IOH is for IVI(In-Vehicle Infotainment) use, ML7223 IOH is
383 for MP(Media Phone) use and ML7831 IOH is for general purpose use.
384 ML7213/ML7223/ML7831 is companion chip for Intel Atom E6xx series.
385 ML7213/ML7223/ML7831 is completely compatible for Intel EG20T PCH.
386
372config I2C_GPIO 387config I2C_GPIO
373 tristate "GPIO-based bitbanging I2C" 388 tristate "GPIO-based bitbanging I2C"
374 depends on GENERIC_GPIO 389 depends on GENERIC_GPIO
@@ -630,6 +645,16 @@ config I2C_SIMTEC
630 This driver can also be built as a module. If so, the module 645 This driver can also be built as a module. If so, the module
631 will be called i2c-simtec. 646 will be called i2c-simtec.
632 647
648config I2C_SIRF
649 tristate "CSR SiRFprimaII I2C interface"
650 depends on ARCH_PRIMA2
651 help
652 If you say yes to this option, support will be included for the
653 CSR SiRFprimaII I2C interface.
654
655 This driver can also be built as a module. If so, the module
656 will be called i2c-sirf.
657
633config I2C_STU300 658config I2C_STU300
634 tristate "ST Microelectronics DDC I2C interface" 659 tristate "ST Microelectronics DDC I2C interface"
635 depends on MACH_U300 660 depends on MACH_U300
@@ -681,20 +706,15 @@ config I2C_XILINX
681 This driver can also be built as a module. If so, the module 706 This driver can also be built as a module. If so, the module
682 will be called xilinx_i2c. 707 will be called xilinx_i2c.
683 708
684config I2C_EG20T 709config I2C_XLR
685 tristate "Intel EG20T PCH/LAPIS Semicon IOH(ML7213/ML7223/ML7831) I2C" 710 tristate "XLR I2C support"
686 depends on PCI 711 depends on CPU_XLR
687 help 712 help
688 This driver is for PCH(Platform controller Hub) I2C of EG20T which 713 This driver enables support for the on-chip I2C interface of
689 is an IOH(Input/Output Hub) for x86 embedded processor. 714 the Netlogic XLR/XLS MIPS processors.
690 This driver can access PCH I2C bus device.
691 715
692 This driver also can be used for LAPIS Semiconductor IOH(Input/ 716 This driver can also be built as a module. If so, the module
693 Output Hub), ML7213, ML7223 and ML7831. 717 will be called i2c-xlr.
694 ML7213 IOH is for IVI(In-Vehicle Infotainment) use, ML7223 IOH is
695 for MP(Media Phone) use and ML7831 IOH is for general purpose use.
696 ML7213/ML7223/ML7831 is companion chip for Intel Atom E6xx series.
697 ML7213/ML7223/ML7831 is completely compatible for Intel EG20T PCH.
698 718
699comment "External I2C/SMBus adapter drivers" 719comment "External I2C/SMBus adapter drivers"
700 720
diff --git a/drivers/i2c/busses/Makefile b/drivers/i2c/busses/Makefile
index fba6da60aa0e..569567b0d027 100644
--- a/drivers/i2c/busses/Makefile
+++ b/drivers/i2c/busses/Makefile
@@ -37,6 +37,7 @@ obj-$(CONFIG_I2C_DESIGNWARE_PLATFORM) += i2c-designware-platform.o
37i2c-designware-platform-objs := i2c-designware-platdrv.o i2c-designware-core.o 37i2c-designware-platform-objs := i2c-designware-platdrv.o i2c-designware-core.o
38obj-$(CONFIG_I2C_DESIGNWARE_PCI) += i2c-designware-pci.o 38obj-$(CONFIG_I2C_DESIGNWARE_PCI) += i2c-designware-pci.o
39i2c-designware-pci-objs := i2c-designware-pcidrv.o i2c-designware-core.o 39i2c-designware-pci-objs := i2c-designware-pcidrv.o i2c-designware-core.o
40obj-$(CONFIG_I2C_EG20T) += i2c-eg20t.o
40obj-$(CONFIG_I2C_GPIO) += i2c-gpio.o 41obj-$(CONFIG_I2C_GPIO) += i2c-gpio.o
41obj-$(CONFIG_I2C_HIGHLANDER) += i2c-highlander.o 42obj-$(CONFIG_I2C_HIGHLANDER) += i2c-highlander.o
42obj-$(CONFIG_I2C_IBM_IIC) += i2c-ibm_iic.o 43obj-$(CONFIG_I2C_IBM_IIC) += i2c-ibm_iic.o
@@ -63,12 +64,13 @@ obj-$(CONFIG_I2C_S6000) += i2c-s6000.o
63obj-$(CONFIG_I2C_SH7760) += i2c-sh7760.o 64obj-$(CONFIG_I2C_SH7760) += i2c-sh7760.o
64obj-$(CONFIG_I2C_SH_MOBILE) += i2c-sh_mobile.o 65obj-$(CONFIG_I2C_SH_MOBILE) += i2c-sh_mobile.o
65obj-$(CONFIG_I2C_SIMTEC) += i2c-simtec.o 66obj-$(CONFIG_I2C_SIMTEC) += i2c-simtec.o
67obj-$(CONFIG_I2C_SIRF) += i2c-sirf.o
66obj-$(CONFIG_I2C_STU300) += i2c-stu300.o 68obj-$(CONFIG_I2C_STU300) += i2c-stu300.o
67obj-$(CONFIG_I2C_TEGRA) += i2c-tegra.o 69obj-$(CONFIG_I2C_TEGRA) += i2c-tegra.o
68obj-$(CONFIG_I2C_VERSATILE) += i2c-versatile.o 70obj-$(CONFIG_I2C_VERSATILE) += i2c-versatile.o
69obj-$(CONFIG_I2C_OCTEON) += i2c-octeon.o 71obj-$(CONFIG_I2C_OCTEON) += i2c-octeon.o
70obj-$(CONFIG_I2C_XILINX) += i2c-xiic.o 72obj-$(CONFIG_I2C_XILINX) += i2c-xiic.o
71obj-$(CONFIG_I2C_EG20T) += i2c-eg20t.o 73obj-$(CONFIG_I2C_XLR) += i2c-xlr.o
72 74
73# External I2C/SMBus adapter drivers 75# External I2C/SMBus adapter drivers
74obj-$(CONFIG_I2C_DIOLAN_U2C) += i2c-diolan-u2c.o 76obj-$(CONFIG_I2C_DIOLAN_U2C) += i2c-diolan-u2c.o
diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c
index 5244c4724df7..4ba589ab8614 100644
--- a/drivers/i2c/busses/i2c-designware-platdrv.c
+++ b/drivers/i2c/busses/i2c-designware-platdrv.c
@@ -214,7 +214,7 @@ static int __init dw_i2c_init_driver(void)
214{ 214{
215 return platform_driver_probe(&dw_i2c_driver, dw_i2c_probe); 215 return platform_driver_probe(&dw_i2c_driver, dw_i2c_probe);
216} 216}
217module_init(dw_i2c_init_driver); 217subsys_initcall(dw_i2c_init_driver);
218 218
219static void __exit dw_i2c_exit_driver(void) 219static void __exit dw_i2c_exit_driver(void)
220{ 220{
diff --git a/drivers/i2c/busses/i2c-eg20t.c b/drivers/i2c/busses/i2c-eg20t.c
index ca8877641040..f086131cb1c7 100644
--- a/drivers/i2c/busses/i2c-eg20t.c
+++ b/drivers/i2c/busses/i2c-eg20t.c
@@ -271,30 +271,36 @@ static inline bool ktime_lt(const ktime_t cmp1, const ktime_t cmp2)
271/** 271/**
272 * pch_i2c_wait_for_bus_idle() - check the status of bus. 272 * pch_i2c_wait_for_bus_idle() - check the status of bus.
273 * @adap: Pointer to struct i2c_algo_pch_data. 273 * @adap: Pointer to struct i2c_algo_pch_data.
274 * @timeout: waiting time counter (us). 274 * @timeout: waiting time counter (ms).
275 */ 275 */
276static s32 pch_i2c_wait_for_bus_idle(struct i2c_algo_pch_data *adap, 276static s32 pch_i2c_wait_for_bus_idle(struct i2c_algo_pch_data *adap,
277 s32 timeout) 277 s32 timeout)
278{ 278{
279 void __iomem *p = adap->pch_base_address; 279 void __iomem *p = adap->pch_base_address;
280 ktime_t ns_val; 280 int schedule = 0;
281 unsigned long end = jiffies + msecs_to_jiffies(timeout);
282
283 while (ioread32(p + PCH_I2CSR) & I2CMBB_BIT) {
284 if (time_after(jiffies, end)) {
285 pch_dbg(adap, "I2CSR = %x\n", ioread32(p + PCH_I2CSR));
286 pch_err(adap, "%s: Timeout Error.return%d\n",
287 __func__, -ETIME);
288 pch_i2c_init(adap);
281 289
282 if ((ioread32(p + PCH_I2CSR) & I2CMBB_BIT) == 0) 290 return -ETIME;