X-Git-Url: http://git.openwrt.org/?a=blobdiff_plain;f=target%2Flinux%2Fbrcm2708%2Fpatches-4.19%2F950-0782-overlays-Make-mcp342x-run-time-compatible.patch;fp=target%2Flinux%2Fbrcm2708%2Fpatches-4.19%2F950-0782-overlays-Make-mcp342x-run-time-compatible.patch;h=900cbb2ca852b100da342729f61696d34e1b52ed;hb=c2308a7e4adbb2acc8ff149f91d1ca46801c135e;hp=0000000000000000000000000000000000000000;hpb=67dcc43f3a22dc3a7ac07a7065971b426feeb043;p=openwrt%2Fstaging%2Fdedeckeh.git diff --git a/target/linux/brcm2708/patches-4.19/950-0782-overlays-Make-mcp342x-run-time-compatible.patch b/target/linux/brcm2708/patches-4.19/950-0782-overlays-Make-mcp342x-run-time-compatible.patch new file mode 100644 index 0000000000..900cbb2ca8 --- /dev/null +++ b/target/linux/brcm2708/patches-4.19/950-0782-overlays-Make-mcp342x-run-time-compatible.patch @@ -0,0 +1,209 @@ +From e650f4bfbe9a09e5b75d702884a8ba8d9df6ccdf Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Mon, 9 Dec 2019 12:32:20 +0000 +Subject: [PATCH] overlays: Make mcp342x run-time compatible + +The order of processing of run-time overlays differs from that done by +the firmware. This means that certain parameter processing techniques +are not compatible with run-time use. The mcp342x overlay is one such +overlay, but it is easy to change the implementation without changing +the interface. + +See: https://www.raspberrypi.org/forums/viewtopic.php?f=107&t=258294 + +Signed-off-by: Phil Elwell +--- + .../arm/boot/dts/overlays/mcp342x-overlay.dts | 133 ++++++++++++++---- + 1 file changed, 102 insertions(+), 31 deletions(-) + +--- a/arch/arm/boot/dts/overlays/mcp342x-overlay.dts ++++ b/arch/arm/boot/dts/overlays/mcp342x-overlay.dts +@@ -8,14 +8,15 @@ + + fragment@0 { + target = <&i2c1>; +- __overlay__ { ++ __dormant__ { + #address-cells = <1>; + #size-cells = <0>; + + status = "okay"; + +- mcp342x: mcp@68 { ++ mcp3421: mcp@68 { + reg = <0x68>; ++ compatible = "microchip,mcp3421"; + + status = "okay"; + }; +@@ -23,71 +24,141 @@ + }; + + fragment@1 { +- target = <&mcp342x>; ++ target = <&i2c1>; + __dormant__ { +- compatible = "microchip,mcp3421"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ status = "okay"; ++ ++ mcp3422: mcp@68 { ++ reg = <0x68>; ++ compatible = "microchip,mcp3422"; ++ ++ status = "okay"; ++ }; + }; + }; + + fragment@2 { +- target = <&mcp342x>; ++ target = <&i2c1>; + __dormant__ { +- compatible = "microchip,mcp3422"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ status = "okay"; ++ ++ mcp3423: mcp@68 { ++ reg = <0x68>; ++ compatible = "microchip,mcp3423"; ++ ++ status = "okay"; ++ }; + }; + }; + + fragment@3 { +- target = <&mcp342x>; ++ target = <&i2c1>; + __dormant__ { +- compatible = "microchip,mcp3423"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ status = "okay"; ++ ++ mcp3424: mcp@68 { ++ reg = <0x68>; ++ compatible = "microchip,mcp3424"; ++ ++ status = "okay"; ++ }; + }; + }; + + fragment@4 { +- target = <&mcp342x>; ++ target = <&i2c1>; + __dormant__ { +- compatible = "microchip,mcp3424"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ status = "okay"; ++ ++ mcp3425: mcp@68 { ++ reg = <0x68>; ++ compatible = "microchip,mcp3425","mcp3425"; ++ ++ status = "okay"; ++ }; + }; + }; + + fragment@5 { +- target = <&mcp342x>; ++ target = <&i2c1>; + __dormant__ { +- compatible = "microchip,mcp3425"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ status = "okay"; ++ ++ mcp3426: mcp@68 { ++ reg = <0x68>; ++ compatible = "microchip,mcp3426"; ++ ++ status = "okay"; ++ }; + }; + }; + + fragment@6 { +- target = <&mcp342x>; ++ target = <&i2c1>; + __dormant__ { +- compatible = "microchip,mcp3426"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ status = "okay"; ++ ++ mcp3427: mcp@68 { ++ reg = <0x68>; ++ compatible = "microchip,mcp3427"; ++ ++ status = "okay"; ++ }; + }; + }; + + fragment@7 { +- target = <&mcp342x>; ++ target = <&i2c1>; + __dormant__ { +- compatible = "microchip,mcp3427"; +- }; +- }; ++ #address-cells = <1>; ++ #size-cells = <0>; + +- fragment@8 { +- target = <&mcp342x>; +- __dormant__ { +- compatible = "microchip,mcp3428"; ++ status = "okay"; ++ ++ mcp3428: mcp@68 { ++ reg = <0x68>; ++ compatible = "microchip,mcp3428"; ++ ++ status = "okay"; ++ }; + }; + }; + + __overrides__ { +- addr = <&mcp342x>,"reg:0"; +- mcp3421 = <0>,"=1"; +- mcp3422 = <0>,"=2"; +- mcp3423 = <0>,"=3"; +- mcp3424 = <0>,"=4"; +- mcp3425 = <0>,"=5"; +- mcp3426 = <0>,"=6"; +- mcp3427 = <0>,"=7"; +- mcp3428 = <0>,"=8"; ++ addr = <&mcp3421>,"reg:0", ++ <&mcp3422>,"reg:0", ++ <&mcp3423>,"reg:0", ++ <&mcp3424>,"reg:0", ++ <&mcp3425>,"reg:0", ++ <&mcp3426>,"reg:0", ++ <&mcp3427>,"reg:0", ++ <&mcp3428>,"reg:0"; ++ mcp3421 = <0>,"=0"; ++ mcp3422 = <0>,"=1"; ++ mcp3423 = <0>,"=2"; ++ mcp3424 = <0>,"=3"; ++ mcp3425 = <0>,"=4"; ++ mcp3426 = <0>,"=5"; ++ mcp3427 = <0>,"=6"; ++ mcp3428 = <0>,"=7"; + }; + }; +