devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] arm64: dts: rockchip: Add Pinephone Pro support for GPIO LEDs
@ 2024-06-23 16:53 Peter Robinson
  2024-06-23 16:53 ` [PATCH 2/3] arm64: dts: rockchip: Enable PinePhone Pro IMU sensor Peter Robinson
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Peter Robinson @ 2024-06-23 16:53 UTC (permalink / raw)
  To: Heiko Stuebner, devicetree, linux-arm-kernel, linux-rockchip
  Cc: Peter Robinson

The PinePhone Pro has a cluster of 3 single RGB GPIO LEDs.
Add the GPIO entries for the 3 red/green/blue LEDs and an
entry for the multi-color group to allow them to be used
as a combined RGB LED.

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
---
 .../dts/rockchip/rk3399-pinephone-pro.dts     | 43 +++++++++++++++++++
 1 file changed, 43 insertions(+)

diff --git a/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts b/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts
index e5709c7ee06aa..5e46f682f0f0b 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts
@@ -12,6 +12,7 @@
 /dts-v1/;
 #include <dt-bindings/input/gpio-keys.h>
 #include <dt-bindings/input/linux-event-codes.h>
+#include <dt-bindings/leds/common.h>
 #include "rk3399.dtsi"
 #include "rk3399-opp.dtsi"
 
@@ -69,6 +70,34 @@ key-power {
 		};
 	};
 
+	leds {
+		compatible = "gpio-leds";
+		pinctrl-names = "default";
+		pinctrl-0 = <&red_led_pin &green_led_pin &blue_led_pin>;
+
+		led_red: led-0 {
+			color = <LED_COLOR_ID_RED>;
+			gpios = <&gpio4 RK_PD2 GPIO_ACTIVE_HIGH>;
+		};
+
+		led_green: led-1 {
+			color = <LED_COLOR_ID_GREEN>;
+			gpios = <&gpio4 RK_PD5 GPIO_ACTIVE_HIGH>;
+		};
+
+		led_blue: led-2 {
+			color = <LED_COLOR_ID_BLUE>;
+			gpios = <&gpio4 RK_PD6 GPIO_ACTIVE_HIGH>;
+		};
+	};
+
+	multi-led {
+		compatible = "leds-group-multicolor";
+		color = <LED_COLOR_ID_RGB>;
+		function = LED_FUNCTION_INDICATOR;
+		leds = <&led_red>, <&led_green>, <&led_blue>;
+	};
+
 	vcc_sys: vcc-sys-regulator {
 		compatible = "regulator-fixed";
 		regulator-name = "vcc_sys";
@@ -481,6 +510,20 @@ pwrbtn_pin: pwrbtn-pin {
 		};
 	};
 
+	leds {
+		red_led_pin: red-led-pin {
+			rockchip,pins = <4 RK_PD2 RK_FUNC_GPIO &pcfg_pull_none>;
+		};
+
+		green_led_pin: green-led-pin {
+			rockchip,pins = <4 RK_PD5 RK_FUNC_GPIO &pcfg_pull_none>;
+		};
+
+		blue_led_pin: blue-led-pin {
+			rockchip,pins = <4 RK_PD6 RK_FUNC_GPIO &pcfg_pull_none>;
+		};
+	};
+
 	pmic {
 		pmic_int_l: pmic-int-l {
 			rockchip,pins = <1 RK_PC5 RK_FUNC_GPIO &pcfg_pull_up>;
-- 
2.45.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/3] arm64: dts: rockchip: Enable PinePhone Pro IMU sensor
  2024-06-23 16:53 [PATCH 1/3] arm64: dts: rockchip: Add Pinephone Pro support for GPIO LEDs Peter Robinson
@ 2024-06-23 16:53 ` Peter Robinson
  2024-06-23 16:53 ` [PATCH 3/3] arm64: dts: rockchip: Enable PinePhone Pro vibrator Peter Robinson
  2024-06-24 16:20 ` [PATCH 1/3] arm64: dts: rockchip: Add Pinephone Pro support for GPIO LEDs Heiko Stuebner
  2 siblings, 0 replies; 4+ messages in thread
From: Peter Robinson @ 2024-06-23 16:53 UTC (permalink / raw)
  To: Heiko Stuebner, devicetree, linux-arm-kernel, linux-rockchip
  Cc: Peter Robinson

Enable the IMU sensor on the PinePhone Pro including
the i2c4 bus that it's attached to.

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
---
 .../boot/dts/rockchip/rk3399-pinephone-pro.dts    | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts b/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts
index 5e46f682f0f0b..fbaf0202df632 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts
@@ -436,6 +436,21 @@ touchscreen@14 {
 	};
 };
 
+&i2c4 {
+	i2c-scl-rising-time-ns = <600>;
+	i2c-scl-falling-time-ns = <20>;
+	status = "okay";
+
+	/* Accelerometer/gyroscope */
+	mpu6500@68 {
+		compatible = "invensense,mpu6500";
+		reg = <0x68>;
+		interrupt-parent = <&gpio1>;
+		interrupts = <RK_PC6 IRQ_TYPE_LEVEL_LOW>;
+		vddio-supply = <&vcc_1v8>;
+	};
+};
+
 &cluster0_opp {
 	opp04 {
 		status = "disabled";
-- 
2.45.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 3/3] arm64: dts: rockchip: Enable PinePhone Pro vibrator
  2024-06-23 16:53 [PATCH 1/3] arm64: dts: rockchip: Add Pinephone Pro support for GPIO LEDs Peter Robinson
  2024-06-23 16:53 ` [PATCH 2/3] arm64: dts: rockchip: Enable PinePhone Pro IMU sensor Peter Robinson
@ 2024-06-23 16:53 ` Peter Robinson
  2024-06-24 16:20 ` [PATCH 1/3] arm64: dts: rockchip: Add Pinephone Pro support for GPIO LEDs Heiko Stuebner
  2 siblings, 0 replies; 4+ messages in thread
From: Peter Robinson @ 2024-06-23 16:53 UTC (permalink / raw)
  To: Heiko Stuebner, devicetree, linux-arm-kernel, linux-rockchip
  Cc: Peter Robinson

The PinePhone Pro has a vibrator attached via GPIO so
lets enable it.

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
---
 arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts b/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts
index fbaf0202df632..8c2a4aaa635d0 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts
@@ -137,6 +137,12 @@ vcc1v8_codec: vcc1v8-codec-regulator {
 		vin-supply = <&vcc3v3_sys>;
 	};
 
+	vibrator {
+		compatible = "gpio-vibrator";
+		enable-gpios = <&gpio3 RK_PB1 GPIO_ACTIVE_HIGH>;
+		vcc-supply = <&vcc3v3_sys>;
+	};
+
 	wifi_pwrseq: sdio-wifi-pwrseq {
 		compatible = "mmc-pwrseq-simple";
 		clocks = <&rk818 1>;
-- 
2.45.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/3] arm64: dts: rockchip: Add Pinephone Pro support for GPIO LEDs
  2024-06-23 16:53 [PATCH 1/3] arm64: dts: rockchip: Add Pinephone Pro support for GPIO LEDs Peter Robinson
  2024-06-23 16:53 ` [PATCH 2/3] arm64: dts: rockchip: Enable PinePhone Pro IMU sensor Peter Robinson
  2024-06-23 16:53 ` [PATCH 3/3] arm64: dts: rockchip: Enable PinePhone Pro vibrator Peter Robinson
@ 2024-06-24 16:20 ` Heiko Stuebner
  2 siblings, 0 replies; 4+ messages in thread
From: Heiko Stuebner @ 2024-06-24 16:20 UTC (permalink / raw)
  To: linux-arm-kernel, devicetree, Peter Robinson, linux-rockchip
  Cc: Heiko Stuebner

On Sun, 23 Jun 2024 17:53:20 +0100, Peter Robinson wrote:
> The PinePhone Pro has a cluster of 3 single RGB GPIO LEDs.
> Add the GPIO entries for the 3 red/green/blue LEDs and an
> entry for the multi-color group to allow them to be used
> as a combined RGB LED.
> 
> 

Applied, thanks!

[1/3] arm64: dts: rockchip: Add Pinephone Pro support for GPIO LEDs
      commit: ee9b6b6414790223e8315ef0e25df69b3b5e6e50
[2/3] arm64: dts: rockchip: Enable PinePhone Pro IMU sensor
      commit: c1d9ced35621bdc894321ad284a29922dd3e7251
[3/3] arm64: dts: rockchip: Enable PinePhone Pro vibrator
      commit: 3f9cfd4f5e453aa33ca4dc40959a1cc524501160

Best regards,
-- 
Heiko Stuebner <heiko@sntech.de>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-06-24 16:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-23 16:53 [PATCH 1/3] arm64: dts: rockchip: Add Pinephone Pro support for GPIO LEDs Peter Robinson
2024-06-23 16:53 ` [PATCH 2/3] arm64: dts: rockchip: Enable PinePhone Pro IMU sensor Peter Robinson
2024-06-23 16:53 ` [PATCH 3/3] arm64: dts: rockchip: Enable PinePhone Pro vibrator Peter Robinson
2024-06-24 16:20 ` [PATCH 1/3] arm64: dts: rockchip: Add Pinephone Pro support for GPIO LEDs Heiko Stuebner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).