Skip to content

Commit 6064315

Browse files
author
Phil Elwell
committed
overlays: Add 'combine' option to i2c overlays
The i2c0-bcm2708 and i2c1-bcm2708 overlays allow the I2C pin usage to be changed. The names also suggest they revert to the old i2c_bcm2708 driver, but they don't. The newer i2c_bcm2835 driver forces transactions to be combined where possible, but this breaks some devices. Add an option to disable transaction combining, which is currently implemented by reverting to the old driver. See: raspberrypi/firmware#828 Signed-off-by: Phil Elwell <[email protected]>
1 parent 1e83804 commit 6064315

File tree

3 files changed

+27
-2
lines changed

3 files changed

+27
-2
lines changed

arch/arm/boot/dts/overlays/README

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -865,24 +865,32 @@ Params: addr Set the address for the BME280, BMP280, DS1621,
865865

866866

867867
Name: i2c0-bcm2708
868-
Info: Enable the i2c_bcm2708 driver for the i2c0 bus. Not all pin combinations
869-
are usable on all platforms.
868+
Info: Change i2c0 pin usage. Not all pin combinations are usable on all
869+
platforms - platforms other then Compute Modules can only use this
870+
to disable transaction combining.
870871
Load: dtoverlay=i2c0-bcm2708,<param>=<val>
871872
Params: sda0_pin GPIO pin for SDA0 (deprecated - use pins_*)
872873
scl0_pin GPIO pin for SCL0 (deprecated - use pins_*)
873874
pins_0_1 Use pins 0 and 1 (default)
874875
pins_28_29 Use pins 28 and 29
875876
pins_44_45 Use pins 44 and 45
876877
pins_46_47 Use pins 46 and 47
878+
combine Allow transactions to be combined (default
879+
"yes")
877880

878881

879882
Name: i2c1-bcm2708
883+
Info: Change i2c1 pin usage. Not all pin combinations are usable on all
884+
platforms - platforms other then Compute Modules can only use this
885+
to disable transaction combining.
880886
Info: Enable the i2c_bcm2708 driver for the i2c1 bus
881887
Load: dtoverlay=i2c1-bcm2708,<param>=<val>
882888
Params: sda1_pin GPIO pin for SDA1 (2 or 44 - default 2)
883889
scl1_pin GPIO pin for SCL1 (3 or 45 - default 3)
884890
pin_func Alternative pin function (4 (alt0), 6 (alt2) -
885891
default 4)
892+
combine Allow transactions to be combined (default
893+
"yes")
886894

887895

888896
Name: i2s-gpio28-31

arch/arm/boot/dts/overlays/i2c0-bcm2708-overlay.dts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,20 @@
5050
};
5151
};
5252

53+
fragment@5 {
54+
target = <&i2c0>;
55+
__dormant__ {
56+
compatible = "brcm,bcm2708-i2c";
57+
};
58+
};
59+
5360
__overrides__ {
5461
sda0_pin = <&frag1>,"brcm,pins:0";
5562
scl0_pin = <&frag1>,"brcm,pins:4";
5663
pins_0_1 = <0>,"+1-2-3-4";
5764
pins_28_29 = <0>,"-1+2-3-4";
5865
pins_44_45 = <0>,"-1-2+3-4";
5966
pins_46_47 = <0>,"-1-2-3+4";
67+
combine = <0>, "!5";
6068
};
6169
};

arch/arm/boot/dts/overlays/i2c1-bcm2708-overlay.dts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,18 @@
2626
brcm,function = <4>; /* alt 0 */
2727
};
2828
};
29+
30+
fragment@2 {
31+
target = <&i2c1>;
32+
__dormant__ {
33+
compatible = "brcm,bcm2708-i2c";
34+
};
35+
};
36+
2937
__overrides__ {
3038
sda1_pin = <&pins>,"brcm,pins:0";
3139
scl1_pin = <&pins>,"brcm,pins:4";
3240
pin_func = <&pins>,"brcm,function:0";
41+
combine = <0>, "!2";
3342
};
3443
};

0 commit comments

Comments
 (0)