diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-10-10 21:27:51 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-10-10 21:27:51 -0400 |
commit | 12250d843e8489ee00b5b7726da855e51694e792 (patch) | |
tree | 905d1577a3d91cf9906628dd65648b0006c1893f /arch/arm/mach-at91 | |
parent | da06a8d7bed2f3bfc12979384b2d1247ec4873db (diff) | |
parent | 62885f59a26195d9f6a3f8c795225dfbab62a110 (diff) |
Merge branch 'i2c-embedded/for-next' of git://git.pengutronix.de/git/wsa/linux
Pull i2c-embedded changes from Wolfram Sang:
"The changes for i2c-embedded include:
- massive rework of the omap driver
- massive rework of the at91 driver. In fact, the old driver gets
removed; I am okay with this approach since the old driver was
depending on BROKEN and its limitations made it practically
unusable, so people used bitbanging instead. But even if there are
users, there is no platform_data or module parameter which would
need to be converted. It is just another driver doing I2C
transfers, just way better. Modifications of arch/arm/at91 related
files have proper acks from the maintainer.
- new driver for R-Car I2C
- devicetree and generic_clock conversions and fixes
- usual driver fixes and changes.
The rework patches have come a long way and lots of people have been
involved in creating/testing them. Most patches have been in
linux-next at least since 3.6-rc5. A few have been added in the last
week, I have to admit.
An unexpected (but welcome :)) peak in private life is the cause for
that. The "late" patches shouldn't cause any merge conflicts and I
will have a special eye on them during the stabilization phase. This
is an exception and I want to have the patches in place properly in
time again for the next kernels."
* 'i2c-embedded/for-next' of git://git.pengutronix.de/git/wsa/linux: (44 commits)
MXS: Implement DMA support into mxs-i2c
i2c: add Renesas R-Car I2C driver
i2c: s3c2410: use clk_prepare_enable and clk_disable_unprepare
ARM: OMAP: convert I2C driver to PM QoS for MPU latency constraints
i2c: nomadik: Add Device Tree support to the Nomadik I2C driver
i2c: algo: pca: Fix chip reset function for PCA9665
i2c: mpc: Wait for STOP to hit the bus
i2c: davinci: preparation for switch to common clock framework
omap-i2c: fix incorrect log message when using a device tree
i2c: omap: sanitize exit path
i2c: omap: switch over to autosuspend API
i2c: omap: remove unnecessary pm_runtime_suspended check
i2c: omap: switch to threaded IRQ support
i2c: omap: remove redundant status read
i2c: omap: get rid of the "complete" label
i2c: omap: resize fifos before each message
i2c: omap: simplify IRQ exit path
i2c: omap: always return IRQ_HANDLED
i2c: omap: simplify errata check
i2c: omap: bus: add a receiver flag
...
Diffstat (limited to 'arch/arm/mach-at91')
-rw-r--r-- | arch/arm/mach-at91/at91rm9200.c | 1 | ||||
-rw-r--r-- | arch/arm/mach-at91/at91rm9200_devices.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-at91/at91sam9260.c | 3 | ||||
-rw-r--r-- | arch/arm/mach-at91/at91sam9260_devices.c | 8 | ||||
-rw-r--r-- | arch/arm/mach-at91/at91sam9261.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-at91/at91sam9261_devices.c | 14 | ||||
-rw-r--r-- | arch/arm/mach-at91/at91sam9263.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-at91/at91sam9263_devices.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-at91/at91sam9g45.c | 4 | ||||
-rw-r--r-- | arch/arm/mach-at91/at91sam9g45_devices.c | 10 | ||||
-rw-r--r-- | arch/arm/mach-at91/at91sam9n12.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-at91/at91sam9rl.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-at91/at91sam9rl_devices.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-at91/at91sam9x5.c | 3 | ||||
-rw-r--r-- | arch/arm/mach-at91/include/mach/at91_twi.h | 68 |
15 files changed, 41 insertions, 84 deletions
diff --git a/arch/arm/mach-at91/at91rm9200.c b/arch/arm/mach-at91/at91rm9200.c index 6f50c6722276..b4f0565aff63 100644 --- a/arch/arm/mach-at91/at91rm9200.c +++ b/arch/arm/mach-at91/at91rm9200.c | |||
@@ -187,6 +187,7 @@ static struct clk_lookup periph_clocks_lookups[] = { | |||
187 | CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc0_clk), | 187 | CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc0_clk), |
188 | CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk), | 188 | CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk), |
189 | CLKDEV_CON_DEV_ID("pclk", "ssc.2", &ssc2_clk), | 189 | CLKDEV_CON_DEV_ID("pclk", "ssc.2", &ssc2_clk), |
190 | CLKDEV_CON_DEV_ID(NULL, "i2c-at91rm9200", &twi_clk), | ||
190 | /* fake hclk clock */ | 191 | /* fake hclk clock */ |
191 | CLKDEV_CON_DEV_ID("hclk", "at91_ohci", &ohci_clk), | 192 | CLKDEV_CON_DEV_ID("hclk", "at91_ohci", &ohci_clk), |
192 | CLKDEV_CON_ID("pioA", &pioA_clk), | 193 | CLKDEV_CON_ID("pioA", &pioA_clk), |
diff --git a/arch/arm/mach-at91/at91rm9200_devices.c b/arch/arm/mach-at91/at91rm9200_devices.c index 9ac427a702da..a563189cdfc3 100644 --- a/arch/arm/mach-at91/at91rm9200_devices.c +++ b/arch/arm/mach-at91/at91rm9200_devices.c | |||
@@ -511,7 +511,7 @@ static struct resource twi_resources[] = { | |||
511 | }; | 511 | }; |
512 | 512 | ||
513 | static struct platform_device at91rm9200_twi_device = { | 513 | static struct platform_device at91rm9200_twi_device = { |
514 | .name = "at91_i2c", | 514 | .name = "i2c-at91rm9200", |
515 | .id = -1, | 515 | .id = -1, |
516 | .resource = twi_resources, | 516 | .resource = twi_resources, |
517 | .num_resources = ARRAY_SIZE(twi_resources), | 517 | .num_resources = ARRAY_SIZE(twi_resources), |
diff --git a/arch/arm/mach-at91/at91sam9260.c b/arch/arm/mach-at91/at91sam9260.c index 30c7f26a4668..ad29f93f20ca 100644 --- a/arch/arm/mach-at91/at91sam9260.c +++ b/arch/arm/mach-at91/at91sam9260.c | |||
@@ -211,6 +211,8 @@ static struct clk_lookup periph_clocks_lookups[] = { | |||
211 | CLKDEV_CON_DEV_ID("t1_clk", "atmel_tcb.1", &tc4_clk), | 211 | CLKDEV_CON_DEV_ID("t1_clk", "atmel_tcb.1", &tc4_clk), |
212 | CLKDEV_CON_DEV_ID("t2_clk", "atmel_tcb.1", &tc5_clk), | 212 | CLKDEV_CON_DEV_ID("t2_clk", "atmel_tcb.1", &tc5_clk), |
213 | CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc_clk), | 213 | CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc_clk), |
214 | CLKDEV_CON_DEV_ID(NULL, "i2c-at91sam9260", &twi_clk), | ||
215 | CLKDEV_CON_DEV_ID(NULL, "i2c-at91sam9g20", &twi_clk), | ||
214 | /* more usart lookup table for DT entries */ | 216 | /* more usart lookup table for DT entries */ |
215 | CLKDEV_CON_DEV_ID("usart", "fffff200.serial", &mck), | 217 | CLKDEV_CON_DEV_ID("usart", "fffff200.serial", &mck), |
216 | CLKDEV_CON_DEV_ID("usart", "fffb0000.serial", &usart0_clk), | 218 | CLKDEV_CON_DEV_ID("usart", "fffb0000.serial", &usart0_clk), |
@@ -219,6 +221,7 @@ static struct clk_lookup periph_clocks_lookups[] = { | |||
219 | CLKDEV_CON_DEV_ID("usart", "fffd0000.serial", &usart3_clk), | 221 | CLKDEV_CON_DEV_ID("usart", "fffd0000.serial", &usart3_clk), |
220 | CLKDEV_CON_DEV_ID("usart", "fffd4000.serial", &usart4_clk), | 222 | CLKDEV_CON_DEV_ID("usart", "fffd4000.serial", &usart4_clk), |
221 | CLKDEV_CON_DEV_ID("usart", "fffd8000.serial", &usart5_clk), | 223 | CLKDEV_CON_DEV_ID("usart", "fffd8000.serial", &usart5_clk), |
224 | CLKDEV_CON_DEV_ID(NULL, "fffac000.i2c", &twi_clk), | ||
222 | /* more tc lookup table for DT entries */ | 225 | /* more tc lookup table for DT entries */ |
223 | CLKDEV_CON_DEV_ID("t0_clk", "fffa0000.timer", &tc0_clk), | 226 | CLKDEV_CON_DEV_ID("t0_clk", "fffa0000.timer", &tc0_clk), |
224 | CLKDEV_CON_DEV_ID("t1_clk", "fffa0000.timer", &tc1_clk), | 227 | CLKDEV_CON_DEV_ID("t1_clk", "fffa0000.timer", &tc1_clk), |
diff --git a/arch/arm/mach-at91/at91sam9260_devices.c b/arch/arm/mach-at91/at91sam9260_devices.c index af50ff3281c7..a76b8684f52d 100644 --- a/arch/arm/mach-at91/at91sam9260_devices.c +++ b/arch/arm/mach-at91/at91sam9260_devices.c | |||
@@ -421,7 +421,6 @@ static struct resource twi_resources[] = { | |||
421 | }; | 421 | }; |
422 | 422 | ||
423 | static struct platform_device at91sam9260_twi_device = { | 423 | static struct platform_device at91sam9260_twi_device = { |
424 | .name = "at91_i2c", | ||
425 | .id = -1, | 424 | .id = -1, |
426 | .resource = twi_resources, | 425 | .resource = twi_resources, |
427 | .num_resources = ARRAY_SIZE(twi_resources), | 426 | .num_resources = ARRAY_SIZE(twi_resources), |
@@ -429,6 +428,13 @@ static struct platform_device at91sam9260_twi_device = { | |||
429 | 428 | ||
430 | void __init at91_add_device_i2c(struct i2c_board_info *devices, int nr_devices) | 429 | void __init at91_add_device_i2c(struct i2c_board_info *devices, int nr_devices) |
431 | { | 430 | { |
431 | /* IP version is not the same on 9260 and g20 */ | ||
432 | if (cpu_is_at91sam9g20()) { | ||
433 | at91sam9260_twi_device.name = "i2c-at91sam9g20"; | ||
434 | } else { | ||
435 | at91sam9260_twi_device.name = "i2c-at91sam9260"; | ||
436 | } | ||
437 | |||
432 | /* pins used for TWI interface */ | 438 | /* pins used for TWI interface */ |
433 | at91_set_A_periph(AT91_PIN_PA23, 0); /* TWD */ | 439 | at91_set_A_periph(AT91_PIN_PA23, 0); /* TWD */ |
434 | at91_set_multi_drive(AT91_PIN_PA23, 1); | 440 | at91_set_multi_drive(AT91_PIN_PA23, 1); |
diff --git a/arch/arm/mach-at91/at91sam9261.c b/arch/arm/mach-at91/at91sam9261.c index f40762c5fede..8d999eb1a137 100644 --- a/arch/arm/mach-at91/at91sam9261.c +++ b/arch/arm/mach-at91/at91sam9261.c | |||
@@ -178,6 +178,8 @@ static struct clk_lookup periph_clocks_lookups[] = { | |||
178 | CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk), | 178 | CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk), |
179 | CLKDEV_CON_DEV_ID("pclk", "ssc.2", &ssc2_clk), | 179 | CLKDEV_CON_DEV_ID("pclk", "ssc.2", &ssc2_clk), |
180 | CLKDEV_CON_DEV_ID("hclk", "at91_ohci", &hck0), | 180 | CLKDEV_CON_DEV_ID("hclk", "at91_ohci", &hck0), |
181 | CLKDEV_CON_DEV_ID(NULL, "i2c-at91sam9261", &twi_clk), | ||
182 | CLKDEV_CON_DEV_ID(NULL, "i2c-at91sam9g10", &twi_clk), | ||
181 | CLKDEV_CON_ID("pioA", &pioA_clk), | 183 | CLKDEV_CON_ID("pioA", &pioA_clk), |
182 | CLKDEV_CON_ID("pioB", &pioB_clk), | 184 | CLKDEV_CON_ID("pioB", &pioB_clk), |
183 | CLKDEV_CON_ID("pioC", &pioC_clk), | 185 | CLKDEV_CON_ID("pioC", &pioC_clk), |
diff --git a/arch/arm/mach-at91/at91sam9261_devices.c b/arch/arm/mach-at91/at91sam9261_devices.c index 11e9fa835cde..9752f17efba9 100644 --- a/arch/arm/mach-at91/at91sam9261_devices.c +++ b/arch/arm/mach-at91/at91sam9261_devices.c | |||
@@ -317,7 +317,6 @@ static struct resource twi_resources[] = { | |||
317 | }; | 317 | }; |
318 | 318 | ||
319 | static struct platform_device at91sam9261_twi_device = { | 319 | static struct platform_device at91sam9261_twi_device = { |
320 | .name = "at91_i2c", | ||
321 | .id = -1, | 320 | .id = -1, |
322 | .resource = twi_resources, | 321 | .resource = twi_resources, |
323 | .num_resources = ARRAY_SIZE(twi_resources), | 322 | .num_resources = ARRAY_SIZE(twi_resources), |
@@ -325,12 +324,19 @@ static struct platform_device at91sam9261_twi_device = { | |||
325 | 324 | ||
326 | void __init at91_add_device_i2c(struct i2c_board_info *devices, int nr_devices) | 325 | void __init at91_add_device_i2c(struct i2c_board_info *devices, int nr_devices) |
327 | { | 326 | { |
327 | /* IP version is not the same on 9261 and g10 */ | ||
328 | if (cpu_is_at91sam9g10()) { | ||
329 | at91sam9261_twi_device.name = "i2c-at91sam9g10"; | ||
330 | /* I2C PIO must not be configured as open-drain on this chip */ | ||
331 | } else { | ||
332 | at91sam9261_twi_device.name = "i2c-at91sam9261"; | ||
333 | at91_set_multi_drive(AT91_PIN_PA7, 1); | ||
334 | at91_set_multi_drive(AT91_PIN_PA8, 1); | ||
335 | } | ||
336 | |||
328 | /* pins used for TWI interface */ | 337 | /* pins used for TWI interface */ |
329 | at91_set_A_periph(AT91_PIN_PA7, 0); /* TWD */ | 338 | at91_set_A_periph(AT91_PIN_PA7, 0); /* TWD */ |
330 | at91_set_multi_drive(AT91_PIN_PA7, 1); | ||
331 | |||
332 | at91_set_A_periph(AT91_PIN_PA8, 0); /* TWCK */ | 339 | at91_set_A_periph(AT91_PIN_PA8, 0); /* TWCK */ |
333 | at91_set_multi_drive(AT91_PIN_PA8, 1); | ||
334 | 340 | ||
335 | i2c_register_board_info(0, devices, nr_devices); | 341 | i2c_register_board_info(0, devices, nr_devices); |
336 | platform_device_register(&at91sam9261_twi_device); | 342 | platform_device_register(&at91sam9261_twi_device); |
diff --git a/arch/arm/mach-at91/at91sam9263.c b/arch/arm/mach-at91/at91sam9263.c index 144ef5de51b6..6a01d0360dfb 100644 --- a/arch/arm/mach-at91/at91sam9263.c +++ b/arch/arm/mach-at91/at91sam9263.c | |||
@@ -193,6 +193,7 @@ static struct clk_lookup periph_clocks_lookups[] = { | |||
193 | CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.0", &spi0_clk), | 193 | CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.0", &spi0_clk), |
194 | CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.1", &spi1_clk), | 194 | CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.1", &spi1_clk), |
195 | CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.0", &tcb_clk), | 195 | CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.0", &tcb_clk), |
196 | CLKDEV_CON_DEV_ID(NULL, "i2c-at91sam9260", &twi_clk), | ||
196 | /* fake hclk clock */ | 197 | /* fake hclk clock */ |
197 | CLKDEV_CON_DEV_ID("hclk", "at91_ohci", &ohci_clk), | 198 | CLKDEV_CON_DEV_ID("hclk", "at91_ohci", &ohci_clk), |
198 | CLKDEV_CON_ID("pioA", &pioA_clk), | 199 | CLKDEV_CON_ID("pioA", &pioA_clk), |
@@ -210,6 +211,7 @@ static struct clk_lookup periph_clocks_lookups[] = { | |||
210 | CLKDEV_CON_DEV_ID("hclk", "a00000.ohci", &ohci_clk), | 211 | CLKDEV_CON_DEV_ID("hclk", "a00000.ohci", &ohci_clk), |
211 | CLKDEV_CON_DEV_ID("spi_clk", "fffa4000.spi", &spi0_clk), | 212 | CLKDEV_CON_DEV_ID("spi_clk", "fffa4000.spi", &spi0_clk), |
212 | CLKDEV_CON_DEV_ID("spi_clk", "fffa8000.spi", &spi1_clk), | 213 | CLKDEV_CON_DEV_ID("spi_clk", "fffa8000.spi", &spi1_clk), |
214 | CLKDEV_CON_DEV_ID(NULL, "fff88000.i2c", &twi_clk), | ||
213 | }; | 215 | }; |
214 | 216 | ||
215 | static struct clk_lookup usart_clocks_lookups[] = { | 217 | static struct clk_lookup usart_clocks_lookups[] = { |
diff --git a/arch/arm/mach-at91/at91sam9263_devices.c b/arch/arm/mach-at91/at91sam9263_devices.c index 7c0898fe20fa..8dde220b42b6 100644 --- a/arch/arm/mach-at91/at91sam9263_devices.c +++ b/arch/arm/mach-at91/at91sam9263_devices.c | |||
@@ -599,7 +599,7 @@ static struct resource twi_resources[] = { | |||
599 | }; | 599 | }; |
600 | 600 | ||
601 | static struct platform_device at91sam9263_twi_device = { | 601 | static struct platform_device at91sam9263_twi_device = { |
602 | .name = "at91_i2c", | 602 | .name = "i2c-at91sam9260", |
603 | .id = -1, | 603 | .id = -1, |
604 | .resource = twi_resources, | 604 | .resource = twi_resources, |
605 | .num_resources = ARRAY_SIZE(twi_resources), | 605 | .num_resources = ARRAY_SIZE(twi_resources), |
diff --git a/arch/arm/mach-at91/at91sam9g45.c b/arch/arm/mach-at91/at91sam9g45.c index ef6cedd52e3c..84af1b506d92 100644 --- a/arch/arm/mach-at91/at91sam9g45.c +++ b/arch/arm/mach-at91/at91sam9g45.c | |||
@@ -237,6 +237,8 @@ static struct clk_lookup periph_clocks_lookups[] = { | |||
237 | CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.1", &spi1_clk), | 237 | CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.1", &spi1_clk), |
238 | CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.0", &tcb0_clk), | 238 | CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.0", &tcb0_clk), |
239 | CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.1", &tcb0_clk), | 239 | CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.1", &tcb0_clk), |
240 | CLKDEV_CON_DEV_ID(NULL, "i2c-at91sam9g10.0", &twi0_clk), | ||
241 | CLKDEV_CON_DEV_ID(NULL, "i2c-at91sam9g10.1", &twi1_clk), | ||
240 | CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc0_clk), | 242 | CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc0_clk), |
241 | CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk), | 243 | CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk), |
242 | CLKDEV_CON_DEV_ID(NULL, "atmel-trng", &trng_clk), | 244 | CLKDEV_CON_DEV_ID(NULL, "atmel-trng", &trng_clk), |
@@ -254,6 +256,8 @@ static struct clk_lookup periph_clocks_lookups[] = { | |||
254 | CLKDEV_CON_DEV_ID("t0_clk", "fffd4000.timer", &tcb0_clk), | 256 | CLKDEV_CON_DEV_ID("t0_clk", "fffd4000.timer", &tcb0_clk), |
255 | CLKDEV_CON_DEV_ID("hclk", "700000.ohci", &uhphs_clk), | 257 | CLKDEV_CON_DEV_ID("hclk", "700000.ohci", &uhphs_clk), |
256 | CLKDEV_CON_DEV_ID("ehci_clk", "800000.ehci", &uhphs_clk), | 258 | CLKDEV_CON_DEV_ID("ehci_clk", "800000.ehci", &uhphs_clk), |
259 | CLKDEV_CON_DEV_ID(NULL, "fff84000.i2c", &twi0_clk), | ||
260 | CLKDEV_CON_DEV_ID(NULL, "fff88000.i2c", &twi1_clk), | ||
257 | /* fake hclk clock */ | 261 | /* fake hclk clock */ |
258 | CLKDEV_CON_DEV_ID("hclk", "at91_ohci", &uhphs_clk), | 262 | CLKDEV_CON_DEV_ID("hclk", "at91_ohci", &uhphs_clk), |
259 | CLKDEV_CON_ID("pioA", &pioA_clk), | 263 | CLKDEV_CON_ID("pioA", &pioA_clk), |
diff --git a/arch/arm/mach-at91/at91sam9g45_devices.c b/arch/arm/mach-at91/at91sam9g45_devices.c index e4c3b3709204..b1596072dcc2 100644 --- a/arch/arm/mach-at91/at91sam9g45_devices.c +++ b/arch/arm/mach-at91/at91sam9g45_devices.c | |||
@@ -653,7 +653,7 @@ static struct resource twi0_resources[] = { | |||
653 | }; | 653 | }; |
654 | 654 | ||
655 | static struct platform_device at91sam9g45_twi0_device = { | 655 | static struct platform_device at91sam9g45_twi0_device = { |
656 | .name = "at91_i2c", | 656 | .name = "i2c-at91sam9g10", |
657 | .id = 0, | 657 | .id = 0, |
658 | .resource = twi0_resources, | 658 | .resource = twi0_resources, |
659 | .num_resources = ARRAY_SIZE(twi0_resources), | 659 | .num_resources = ARRAY_SIZE(twi0_resources), |
@@ -673,7 +673,7 @@ static struct resource twi1_resources[] = { | |||
673 | }; | 673 | }; |
674 | 674 | ||
675 | static struct platform_device at91sam9g45_twi1_device = { | 675 | static struct platform_device at91sam9g45_twi1_device = { |
676 | .name = "at91_i2c", | 676 | .name = "i2c-at91sam9g10", |
677 | .id = 1, | 677 | .id = 1, |
678 | .resource = twi1_resources, | 678 | .resource = twi1_resources, |
679 | .num_resources = ARRAY_SIZE(twi1_resources), | 679 | .num_resources = ARRAY_SIZE(twi1_resources), |
@@ -686,18 +686,12 @@ void __init at91_add_device_i2c(short i2c_id, struct i2c_board_info *devices, in | |||
686 | /* pins used for TWI interface */ | 686 | /* pins used for TWI interface */ |
687 | if (i2c_id == 0) { | 687 | if (i2c_id == 0) { |
688 | at91_set_A_periph(AT91_PIN_PA20, 0); /* TWD */ | 688 | at91_set_A_periph(AT91_PIN_PA20, 0); /* TWD */ |
689 | at91_set_multi_drive(AT91_PIN_PA20, 1); | ||
690 | |||
691 | at91_set_A_periph(AT91_PIN_PA21, 0); /* TWCK */ | 689 | at91_set_A_periph(AT91_PIN_PA21, 0); /* TWCK */ |
692 | at91_set_multi_drive(AT91_PIN_PA21, 1); | ||
693 | 690 | ||
694 | platform_device_register(&at91sam9g45_twi0_device); | 691 | platform_device_register(&at91sam9g45_twi0_device); |
695 | } else { | 692 | } else { |
696 | at91_set_A_periph(AT91_PIN_PB10, 0); /* TWD */ | 693 | at91_set_A_periph(AT91_PIN_PB10, 0); /* TWD */ |
697 | at91_set_multi_drive(AT91_PIN_PB10, 1); | ||
698 | |||
699 | at91_set_A_periph(AT91_PIN_PB11, 0); /* TWCK */ | 694 | at91_set_A_periph(AT91_PIN_PB11, 0); /* TWCK */ |
700 | at91_set_multi_drive(AT91_PIN_PB11, 1); | ||
701 | 695 | ||
702 | platform_device_register(&at91sam9g45_twi1_device); | 696 | platform_device_register(&at91sam9g45_twi1_device); |
703 | } | 697 | } |
diff --git a/arch/arm/mach-at91/at91sam9n12.c b/arch/arm/mach-at91/at91sam9n12.c index 08494664ab78..732d3d3f4ec5 100644 --- a/arch/arm/mach-at91/at91sam9n12.c +++ b/arch/arm/mach-at91/at91sam9n12.c | |||
@@ -169,6 +169,8 @@ static struct clk_lookup periph_clocks_lookups[] = { | |||
169 | CLKDEV_CON_DEV_ID("t0_clk", "f8008000.timer", &tcb_clk), | 169 | CLKDEV_CON_DEV_ID("t0_clk", "f8008000.timer", &tcb_clk), |
170 | CLKDEV_CON_DEV_ID("t0_clk", "f800c000.timer", &tcb_clk), | 170 | CLKDEV_CON_DEV_ID("t0_clk", "f800c000.timer", &tcb_clk), |
171 | CLKDEV_CON_DEV_ID("dma_clk", "ffffec00.dma-controller", &dma_clk), | 171 | CLKDEV_CON_DEV_ID("dma_clk", "ffffec00.dma-controller", &dma_clk), |
172 | CLKDEV_CON_DEV_ID(NULL, "f8010000.i2c", &twi0_clk), | ||
173 | CLKDEV_CON_DEV_ID(NULL, "f8014000.i2c", &twi1_clk), | ||
172 | CLKDEV_CON_ID("pioA", &pioAB_clk), | 174 | CLKDEV_CON_ID("pioA", &pioAB_clk), |
173 | CLKDEV_CON_ID("pioB", &pioAB_clk), | 175 | CLKDEV_CON_ID("pioB", &pioAB_clk), |
174 | CLKDEV_CON_ID("pioC", &pioCD_clk), | 176 | CLKDEV_CON_ID("pioC", &pioCD_clk), |
diff --git a/arch/arm/mach-at91/at91sam9rl.c b/arch/arm/mach-at91/at91sam9rl.c index 72ce50a50de5..72e908412222 100644 --- a/arch/arm/mach-at91/at91sam9rl.c +++ b/arch/arm/mach-at91/at91sam9rl.c | |||
@@ -186,6 +186,8 @@ static struct clk_lookup periph_clocks_lookups[] = { | |||
186 | CLKDEV_CON_DEV_ID("t2_clk", "atmel_tcb.0", &tc2_clk), | 186 | CLKDEV_CON_DEV_ID("t2_clk", "atmel_tcb.0", &tc2_clk), |
187 | CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc0_clk), | 187 | CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc0_clk), |
188 | CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk), | 188 | CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk), |
189 | CLKDEV_CON_DEV_ID(NULL, "i2c-at91sam9g20.0", &twi0_clk), | ||
190 | CLKDEV_CON_DEV_ID(NULL, "i2c-at91sam9g20.1", &twi1_clk), | ||
189 | CLKDEV_CON_ID("pioA", &pioA_clk), | 191 | CLKDEV_CON_ID("pioA", &pioA_clk), |
190 | CLKDEV_CON_ID("pioB", &pioB_clk), | 192 | CLKDEV_CON_ID("pioB", &pioB_clk), |
191 | CLKDEV_CON_ID("pioC", &pioC_clk), | 193 | CLKDEV_CON_ID("pioC", &pioC_clk), |
diff --git a/arch/arm/mach-at91/at91sam9rl_devices.c b/arch/arm/mach-at91/at91sam9rl_devices.c index deafea0e493d..d6ca0543ce8d 100644 --- a/arch/arm/mach-at91/at91sam9rl_devices.c +++ b/arch/arm/mach-at91/at91sam9rl_devices.c | |||
@@ -346,7 +346,7 @@ static struct resource twi_resources[] = { | |||
346 | }; | 346 | }; |
347 | 347 | ||
348 | static struct platform_device at91sam9rl_twi_device = { | 348 | static struct platform_device at91sam9rl_twi_device = { |
349 | .name = "at91_i2c", | 349 | .name = "i2c-at91sam9g20", |
350 | .id = -1, | 350 | .id = -1, |
351 | .resource = twi_resources, | 351 | .resource = twi_resources, |
352 | .num_resources = ARRAY_SIZE(twi_resources), | 352 | .num_resources = ARRAY_SIZE(twi_resources), |
diff --git a/arch/arm/mach-at91/at91sam9x5.c b/arch/arm/mach-at91/at91sam9x5.c index 477cf9d06672..e5035380dcbc 100644 --- a/arch/arm/mach-at91/at91sam9x5.c +++ b/arch/arm/mach-at91/at91sam9x5.c | |||
@@ -231,6 +231,9 @@ static struct clk_lookup periph_clocks_lookups[] = { | |||
231 | CLKDEV_CON_DEV_ID("t0_clk", "f800c000.timer", &tcb0_clk), | 231 | CLKDEV_CON_DEV_ID("t0_clk", "f800c000.timer", &tcb0_clk), |
232 | CLKDEV_CON_DEV_ID("dma_clk", "ffffec00.dma-controller", &dma0_clk), | 232 | CLKDEV_CON_DEV_ID("dma_clk", "ffffec00.dma-controller", &dma0_clk), |
233 | CLKDEV_CON_DEV_ID("dma_clk", "ffffee00.dma-controller", &dma1_clk), | 233 | CLKDEV_CON_DEV_ID("dma_clk", "ffffee00.dma-controller", &dma1_clk), |
234 | CLKDEV_CON_DEV_ID(NULL, "f8010000.i2c", &twi0_clk), | ||
235 | CLKDEV_CON_DEV_ID(NULL, "f8014000.i2c", &twi1_clk), | ||
236 | CLKDEV_CON_DEV_ID(NULL, "f8018000.i2c", &twi2_clk), | ||
234 | CLKDEV_CON_ID("pioA", &pioAB_clk), | 237 | CLKDEV_CON_ID("pioA", &pioAB_clk), |
235 | CLKDEV_CON_ID("pioB", &pioAB_clk), | 238 | CLKDEV_CON_ID("pioB", &pioAB_clk), |
236 | CLKDEV_CON_ID("pioC", &pioCD_clk), | 239 | CLKDEV_CON_ID("pioC", &pioCD_clk), |
diff --git a/arch/arm/mach-at91/include/mach/at91_twi.h b/arch/arm/mach-at91/include/mach/at91_twi.h deleted file mode 100644 index bb2880f6ba37..000000000000 --- a/arch/arm/mach-at91/include/mach/at91_twi.h +++ /dev/null | |||
@@ -1,68 +0,0 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-at91/include/mach/at91_twi.h | ||
3 | * | ||
4 | * Copyright (C) 2005 Ivan Kokshaysky | ||
5 | * Copyright (C) SAN People | ||
6 | * | ||
7 | * Two-wire Interface (TWI) registers. | ||
8 | * Based on AT91RM9200 datasheet revision E. | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or modify | ||
11 | * it under the terms of the GNU General Public License as published by | ||
12 | * the Free Software Foundation; either version 2 of the License, or | ||
13 | * (at your option) any later version. | ||
14 | */ | ||
15 | |||
16 | #ifndef AT91_TWI_H | ||
17 | #define AT91_TWI_H | ||
18 | |||
19 | #define AT91_TWI_CR 0x00 /* Control Register */ | ||
20 | #define AT91_TWI_START (1 << 0) /* Send a Start Condition */ | ||
21 | #define AT91_TWI_STOP (1 << 1) /* Send a Stop Condition */ | ||
22 | #define AT91_TWI_MSEN (1 << 2) /* Master Transfer Enable */ | ||
23 | #define AT91_TWI_MSDIS (1 << 3) /* Master Transfer Disable */ | ||
24 | #define AT91_TWI_SVEN (1 << 4) /* Slave Transfer Enable [SAM9260 only] */ | ||
25 | #define AT91_TWI_SVDIS (1 << 5) /* Slave Transfer Disable [SAM9260 only] */ | ||
26 | #define AT91_TWI_SWRST (1 << 7) /* Software Reset */ | ||
27 | |||
28 | #define AT91_TWI_MMR 0x04 /* Master Mode Register */ | ||
29 | #define AT91_TWI_IADRSZ (3 << 8) /* Internal Device Address Size */ | ||
30 | #define AT91_TWI_IADRSZ_NO (0 << 8) | ||
31 | #define AT91_TWI_IADRSZ_1 (1 << 8) | ||
32 | #define AT91_TWI_IADRSZ_2 (2 << 8) | ||
33 | #define AT91_TWI_IADRSZ_3 (3 << 8) | ||
34 | #define AT91_TWI_MREAD (1 << 12) /* Master Read Direction */ | ||
35 | #define AT91_TWI_DADR (0x7f << 16) /* Device Address */ | ||
36 | |||
37 | #define AT91_TWI_SMR 0x08 /* Slave Mode Register [SAM9260 only] */ | ||
38 | #define AT91_TWI_SADR (0x7f << 16) /* Slave Address */ | ||
39 | |||
40 | #define AT91_TWI_IADR 0x0c /* Internal Address Register */ | ||
41 | |||
42 | #define AT91_TWI_CWGR 0x10 /* Clock Waveform Generator Register */ | ||
43 | #define AT91_TWI_CLDIV (0xff << 0) /* Clock Low Divisor */ | ||
44 | #define AT91_TWI_CHDIV (0xff << 8) /* Clock High Divisor */ | ||
45 | #define AT91_TWI_CKDIV (7 << 16) /* Clock Divider */ | ||
46 | |||
47 | #define AT91_TWI_SR 0x20 /* Status Register */ | ||
48 | #define AT91_TWI_TXCOMP (1 << 0) /* Transmission Complete */ | ||
49 | #define AT91_TWI_RXRDY (1 << 1) /* Receive Holding Register Ready */ | ||
50 | #define AT91_TWI_TXRDY (1 << 2) /* Transmit Holding Register Ready */ | ||
51 | #define AT91_TWI_SVREAD (1 << 3) /* Slave Read [SAM9260 only] */ | ||
52 | #define AT91_TWI_SVACC (1 << 4) /* Slave Access [SAM9260 only] */ | ||
53 | #define AT91_TWI_GACC (1 << 5) /* General Call Access [SAM9260 only] */ | ||
54 | #define AT91_TWI_OVRE (1 << 6) /* Overrun Error [AT91RM9200 only] */ | ||
55 | #define AT91_TWI_UNRE (1 << 7) /* Underrun Error [AT91RM9200 only] */ | ||
56 | #define AT91_TWI_NACK (1 << 8) /* Not Acknowledged */ | ||
57 | #define AT91_TWI_ARBLST (1 << 9) /* Arbitration Lost [SAM9260 only] */ | ||
58 | #define AT91_TWI_SCLWS (1 << 10) /* Clock Wait State [SAM9260 only] */ | ||
59 | #define AT91_TWI_EOSACC (1 << 11) /* End of Slave Address [SAM9260 only] */ | ||
60 | |||
61 | #define AT91_TWI_IER 0x24 /* Interrupt Enable Register */ | ||
62 | #define AT91_TWI_IDR 0x28 /* Interrupt Disable Register */ | ||
63 | #define AT91_TWI_IMR 0x2c /* Interrupt Mask Register */ | ||
64 | #define AT91_TWI_RHR 0x30 /* Receive Holding Register */ | ||
65 | #define AT91_TWI_THR 0x34 /* Transmit Holding Register */ | ||
66 | |||
67 | #endif | ||
68 | |||