diff options
45 files changed, 420 insertions, 148 deletions
diff --git a/arch/arm/mach-mmp/include/mach/mmp2.h b/arch/arm/mach-mmp/include/mach/mmp2.h index 4aec493640b4..2cbf6df09b82 100644 --- a/arch/arm/mach-mmp/include/mach/mmp2.h +++ b/arch/arm/mach-mmp/include/mach/mmp2.h | |||
@@ -11,8 +11,8 @@ extern void __init mmp2_init_irq(void); | |||
11 | extern void mmp2_clear_pmic_int(void); | 11 | extern void mmp2_clear_pmic_int(void); |
12 | 12 | ||
13 | #include <linux/i2c.h> | 13 | #include <linux/i2c.h> |
14 | #include <linux/i2c/pxa-i2c.h> | ||
14 | #include <mach/devices.h> | 15 | #include <mach/devices.h> |
15 | #include <plat/i2c.h> | ||
16 | 16 | ||
17 | extern struct pxa_device_desc mmp2_device_uart1; | 17 | extern struct pxa_device_desc mmp2_device_uart1; |
18 | extern struct pxa_device_desc mmp2_device_uart2; | 18 | extern struct pxa_device_desc mmp2_device_uart2; |
diff --git a/arch/arm/mach-mmp/include/mach/pxa168.h b/arch/arm/mach-mmp/include/mach/pxa168.h index 1801e4206232..a52b3d2f325c 100644 --- a/arch/arm/mach-mmp/include/mach/pxa168.h +++ b/arch/arm/mach-mmp/include/mach/pxa168.h | |||
@@ -8,8 +8,8 @@ extern void __init pxa168_init_irq(void); | |||
8 | extern void pxa168_clear_keypad_wakeup(void); | 8 | extern void pxa168_clear_keypad_wakeup(void); |
9 | 9 | ||
10 | #include <linux/i2c.h> | 10 | #include <linux/i2c.h> |
11 | #include <linux/i2c/pxa-i2c.h> | ||
11 | #include <mach/devices.h> | 12 | #include <mach/devices.h> |
12 | #include <plat/i2c.h> | ||
13 | #include <plat/pxa3xx_nand.h> | 13 | #include <plat/pxa3xx_nand.h> |
14 | #include <video/pxa168fb.h> | 14 | #include <video/pxa168fb.h> |
15 | #include <plat/pxa27x_keypad.h> | 15 | #include <plat/pxa27x_keypad.h> |
diff --git a/arch/arm/mach-mmp/include/mach/pxa910.h b/arch/arm/mach-mmp/include/mach/pxa910.h index f13c49d6f8dc..91be75591398 100644 --- a/arch/arm/mach-mmp/include/mach/pxa910.h +++ b/arch/arm/mach-mmp/include/mach/pxa910.h | |||
@@ -7,8 +7,8 @@ extern struct sys_timer pxa910_timer; | |||
7 | extern void __init pxa910_init_irq(void); | 7 | extern void __init pxa910_init_irq(void); |
8 | 8 | ||
9 | #include <linux/i2c.h> | 9 | #include <linux/i2c.h> |
10 | #include <linux/i2c/pxa-i2c.h> | ||
10 | #include <mach/devices.h> | 11 | #include <mach/devices.h> |
11 | #include <plat/i2c.h> | ||
12 | #include <plat/pxa3xx_nand.h> | 12 | #include <plat/pxa3xx_nand.h> |
13 | 13 | ||
14 | extern struct pxa_device_desc pxa910_device_uart1; | 14 | extern struct pxa_device_desc pxa910_device_uart1; |
diff --git a/arch/arm/mach-pxa/balloon3.c b/arch/arm/mach-pxa/balloon3.c index e194d928cdaa..d2af73321dae 100644 --- a/arch/arm/mach-pxa/balloon3.c +++ b/arch/arm/mach-pxa/balloon3.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <linux/mtd/partitions.h> | 27 | #include <linux/mtd/partitions.h> |
28 | #include <linux/types.h> | 28 | #include <linux/types.h> |
29 | #include <linux/i2c/pcf857x.h> | 29 | #include <linux/i2c/pcf857x.h> |
30 | #include <linux/i2c/pxa-i2c.h> | ||
30 | #include <linux/mtd/nand.h> | 31 | #include <linux/mtd/nand.h> |
31 | #include <linux/mtd/physmap.h> | 32 | #include <linux/mtd/physmap.h> |
32 | #include <linux/regulator/max1586.h> | 33 | #include <linux/regulator/max1586.h> |
@@ -51,8 +52,6 @@ | |||
51 | #include <mach/irda.h> | 52 | #include <mach/irda.h> |
52 | #include <mach/ohci.h> | 53 | #include <mach/ohci.h> |
53 | 54 | ||
54 | #include <plat/i2c.h> | ||
55 | |||
56 | #include "generic.h" | 55 | #include "generic.h" |
57 | #include "devices.h" | 56 | #include "devices.h" |
58 | 57 | ||
diff --git a/arch/arm/mach-pxa/cm-x300.c b/arch/arm/mach-pxa/cm-x300.c index 7984268508b6..bfca7ed2fea3 100644 --- a/arch/arm/mach-pxa/cm-x300.c +++ b/arch/arm/mach-pxa/cm-x300.c | |||
@@ -29,6 +29,7 @@ | |||
29 | 29 | ||
30 | #include <linux/i2c.h> | 30 | #include <linux/i2c.h> |
31 | #include <linux/i2c/pca953x.h> | 31 | #include <linux/i2c/pca953x.h> |
32 | #include <linux/i2c/pxa-i2c.h> | ||
32 | 33 | ||
33 | #include <linux/mfd/da903x.h> | 34 | #include <linux/mfd/da903x.h> |
34 | #include <linux/regulator/machine.h> | 35 | #include <linux/regulator/machine.h> |
@@ -48,7 +49,6 @@ | |||
48 | #include <mach/pxafb.h> | 49 | #include <mach/pxafb.h> |
49 | #include <mach/mmc.h> | 50 | #include <mach/mmc.h> |
50 | #include <mach/ohci.h> | 51 | #include <mach/ohci.h> |
51 | #include <plat/i2c.h> | ||
52 | #include <plat/pxa3xx_nand.h> | 52 | #include <plat/pxa3xx_nand.h> |
53 | #include <mach/audio.h> | 53 | #include <mach/audio.h> |
54 | #include <mach/pxa3xx-u2d.h> | 54 | #include <mach/pxa3xx-u2d.h> |
diff --git a/arch/arm/mach-pxa/colibri-evalboard.c b/arch/arm/mach-pxa/colibri-evalboard.c index 28f667e52ef9..81c3c433e2d6 100644 --- a/arch/arm/mach-pxa/colibri-evalboard.c +++ b/arch/arm/mach-pxa/colibri-evalboard.c | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <mach/hardware.h> | 20 | #include <mach/hardware.h> |
21 | #include <asm/mach/arch.h> | 21 | #include <asm/mach/arch.h> |
22 | #include <linux/i2c.h> | 22 | #include <linux/i2c.h> |
23 | #include <linux/i2c/pxa-i2c.h> | ||
23 | 24 | ||
24 | #include <mach/pxa27x.h> | 25 | #include <mach/pxa27x.h> |
25 | #include <mach/colibri.h> | 26 | #include <mach/colibri.h> |
@@ -27,8 +28,6 @@ | |||
27 | #include <mach/ohci.h> | 28 | #include <mach/ohci.h> |
28 | #include <mach/pxa27x-udc.h> | 29 | #include <mach/pxa27x-udc.h> |
29 | 30 | ||
30 | #include <plat/i2c.h> | ||
31 | |||
32 | #include "generic.h" | 31 | #include "generic.h" |
33 | #include "devices.h" | 32 | #include "devices.h" |
34 | 33 | ||
diff --git a/arch/arm/mach-pxa/colibri-pxa270-income.c b/arch/arm/mach-pxa/colibri-pxa270-income.c index 07b62a096f17..ee797397dc5b 100644 --- a/arch/arm/mach-pxa/colibri-pxa270-income.c +++ b/arch/arm/mach-pxa/colibri-pxa270-income.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <linux/kernel.h> | 21 | #include <linux/kernel.h> |
22 | #include <linux/platform_device.h> | 22 | #include <linux/platform_device.h> |
23 | #include <linux/pwm_backlight.h> | 23 | #include <linux/pwm_backlight.h> |
24 | #include <linux/i2c/pxa-i2c.h> | ||
24 | #include <linux/sysdev.h> | 25 | #include <linux/sysdev.h> |
25 | 26 | ||
26 | #include <asm/irq.h> | 27 | #include <asm/irq.h> |
@@ -33,8 +34,6 @@ | |||
33 | #include <mach/pxa27x-udc.h> | 34 | #include <mach/pxa27x-udc.h> |
34 | #include <mach/pxafb.h> | 35 | #include <mach/pxafb.h> |
35 | 36 | ||
36 | #include <plat/i2c.h> | ||
37 | |||
38 | #include "devices.h" | 37 | #include "devices.h" |
39 | #include "generic.h" | 38 | #include "generic.h" |
40 | 39 | ||
diff --git a/arch/arm/mach-pxa/corgi.c b/arch/arm/mach-pxa/corgi.c index a5452a3a276d..d4e705caefea 100644 --- a/arch/arm/mach-pxa/corgi.c +++ b/arch/arm/mach-pxa/corgi.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <linux/gpio.h> | 24 | #include <linux/gpio.h> |
25 | #include <linux/backlight.h> | 25 | #include <linux/backlight.h> |
26 | #include <linux/i2c.h> | 26 | #include <linux/i2c.h> |
27 | #include <linux/i2c/pxa-i2c.h> | ||
27 | #include <linux/io.h> | 28 | #include <linux/io.h> |
28 | #include <linux/spi/spi.h> | 29 | #include <linux/spi/spi.h> |
29 | #include <linux/spi/ads7846.h> | 30 | #include <linux/spi/ads7846.h> |
@@ -45,7 +46,6 @@ | |||
45 | #include <asm/mach/irq.h> | 46 | #include <asm/mach/irq.h> |
46 | 47 | ||
47 | #include <mach/pxa25x.h> | 48 | #include <mach/pxa25x.h> |
48 | #include <plat/i2c.h> | ||
49 | #include <mach/irda.h> | 49 | #include <mach/irda.h> |
50 | #include <mach/mmc.h> | 50 | #include <mach/mmc.h> |
51 | #include <mach/udc.h> | 51 | #include <mach/udc.h> |
diff --git a/arch/arm/mach-pxa/csb726.c b/arch/arm/mach-pxa/csb726.c index a305424a967d..0481c29a70e8 100644 --- a/arch/arm/mach-pxa/csb726.c +++ b/arch/arm/mach-pxa/csb726.c | |||
@@ -17,12 +17,12 @@ | |||
17 | #include <linux/mtd/partitions.h> | 17 | #include <linux/mtd/partitions.h> |
18 | #include <linux/sm501.h> | 18 | #include <linux/sm501.h> |
19 | #include <linux/smsc911x.h> | 19 | #include <linux/smsc911x.h> |
20 | #include <linux/i2c/pxa-i2c.h> | ||
20 | 21 | ||
21 | #include <asm/mach-types.h> | 22 | #include <asm/mach-types.h> |
22 | #include <asm/mach/arch.h> | 23 | #include <asm/mach/arch.h> |
23 | #include <mach/csb726.h> | 24 | #include <mach/csb726.h> |
24 | #include <mach/mfp-pxa27x.h> | 25 | #include <mach/mfp-pxa27x.h> |
25 | #include <plat/i2c.h> | ||
26 | #include <mach/mmc.h> | 26 | #include <mach/mmc.h> |
27 | #include <mach/ohci.h> | 27 | #include <mach/ohci.h> |
28 | #include <mach/pxa2xx-regs.h> | 28 | #include <mach/pxa2xx-regs.h> |
diff --git a/arch/arm/mach-pxa/devices.c b/arch/arm/mach-pxa/devices.c index 4c766e3b4af3..c4bf08b3eb61 100644 --- a/arch/arm/mach-pxa/devices.c +++ b/arch/arm/mach-pxa/devices.c | |||
@@ -4,6 +4,7 @@ | |||
4 | #include <linux/platform_device.h> | 4 | #include <linux/platform_device.h> |
5 | #include <linux/dma-mapping.h> | 5 | #include <linux/dma-mapping.h> |
6 | #include <linux/spi/pxa2xx_spi.h> | 6 | #include <linux/spi/pxa2xx_spi.h> |
7 | #include <linux/i2c/pxa-i2c.h> | ||
7 | 8 | ||
8 | #include <asm/pmu.h> | 9 | #include <asm/pmu.h> |
9 | #include <mach/udc.h> | 10 | #include <mach/udc.h> |
@@ -16,7 +17,6 @@ | |||
16 | #include <mach/camera.h> | 17 | #include <mach/camera.h> |
17 | #include <mach/audio.h> | 18 | #include <mach/audio.h> |
18 | #include <mach/hardware.h> | 19 | #include <mach/hardware.h> |
19 | #include <plat/i2c.h> | ||
20 | #include <plat/pxa3xx_nand.h> | 20 | #include <plat/pxa3xx_nand.h> |
21 | 21 | ||
22 | #include "devices.h" | 22 | #include "devices.h" |
diff --git a/arch/arm/mach-pxa/em-x270.c b/arch/arm/mach-pxa/em-x270.c index a78bb3097739..b411d7cbf5a1 100644 --- a/arch/arm/mach-pxa/em-x270.c +++ b/arch/arm/mach-pxa/em-x270.c | |||
@@ -31,6 +31,7 @@ | |||
31 | #include <linux/apm-emulation.h> | 31 | #include <linux/apm-emulation.h> |
32 | #include <linux/i2c.h> | 32 | #include <linux/i2c.h> |
33 | #include <linux/i2c/pca953x.h> | 33 | #include <linux/i2c/pca953x.h> |
34 | #include <linux/i2c/pxa-i2c.h> | ||
34 | #include <linux/regulator/userspace-consumer.h> | 35 | #include <linux/regulator/userspace-consumer.h> |
35 | 36 | ||
36 | #include <media/soc_camera.h> | 37 | #include <media/soc_camera.h> |
@@ -45,7 +46,6 @@ | |||
45 | #include <mach/ohci.h> | 46 | #include <mach/ohci.h> |
46 | #include <mach/mmc.h> | 47 | #include <mach/mmc.h> |
47 | #include <plat/pxa27x_keypad.h> | 48 | #include <plat/pxa27x_keypad.h> |
48 | #include <plat/i2c.h> | ||
49 | #include <mach/camera.h> | 49 | #include <mach/camera.h> |
50 | 50 | ||
51 | #include "generic.h" | 51 | #include "generic.h" |
diff --git a/arch/arm/mach-pxa/ezx.c b/arch/arm/mach-pxa/ezx.c index 87cec0abe5b0..93f05e024313 100644 --- a/arch/arm/mach-pxa/ezx.c +++ b/arch/arm/mach-pxa/ezx.c | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <linux/gpio.h> | 20 | #include <linux/gpio.h> |
21 | #include <linux/gpio_keys.h> | 21 | #include <linux/gpio_keys.h> |
22 | #include <linux/leds-lp3944.h> | 22 | #include <linux/leds-lp3944.h> |
23 | #include <linux/i2c/pxa-i2c.h> | ||
23 | 24 | ||
24 | #include <media/soc_camera.h> | 25 | #include <media/soc_camera.h> |
25 | 26 | ||
@@ -30,7 +31,6 @@ | |||
30 | #include <mach/pxa27x.h> | 31 | #include <mach/pxa27x.h> |
31 | #include <mach/pxafb.h> | 32 | #include <mach/pxafb.h> |
32 | #include <mach/ohci.h> | 33 | #include <mach/ohci.h> |
33 | #include <plat/i2c.h> | ||
34 | #include <mach/hardware.h> | 34 | #include <mach/hardware.h> |
35 | #include <plat/pxa27x_keypad.h> | 35 | #include <plat/pxa27x_keypad.h> |
36 | #include <mach/camera.h> | 36 | #include <mach/camera.h> |
diff --git a/arch/arm/mach-pxa/hx4700.c b/arch/arm/mach-pxa/hx4700.c index a908e0a5f396..6de0ad0eea65 100644 --- a/arch/arm/mach-pxa/hx4700.c +++ b/arch/arm/mach-pxa/hx4700.c | |||
@@ -35,6 +35,7 @@ | |||
35 | #include <linux/spi/spi.h> | 35 | #include <linux/spi/spi.h> |
36 | #include <linux/spi/pxa2xx_spi.h> | 36 | #include <linux/spi/pxa2xx_spi.h> |
37 | #include <linux/usb/gpio_vbus.h> | 37 | #include <linux/usb/gpio_vbus.h> |
38 | #include <linux/i2c/pxa-i2c.h> | ||
38 | 39 | ||
39 | #include <mach/hardware.h> | 40 | #include <mach/hardware.h> |
40 | #include <asm/mach-types.h> | 41 | #include <asm/mach-types.h> |
@@ -42,7 +43,6 @@ | |||
42 | 43 | ||
43 | #include <mach/pxa27x.h> | 44 | #include <mach/pxa27x.h> |
44 | #include <mach/hx4700.h> | 45 | #include <mach/hx4700.h> |
45 | #include <plat/i2c.h> | ||
46 | #include <mach/irda.h> | 46 | #include <mach/irda.h> |
47 | 47 | ||
48 | #include <video/platform_lcd.h> | 48 | #include <video/platform_lcd.h> |
diff --git a/arch/arm/mach-pxa/littleton.c b/arch/arm/mach-pxa/littleton.c index ccb7bfad17ca..87c1ed9ccd2f 100644 --- a/arch/arm/mach-pxa/littleton.c +++ b/arch/arm/mach-pxa/littleton.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include <linux/leds.h> | 28 | #include <linux/leds.h> |
29 | #include <linux/mfd/da903x.h> | 29 | #include <linux/mfd/da903x.h> |
30 | #include <linux/i2c/max732x.h> | 30 | #include <linux/i2c/max732x.h> |
31 | #include <linux/i2c/pxa-i2c.h> | ||
31 | 32 | ||
32 | #include <asm/types.h> | 33 | #include <asm/types.h> |
33 | #include <asm/setup.h> | 34 | #include <asm/setup.h> |
@@ -45,7 +46,6 @@ | |||
45 | #include <mach/mmc.h> | 46 | #include <mach/mmc.h> |
46 | #include <plat/pxa27x_keypad.h> | 47 | #include <plat/pxa27x_keypad.h> |
47 | #include <mach/littleton.h> | 48 | #include <mach/littleton.h> |
48 | #include <plat/i2c.h> | ||
49 | #include <plat/pxa3xx_nand.h> | 49 | #include <plat/pxa3xx_nand.h> |
50 | 50 | ||
51 | #include "generic.h" | 51 | #include "generic.h" |
diff --git a/arch/arm/mach-pxa/magician.c b/arch/arm/mach-pxa/magician.c index 41198f0dc3ac..5535991c4a3c 100644 --- a/arch/arm/mach-pxa/magician.c +++ b/arch/arm/mach-pxa/magician.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include <linux/regulator/bq24022.h> | 28 | #include <linux/regulator/bq24022.h> |
29 | #include <linux/regulator/machine.h> | 29 | #include <linux/regulator/machine.h> |
30 | #include <linux/usb/gpio_vbus.h> | 30 | #include <linux/usb/gpio_vbus.h> |
31 | #include <linux/i2c/pxa-i2c.h> | ||
31 | 32 | ||
32 | #include <mach/hardware.h> | 33 | #include <mach/hardware.h> |
33 | #include <asm/mach-types.h> | 34 | #include <asm/mach-types.h> |
@@ -36,7 +37,6 @@ | |||
36 | #include <mach/pxa27x.h> | 37 | #include <mach/pxa27x.h> |
37 | #include <mach/magician.h> | 38 | #include <mach/magician.h> |
38 | #include <mach/pxafb.h> | 39 | #include <mach/pxafb.h> |
39 | #include <plat/i2c.h> | ||
40 | #include <mach/mmc.h> | 40 | #include <mach/mmc.h> |
41 | #include <mach/irda.h> | 41 | #include <mach/irda.h> |
42 | #include <mach/ohci.h> | 42 | #include <mach/ohci.h> |
diff --git a/arch/arm/mach-pxa/mainstone.c b/arch/arm/mach-pxa/mainstone.c index d4b6f2375f2c..f9542220595a 100644 --- a/arch/arm/mach-pxa/mainstone.c +++ b/arch/arm/mach-pxa/mainstone.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <linux/gpio_keys.h> | 27 | #include <linux/gpio_keys.h> |
28 | #include <linux/pwm_backlight.h> | 28 | #include <linux/pwm_backlight.h> |
29 | #include <linux/smc91x.h> | 29 | #include <linux/smc91x.h> |
30 | #include <linux/i2c/pxa-i2c.h> | ||
30 | 31 | ||
31 | #include <asm/types.h> | 32 | #include <asm/types.h> |
32 | #include <asm/setup.h> | 33 | #include <asm/setup.h> |
@@ -46,7 +47,6 @@ | |||
46 | #include <mach/mainstone.h> | 47 | #include <mach/mainstone.h> |
47 | #include <mach/audio.h> | 48 | #include <mach/audio.h> |
48 | #include <mach/pxafb.h> | 49 | #include <mach/pxafb.h> |
49 | #include <plat/i2c.h> | ||
50 | #include <mach/mmc.h> | 50 | #include <mach/mmc.h> |
51 | #include <mach/irda.h> | 51 | #include <mach/irda.h> |
52 | #include <mach/ohci.h> | 52 | #include <mach/ohci.h> |
diff --git a/arch/arm/mach-pxa/mioa701.c b/arch/arm/mach-pxa/mioa701.c index faafea3542fb..78d98a8607ec 100644 --- a/arch/arm/mach-pxa/mioa701.c +++ b/arch/arm/mach-pxa/mioa701.c | |||
@@ -39,6 +39,7 @@ | |||
39 | #include <linux/usb/gpio_vbus.h> | 39 | #include <linux/usb/gpio_vbus.h> |
40 | #include <linux/regulator/max1586.h> | 40 | #include <linux/regulator/max1586.h> |
41 | #include <linux/slab.h> | 41 | #include <linux/slab.h> |
42 | #include <linux/i2c/pxa-i2c.h> | ||
42 | 43 | ||
43 | #include <asm/mach-types.h> | 44 | #include <asm/mach-types.h> |
44 | #include <asm/mach/arch.h> | 45 | #include <asm/mach/arch.h> |
@@ -50,7 +51,6 @@ | |||
50 | #include <mach/mmc.h> | 51 | #include <mach/mmc.h> |
51 | #include <mach/udc.h> | 52 | #include <mach/udc.h> |
52 | #include <mach/pxa27x-udc.h> | 53 | #include <mach/pxa27x-udc.h> |
53 | #include <plat/i2c.h> | ||
54 | #include <mach/camera.h> | 54 | #include <mach/camera.h> |
55 | #include <mach/audio.h> | 55 | #include <mach/audio.h> |
56 | #include <media/soc_camera.h> | 56 | #include <media/soc_camera.h> |
diff --git a/arch/arm/mach-pxa/mxm8x10.c b/arch/arm/mach-pxa/mxm8x10.c index cdf7f41e2bb3..b5a8fd3fce04 100644 --- a/arch/arm/mach-pxa/mxm8x10.c +++ b/arch/arm/mach-pxa/mxm8x10.c | |||
@@ -22,8 +22,8 @@ | |||
22 | #include <linux/serial_8250.h> | 22 | #include <linux/serial_8250.h> |
23 | #include <linux/dm9000.h> | 23 | #include <linux/dm9000.h> |
24 | #include <linux/gpio.h> | 24 | #include <linux/gpio.h> |
25 | #include <linux/i2c/pxa-i2c.h> | ||
25 | 26 | ||
26 | #include <plat/i2c.h> | ||
27 | #include <plat/pxa3xx_nand.h> | 27 | #include <plat/pxa3xx_nand.h> |
28 | 28 | ||
29 | #include <mach/pxafb.h> | 29 | #include <mach/pxafb.h> |
diff --git a/arch/arm/mach-pxa/palm27x.c b/arch/arm/mach-pxa/palm27x.c index 35572c427fa8..72adb3ae2b43 100644 --- a/arch/arm/mach-pxa/palm27x.c +++ b/arch/arm/mach-pxa/palm27x.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <linux/power_supply.h> | 22 | #include <linux/power_supply.h> |
23 | #include <linux/usb/gpio_vbus.h> | 23 | #include <linux/usb/gpio_vbus.h> |
24 | #include <linux/regulator/max1586.h> | 24 | #include <linux/regulator/max1586.h> |
25 | #include <linux/i2c/pxa-i2c.h> | ||
25 | 26 | ||
26 | #include <asm/mach-types.h> | 27 | #include <asm/mach-types.h> |
27 | #include <asm/mach/arch.h> | 28 | #include <asm/mach/arch.h> |
@@ -36,8 +37,6 @@ | |||
36 | #include <mach/palmasoc.h> | 37 | #include <mach/palmasoc.h> |
37 | #include <mach/palm27x.h> | 38 | #include <mach/palm27x.h> |
38 | 39 | ||
39 | #include <plat/i2c.h> | ||
40 | |||
41 | #include "generic.h" | 40 | #include "generic.h" |
42 | #include "devices.h" | 41 | #include "devices.h" |
43 | 42 | ||
diff --git a/arch/arm/mach-pxa/pcm990-baseboard.c b/arch/arm/mach-pxa/pcm990-baseboard.c index 90820faa711a..9dbf3ccd4150 100644 --- a/arch/arm/mach-pxa/pcm990-baseboard.c +++ b/arch/arm/mach-pxa/pcm990-baseboard.c | |||
@@ -23,12 +23,12 @@ | |||
23 | #include <linux/irq.h> | 23 | #include <linux/irq.h> |
24 | #include <linux/platform_device.h> | 24 | #include <linux/platform_device.h> |
25 | #include <linux/i2c.h> | 25 | #include <linux/i2c.h> |
26 | #include <linux/i2c/pxa-i2c.h> | ||
26 | #include <linux/pwm_backlight.h> | 27 | #include <linux/pwm_backlight.h> |
27 | 28 | ||
28 | #include <media/soc_camera.h> | 29 | #include <media/soc_camera.h> |
29 | 30 | ||
30 | #include <asm/gpio.h> | 31 | #include <asm/gpio.h> |
31 | #include <plat/i2c.h> | ||
32 | #include <mach/camera.h> | 32 | #include <mach/camera.h> |
33 | #include <asm/mach/map.h> | 33 | #include <asm/mach/map.h> |
34 | #include <mach/pxa27x.h> | 34 | #include <mach/pxa27x.h> |
diff --git a/arch/arm/mach-pxa/poodle.c b/arch/arm/mach-pxa/poodle.c index 4f0ff1ab623d..35353af345d5 100644 --- a/arch/arm/mach-pxa/poodle.c +++ b/arch/arm/mach-pxa/poodle.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <linux/mtd/physmap.h> | 23 | #include <linux/mtd/physmap.h> |
24 | #include <linux/gpio.h> | 24 | #include <linux/gpio.h> |
25 | #include <linux/i2c.h> | 25 | #include <linux/i2c.h> |
26 | #include <linux/i2c/pxa-i2c.h> | ||
26 | #include <linux/spi/spi.h> | 27 | #include <linux/spi/spi.h> |
27 | #include <linux/spi/ads7846.h> | 28 | #include <linux/spi/ads7846.h> |
28 | #include <linux/spi/pxa2xx_spi.h> | 29 | #include <linux/spi/pxa2xx_spi.h> |
@@ -44,7 +45,6 @@ | |||
44 | #include <mach/irda.h> | 45 | #include <mach/irda.h> |
45 | #include <mach/poodle.h> | 46 | #include <mach/poodle.h> |
46 | #include <mach/pxafb.h> | 47 | #include <mach/pxafb.h> |
47 | #include <plat/i2c.h> | ||
48 | 48 | ||
49 | #include <asm/hardware/scoop.h> | 49 | #include <asm/hardware/scoop.h> |
50 | #include <asm/hardware/locomo.h> | 50 | #include <asm/hardware/locomo.h> |
diff --git a/arch/arm/mach-pxa/pxa27x.c b/arch/arm/mach-pxa/pxa27x.c index 28b11be00b3f..1cb5d0f9723f 100644 --- a/arch/arm/mach-pxa/pxa27x.c +++ b/arch/arm/mach-pxa/pxa27x.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/sysdev.h> | 19 | #include <linux/sysdev.h> |
20 | #include <linux/io.h> | 20 | #include <linux/io.h> |
21 | #include <linux/irq.h> | 21 | #include <linux/irq.h> |
22 | #include <linux/i2c/pxa-i2c.h> | ||
22 | 23 | ||
23 | #include <asm/mach/map.h> | 24 | #include <asm/mach/map.h> |
24 | #include <mach/hardware.h> | 25 | #include <mach/hardware.h> |
@@ -32,8 +33,6 @@ | |||
32 | #include <mach/dma.h> | 33 | #include <mach/dma.h> |
33 | #include <mach/smemc.h> | 34 | #include <mach/smemc.h> |
34 | 35 | ||
35 | #include <plat/i2c.h> | ||
36 | |||
37 | #include "generic.h" | 36 | #include "generic.h" |
38 | #include "devices.h" | 37 | #include "devices.h" |
39 | #include "clock.h" | 38 | #include "clock.h" |
diff --git a/arch/arm/mach-pxa/pxa3xx.c b/arch/arm/mach-pxa/pxa3xx.c index 1230343d9c70..f374247b8466 100644 --- a/arch/arm/mach-pxa/pxa3xx.c +++ b/arch/arm/mach-pxa/pxa3xx.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <linux/irq.h> | 21 | #include <linux/irq.h> |
22 | #include <linux/io.h> | 22 | #include <linux/io.h> |
23 | #include <linux/sysdev.h> | 23 | #include <linux/sysdev.h> |
24 | #include <linux/i2c/pxa-i2c.h> | ||
24 | 25 | ||
25 | #include <asm/mach/map.h> | 26 | #include <asm/mach/map.h> |
26 | #include <mach/hardware.h> | 27 | #include <mach/hardware.h> |
@@ -32,7 +33,6 @@ | |||
32 | #include <mach/dma.h> | 33 | #include <mach/dma.h> |
33 | #include <mach/regs-intc.h> | 34 | #include <mach/regs-intc.h> |
34 | #include <mach/smemc.h> | 35 | #include <mach/smemc.h> |
35 | #include <plat/i2c.h> | ||
36 | 36 | ||
37 | #include "generic.h" | 37 | #include "generic.h" |
38 | #include "devices.h" | 38 | #include "devices.h" |
diff --git a/arch/arm/mach-pxa/pxa95x.c b/arch/arm/mach-pxa/pxa95x.c index 437980f72710..23b229bd06e9 100644 --- a/arch/arm/mach-pxa/pxa95x.c +++ b/arch/arm/mach-pxa/pxa95x.c | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <linux/init.h> | 15 | #include <linux/init.h> |
16 | #include <linux/pm.h> | 16 | #include <linux/pm.h> |
17 | #include <linux/platform_device.h> | 17 | #include <linux/platform_device.h> |
18 | #include <linux/i2c/pxa-i2c.h> | ||
18 | #include <linux/irq.h> | 19 | #include <linux/irq.h> |
19 | #include <linux/io.h> | 20 | #include <linux/io.h> |
20 | #include <linux/sysdev.h> | 21 | #include <linux/sysdev.h> |
@@ -27,7 +28,6 @@ | |||
27 | #include <mach/pm.h> | 28 | #include <mach/pm.h> |
28 | #include <mach/dma.h> | 29 | #include <mach/dma.h> |
29 | #include <mach/regs-intc.h> | 30 | #include <mach/regs-intc.h> |
30 | #include <plat/i2c.h> | ||
31 | 31 | ||
32 | #include "generic.h" | 32 | #include "generic.h" |
33 | #include "devices.h" | 33 | #include "devices.h" |
diff --git a/arch/arm/mach-pxa/raumfeld.c b/arch/arm/mach-pxa/raumfeld.c index 8361151be054..47094188e029 100644 --- a/arch/arm/mach-pxa/raumfeld.c +++ b/arch/arm/mach-pxa/raumfeld.c | |||
@@ -32,6 +32,7 @@ | |||
32 | #include <linux/sched.h> | 32 | #include <linux/sched.h> |
33 | #include <linux/pwm_backlight.h> | 33 | #include <linux/pwm_backlight.h> |
34 | #include <linux/i2c.h> | 34 | #include <linux/i2c.h> |
35 | #include <linux/i2c/pxa-i2c.h> | ||
35 | #include <linux/spi/spi.h> | 36 | #include <linux/spi/spi.h> |
36 | #include <linux/spi/spi_gpio.h> | 37 | #include <linux/spi/spi_gpio.h> |
37 | #include <linux/lis3lv02d.h> | 38 | #include <linux/lis3lv02d.h> |
@@ -53,7 +54,6 @@ | |||
53 | #include <mach/ohci.h> | 54 | #include <mach/ohci.h> |
54 | #include <mach/pxafb.h> | 55 | #include <mach/pxafb.h> |
55 | #include <mach/mmc.h> | 56 | #include <mach/mmc.h> |
56 | #include <plat/i2c.h> | ||
57 | #include <plat/pxa3xx_nand.h> | 57 | #include <plat/pxa3xx_nand.h> |
58 | 58 | ||
59 | #include "generic.h" | 59 | #include "generic.h" |
diff --git a/arch/arm/mach-pxa/saar.c b/arch/arm/mach-pxa/saar.c index c1ca8cb467fc..eb83c89428ef 100644 --- a/arch/arm/mach-pxa/saar.c +++ b/arch/arm/mach-pxa/saar.c | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <linux/delay.h> | 20 | #include <linux/delay.h> |
21 | #include <linux/fb.h> | 21 | #include <linux/fb.h> |
22 | #include <linux/i2c.h> | 22 | #include <linux/i2c.h> |
23 | #include <linux/i2c/pxa-i2c.h> | ||
23 | #include <linux/smc91x.h> | 24 | #include <linux/smc91x.h> |
24 | #include <linux/mfd/da903x.h> | 25 | #include <linux/mfd/da903x.h> |
25 | #include <linux/mtd/mtd.h> | 26 | #include <linux/mtd/mtd.h> |
@@ -31,7 +32,6 @@ | |||
31 | #include <asm/mach/flash.h> | 32 | #include <asm/mach/flash.h> |
32 | 33 | ||
33 | #include <mach/pxa930.h> | 34 | #include <mach/pxa930.h> |
34 | #include <plat/i2c.h> | ||
35 | #include <mach/pxafb.h> | 35 | #include <mach/pxafb.h> |
36 | 36 | ||
37 | #include "devices.h" | 37 | #include "devices.h" |
diff --git a/arch/arm/mach-pxa/saarb.c b/arch/arm/mach-pxa/saarb.c index e497922f761a..9322fe527c7f 100644 --- a/arch/arm/mach-pxa/saarb.c +++ b/arch/arm/mach-pxa/saarb.c | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <linux/init.h> | 13 | #include <linux/init.h> |
14 | #include <linux/kernel.h> | 14 | #include <linux/kernel.h> |
15 | #include <linux/i2c.h> | 15 | #include <linux/i2c.h> |
16 | #include <linux/i2c/pxa-i2c.h> | ||
16 | #include <linux/mfd/88pm860x.h> | 17 | #include <linux/mfd/88pm860x.h> |
17 | 18 | ||
18 | #include <asm/mach-types.h> | 19 | #include <asm/mach-types.h> |
@@ -24,8 +25,6 @@ | |||
24 | #include <mach/mfp-pxa930.h> | 25 | #include <mach/mfp-pxa930.h> |
25 | #include <mach/gpio.h> | 26 | #include <mach/gpio.h> |
26 | 27 | ||
27 | #include <plat/i2c.h> | ||
28 | |||
29 | #include "generic.h" | 28 | #include "generic.h" |
30 | 29 | ||
31 | #define SAARB_NR_IRQS (IRQ_BOARD_START + 40) | 30 | #define SAARB_NR_IRQS (IRQ_BOARD_START + 40) |
diff --git a/arch/arm/mach-pxa/spitz.c b/arch/arm/mach-pxa/spitz.c index b49a2c21124c..38e2c0912b9a 100644 --- a/arch/arm/mach-pxa/spitz.c +++ b/arch/arm/mach-pxa/spitz.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/gpio.h> | 19 | #include <linux/gpio.h> |
20 | #include <linux/leds.h> | 20 | #include <linux/leds.h> |
21 | #include <linux/i2c.h> | 21 | #include <linux/i2c.h> |
22 | #include <linux/i2c/pxa-i2c.h> | ||
22 | #include <linux/i2c/pca953x.h> | 23 | #include <linux/i2c/pca953x.h> |
23 | #include <linux/spi/spi.h> | 24 | #include <linux/spi/spi.h> |
24 | #include <linux/spi/ads7846.h> | 25 | #include <linux/spi/ads7846.h> |
@@ -47,8 +48,6 @@ | |||
47 | #include <mach/sharpsl_pm.h> | 48 | #include <mach/sharpsl_pm.h> |
48 | #include <mach/smemc.h> | 49 | #include <mach/smemc.h> |
49 | 50 | ||
50 | #include <plat/i2c.h> | ||
51 | |||
52 | #include "generic.h" | 51 | #include "generic.h" |
53 | #include "devices.h" | 52 | #include "devices.h" |
54 | 53 | ||
diff --git a/arch/arm/mach-pxa/stargate2.c b/arch/arm/mach-pxa/stargate2.c index 9a14fdb83c82..cb5611daf5fe 100644 --- a/arch/arm/mach-pxa/stargate2.c +++ b/arch/arm/mach-pxa/stargate2.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include <linux/mtd/plat-ram.h> | 25 | #include <linux/mtd/plat-ram.h> |
26 | #include <linux/mtd/partitions.h> | 26 | #include <linux/mtd/partitions.h> |
27 | 27 | ||
28 | #include <linux/i2c/pxa-i2c.h> | ||
28 | #include <linux/i2c/pcf857x.h> | 29 | #include <linux/i2c/pcf857x.h> |
29 | #include <linux/i2c/at24.h> | 30 | #include <linux/i2c/at24.h> |
30 | #include <linux/smc91x.h> | 31 | #include <linux/smc91x.h> |
@@ -43,7 +44,6 @@ | |||
43 | #include <asm/mach/flash.h> | 44 | #include <asm/mach/flash.h> |
44 | 45 | ||
45 | #include <mach/pxa27x.h> | 46 | #include <mach/pxa27x.h> |
46 | #include <plat/i2c.h> | ||
47 | #include <mach/mmc.h> | 47 | #include <mach/mmc.h> |
48 | #include <mach/udc.h> | 48 | #include <mach/udc.h> |
49 | #include <mach/pxa27x-udc.h> | 49 | #include <mach/pxa27x-udc.h> |
diff --git a/arch/arm/mach-pxa/tavorevb3.c b/arch/arm/mach-pxa/tavorevb3.c index 70191a9450eb..79f4422f12f4 100644 --- a/arch/arm/mach-pxa/tavorevb3.c +++ b/arch/arm/mach-pxa/tavorevb3.c | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <linux/platform_device.h> | 15 | #include <linux/platform_device.h> |
16 | #include <linux/interrupt.h> | 16 | #include <linux/interrupt.h> |
17 | #include <linux/i2c.h> | 17 | #include <linux/i2c.h> |
18 | #include <linux/i2c/pxa-i2c.h> | ||
18 | #include <linux/gpio.h> | 19 | #include <linux/gpio.h> |
19 | #include <linux/mfd/88pm860x.h> | 20 | #include <linux/mfd/88pm860x.h> |
20 | 21 | ||
@@ -23,8 +24,6 @@ | |||
23 | 24 | ||
24 | #include <mach/pxa930.h> | 25 | #include <mach/pxa930.h> |
25 | 26 | ||
26 | #include <plat/i2c.h> | ||
27 | |||
28 | #include "devices.h" | 27 | #include "devices.h" |
29 | #include "generic.h" | 28 | #include "generic.h" |
30 | 29 | ||
diff --git a/arch/arm/mach-pxa/tosa.c b/arch/arm/mach-pxa/tosa.c index f2582ec300d9..5ad3807af334 100644 --- a/arch/arm/mach-pxa/tosa.c +++ b/arch/arm/mach-pxa/tosa.c | |||
@@ -34,6 +34,7 @@ | |||
34 | #include <linux/spi/spi.h> | 34 | #include <linux/spi/spi.h> |
35 | #include <linux/spi/pxa2xx_spi.h> | 35 | #include <linux/spi/pxa2xx_spi.h> |
36 | #include <linux/input/matrix_keypad.h> | 36 | #include <linux/input/matrix_keypad.h> |
37 | #include <linux/i2c/pxa-i2c.h> | ||
37 | 38 | ||
38 | #include <asm/setup.h> | 39 | #include <asm/setup.h> |
39 | #include <asm/mach-types.h> | 40 | #include <asm/mach-types.h> |
@@ -41,7 +42,6 @@ | |||
41 | #include <mach/pxa25x.h> | 42 | #include <mach/pxa25x.h> |
42 | #include <mach/reset.h> | 43 | #include <mach/reset.h> |
43 | #include <mach/irda.h> | 44 | #include <mach/irda.h> |
44 | #include <plat/i2c.h> | ||
45 | #include <mach/mmc.h> | 45 | #include <mach/mmc.h> |
46 | #include <mach/udc.h> | 46 | #include <mach/udc.h> |
47 | #include <mach/tosa_bt.h> | 47 | #include <mach/tosa_bt.h> |
diff --git a/arch/arm/mach-pxa/trizeps4.c b/arch/arm/mach-pxa/trizeps4.c index 423261d63d07..857bb2e63486 100644 --- a/arch/arm/mach-pxa/trizeps4.c +++ b/arch/arm/mach-pxa/trizeps4.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #include <linux/dm9000.h> | 26 | #include <linux/dm9000.h> |
27 | #include <linux/mtd/physmap.h> | 27 | #include <linux/mtd/physmap.h> |
28 | #include <linux/mtd/partitions.h> | 28 | #include <linux/mtd/partitions.h> |
29 | #include <linux/i2c/pxa-i2c.h> | ||
29 | 30 | ||
30 | #include <asm/types.h> | 31 | #include <asm/types.h> |
31 | #include <asm/setup.h> | 32 | #include <asm/setup.h> |
@@ -47,7 +48,6 @@ | |||
47 | #include <mach/irda.h> | 48 | #include <mach/irda.h> |
48 | #include <mach/ohci.h> | 49 | #include <mach/ohci.h> |
49 | #include <mach/smemc.h> | 50 | #include <mach/smemc.h> |
50 | #include <plat/i2c.h> | ||
51 | 51 | ||
52 | #include "generic.h" | 52 | #include "generic.h" |
53 | #include "devices.h" | 53 | #include "devices.h" |
diff --git a/arch/arm/mach-pxa/viper.c b/arch/arm/mach-pxa/viper.c index 49eeeab23689..12279214c875 100644 --- a/arch/arm/mach-pxa/viper.c +++ b/arch/arm/mach-pxa/viper.c | |||
@@ -36,6 +36,7 @@ | |||
36 | #include <linux/gpio.h> | 36 | #include <linux/gpio.h> |
37 | #include <linux/jiffies.h> | 37 | #include <linux/jiffies.h> |
38 | #include <linux/i2c-gpio.h> | 38 | #include <linux/i2c-gpio.h> |
39 | #include <linux/i2c/pxa-i2c.h> | ||
39 | #include <linux/serial_8250.h> | 40 | #include <linux/serial_8250.h> |
40 | #include <linux/smc91x.h> | 41 | #include <linux/smc91x.h> |
41 | #include <linux/pwm_backlight.h> | 42 | #include <linux/pwm_backlight.h> |
@@ -47,7 +48,6 @@ | |||
47 | #include <mach/pxa25x.h> | 48 | #include <mach/pxa25x.h> |
48 | #include <mach/audio.h> | 49 | #include <mach/audio.h> |
49 | #include <mach/pxafb.h> | 50 | #include <mach/pxafb.h> |
50 | #include <plat/i2c.h> | ||
51 | #include <mach/regs-uart.h> | 51 | #include <mach/regs-uart.h> |
52 | #include <mach/arcom-pcmcia.h> | 52 | #include <mach/arcom-pcmcia.h> |
53 | #include <mach/viper.h> | 53 | #include <mach/viper.h> |
diff --git a/arch/arm/mach-pxa/vpac270.c b/arch/arm/mach-pxa/vpac270.c index b9b579715ff6..e709fd459268 100644 --- a/arch/arm/mach-pxa/vpac270.c +++ b/arch/arm/mach-pxa/vpac270.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #include <linux/ucb1400.h> | 26 | #include <linux/ucb1400.h> |
27 | #include <linux/ata_platform.h> | 27 | #include <linux/ata_platform.h> |
28 | #include <linux/regulator/max1586.h> | 28 | #include <linux/regulator/max1586.h> |
29 | #include <linux/i2c/pxa-i2c.h> | ||
29 | 30 | ||
30 | #include <asm/mach-types.h> | 31 | #include <asm/mach-types.h> |
31 | #include <asm/mach/arch.h> | 32 | #include <asm/mach/arch.h> |
@@ -40,8 +41,6 @@ | |||
40 | #include <mach/udc.h> | 41 | #include <mach/udc.h> |
41 | #include <mach/pata_pxa.h> | 42 | #include <mach/pata_pxa.h> |
42 | 43 | ||
43 | #include <plat/i2c.h> | ||
44 | |||
45 | #include "generic.h" | 44 | #include "generic.h" |
46 | #include "devices.h" | 45 | #include "devices.h" |
47 | 46 | ||
diff --git a/arch/arm/mach-pxa/xcep.c b/arch/arm/mach-pxa/xcep.c index 51c0281c6e0a..f55f8f2e0db3 100644 --- a/arch/arm/mach-pxa/xcep.c +++ b/arch/arm/mach-pxa/xcep.c | |||
@@ -16,6 +16,7 @@ | |||
16 | 16 | ||
17 | #include <linux/platform_device.h> | 17 | #include <linux/platform_device.h> |
18 | #include <linux/i2c.h> | 18 | #include <linux/i2c.h> |
19 | #include <linux/i2c/pxa-i2c.h> | ||
19 | #include <linux/smc91x.h> | 20 | #include <linux/smc91x.h> |
20 | #include <linux/mtd/mtd.h> | 21 | #include <linux/mtd/mtd.h> |
21 | #include <linux/mtd/partitions.h> | 22 | #include <linux/mtd/partitions.h> |
@@ -26,8 +27,6 @@ | |||
26 | #include <asm/mach/irq.h> | 27 | #include <asm/mach/irq.h> |
27 | #include <asm/mach/map.h> | 28 | #include <asm/mach/map.h> |
28 | 29 | ||
29 | #include <plat/i2c.h> | ||
30 | |||
31 | #include <mach/hardware.h> | 30 | #include <mach/hardware.h> |
32 | #include <mach/pxa2xx-regs.h> | 31 | #include <mach/pxa2xx-regs.h> |
33 | #include <mach/mfp-pxa25x.h> | 32 | #include <mach/mfp-pxa25x.h> |
diff --git a/arch/arm/mach-pxa/z2.c b/arch/arm/mach-pxa/z2.c index a323e076129e..aaf883754ef4 100644 --- a/arch/arm/mach-pxa/z2.c +++ b/arch/arm/mach-pxa/z2.c | |||
@@ -29,6 +29,7 @@ | |||
29 | #include <linux/gpio_keys.h> | 29 | #include <linux/gpio_keys.h> |
30 | #include <linux/delay.h> | 30 | #include <linux/delay.h> |
31 | #include <linux/regulator/machine.h> | 31 | #include <linux/regulator/machine.h> |
32 | #include <linux/i2c/pxa-i2c.h> | ||
32 | 33 | ||
33 | #include <asm/mach-types.h> | 34 | #include <asm/mach-types.h> |
34 | #include <asm/mach/arch.h> | 35 | #include <asm/mach/arch.h> |
@@ -40,8 +41,6 @@ | |||
40 | #include <mach/mmc.h> | 41 | #include <mach/mmc.h> |
41 | #include <plat/pxa27x_keypad.h> | 42 | #include <plat/pxa27x_keypad.h> |
42 | 43 | ||
43 | #include <plat/i2c.h> | ||
44 | |||
45 | #include "generic.h" | 44 | #include "generic.h" |
46 | #include "devices.h" | 45 | #include "devices.h" |
47 | 46 | ||
diff --git a/arch/arm/mach-pxa/zeus.c b/arch/arm/mach-pxa/zeus.c index b92aa3b8c4f7..730f51e57c17 100644 --- a/arch/arm/mach-pxa/zeus.c +++ b/arch/arm/mach-pxa/zeus.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include <linux/mtd/partitions.h> | 25 | #include <linux/mtd/partitions.h> |
26 | #include <linux/mtd/physmap.h> | 26 | #include <linux/mtd/physmap.h> |
27 | #include <linux/i2c.h> | 27 | #include <linux/i2c.h> |
28 | #include <linux/i2c/pxa-i2c.h> | ||
28 | #include <linux/i2c/pca953x.h> | 29 | #include <linux/i2c/pca953x.h> |
29 | #include <linux/apm-emulation.h> | 30 | #include <linux/apm-emulation.h> |
30 | #include <linux/can/platform/mcp251x.h> | 31 | #include <linux/can/platform/mcp251x.h> |
@@ -33,8 +34,6 @@ | |||
33 | #include <asm/mach/arch.h> | 34 | #include <asm/mach/arch.h> |
34 | #include <asm/mach/map.h> | 35 | #include <asm/mach/map.h> |
35 | 36 | ||
36 | #include <plat/i2c.h> | ||
37 | |||
38 | #include <mach/pxa2xx-regs.h> | 37 | #include <mach/pxa2xx-regs.h> |
39 | #include <mach/regs-uart.h> | 38 | #include <mach/regs-uart.h> |
40 | #include <mach/ohci.h> | 39 | #include <mach/ohci.h> |
diff --git a/arch/arm/mach-pxa/zylonite_pxa300.c b/arch/arm/mach-pxa/zylonite_pxa300.c index 3aa73b3e33f2..93c64d8d7de9 100644 --- a/arch/arm/mach-pxa/zylonite_pxa300.c +++ b/arch/arm/mach-pxa/zylonite_pxa300.c | |||
@@ -17,11 +17,11 @@ | |||
17 | #include <linux/kernel.h> | 17 | #include <linux/kernel.h> |
18 | #include <linux/init.h> | 18 | #include <linux/init.h> |
19 | #include <linux/i2c.h> | 19 | #include <linux/i2c.h> |
20 | #include <linux/i2c/pxa-i2c.h> | ||
20 | #include <linux/i2c/pca953x.h> | 21 | #include <linux/i2c/pca953x.h> |
21 | #include <linux/gpio.h> | 22 | #include <linux/gpio.h> |
22 | 23 | ||
23 | #include <mach/pxa300.h> | 24 | #include <mach/pxa300.h> |
24 | #include <plat/i2c.h> | ||
25 | #include <mach/zylonite.h> | 25 | #include <mach/zylonite.h> |
26 | 26 | ||
27 | #include "generic.h" | 27 | #include "generic.h" |
diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig index 9294dc21861a..2a44a2ff2c5c 100644 --- a/drivers/i2c/busses/Kconfig +++ b/drivers/i2c/busses/Kconfig | |||
@@ -546,15 +546,18 @@ config I2C_PUV3 | |||
546 | 546 | ||
547 | config I2C_PXA | 547 | config I2C_PXA |
548 | tristate "Intel PXA2XX I2C adapter" | 548 | tristate "Intel PXA2XX I2C adapter" |
549 | depends on ARCH_PXA || ARCH_MMP | 549 | depends on ARCH_PXA || ARCH_MMP || (X86_32 && PCI && OF) |
550 | help | 550 | help |
551 | If you have devices in the PXA I2C bus, say yes to this option. | 551 | If you have devices in the PXA I2C bus, say yes to this option. |
552 | This driver can also be built as a module. If so, the module | 552 | This driver can also be built as a module. If so, the module |
553 | will be called i2c-pxa. | 553 | will be called i2c-pxa. |
554 | 554 | ||
555 | config I2C_PXA_PCI | ||
556 | def_bool I2C_PXA && X86_32 && PCI && OF | ||
557 | |||
555 | config I2C_PXA_SLAVE | 558 | config I2C_PXA_SLAVE |
556 | bool "Intel PXA2XX I2C Slave comms support" | 559 | bool "Intel PXA2XX I2C Slave comms support" |
557 | depends on I2C_PXA | 560 | depends on I2C_PXA && !X86_32 |
558 | help | 561 | help |
559 | Support I2C slave mode communications on the PXA I2C bus. This | 562 | Support I2C slave mode communications on the PXA I2C bus. This |
560 | is necessary for systems where the PXA may be a target on the | 563 | is necessary for systems where the PXA may be a target on the |
@@ -667,12 +670,15 @@ config I2C_XILINX | |||
667 | will be called xilinx_i2c. | 670 | will be called xilinx_i2c. |
668 | 671 | ||
669 | config I2C_EG20T | 672 | config I2C_EG20T |
670 | tristate "PCH I2C of Intel EG20T" | 673 | tristate "Intel EG20T PCH/OKI SEMICONDUCTOR ML7213 IOH" |
671 | depends on PCI | 674 | depends on PCI |
672 | help | 675 | help |
673 | This driver is for PCH(Platform controller Hub) I2C of EG20T which | 676 | This driver is for PCH(Platform controller Hub) I2C of EG20T which |
674 | is an IOH(Input/Output Hub) for x86 embedded processor. | 677 | is an IOH(Input/Output Hub) for x86 embedded processor. |
675 | This driver can access PCH I2C bus device. | 678 | This driver can access PCH I2C bus device. |
679 | |||
680 | This driver also supports the ML7213, a companion chip for the | ||
681 | Atom E6xx series and compatible with the Intel EG20T PCH. | ||
676 | 682 | ||
677 | comment "External I2C/SMBus adapter drivers" | 683 | comment "External I2C/SMBus adapter drivers" |
678 | 684 | ||
diff --git a/drivers/i2c/busses/Makefile b/drivers/i2c/busses/Makefile index 8596cfdb43ef..e6cf294d3729 100644 --- a/drivers/i2c/busses/Makefile +++ b/drivers/i2c/busses/Makefile | |||
@@ -54,6 +54,7 @@ obj-$(CONFIG_I2C_PMCMSP) += i2c-pmcmsp.o | |||
54 | obj-$(CONFIG_I2C_PNX) += i2c-pnx.o | 54 | obj-$(CONFIG_I2C_PNX) += i2c-pnx.o |
55 | obj-$(CONFIG_I2C_PUV3) += i2c-puv3.o | 55 | obj-$(CONFIG_I2C_PUV3) += i2c-puv3.o |
56 | obj-$(CONFIG_I2C_PXA) += i2c-pxa.o | 56 | obj-$(CONFIG_I2C_PXA) += i2c-pxa.o |
57 | obj-$(CONFIG_I2C_PXA_PCI) += i2c-pxa-pci.o | ||
57 | obj-$(CONFIG_I2C_S3C2410) += i2c-s3c2410.o | 58 | obj-$(CONFIG_I2C_S3C2410) += i2c-s3c2410.o |
58 | obj-$(CONFIG_I2C_S6000) += i2c-s6000.o | 59 | obj-$(CONFIG_I2C_S6000) += i2c-s6000.o |
59 | obj-$(CONFIG_I2C_SH7760) += i2c-sh7760.o | 60 | obj-$(CONFIG_I2C_SH7760) += i2c-sh7760.o |
diff --git a/drivers/i2c/busses/i2c-eg20t.c b/drivers/i2c/busses/i2c-eg20t.c index 50ea1f43bdc1..878a12026af2 100644 --- a/drivers/i2c/busses/i2c-eg20t.c +++ b/drivers/i2c/busses/i2c-eg20t.c | |||
@@ -132,6 +132,13 @@ | |||
132 | #define pch_pci_dbg(pdev, fmt, arg...) \ | 132 | #define pch_pci_dbg(pdev, fmt, arg...) \ |
133 | dev_dbg(&pdev->dev, "%s :" fmt, __func__, ##arg) | 133 | dev_dbg(&pdev->dev, "%s :" fmt, __func__, ##arg) |
134 | 134 | ||
135 | /* | ||
136 | Set the number of I2C instance max | ||
137 | Intel EG20T PCH : 1ch | ||
138 | OKI SEMICONDUCTOR ML7213 IOH : 2ch | ||
139 | */ | ||
140 | #define PCH_I2C_MAX_DEV 2 | ||
141 | |||
135 | /** | 142 | /** |
136 | * struct i2c_algo_pch_data - for I2C driver functionalities | 143 | * struct i2c_algo_pch_data - for I2C driver functionalities |
137 | * @pch_adapter: stores the reference to i2c_adapter structure | 144 | * @pch_adapter: stores the reference to i2c_adapter structure |
@@ -156,12 +163,14 @@ struct i2c_algo_pch_data { | |||
156 | * @pch_data: stores a list of i2c_algo_pch_data | 163 | * @pch_data: stores a list of i2c_algo_pch_data |
157 | * @pch_i2c_suspended: specifies whether the system is suspended or not | 164 | * @pch_i2c_suspended: specifies whether the system is suspended or not |
158 | * perhaps with more lines and words. | 165 | * perhaps with more lines and words. |
166 | * @ch_num: specifies the number of i2c instance | ||
159 | * | 167 | * |
160 | * pch_data has as many elements as maximum I2C channels | 168 | * pch_data has as many elements as maximum I2C channels |
161 | */ | 169 | */ |
162 | struct adapter_info { | 170 | struct adapter_info { |
163 | struct i2c_algo_pch_data pch_data; | 171 | struct i2c_algo_pch_data pch_data[PCH_I2C_MAX_DEV]; |
164 | bool pch_i2c_suspended; | 172 | bool pch_i2c_suspended; |
173 | int ch_num; | ||
165 | }; | 174 | }; |
166 | 175 | ||
167 | 176 | ||
@@ -170,8 +179,13 @@ static int pch_clk = 50000; /* specifies I2C clock speed in KHz */ | |||
170 | static wait_queue_head_t pch_event; | 179 | static wait_queue_head_t pch_event; |
171 | static DEFINE_MUTEX(pch_mutex); | 180 | static DEFINE_MUTEX(pch_mutex); |
172 | 181 | ||
182 | /* Definition for ML7213 by OKI SEMICONDUCTOR */ | ||
183 | #define PCI_VENDOR_ID_ROHM 0x10DB | ||
184 | #define PCI_DEVICE_ID_ML7213_I2C 0x802D | ||
185 | |||
173 | static struct pci_device_id __devinitdata pch_pcidev_id[] = { | 186 | static struct pci_device_id __devinitdata pch_pcidev_id[] = { |
174 | {PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_PCH_I2C)}, | 187 | { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_PCH_I2C), 1, }, |
188 | { PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ML7213_I2C), 2, }, | ||
175 | {0,} | 189 | {0,} |
176 | }; | 190 | }; |
177 | 191 | ||
@@ -212,8 +226,7 @@ static void pch_i2c_init(struct i2c_algo_pch_data *adap) | |||
212 | /* Initialize I2C registers */ | 226 | /* Initialize I2C registers */ |
213 | iowrite32(0x21, p + PCH_I2CNF); | 227 | iowrite32(0x21, p + PCH_I2CNF); |
214 | 228 | ||
215 | pch_setbit(adap->pch_base_address, PCH_I2CCTL, | 229 | pch_setbit(adap->pch_base_address, PCH_I2CCTL, PCH_I2CCTL_I2CMEN); |
216 | PCH_I2CCTL_I2CMEN); | ||
217 | 230 | ||
218 | if (pch_i2c_speed != 400) | 231 | if (pch_i2c_speed != 400) |
219 | pch_i2c_speed = 100; | 232 | pch_i2c_speed = 100; |
@@ -255,7 +268,7 @@ static inline bool ktime_lt(const ktime_t cmp1, const ktime_t cmp2) | |||
255 | * @timeout: waiting time counter (us). | 268 | * @timeout: waiting time counter (us). |
256 | */ | 269 | */ |
257 | static s32 pch_i2c_wait_for_bus_idle(struct i2c_algo_pch_data *adap, | 270 | static s32 pch_i2c_wait_for_bus_idle(struct i2c_algo_pch_data *adap, |
258 | s32 timeout) | 271 | s32 timeout) |
259 | { | 272 | { |
260 | void __iomem *p = adap->pch_base_address; | 273 | void __iomem *p = adap->pch_base_address; |
261 | 274 | ||
@@ -475,8 +488,8 @@ static void pch_i2c_sendnack(struct i2c_algo_pch_data *adap) | |||
475 | * @last: specifies whether last message or not. | 488 | * @last: specifies whether last message or not. |
476 | * @first: specifies whether first message or not. | 489 | * @first: specifies whether first message or not. |
477 | */ | 490 | */ |
478 | s32 pch_i2c_readbytes(struct i2c_adapter *i2c_adap, struct i2c_msg *msgs, | 491 | static s32 pch_i2c_readbytes(struct i2c_adapter *i2c_adap, struct i2c_msg *msgs, |
479 | u32 last, u32 first) | 492 | u32 last, u32 first) |
480 | { | 493 | { |
481 | struct i2c_algo_pch_data *adap = i2c_adap->algo_data; | 494 | struct i2c_algo_pch_data *adap = i2c_adap->algo_data; |
482 | 495 | ||
@@ -569,10 +582,10 @@ s32 pch_i2c_readbytes(struct i2c_adapter *i2c_adap, struct i2c_msg *msgs, | |||
569 | } | 582 | } |
570 | 583 | ||
571 | /** | 584 | /** |
572 | * pch_i2c_cb_ch0() - Interrupt handler Call back function | 585 | * pch_i2c_cb() - Interrupt handler Call back function |
573 | * @adap: Pointer to struct i2c_algo_pch_data. | 586 | * @adap: Pointer to struct i2c_algo_pch_data. |
574 | */ | 587 | */ |
575 | static void pch_i2c_cb_ch0(struct i2c_algo_pch_data *adap) | 588 | static void pch_i2c_cb(struct i2c_algo_pch_data *adap) |
576 | { | 589 | { |
577 | u32 sts; | 590 | u32 sts; |
578 | void __iomem *p = adap->pch_base_address; | 591 | void __iomem *p = adap->pch_base_address; |
@@ -600,24 +613,30 @@ static void pch_i2c_cb_ch0(struct i2c_algo_pch_data *adap) | |||
600 | */ | 613 | */ |
601 | static irqreturn_t pch_i2c_handler(int irq, void *pData) | 614 | static irqreturn_t pch_i2c_handler(int irq, void *pData) |
602 | { | 615 | { |
603 | s32 reg_val; | 616 | u32 reg_val; |
604 | 617 | int flag; | |
605 | struct i2c_algo_pch_data *adap_data = (struct i2c_algo_pch_data *)pData; | 618 | int i; |
606 | void __iomem *p = adap_data->pch_base_address; | 619 | struct adapter_info *adap_info = pData; |
607 | u32 mode = ioread32(p + PCH_I2CMOD) & (BUFFER_MODE | EEPROM_SR_MODE); | 620 | void __iomem *p; |
608 | 621 | u32 mode; | |
609 | if (mode != NORMAL_MODE) { | 622 | |
610 | pch_err(adap_data, "I2C mode is not supported\n"); | 623 | for (i = 0, flag = 0; i < adap_info->ch_num; i++) { |
611 | return IRQ_NONE; | 624 | p = adap_info->pch_data[i].pch_base_address; |
625 | mode = ioread32(p + PCH_I2CMOD); | ||
626 | mode &= BUFFER_MODE | EEPROM_SR_MODE; | ||
627 | if (mode != NORMAL_MODE) { | ||
628 | pch_err(adap_info->pch_data, | ||
629 | "I2C-%d mode(%d) is not supported\n", mode, i); | ||
630 | continue; | ||
631 | } | ||
632 | reg_val = ioread32(p + PCH_I2CSR); | ||
633 | if (reg_val & (I2CMAL_BIT | I2CMCF_BIT | I2CMIF_BIT)) { | ||
634 | pch_i2c_cb(&adap_info->pch_data[i]); | ||
635 | flag = 1; | ||
636 | } | ||
612 | } | 637 | } |
613 | 638 | ||
614 | reg_val = ioread32(p + PCH_I2CSR); | 639 | return flag ? IRQ_HANDLED : IRQ_NONE; |
615 | if (reg_val & (I2CMAL_BIT | I2CMCF_BIT | I2CMIF_BIT)) | ||
616 | pch_i2c_cb_ch0(adap_data); | ||
617 | else | ||
618 | return IRQ_NONE; | ||
619 | |||
620 | return IRQ_HANDLED; | ||
621 | } | 640 | } |
622 | 641 | ||
623 | /** | 642 | /** |
@@ -627,7 +646,7 @@ static irqreturn_t pch_i2c_handler(int irq, void *pData) | |||
627 | * @num: number of messages. | 646 | * @num: number of messages. |
628 | */ | 647 | */ |
629 | static s32 pch_i2c_xfer(struct i2c_adapter *i2c_adap, | 648 | static s32 pch_i2c_xfer(struct i2c_adapter *i2c_adap, |
630 | struct i2c_msg *msgs, s32 num) | 649 | struct i2c_msg *msgs, s32 num) |
631 | { | 650 | { |
632 | struct i2c_msg *pmsg; | 651 | struct i2c_msg *pmsg; |
633 | u32 i = 0; | 652 | u32 i = 0; |
@@ -710,11 +729,13 @@ static void pch_i2c_disbl_int(struct i2c_algo_pch_data *adap) | |||
710 | } | 729 | } |
711 | 730 | ||
712 | static int __devinit pch_i2c_probe(struct pci_dev *pdev, | 731 | static int __devinit pch_i2c_probe(struct pci_dev *pdev, |
713 | const struct pci_device_id *id) | 732 | const struct pci_device_id *id) |
714 | { | 733 | { |
715 | void __iomem *base_addr; | 734 | void __iomem *base_addr; |
716 | s32 ret; | 735 | int ret; |
736 | int i, j; | ||
717 | struct adapter_info *adap_info; | 737 | struct adapter_info *adap_info; |
738 | struct i2c_adapter *pch_adap; | ||
718 | 739 | ||
719 | pch_pci_dbg(pdev, "Entered.\n"); | 740 | pch_pci_dbg(pdev, "Entered.\n"); |
720 | 741 | ||
@@ -744,44 +765,48 @@ static int __devinit pch_i2c_probe(struct pci_dev *pdev, | |||
744 | goto err_pci_iomap; | 765 | goto err_pci_iomap; |
745 | } | 766 | } |
746 | 767 | ||
747 | adap_info->pch_i2c_suspended = false; | 768 | /* Set the number of I2C channel instance */ |
769 | adap_info->ch_num = id->driver_data; | ||
748 | 770 | ||
749 | adap_info->pch_data.p_adapter_info = adap_info; | 771 | for (i = 0; i < adap_info->ch_num; i++) { |
772 | pch_adap = &adap_info->pch_data[i].pch_adapter; | ||
773 | adap_info->pch_i2c_suspended = false; | ||
750 | 774 | ||
751 | adap_info->pch_data.pch_adapter.owner = THIS_MODULE; | 775 | adap_info->pch_data[i].p_adapter_info = adap_info; |
752 | adap_info->pch_data.pch_adapter.class = I2C_CLASS_HWMON; | ||
753 | strcpy(adap_info->pch_data.pch_adapter.name, KBUILD_MODNAME); | ||
754 | adap_info->pch_data.pch_adapter.algo = &pch_algorithm; | ||
755 | adap_info->pch_data.pch_adapter.algo_data = | ||
756 | &adap_info->pch_data; | ||
757 | 776 | ||
758 | /* (i * 0x80) + base_addr; */ | 777 | pch_adap->owner = THIS_MODULE; |
759 | adap_info->pch_data.pch_base_address = base_addr; | 778 | pch_adap->class = I2C_CLASS_HWMON; |
779 | strcpy(pch_adap->name, KBUILD_MODNAME); | ||
780 | pch_adap->algo = &pch_algorithm; | ||
781 | pch_adap->algo_data = &adap_info->pch_data[i]; | ||
760 | 782 | ||
761 | adap_info->pch_data.pch_adapter.dev.parent = &pdev->dev; | 783 | /* base_addr + offset; */ |
784 | adap_info->pch_data[i].pch_base_address = base_addr + 0x100 * i; | ||
762 | 785 | ||
763 | ret = i2c_add_adapter(&(adap_info->pch_data.pch_adapter)); | 786 | pch_adap->dev.parent = &pdev->dev; |
764 | 787 | ||
765 | if (ret) { | 788 | ret = i2c_add_adapter(pch_adap); |
766 | pch_pci_err(pdev, "i2c_add_adapter FAILED\n"); | 789 | if (ret) { |
767 | goto err_i2c_add_adapter; | 790 | pch_pci_err(pdev, "i2c_add_adapter[ch:%d] FAILED\n", i); |
768 | } | 791 | goto err_i2c_add_adapter; |
792 | } | ||
769 | 793 | ||
770 | pch_i2c_init(&adap_info->pch_data); | 794 | pch_i2c_init(&adap_info->pch_data[i]); |
795 | } | ||
771 | ret = request_irq(pdev->irq, pch_i2c_handler, IRQF_SHARED, | 796 | ret = request_irq(pdev->irq, pch_i2c_handler, IRQF_SHARED, |
772 | KBUILD_MODNAME, &adap_info->pch_data); | 797 | KBUILD_MODNAME, adap_info); |
773 | if (ret) { | 798 | if (ret) { |
774 | pch_pci_err(pdev, "request_irq FAILED\n"); | 799 | pch_pci_err(pdev, "request_irq FAILED\n"); |
775 | goto err_request_irq; | 800 | goto err_i2c_add_adapter; |
776 | } | 801 | } |
777 | 802 | ||
778 | pci_set_drvdata(pdev, adap_info); | 803 | pci_set_drvdata(pdev, adap_info); |
779 | pch_pci_dbg(pdev, "returns %d.\n", ret); | 804 | pch_pci_dbg(pdev, "returns %d.\n", ret); |
780 | return 0; | 805 | return 0; |
781 | 806 | ||
782 | err_request_irq: | ||
783 | i2c_del_adapter(&(adap_info->pch_data.pch_adapter)); | ||
784 | err_i2c_add_adapter: | 807 | err_i2c_add_adapter: |
808 | for (j = 0; j < i; j++) | ||
809 | i2c_del_adapter(&adap_info->pch_data[j].pch_adapter); | ||
785 | pci_iounmap(pdev, base_addr); | 810 | pci_iounmap(pdev, base_addr); |
786 | err_pci_iomap: | 811 | err_pci_iomap: |
787 | pci_release_regions(pdev); | 812 | pci_release_regions(pdev); |
@@ -794,17 +819,22 @@ err_pci_enable: | |||
794 | 819 | ||
795 | static void __devexit pch_i2c_remove(struct pci_dev *pdev) | 820 | static void __devexit pch_i2c_remove(struct pci_dev *pdev) |
796 | { | 821 | { |
822 | int i; | ||
797 | struct adapter_info *adap_info = pci_get_drvdata(pdev); | 823 | struct adapter_info *adap_info = pci_get_drvdata(pdev); |
798 | 824 | ||
799 | pch_i2c_disbl_int(&adap_info->pch_data); | 825 | free_irq(pdev->irq, adap_info); |
800 | free_irq(pdev->irq, &adap_info->pch_data); | ||
801 | i2c_del_adapter(&(adap_info->pch_data.pch_adapter)); | ||
802 | 826 | ||
803 | if (adap_info->pch_data.pch_base_address) { | 827 | for (i = 0; i < adap_info->ch_num; i++) { |
804 | pci_iounmap(pdev, adap_info->pch_data.pch_base_address); | 828 | pch_i2c_disbl_int(&adap_info->pch_data[i]); |
805 | adap_info->pch_data.pch_base_address = 0; | 829 | i2c_del_adapter(&adap_info->pch_data[i].pch_adapter); |
806 | } | 830 | } |
807 | 831 | ||
832 | if (adap_info->pch_data[0].pch_base_address) | ||
833 | pci_iounmap(pdev, adap_info->pch_data[0].pch_base_address); | ||
834 | |||
835 | for (i = 0; i < adap_info->ch_num; i++) | ||
836 | adap_info->pch_data[i].pch_base_address = 0; | ||
837 | |||
808 | pci_set_drvdata(pdev, NULL); | 838 | pci_set_drvdata(pdev, NULL); |
809 | 839 | ||
810 | pci_release_regions(pdev); | 840 | pci_release_regions(pdev); |
@@ -817,17 +847,22 @@ static void __devexit pch_i2c_remove(struct pci_dev *pdev) | |||
817 | static int pch_i2c_suspend(struct pci_dev *pdev, pm_message_t state) | 847 | static int pch_i2c_suspend(struct pci_dev *pdev, pm_message_t state) |
818 | { | 848 | { |
819 | int ret; | 849 | int ret; |
850 | int i; | ||
820 | struct adapter_info *adap_info = pci_get_drvdata(pdev); | 851 | struct adapter_info *adap_info = pci_get_drvdata(pdev); |
821 | void __iomem *p = adap_info->pch_data.pch_base_address; | 852 | void __iomem *p = adap_info->pch_data[0].pch_base_address; |
822 | 853 | ||
823 | adap_info->pch_i2c_suspended = true; | 854 | adap_info->pch_i2c_suspended = true; |
824 | 855 | ||
825 | while ((adap_info->pch_data.pch_i2c_xfer_in_progress)) { | 856 | for (i = 0; i < adap_info->ch_num; i++) { |
826 | /* Wait until all channel transfers are completed */ | 857 | while ((adap_info->pch_data[i].pch_i2c_xfer_in_progress)) { |
827 | msleep(20); | 858 | /* Wait until all channel transfers are completed */ |
859 | msleep(20); | ||
860 | } | ||
828 | } | 861 | } |
862 | |||
829 | /* Disable the i2c interrupts */ | 863 | /* Disable the i2c interrupts */ |
830 | pch_i2c_disbl_int(&adap_info->pch_data); | 864 | for (i = 0; i < adap_info->ch_num; i++) |
865 | pch_i2c_disbl_int(&adap_info->pch_data[i]); | ||
831 | 866 | ||
832 | pch_pci_dbg(pdev, "I2CSR = %x I2CBUFSTA = %x I2CESRSTA = %x " | 867 | pch_pci_dbg(pdev, "I2CSR = %x I2CBUFSTA = %x I2CESRSTA = %x " |
833 | "invoked function pch_i2c_disbl_int successfully\n", | 868 | "invoked function pch_i2c_disbl_int successfully\n", |
@@ -850,6 +885,7 @@ static int pch_i2c_suspend(struct pci_dev *pdev, pm_message_t state) | |||
850 | 885 | ||
851 | static int pch_i2c_resume(struct pci_dev *pdev) | 886 | static int pch_i2c_resume(struct pci_dev *pdev) |
852 | { | 887 | { |
888 | int i; | ||
853 | struct adapter_info *adap_info = pci_get_drvdata(pdev); | 889 | struct adapter_info *adap_info = pci_get_drvdata(pdev); |
854 | 890 | ||
855 | pci_set_power_state(pdev, PCI_D0); | 891 | pci_set_power_state(pdev, PCI_D0); |
@@ -862,7 +898,8 @@ static int pch_i2c_resume(struct pci_dev *pdev) | |||
862 | 898 | ||
863 | pci_enable_wake(pdev, PCI_D3hot, 0); | 899 | pci_enable_wake(pdev, PCI_D3hot, 0); |
864 | 900 | ||
865 | pch_i2c_init(&adap_info->pch_data); | 901 | for (i = 0; i < adap_info->ch_num; i++) |
902 | pch_i2c_init(&adap_info->pch_data[i]); | ||
866 | 903 | ||
867 | adap_info->pch_i2c_suspended = false; | 904 | adap_info->pch_i2c_suspended = false; |
868 | 905 | ||
@@ -894,7 +931,7 @@ static void __exit pch_pci_exit(void) | |||
894 | } | 931 | } |
895 | module_exit(pch_pci_exit); | 932 | module_exit(pch_pci_exit); |
896 | 933 | ||
897 | MODULE_DESCRIPTION("PCH I2C PCI Driver"); | 934 | MODULE_DESCRIPTION("Intel EG20T PCH/OKI SEMICONDUCTOR ML7213 IOH I2C Driver"); |
898 | MODULE_LICENSE("GPL"); | 935 | MODULE_LICENSE("GPL"); |
899 | MODULE_AUTHOR("Tomoya MORINAGA. <tomoya-linux@dsn.okisemi.com>"); | 936 | MODULE_AUTHOR("Tomoya MORINAGA. <tomoya-linux@dsn.okisemi.com>"); |
900 | module_param(pch_i2c_speed, int, (S_IRUSR | S_IWUSR)); | 937 | module_param(pch_i2c_speed, int, (S_IRUSR | S_IWUSR)); |
diff --git a/drivers/i2c/busses/i2c-mxs.c b/drivers/i2c/busses/i2c-mxs.c index 8022e2390a5a..caf96dc8ca1b 100644 --- a/drivers/i2c/busses/i2c-mxs.c +++ b/drivers/i2c/busses/i2c-mxs.c | |||
@@ -118,6 +118,8 @@ static void mxs_i2c_reset(struct mxs_i2c_dev *i2c) | |||
118 | { | 118 | { |
119 | mxs_reset_block(i2c->regs); | 119 | mxs_reset_block(i2c->regs); |
120 | writel(MXS_I2C_IRQ_MASK << 8, i2c->regs + MXS_I2C_CTRL1_SET); | 120 | writel(MXS_I2C_IRQ_MASK << 8, i2c->regs + MXS_I2C_CTRL1_SET); |
121 | writel(MXS_I2C_QUEUECTRL_PIO_QUEUE_MODE, | ||
122 | i2c->regs + MXS_I2C_QUEUECTRL_SET); | ||
121 | } | 123 | } |
122 | 124 | ||
123 | static void mxs_i2c_pioq_setup_read(struct mxs_i2c_dev *i2c, u8 addr, int len, | 125 | static void mxs_i2c_pioq_setup_read(struct mxs_i2c_dev *i2c, u8 addr, int len, |
@@ -347,8 +349,6 @@ static int __devinit mxs_i2c_probe(struct platform_device *pdev) | |||
347 | 349 | ||
348 | /* Do reset to enforce correct startup after pinmuxing */ | 350 | /* Do reset to enforce correct startup after pinmuxing */ |
349 | mxs_i2c_reset(i2c); | 351 | mxs_i2c_reset(i2c); |
350 | writel(MXS_I2C_QUEUECTRL_PIO_QUEUE_MODE, | ||
351 | i2c->regs + MXS_I2C_QUEUECTRL_SET); | ||
352 | 352 | ||
353 | adap = &i2c->adapter; | 353 | adap = &i2c->adapter; |
354 | strlcpy(adap->name, "MXS I2C adapter", sizeof(adap->name)); | 354 | strlcpy(adap->name, "MXS I2C adapter", sizeof(adap->name)); |
diff --git a/drivers/i2c/busses/i2c-pxa-pci.c b/drivers/i2c/busses/i2c-pxa-pci.c new file mode 100644 index 000000000000..6659d269b841 --- /dev/null +++ b/drivers/i2c/busses/i2c-pxa-pci.c | |||
@@ -0,0 +1,176 @@ | |||
1 | /* | ||
2 | * The CE4100's I2C device is more or less the same one as found on PXA. | ||
3 | * It does not support slave mode, the register slightly moved. This PCI | ||
4 | * device provides three bars, every contains a single I2C controller. | ||
5 | */ | ||
6 | #include <linux/pci.h> | ||
7 | #include <linux/platform_device.h> | ||
8 | #include <linux/i2c/pxa-i2c.h> | ||
9 | #include <linux/of.h> | ||
10 | #include <linux/of_device.h> | ||
11 | #include <linux/of_address.h> | ||
12 | |||
13 | #define CE4100_PCI_I2C_DEVS 3 | ||
14 | |||
15 | struct ce4100_devices { | ||
16 | struct platform_device *pdev[CE4100_PCI_I2C_DEVS]; | ||
17 | }; | ||
18 | |||
19 | static struct platform_device *add_i2c_device(struct pci_dev *dev, int bar) | ||
20 | { | ||
21 | struct platform_device *pdev; | ||
22 | struct i2c_pxa_platform_data pdata; | ||
23 | struct resource res[2]; | ||
24 | struct device_node *child; | ||
25 | static int devnum; | ||
26 | int ret; | ||
27 | |||
28 | memset(&pdata, 0, sizeof(struct i2c_pxa_platform_data)); | ||
29 | memset(&res, 0, sizeof(res)); | ||
30 | |||
31 | res[0].flags = IORESOURCE_MEM; | ||
32 | res[0].start = pci_resource_start(dev, bar); | ||
33 | res[0].end = pci_resource_end(dev, bar); | ||
34 | |||
35 | res[1].flags = IORESOURCE_IRQ; | ||
36 | res[1].start = dev->irq; | ||
37 | res[1].end = dev->irq; | ||
38 | |||
39 | for_each_child_of_node(dev->dev.of_node, child) { | ||
40 | const void *prop; | ||
41 | struct resource r; | ||
42 | int ret; | ||
43 | |||
44 | ret = of_address_to_resource(child, 0, &r); | ||
45 | if (ret < 0) | ||
46 | continue; | ||
47 | if (r.start != res[0].start) | ||
48 | continue; | ||
49 | if (r.end != res[0].end) | ||
50 | continue; | ||
51 | if (r.flags != res[0].flags) | ||
52 | continue; | ||
53 | |||
54 | prop = of_get_property(child, "fast-mode", NULL); | ||
55 | if (prop) | ||
56 | pdata.fast_mode = 1; | ||
57 | |||
58 | break; | ||
59 | } | ||
60 | |||
61 | if (!child) { | ||
62 | dev_err(&dev->dev, "failed to match a DT node for bar %d.\n", | ||
63 | bar); | ||
64 | ret = -EINVAL; | ||
65 | goto out; | ||
66 | } | ||
67 | |||
68 | pdev = platform_device_alloc("ce4100-i2c", devnum); | ||
69 | if (!pdev) { | ||
70 | of_node_put(child); | ||
71 | ret = -ENOMEM; | ||
72 | goto out; | ||
73 | } | ||
74 | pdev->dev.parent = &dev->dev; | ||
75 | pdev->dev.of_node = child; | ||
76 | |||
77 | ret = platform_device_add_resources(pdev, res, ARRAY_SIZE(res)); | ||
78 | if (ret) | ||
79 | goto err; | ||
80 | |||
81 | ret = platform_device_add_data(pdev, &pdata, sizeof(pdata)); | ||
82 | if (ret) | ||
83 | goto err; | ||
84 | |||
85 | ret = platform_device_add(pdev); | ||
86 | if (ret) | ||
87 | goto err; | ||
88 | devnum++; | ||
89 | return pdev; | ||
90 | err: | ||
91 | platform_device_put(pdev); | ||
92 | out: | ||
93 | return ERR_PTR(ret); | ||
94 | } | ||
95 | |||
96 | static int __devinit ce4100_i2c_probe(struct pci_dev *dev, | ||
97 | const struct pci_device_id *ent) | ||
98 | { | ||
99 | int ret; | ||
100 | int i; | ||
101 | struct ce4100_devices *sds; | ||
102 | |||
103 | ret = pci_enable_device_mem(dev); | ||
104 | if (ret) | ||
105 | return ret; | ||
106 | |||
107 | if (!dev->dev.of_node) { | ||
108 | dev_err(&dev->dev, "Missing device tree node.\n"); | ||
109 | return -EINVAL; | ||
110 | } | ||
111 | sds = kzalloc(sizeof(*sds), GFP_KERNEL); | ||
112 | if (!sds) | ||
113 | goto err_mem; | ||
114 | |||
115 | for (i = 0; i < ARRAY_SIZE(sds->pdev); i++) { | ||
116 | sds->pdev[i] = add_i2c_device(dev, i); | ||
117 | if (IS_ERR(sds->pdev[i])) { | ||
118 | while (--i >= 0) | ||
119 | platform_device_unregister(sds->pdev[i]); | ||
120 | goto err_dev_add; | ||
121 | } | ||
122 | } | ||
123 | pci_set_drvdata(dev, sds); | ||
124 | return 0; | ||
125 | |||
126 | err_dev_add: | ||
127 | pci_set_drvdata(dev, NULL); | ||
128 | kfree(sds); | ||
129 | err_mem: | ||
130 | pci_disable_device(dev); | ||
131 | return ret; | ||
132 | } | ||
133 | |||
134 | static void __devexit ce4100_i2c_remove(struct pci_dev *dev) | ||
135 | { | ||
136 | struct ce4100_devices *sds; | ||
137 | unsigned int i; | ||
138 | |||
139 | sds = pci_get_drvdata(dev); | ||
140 | pci_set_drvdata(dev, NULL); | ||
141 | |||
142 | for (i = 0; i < ARRAY_SIZE(sds->pdev); i++) | ||
143 | platform_device_unregister(sds->pdev[i]); | ||
144 | |||
145 | pci_disable_device(dev); | ||
146 | kfree(sds); | ||
147 | } | ||
148 | |||
149 | static struct pci_device_id ce4100_i2c_devices[] __devinitdata = { | ||
150 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x2e68)}, | ||
151 | { }, | ||
152 | }; | ||
153 | MODULE_DEVICE_TABLE(pci, ce4100_i2c_devices); | ||
154 | |||
155 | static struct pci_driver ce4100_i2c_driver = { | ||
156 | .name = "ce4100_i2c", | ||
157 | .id_table = ce4100_i2c_devices, | ||
158 | .probe = ce4100_i2c_probe, | ||
159 | .remove = __devexit_p(ce4100_i2c_remove), | ||
160 | }; | ||
161 | |||
162 | static int __init ce4100_i2c_init(void) | ||
163 | { | ||
164 | return pci_register_driver(&ce4100_i2c_driver); | ||
165 | } | ||
166 | module_init(ce4100_i2c_init); | ||
167 | |||
168 | static void __exit ce4100_i2c_exit(void) | ||
169 | { | ||
170 | pci_unregister_driver(&ce4100_i2c_driver); | ||
171 | } | ||
172 | module_exit(ce4100_i2c_exit); | ||
173 | |||
174 | MODULE_DESCRIPTION("CE4100 PCI-I2C glue code for PXA's driver"); | ||
175 | MODULE_LICENSE("GPL v2"); | ||
176 | MODULE_AUTHOR("Sebastian Andrzej Siewior <bigeasy@linutronix.de>"); | ||
diff --git a/drivers/i2c/busses/i2c-pxa.c b/drivers/i2c/busses/i2c-pxa.c index f4c19a97e0b3..b914184748c9 100644 --- a/drivers/i2c/busses/i2c-pxa.c +++ b/drivers/i2c/busses/i2c-pxa.c | |||
@@ -29,38 +29,75 @@ | |||
29 | #include <linux/errno.h> | 29 | #include <linux/errno.h> |
30 | #include <linux/interrupt.h> | 30 | #include <linux/interrupt.h> |
31 | #include <linux/i2c-pxa.h> | 31 | #include <linux/i2c-pxa.h> |
32 | #include <linux/of_i2c.h> | ||
32 | #include <linux/platform_device.h> | 33 | #include <linux/platform_device.h> |
33 | #include <linux/err.h> | 34 | #include <linux/err.h> |
34 | #include <linux/clk.h> | 35 | #include <linux/clk.h> |
35 | #include <linux/slab.h> | 36 | #include <linux/slab.h> |
36 | #include <linux/io.h> | 37 | #include <linux/io.h> |
38 | #include <linux/i2c/pxa-i2c.h> | ||
37 | 39 | ||
38 | #include <asm/irq.h> | 40 | #include <asm/irq.h> |
39 | #include <plat/i2c.h> | 41 | |
42 | #ifndef CONFIG_HAVE_CLK | ||
43 | #define clk_get(dev, id) NULL | ||
44 | #define clk_put(clk) do { } while (0) | ||
45 | #define clk_disable(clk) do { } while (0) | ||
46 | #define clk_enable(clk) do { } while (0) | ||
47 | #endif | ||
48 | |||
49 | struct pxa_reg_layout { | ||
50 | u32 ibmr; | ||
51 | u32 idbr; | ||
52 | u32 icr; | ||
53 | u32 isr; | ||
54 | u32 isar; | ||
55 | }; | ||
56 | |||
57 | enum pxa_i2c_types { | ||
58 | REGS_PXA2XX, | ||
59 | REGS_PXA3XX, | ||
60 | REGS_CE4100, | ||
61 | }; | ||
40 | 62 | ||
41 | /* | 63 | /* |
42 | * I2C register offsets will be shifted 0 or 1 bit left, depending on | 64 | * I2C registers definitions |
43 | * different SoCs | ||
44 | */ | 65 | */ |
45 | #define REG_SHIFT_0 (0 << 0) | 66 | static struct pxa_reg_layout pxa_reg_layout[] = { |
46 | #define REG_SHIFT_1 (1 << 0) | 67 | [REGS_PXA2XX] = { |
47 | #define REG_SHIFT(d) ((d) & 0x1) | 68 | .ibmr = 0x00, |
69 | .idbr = 0x08, | ||
70 | .icr = 0x10, | ||
71 | .isr = 0x18, | ||
72 | .isar = 0x20, | ||
73 | }, | ||
74 | [REGS_PXA3XX] = { | ||
75 | .ibmr = 0x00, | ||
76 | .idbr = 0x04, | ||
77 | .icr = 0x08, | ||
78 | .isr = 0x0c, | ||
79 | .isar = 0x10, | ||
80 | }, | ||
81 | [REGS_CE4100] = { | ||
82 | .ibmr = 0x14, | ||
83 | .idbr = 0x0c, | ||
84 | .icr = 0x00, | ||
85 | .isr = 0x04, | ||
86 | /* no isar register */ | ||
87 | }, | ||
88 | }; | ||
48 | 89 | ||
49 | static const struct platform_device_id i2c_pxa_id_table[] = { | 90 | static const struct platform_device_id i2c_pxa_id_table[] = { |
50 | { "pxa2xx-i2c", REG_SHIFT_1 }, | 91 | { "pxa2xx-i2c", REGS_PXA2XX }, |
51 | { "pxa3xx-pwri2c", REG_SHIFT_0 }, | 92 | { "pxa3xx-pwri2c", REGS_PXA3XX }, |
93 | { "ce4100-i2c", REGS_CE4100 }, | ||
52 | { }, | 94 | { }, |
53 | }; | 95 | }; |
54 | MODULE_DEVICE_TABLE(platform, i2c_pxa_id_table); | 96 | MODULE_DEVICE_TABLE(platform, i2c_pxa_id_table); |
55 | 97 | ||
56 | /* | 98 | /* |
57 | * I2C registers and bit definitions | 99 | * I2C bit definitions |
58 | */ | 100 | */ |
59 | #define IBMR (0x00) | ||
60 | #define IDBR (0x08) | ||
61 | #define ICR (0x10) | ||
62 | #define ISR (0x18) | ||
63 | #define ISAR (0x20) | ||
64 | 101 | ||
65 | #define ICR_START (1 << 0) /* start bit */ | 102 | #define ICR_START (1 << 0) /* start bit */ |
66 | #define ICR_STOP (1 << 1) /* stop bit */ | 103 | #define ICR_STOP (1 << 1) /* stop bit */ |
@@ -111,7 +148,11 @@ struct pxa_i2c { | |||
111 | u32 icrlog[32]; | 148 | u32 icrlog[32]; |
112 | 149 | ||
113 | void __iomem *reg_base; | 150 | void __iomem *reg_base; |
114 | unsigned int reg_shift; | 151 | void __iomem *reg_ibmr; |
152 | void __iomem *reg_idbr; | ||
153 | void __iomem *reg_icr; | ||
154 | void __iomem *reg_isr; | ||
155 | void __iomem *reg_isar; | ||
115 | 156 | ||
116 | unsigned long iobase; | 157 | unsigned long iobase; |
117 | unsigned long iosize; | 158 | unsigned long iosize; |
@@ -121,11 +162,11 @@ struct pxa_i2c { | |||
121 | unsigned int fast_mode :1; | 162 | unsigned int fast_mode :1; |
122 | }; | 163 | }; |
123 | 164 | ||
124 | #define _IBMR(i2c) ((i2c)->reg_base + (0x0 << (i2c)->reg_shift)) | 165 | #define _IBMR(i2c) ((i2c)->reg_ibmr) |
125 | #define _IDBR(i2c) ((i2c)->reg_base + (0x4 << (i2c)->reg_shift)) | 166 | #define _IDBR(i2c) ((i2c)->reg_idbr) |
126 | #define _ICR(i2c) ((i2c)->reg_base + (0x8 << (i2c)->reg_shift)) | 167 | #define _ICR(i2c) ((i2c)->reg_icr) |
127 | #define _ISR(i2c) ((i2c)->reg_base + (0xc << (i2c)->reg_shift)) | 168 | #define _ISR(i2c) ((i2c)->reg_isr) |
128 | #define _ISAR(i2c) ((i2c)->reg_base + (0x10 << (i2c)->reg_shift)) | 169 | #define _ISAR(i2c) ((i2c)->reg_isar) |
129 | 170 | ||
130 | /* | 171 | /* |
131 | * I2C Slave mode address | 172 | * I2C Slave mode address |
@@ -418,7 +459,8 @@ static void i2c_pxa_reset(struct pxa_i2c *i2c) | |||
418 | writel(I2C_ISR_INIT, _ISR(i2c)); | 459 | writel(I2C_ISR_INIT, _ISR(i2c)); |
419 | writel(readl(_ICR(i2c)) & ~ICR_UR, _ICR(i2c)); | 460 | writel(readl(_ICR(i2c)) & ~ICR_UR, _ICR(i2c)); |
420 | 461 | ||
421 | writel(i2c->slave_addr, _ISAR(i2c)); | 462 | if (i2c->reg_isar) |
463 | writel(i2c->slave_addr, _ISAR(i2c)); | ||
422 | 464 | ||
423 | /* set control register values */ | 465 | /* set control register values */ |
424 | writel(I2C_ICR_INIT | (i2c->fast_mode ? ICR_FM : 0), _ICR(i2c)); | 466 | writel(I2C_ICR_INIT | (i2c->fast_mode ? ICR_FM : 0), _ICR(i2c)); |
@@ -729,8 +771,10 @@ static int i2c_pxa_do_xfer(struct pxa_i2c *i2c, struct i2c_msg *msg, int num) | |||
729 | */ | 771 | */ |
730 | ret = i2c->msg_idx; | 772 | ret = i2c->msg_idx; |
731 | 773 | ||
732 | if (timeout == 0) | 774 | if (!timeout && i2c->msg_num) { |
733 | i2c_pxa_scream_blue_murder(i2c, "timeout"); | 775 | i2c_pxa_scream_blue_murder(i2c, "timeout"); |
776 | ret = I2C_RETRY; | ||
777 | } | ||
734 | 778 | ||
735 | out: | 779 | out: |
736 | return ret; | 780 | return ret; |
@@ -915,11 +959,17 @@ static void i2c_pxa_irq_rxfull(struct pxa_i2c *i2c, u32 isr) | |||
915 | writel(icr, _ICR(i2c)); | 959 | writel(icr, _ICR(i2c)); |
916 | } | 960 | } |
917 | 961 | ||
962 | #define VALID_INT_SOURCE (ISR_SSD | ISR_ALD | ISR_ITE | ISR_IRF | \ | ||
963 | ISR_SAD | ISR_BED) | ||
918 | static irqreturn_t i2c_pxa_handler(int this_irq, void *dev_id) | 964 | static irqreturn_t i2c_pxa_handler(int this_irq, void *dev_id) |
919 | { | 965 | { |
920 | struct pxa_i2c *i2c = dev_id; | 966 | struct pxa_i2c *i2c = dev_id; |
921 | u32 isr = readl(_ISR(i2c)); | 967 | u32 isr = readl(_ISR(i2c)); |
922 | 968 | ||
969 | isr &= VALID_INT_SOURCE; | ||
970 | if (!isr) | ||
971 | return IRQ_NONE; | ||
972 | |||
923 | if (i2c_debug > 2 && 0) { | 973 | if (i2c_debug > 2 && 0) { |
924 | dev_dbg(&i2c->adap.dev, "%s: ISR=%08x, ICR=%08x, IBMR=%02x\n", | 974 | dev_dbg(&i2c->adap.dev, "%s: ISR=%08x, ICR=%08x, IBMR=%02x\n", |
925 | __func__, isr, readl(_ICR(i2c)), readl(_IBMR(i2c))); | 975 | __func__, isr, readl(_ICR(i2c)), readl(_IBMR(i2c))); |
@@ -934,7 +984,7 @@ static irqreturn_t i2c_pxa_handler(int this_irq, void *dev_id) | |||
934 | /* | 984 | /* |
935 | * Always clear all pending IRQs. | 985 | * Always clear all pending IRQs. |
936 | */ | 986 | */ |
937 | writel(isr & (ISR_SSD|ISR_ALD|ISR_ITE|ISR_IRF|ISR_SAD|ISR_BED), _ISR(i2c)); | 987 | writel(isr, _ISR(i2c)); |
938 | 988 | ||
939 | if (isr & ISR_SAD) | 989 | if (isr & ISR_SAD) |
940 | i2c_pxa_slave_start(i2c, isr); | 990 | i2c_pxa_slave_start(i2c, isr); |
@@ -1001,6 +1051,7 @@ static int i2c_pxa_probe(struct platform_device *dev) | |||
1001 | struct resource *res; | 1051 | struct resource *res; |
1002 | struct i2c_pxa_platform_data *plat = dev->dev.platform_data; | 1052 | struct i2c_pxa_platform_data *plat = dev->dev.platform_data; |
1003 | const struct platform_device_id *id = platform_get_device_id(dev); | 1053 | const struct platform_device_id *id = platform_get_device_id(dev); |
1054 | enum pxa_i2c_types i2c_type = id->driver_data; | ||
1004 | int ret; | 1055 | int ret; |
1005 | int irq; | 1056 | int irq; |
1006 | 1057 | ||
@@ -1044,7 +1095,13 @@ static int i2c_pxa_probe(struct platform_device *dev) | |||
1044 | ret = -EIO; | 1095 | ret = -EIO; |
1045 | goto eremap; | 1096 | goto eremap; |
1046 | } | 1097 | } |
1047 | i2c->reg_shift = REG_SHIFT(id->driver_data); | 1098 | |
1099 | i2c->reg_ibmr = i2c->reg_base + pxa_reg_layout[i2c_type].ibmr; | ||
1100 | i2c->reg_idbr = i2c->reg_base + pxa_reg_layout[i2c_type].idbr; | ||
1101 | i2c->reg_icr = i2c->reg_base + pxa_reg_layout[i2c_type].icr; | ||
1102 | i2c->reg_isr = i2c->reg_base + pxa_reg_layout[i2c_type].isr; | ||
1103 | if (i2c_type != REGS_CE4100) | ||
1104 | i2c->reg_isar = i2c->reg_base + pxa_reg_layout[i2c_type].isar; | ||
1048 | 1105 | ||
1049 | i2c->iobase = res->start; | 1106 | i2c->iobase = res->start; |
1050 | i2c->iosize = resource_size(res); | 1107 | i2c->iosize = resource_size(res); |
@@ -1072,7 +1129,7 @@ static int i2c_pxa_probe(struct platform_device *dev) | |||
1072 | i2c->adap.algo = &i2c_pxa_pio_algorithm; | 1129 | i2c->adap.algo = &i2c_pxa_pio_algorithm; |
1073 | } else { | 1130 | } else { |
1074 | i2c->adap.algo = &i2c_pxa_algorithm; | 1131 | i2c->adap.algo = &i2c_pxa_algorithm; |
1075 | ret = request_irq(irq, i2c_pxa_handler, IRQF_DISABLED, | 1132 | ret = request_irq(irq, i2c_pxa_handler, IRQF_SHARED, |
1076 | i2c->adap.name, i2c); | 1133 | i2c->adap.name, i2c); |
1077 | if (ret) | 1134 | if (ret) |
1078 | goto ereqirq; | 1135 | goto ereqirq; |
@@ -1082,12 +1139,19 @@ static int i2c_pxa_probe(struct platform_device *dev) | |||
1082 | 1139 | ||
1083 | i2c->adap.algo_data = i2c; | 1140 | i2c->adap.algo_data = i2c; |
1084 | i2c->adap.dev.parent = &dev->dev; | 1141 | i2c->adap.dev.parent = &dev->dev; |
1142 | #ifdef CONFIG_OF | ||
1143 | i2c->adap.dev.of_node = dev->dev.of_node; | ||
1144 | #endif | ||
1085 | 1145 | ||
1086 | ret = i2c_add_numbered_adapter(&i2c->adap); | 1146 | if (i2c_type == REGS_CE4100) |
1147 | ret = i2c_add_adapter(&i2c->adap); | ||
1148 | else | ||
1149 | ret = i2c_add_numbered_adapter(&i2c->adap); | ||
1087 | if (ret < 0) { | 1150 | if (ret < 0) { |
1088 | printk(KERN_INFO "I2C: Failed to add bus\n"); | 1151 | printk(KERN_INFO "I2C: Failed to add bus\n"); |
1089 | goto eadapt; | 1152 | goto eadapt; |
1090 | } | 1153 | } |
1154 | of_i2c_register_devices(&i2c->adap); | ||
1091 | 1155 | ||
1092 | platform_set_drvdata(dev, i2c); | 1156 | platform_set_drvdata(dev, i2c); |
1093 | 1157 | ||
diff --git a/arch/arm/plat-pxa/include/plat/i2c.h b/include/linux/i2c/pxa-i2c.h index 1a9f65e6ec0f..1a9f65e6ec0f 100644 --- a/arch/arm/plat-pxa/include/plat/i2c.h +++ b/include/linux/i2c/pxa-i2c.h | |||