Skip to content
Snippets Groups Projects
Commit 12250d84 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

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
  ...
parents da06a8d7 62885f59
No related merge requests found
Showing
with 231 additions and 6 deletions
I2C for Atmel platforms
Required properties :
- compatible : Must be "atmel,at91rm9200-i2c", "atmel,at91sam9261-i2c",
"atmel,at91sam9260-i2c", "atmel,at91sam9g20-i2c", "atmel,at91sam9g10-i2c"
or "atmel,at91sam9x5-i2c"
- reg: physical base address of the controller and length of memory mapped
region.
- interrupts: interrupt number to the cpu.
- #address-cells = <1>;
- #size-cells = <0>;
Optional properties:
- Child nodes conforming to i2c bus binding
Examples :
i2c0: i2c@fff84000 {
compatible = "atmel,at91sam9g20-i2c";
reg = <0xfff84000 0x100>;
interrupts = <12 4 6>;
#address-cells = <1>;
#size-cells = <0>;
24c512@50 {
compatible = "24c512";
reg = <0x50>;
pagesize = <128>;
}
}
* Texas Instruments Davinci I2C
This file provides information, what the device node for the
davinci i2c interface contain.
Required properties:
- compatible: "ti,davinci-i2c";
- reg : Offset and length of the register set for the device
Recommended properties :
- interrupts : standard interrupt property.
- clock-frequency : desired I2C bus clock frequency in Hz.
Example (enbw_cmc board):
i2c@1c22000 {
compatible = "ti,davinci-i2c";
reg = <0x22000 0x1000>;
clock-frequency = <100000>;
interrupts = <15>;
interrupt-parent = <&intc>;
#address-cells = <1>;
#size-cells = <0>;
dtt@48 {
compatible = "national,lm75";
reg = <0x48>;
};
};
...@@ -6,6 +6,7 @@ Required properties: ...@@ -6,6 +6,7 @@ Required properties:
- interrupts: Should contain ERROR and DMA interrupts - interrupts: Should contain ERROR and DMA interrupts
- clock-frequency: Desired I2C bus clock frequency in Hz. - clock-frequency: Desired I2C bus clock frequency in Hz.
Only 100000Hz and 400000Hz modes are supported. Only 100000Hz and 400000Hz modes are supported.
- fsl,i2c-dma-channel: APBX DMA channel for the I2C
Examples: Examples:
...@@ -16,4 +17,5 @@ i2c0: i2c@80058000 { ...@@ -16,4 +17,5 @@ i2c0: i2c@80058000 {
reg = <0x80058000 2000>; reg = <0x80058000 2000>;
interrupts = <111 68>; interrupts = <111 68>;
clock-frequency = <100000>; clock-frequency = <100000>;
fsl,i2c-dma-channel = <6>;
}; };
I2C for Nomadik based systems
Required (non-standard) properties:
- Nil
Recommended (non-standard) properties:
- clock-frequency : Maximum bus clock frequency for the device
Optional (non-standard) properties:
- Nil
Example :
i2c@80004000 {
compatible = "stericsson,db8500-i2c", "st,nomadik-i2c";
reg = <0x80004000 0x1000>;
interrupts = <0 21 0x4>;
#address-cells = <1>;
#size-cells = <0>;
v-i2c-supply = <&db8500_vape_reg>;
clock-frequency = <400000>;
};
...@@ -28,6 +28,7 @@ aliases { ...@@ -28,6 +28,7 @@ aliases {
gpio2 = &pioC; gpio2 = &pioC;
tcb0 = &tcb0; tcb0 = &tcb0;
tcb1 = &tcb1; tcb1 = &tcb1;
i2c0 = &i2c0;
}; };
cpus { cpus {
cpu@0 { cpu@0 {
...@@ -202,6 +203,15 @@ usb1: gadget@fffa4000 { ...@@ -202,6 +203,15 @@ usb1: gadget@fffa4000 {
status = "disabled"; status = "disabled";
}; };
i2c0: i2c@fffac000 {
compatible = "atmel,at91sam9260-i2c";
reg = <0xfffac000 0x100>;
interrupts = <11 4 6>;
#address-cells = <1>;
#size-cells = <0>;
status = "disabled";
};
adc0: adc@fffe0000 { adc0: adc@fffe0000 {
compatible = "atmel,at91sam9260-adc"; compatible = "atmel,at91sam9260-adc";
reg = <0xfffe0000 0x100>; reg = <0xfffe0000 0x100>;
......
...@@ -24,6 +24,7 @@ aliases { ...@@ -24,6 +24,7 @@ aliases {
gpio3 = &pioD; gpio3 = &pioD;
gpio4 = &pioE; gpio4 = &pioE;
tcb0 = &tcb0; tcb0 = &tcb0;
i2c0 = &i2c0;
}; };
cpus { cpus {
cpu@0 { cpu@0 {
...@@ -185,6 +186,15 @@ usb1: gadget@fff78000 { ...@@ -185,6 +186,15 @@ usb1: gadget@fff78000 {
interrupts = <24 4 2>; interrupts = <24 4 2>;
status = "disabled"; status = "disabled";
}; };
i2c0: i2c@fff88000 {
compatible = "atmel,at91sam9263-i2c";
reg = <0xfff88000 0x100>;
interrupts = <13 4 6>;
#address-cells = <1>;
#size-cells = <0>;
status = "disabled";
};
}; };
nand0: nand@40000000 { nand0: nand@40000000 {
......
...@@ -18,6 +18,10 @@ memory { ...@@ -18,6 +18,10 @@ memory {
ahb { ahb {
apb { apb {
i2c0: i2c@fffac000 {
compatible = "atmel,at91sam9g20-i2c";
};
adc0: adc@fffe0000 { adc0: adc@fffe0000 {
atmel,adc-startup-time = <40>; atmel,adc-startup-time = <40>;
}; };
......
...@@ -32,6 +32,18 @@ macb0: ethernet@f802c000 { ...@@ -32,6 +32,18 @@ macb0: ethernet@f802c000 {
phy-mode = "rmii"; phy-mode = "rmii";
status = "okay"; status = "okay";
}; };
i2c0: i2c@f8010000 {
status = "okay";
};
i2c1: i2c@f8014000 {
status = "okay";
};
i2c2: i2c@f8018000 {
status = "okay";
};
}; };
usb0: ohci@00600000 { usb0: ohci@00600000 {
......
...@@ -29,6 +29,8 @@ aliases { ...@@ -29,6 +29,8 @@ aliases {
gpio4 = &pioE; gpio4 = &pioE;
tcb0 = &tcb0; tcb0 = &tcb0;
tcb1 = &tcb1; tcb1 = &tcb1;
i2c0 = &i2c0;
i2c1 = &i2c1;
}; };
cpus { cpus {
cpu@0 { cpu@0 {
...@@ -206,6 +208,24 @@ macb0: ethernet@fffbc000 { ...@@ -206,6 +208,24 @@ macb0: ethernet@fffbc000 {
status = "disabled"; status = "disabled";
}; };
i2c0: i2c@fff84000 {
compatible = "atmel,at91sam9g10-i2c";
reg = <0xfff84000 0x100>;
interrupts = <12 4 6>;
#address-cells = <1>;
#size-cells = <0>;
status = "disabled";
};
i2c1: i2c@fff88000 {
compatible = "atmel,at91sam9g10-i2c";
reg = <0xfff88000 0x100>;
interrupts = <13 4 6>;
#address-cells = <1>;
#size-cells = <0>;
status = "disabled";
};
adc0: adc@fffb0000 { adc0: adc@fffb0000 {
compatible = "atmel,at91sam9260-adc"; compatible = "atmel,at91sam9260-adc";
reg = <0xfffb0000 0x100>; reg = <0xfffb0000 0x100>;
......
...@@ -46,6 +46,14 @@ macb0: ethernet@fffbc000 { ...@@ -46,6 +46,14 @@ macb0: ethernet@fffbc000 {
phy-mode = "rmii"; phy-mode = "rmii";
status = "okay"; status = "okay";
}; };
i2c0: i2c@fff84000 {
status = "okay";
};
i2c1: i2c@fff88000 {
status = "okay";
};
}; };
nand0: nand@40000000 { nand0: nand@40000000 {
......
...@@ -26,6 +26,8 @@ aliases { ...@@ -26,6 +26,8 @@ aliases {
gpio3 = &pioD; gpio3 = &pioD;
tcb0 = &tcb0; tcb0 = &tcb0;
tcb1 = &tcb1; tcb1 = &tcb1;
i2c0 = &i2c0;
i2c1 = &i2c1;
}; };
cpus { cpus {
cpu@0 { cpu@0 {
...@@ -182,6 +184,24 @@ usart3: serial@f8028000 { ...@@ -182,6 +184,24 @@ usart3: serial@f8028000 {
atmel,use-dma-tx; atmel,use-dma-tx;
status = "disabled"; status = "disabled";
}; };
i2c0: i2c@f8010000 {
compatible = "atmel,at91sam9x5-i2c";
reg = <0xf8010000 0x100>;
interrupts = <9 4 6>;
#address-cells = <1>;
#size-cells = <0>;
status = "disabled";
};
i2c1: i2c@f8014000 {
compatible = "atmel,at91sam9x5-i2c";
reg = <0xf8014000 0x100>;
interrupts = <10 4 6>;
#address-cells = <1>;
#size-cells = <0>;
status = "disabled";
};
}; };
nand0: nand@40000000 { nand0: nand@40000000 {
......
...@@ -37,6 +37,14 @@ apb { ...@@ -37,6 +37,14 @@ apb {
dbgu: serial@fffff200 { dbgu: serial@fffff200 {
status = "okay"; status = "okay";
}; };
i2c0: i2c@f8010000 {
status = "okay";
};
i2c1: i2c@f8014000 {
status = "okay";
};
}; };
nand0: nand@40000000 { nand0: nand@40000000 {
......
...@@ -27,6 +27,9 @@ aliases { ...@@ -27,6 +27,9 @@ aliases {
gpio3 = &pioD; gpio3 = &pioD;
tcb0 = &tcb0; tcb0 = &tcb0;
tcb1 = &tcb1; tcb1 = &tcb1;
i2c0 = &i2c0;
i2c1 = &i2c1;
i2c2 = &i2c2;
}; };
cpus { cpus {
cpu@0 { cpu@0 {
...@@ -196,6 +199,33 @@ macb1: ethernet@f8030000 { ...@@ -196,6 +199,33 @@ macb1: ethernet@f8030000 {
status = "disabled"; status = "disabled";
}; };
i2c0: i2c@f8010000 {
compatible = "atmel,at91sam9x5-i2c";
reg = <0xf8010000 0x100>;
interrupts = <9 4 6>;
#address-cells = <1>;
#size-cells = <0>;
status = "disabled";
};
i2c1: i2c@f8014000 {
compatible = "atmel,at91sam9x5-i2c";
reg = <0xf8014000 0x100>;
interrupts = <10 4 6>;
#address-cells = <1>;
#size-cells = <0>;
status = "disabled";
};
i2c2: i2c@f8018000 {
compatible = "atmel,at91sam9x5-i2c";
reg = <0xf8018000 0x100>;
interrupts = <11 4 6>;
#address-cells = <1>;
#size-cells = <0>;
status = "disabled";
};
adc0: adc@f804c000 { adc0: adc@f804c000 {
compatible = "atmel,at91sam9260-adc"; compatible = "atmel,at91sam9260-adc";
reg = <0xf804c000 0x100>; reg = <0xf804c000 0x100>;
......
...@@ -764,6 +764,7 @@ i2c0: i2c@80058000 { ...@@ -764,6 +764,7 @@ i2c0: i2c@80058000 {
reg = <0x80058000 0x2000>; reg = <0x80058000 0x2000>;
interrupts = <111 68>; interrupts = <111 68>;
clock-frequency = <100000>; clock-frequency = <100000>;
fsl,i2c-dma-channel = <6>;
status = "disabled"; status = "disabled";
}; };
...@@ -774,6 +775,7 @@ i2c1: i2c@8005a000 { ...@@ -774,6 +775,7 @@ i2c1: i2c@8005a000 {
reg = <0x8005a000 0x2000>; reg = <0x8005a000 0x2000>;
interrupts = <110 69>; interrupts = <110 69>;
clock-frequency = <100000>; clock-frequency = <100000>;
fsl,i2c-dma-channel = <7>;
status = "disabled"; status = "disabled";
}; };
......
...@@ -187,6 +187,7 @@ static struct clk_lookup periph_clocks_lookups[] = { ...@@ -187,6 +187,7 @@ static struct clk_lookup periph_clocks_lookups[] = {
CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc0_clk), CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc0_clk),
CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk), CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk),
CLKDEV_CON_DEV_ID("pclk", "ssc.2", &ssc2_clk), CLKDEV_CON_DEV_ID("pclk", "ssc.2", &ssc2_clk),
CLKDEV_CON_DEV_ID(NULL, "i2c-at91rm9200", &twi_clk),
/* fake hclk clock */ /* fake hclk clock */
CLKDEV_CON_DEV_ID("hclk", "at91_ohci", &ohci_clk), CLKDEV_CON_DEV_ID("hclk", "at91_ohci", &ohci_clk),
CLKDEV_CON_ID("pioA", &pioA_clk), CLKDEV_CON_ID("pioA", &pioA_clk),
......
...@@ -511,7 +511,7 @@ static struct resource twi_resources[] = { ...@@ -511,7 +511,7 @@ static struct resource twi_resources[] = {
}; };
static struct platform_device at91rm9200_twi_device = { static struct platform_device at91rm9200_twi_device = {
.name = "at91_i2c", .name = "i2c-at91rm9200",
.id = -1, .id = -1,
.resource = twi_resources, .resource = twi_resources,
.num_resources = ARRAY_SIZE(twi_resources), .num_resources = ARRAY_SIZE(twi_resources),
......
...@@ -211,6 +211,8 @@ static struct clk_lookup periph_clocks_lookups[] = { ...@@ -211,6 +211,8 @@ static struct clk_lookup periph_clocks_lookups[] = {
CLKDEV_CON_DEV_ID("t1_clk", "atmel_tcb.1", &tc4_clk), CLKDEV_CON_DEV_ID("t1_clk", "atmel_tcb.1", &tc4_clk),
CLKDEV_CON_DEV_ID("t2_clk", "atmel_tcb.1", &tc5_clk), CLKDEV_CON_DEV_ID("t2_clk", "atmel_tcb.1", &tc5_clk),
CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc_clk), CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc_clk),
CLKDEV_CON_DEV_ID(NULL, "i2c-at91sam9260", &twi_clk),
CLKDEV_CON_DEV_ID(NULL, "i2c-at91sam9g20", &twi_clk),
/* more usart lookup table for DT entries */ /* more usart lookup table for DT entries */
CLKDEV_CON_DEV_ID("usart", "fffff200.serial", &mck), CLKDEV_CON_DEV_ID("usart", "fffff200.serial", &mck),
CLKDEV_CON_DEV_ID("usart", "fffb0000.serial", &usart0_clk), CLKDEV_CON_DEV_ID("usart", "fffb0000.serial", &usart0_clk),
...@@ -219,6 +221,7 @@ static struct clk_lookup periph_clocks_lookups[] = { ...@@ -219,6 +221,7 @@ static struct clk_lookup periph_clocks_lookups[] = {
CLKDEV_CON_DEV_ID("usart", "fffd0000.serial", &usart3_clk), CLKDEV_CON_DEV_ID("usart", "fffd0000.serial", &usart3_clk),
CLKDEV_CON_DEV_ID("usart", "fffd4000.serial", &usart4_clk), CLKDEV_CON_DEV_ID("usart", "fffd4000.serial", &usart4_clk),
CLKDEV_CON_DEV_ID("usart", "fffd8000.serial", &usart5_clk), CLKDEV_CON_DEV_ID("usart", "fffd8000.serial", &usart5_clk),
CLKDEV_CON_DEV_ID(NULL, "fffac000.i2c", &twi_clk),
/* more tc lookup table for DT entries */ /* more tc lookup table for DT entries */
CLKDEV_CON_DEV_ID("t0_clk", "fffa0000.timer", &tc0_clk), CLKDEV_CON_DEV_ID("t0_clk", "fffa0000.timer", &tc0_clk),
CLKDEV_CON_DEV_ID("t1_clk", "fffa0000.timer", &tc1_clk), CLKDEV_CON_DEV_ID("t1_clk", "fffa0000.timer", &tc1_clk),
......
...@@ -421,7 +421,6 @@ static struct resource twi_resources[] = { ...@@ -421,7 +421,6 @@ static struct resource twi_resources[] = {
}; };
static struct platform_device at91sam9260_twi_device = { static struct platform_device at91sam9260_twi_device = {
.name = "at91_i2c",
.id = -1, .id = -1,
.resource = twi_resources, .resource = twi_resources,
.num_resources = ARRAY_SIZE(twi_resources), .num_resources = ARRAY_SIZE(twi_resources),
...@@ -429,6 +428,13 @@ static struct platform_device at91sam9260_twi_device = { ...@@ -429,6 +428,13 @@ static struct platform_device at91sam9260_twi_device = {
void __init at91_add_device_i2c(struct i2c_board_info *devices, int nr_devices) void __init at91_add_device_i2c(struct i2c_board_info *devices, int nr_devices)
{ {
/* IP version is not the same on 9260 and g20 */
if (cpu_is_at91sam9g20()) {
at91sam9260_twi_device.name = "i2c-at91sam9g20";
} else {
at91sam9260_twi_device.name = "i2c-at91sam9260";
}
/* pins used for TWI interface */ /* pins used for TWI interface */
at91_set_A_periph(AT91_PIN_PA23, 0); /* TWD */ at91_set_A_periph(AT91_PIN_PA23, 0); /* TWD */
at91_set_multi_drive(AT91_PIN_PA23, 1); at91_set_multi_drive(AT91_PIN_PA23, 1);
......
...@@ -178,6 +178,8 @@ static struct clk_lookup periph_clocks_lookups[] = { ...@@ -178,6 +178,8 @@ static struct clk_lookup periph_clocks_lookups[] = {
CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk), CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk),
CLKDEV_CON_DEV_ID("pclk", "ssc.2", &ssc2_clk), CLKDEV_CON_DEV_ID("pclk", "ssc.2", &ssc2_clk),
CLKDEV_CON_DEV_ID("hclk", "at91_ohci", &hck0), CLKDEV_CON_DEV_ID("hclk", "at91_ohci", &hck0),
CLKDEV_CON_DEV_ID(NULL, "i2c-at91sam9261", &twi_clk),
CLKDEV_CON_DEV_ID(NULL, "i2c-at91sam9g10", &twi_clk),
CLKDEV_CON_ID("pioA", &pioA_clk), CLKDEV_CON_ID("pioA", &pioA_clk),
CLKDEV_CON_ID("pioB", &pioB_clk), CLKDEV_CON_ID("pioB", &pioB_clk),
CLKDEV_CON_ID("pioC", &pioC_clk), CLKDEV_CON_ID("pioC", &pioC_clk),
......
...@@ -317,7 +317,6 @@ static struct resource twi_resources[] = { ...@@ -317,7 +317,6 @@ static struct resource twi_resources[] = {
}; };
static struct platform_device at91sam9261_twi_device = { static struct platform_device at91sam9261_twi_device = {
.name = "at91_i2c",
.id = -1, .id = -1,
.resource = twi_resources, .resource = twi_resources,
.num_resources = ARRAY_SIZE(twi_resources), .num_resources = ARRAY_SIZE(twi_resources),
...@@ -325,12 +324,19 @@ static struct platform_device at91sam9261_twi_device = { ...@@ -325,12 +324,19 @@ static struct platform_device at91sam9261_twi_device = {
void __init at91_add_device_i2c(struct i2c_board_info *devices, int nr_devices) void __init at91_add_device_i2c(struct i2c_board_info *devices, int nr_devices)
{ {
/* IP version is not the same on 9261 and g10 */
if (cpu_is_at91sam9g10()) {
at91sam9261_twi_device.name = "i2c-at91sam9g10";
/* I2C PIO must not be configured as open-drain on this chip */
} else {
at91sam9261_twi_device.name = "i2c-at91sam9261";
at91_set_multi_drive(AT91_PIN_PA7, 1);
at91_set_multi_drive(AT91_PIN_PA8, 1);
}
/* pins used for TWI interface */ /* pins used for TWI interface */
at91_set_A_periph(AT91_PIN_PA7, 0); /* TWD */ at91_set_A_periph(AT91_PIN_PA7, 0); /* TWD */
at91_set_multi_drive(AT91_PIN_PA7, 1);
at91_set_A_periph(AT91_PIN_PA8, 0); /* TWCK */ at91_set_A_periph(AT91_PIN_PA8, 0); /* TWCK */
at91_set_multi_drive(AT91_PIN_PA8, 1);
i2c_register_board_info(0, devices, nr_devices); i2c_register_board_info(0, devices, nr_devices);
platform_device_register(&at91sam9261_twi_device); platform_device_register(&at91sam9261_twi_device);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment