diff options
author | Derek Foreman <derekf@osg.samsung.com> | 2015-05-27 13:20:21 -0500 |
---|---|---|
committer | Pedro Alvarez <pedro.alvarez@codethink.co.uk> | 2015-10-13 11:39:16 +0000 |
commit | ec516140067e9a53c8b293e4c764eb8e6c7e371f (patch) | |
tree | 9d6b8e3c17504a4bef9ab34a7abf163802d1bdc4 | |
parent | 07009cab090ade3dd180e8a55d590b1a00072eed (diff) | |
download | linux-ec516140067e9a53c8b293e4c764eb8e6c7e371f.tar.gz |
rpi2 setup
Fix up device tree and i2c setup for rpi2
Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
-rw-r--r-- | arch/arm/boot/dts/bcm2708_common.dtsi | 2 | ||||
-rw-r--r-- | arch/arm/boot/dts/bcm2709-rpi-2-b.dts | 6 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-bcm2708.c | 6 |
3 files changed, 12 insertions, 2 deletions
diff --git a/arch/arm/boot/dts/bcm2708_common.dtsi b/arch/arm/boot/dts/bcm2708_common.dtsi index ccf01a568cb6..15277d2765bb 100644 --- a/arch/arm/boot/dts/bcm2708_common.dtsi +++ b/arch/arm/boot/dts/bcm2708_common.dtsi @@ -155,7 +155,7 @@ }; i2c2: i2c@7e805000 { - compatible = "brcm,bcm2835-i2c"; + compatible = "brcm,bcm2708-i2c"; reg = <0x7e805000 0x1000>; interrupts = <2 21>; clocks = <&clk_i2c>; diff --git a/arch/arm/boot/dts/bcm2709-rpi-2-b.dts b/arch/arm/boot/dts/bcm2709-rpi-2-b.dts index 8aaaf1fb7143..712ca455cc46 100644 --- a/arch/arm/boot/dts/bcm2709-rpi-2-b.dts +++ b/arch/arm/boot/dts/bcm2709-rpi-2-b.dts @@ -11,6 +11,7 @@ spi0 = &spi0; i2c0 = &i2c0; i2c1 = &i2c1; + i2c2 = &i2c2; i2s = &i2s; gpio = &gpio; intc = &intc; @@ -94,6 +95,11 @@ clock-frequency = <100000>; }; +&i2c2 { + pinctrl-names = "default"; + clock-frequency = <100000>; +}; + &i2s { #sound-dai-cells = <0>; pinctrl-names = "default"; diff --git a/drivers/i2c/busses/i2c-bcm2708.c b/drivers/i2c/busses/i2c-bcm2708.c index 8773203b34eb..2054ff44e744 100644 --- a/drivers/i2c/busses/i2c-bcm2708.c +++ b/drivers/i2c/busses/i2c-bcm2708.c @@ -109,6 +109,7 @@ static void bcm2708_i2c_init_pinmode(int id) #define SET_GPIO_ALT(g,a) *(gpio+(((g)/10))) |= (((a)<=3?(a)+4:(a)==4?3:2)<<(((g)%10)*3)) int pin; + u32 *gpio = ioremap(GPIO_BASE, SZ_16K); BUG_ON(id != 0 && id != 1); @@ -382,7 +383,7 @@ static int bcm2708_i2c_probe(struct platform_device *pdev) goto out_clk_put; } - if (!pdev->dev.of_node) + if (pdev->id < 2) bcm2708_i2c_init_pinmode(pdev->id); bi = kzalloc(sizeof(*bi), GFP_KERNEL); @@ -407,6 +408,9 @@ static int bcm2708_i2c_probe(struct platform_device *pdev) case 1: adap->class = I2C_CLASS_DDC; break; + case 2: + adap->class = I2C_CLASS_DDC; + break; default: dev_err(&pdev->dev, "can only bind to BSC 0 or 1\n"); err = -ENXIO; |