layerscape: add i2c peripherials on LS1012A-RDB
[openwrt/openwrt.git] / target / linux / layerscape / patches-5.4 / 900-layerscape_fix_support_of_LS1012A-RDB.patch
1 From 650480191492845c8eb7e0c2e5b1e37cabc59eff Mon Sep 17 00:00:00 2001
2 From: Pawel Dembicki <paweldembicki@gmail.com>
3 Date: Fri, 13 Nov 2020 07:17:39 +0100
4 Subject: [PATCH 1/2] arm64: dts: fsl-ls1012a-rdb: add i2c devices
5
6 LS1012A-RDB equipped in some i2c devices:
7 - 3x GPIO Expander: PCAL9555A (NXP)
8 - Gyro: FXAS21002 (NXP)
9 - Accelerometer: FXOS8700 (NXP)
10 - Current & Power Monitor: INA220 (TI)
11
12 This patch add listed devices to dts.
13
14 Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
15 ---
16 .../boot/dts/freescale/fsl-ls1012a-rdb.dts | 66 +++++++++++++++++++
17 1 file changed, 66 insertions(+)
18
19 --- a/arch/arm64/boot/dts/freescale/fsl-ls1012a-rdb.dts
20 +++ b/arch/arm64/boot/dts/freescale/fsl-ls1012a-rdb.dts
21 @@ -7,6 +7,7 @@
22 */
23 /dts-v1/;
24
25 +#include <dt-bindings/interrupt-controller/irq.h>
26 #include "fsl-ls1012a.dtsi"
27
28 / {
29 @@ -16,6 +17,25 @@
30 aliases {
31 ethernet0 = &pfe_mac0;
32 ethernet1 = &pfe_mac1;
33 + serial0 = &duart0;
34 + };
35 +
36 + dummy3v3: dummy_reg {
37 + compatible = "regulator-fixed";
38 + regulator-name = "dummy_regulator_3v3";
39 +
40 + regulator-min-microvolt = <3300000>;
41 + regulator-max-microvolt = <3300000>;
42 + regulator-always-on;
43 + };
44 +
45 + dummy1v8: dummy_reg {
46 + compatible = "regulator-fixed";
47 + regulator-name = "dummy_regulator_1v8";
48 +
49 + regulator-min-microvolt = <1800000>;
50 + regulator-max-microvolt = <1800000>;
51 + regulator-always-on;
52 };
53 };
54
55 @@ -42,6 +62,52 @@
56
57 &i2c0 {
58 status = "okay";
59 +
60 + accelerometer@1e {
61 + compatible = "nxp,fxos8700";
62 + reg = <0x1e>;
63 + interrupt-parent = <&gpio26>;
64 + interrupts = <13 IRQ_TYPE_EDGE_RISING>;
65 + interrupt-names = "INT1";
66 + };
67 +
68 + gyroscope@20 {
69 + compatible = "nxp,fxas21002c";
70 + reg = <0x20>;
71 + vdd-supply = <&dummy3v3>;
72 + vddio-supply = <&dummy1v8>;
73 + };
74 +
75 + gpio@24 {
76 + compatible = "nxp,pcal9555a";
77 + reg = <0x24>;
78 + gpio-controller;
79 + #gpio-cells = <2>;
80 + };
81 +
82 + gpio25: gpio@25 {
83 + compatible = "nxp,pcal9555a";
84 + reg = <0x25>;
85 + gpio-controller;
86 + #gpio-cells = <2>;
87 + };
88 +
89 + gpio26: gpio@26 {
90 + compatible = "nxp,pcal9555a";
91 + reg = <0x26>;
92 + interrupt-parent = <&gpio0>;
93 + interrupts = <13 IRQ_TYPE_EDGE_FALLING>;
94 + interrupt-controller;
95 + #interrupt-cells = <2>;
96 + gpio-controller;
97 + #gpio-cells = <2>;
98 + };
99 +
100 + current-sensor@40 {
101 + compatible = "ti,ina220";
102 + reg = <0x40>;
103 + shunt-resistor = <2000>;
104 + };
105 };
106
107 &sata {