arm64: dts: allwinner: pinephone: Add LED flash
authorLuca Weiss <luca@z3ntu.xyz>
Thu, 5 Nov 2020 05:41:32 +0000 (23:41 -0600)
committerMaxime Ripard <maxime@cerno.tech>
Thu, 5 Nov 2020 11:21:59 +0000 (12:21 +0100)
All revisions of the PinePhone have an SGM3140 LED flash. The gpios were
swapped on v1.0 of the board, but this was fixed in later revisions.

Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
Signed-off-by: Samuel Holland <samuel@sholland.org>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Link: https://lore.kernel.org/r/20201105054135.24860-4-samuel@sholland.org
arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.0.dts
arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.1.dts
arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.2.dts
arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi

index 0c42272106afaf65794d773b8c37efec39ee1dbc..3d5a2ae9aa39014aaa995a155f607c2f65287667 100644 (file)
@@ -9,3 +9,8 @@
        model = "Pine64 PinePhone Developer Batch (1.0)";
        compatible = "pine64,pinephone-1.0", "allwinner,sun50i-a64";
 };
+
+&sgm3140 {
+       enable-gpios = <&pio 2 3 GPIO_ACTIVE_HIGH>; /* PC3 */
+       flash-gpios = <&pio 3 24 GPIO_ACTIVE_HIGH>; /* PD24 */
+};
index 3e99a87e9ce5220da92e5e42af7c08f0782cddde..c9b9f6e9ee8c0dfc1ec232a20ca15dd2a068ea10 100644 (file)
@@ -28,3 +28,8 @@
        num-interpolated-steps = <50>;
        default-brightness-level = <400>;
 };
+
+&sgm3140 {
+       enable-gpios = <&pio 3 24 GPIO_ACTIVE_HIGH>; /* PD24 */
+       flash-gpios = <&pio 2 3 GPIO_ACTIVE_HIGH>; /* PC3 */
+};
index a9f5b670c9b826b1a9ba071323881dc0674922ce..94e4f11e02159be1af359df2b7aafa91862bd66f 100644 (file)
@@ -38,3 +38,8 @@
        interrupt-parent = <&pio>;
        interrupts = <1 1 IRQ_TYPE_EDGE_RISING>; /* PB1 */
 };
+
+&sgm3140 {
+       enable-gpios = <&pio 3 24 GPIO_ACTIVE_HIGH>; /* PD24 */
+       flash-gpios = <&pio 2 3 GPIO_ACTIVE_HIGH>; /* PC3 */
+};
index 555837722be216ee36f35d50d7cc6cca862c4ec5..8285391a026585ae2f43bff43d924aa6fa561e8f 100644 (file)
                };
        };
 
+       sgm3140: led-controller {
+               compatible = "sgmicro,sgm3140";
+               vin-supply = <&reg_dcdc1>;
+
+               sgm3140_flash: led {
+                       function = LED_FUNCTION_FLASH;
+                       color = <LED_COLOR_ID_WHITE>;
+                       flash-max-timeout-us = <250000>;
+               };
+       };
+
        speaker_amp: audio-amplifier {
                compatible = "simple-audio-amplifier";
                enable-gpios = <&pio 2 7 GPIO_ACTIVE_HIGH>; /* PC7 */