Skip to contentSkip to conversation

arm64: dts: rockchip: add Hynitron cst340 for Anbernic 353 series

PATCH Superseded Chris Morgan 3 participants 4 messages Nov 26, 2022 – Apr 12, 2023

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm64: dts: rockchip: add Hynitron cst340 for Anbernic 353 series

From: Chris Morgan <[email protected]>

Add support for the Hynitron cst340 touchscreen driver to the Anbernic RG353P and RG353V devices. Note the RG353VS device does not have a touchscreen.

https://lore.kernel.org/linux-input/Y1y9e9sgE%[email protected]/

---
 .../dts/rockchip/rk3566-anbernic-rg353p.dts   | 20 +++++++++++++++++++
 .../dts/rockchip/rk3566-anbernic-rg353v.dts   | 13 ++++++++++++
 2 files changed, 33 insertions(+)
arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg353p.dts +20 -0
index 63cff402f3a8..06222dead921 100644
@@ -95,6 +95,19 @@ &i2c2 {
 	pintctrl-names = "default";
 	pinctrl-0 = <&i2c2m1_xfer>;
 	status = "okay";
+
+	touch@1a {
+		compatible = "hynitron,cst340";
+		reg = <0x1a>;
+		interrupt-parent = <&gpio4>;
+		interrupts = <RK_PB1 IRQ_TYPE_EDGE_FALLING>;
+		pinctrl-0 = <&touch_rst>;
+		pinctrl-names = "default";
+		reset-gpios = <&gpio4 RK_PA6 GPIO_ACTIVE_LOW>;
+		touchscreen-size-x = <640>;
+		touchscreen-size-y = <480>;
+		status = "okay";
+	};
 };
 
 &pinctrl {
@@ -104,6 +117,13 @@ spk_amp_enable_h: spk-amp-enable-h {
 				<4 RK_PC2 RK_FUNC_GPIO &pcfg_pull_none>;
 		};
 	};
+
+	touch {
+		touch_rst: touch-rst {
+			rockchip,pins =
+				<4 RK_PA6 RK_FUNC_GPIO &pcfg_pull_up>;
+		};
+	};
 };
 
 &rk817 {
arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg353v.dts +13 -0
index 885234a023e1..dc3fc67f5853 100644
@@ -82,6 +82,19 @@ &i2c2 {
 	pintctrl-names = "default";
 	pinctrl-0 = <&i2c2m1_xfer>;
 	status = "okay";
+
+	touch@1a {
+		compatible = "hynitron,cst340";
+		reg = <0x1a>;
+		interrupt-parent = <&gpio4>;
+		interrupts = <RK_PB1 IRQ_TYPE_EDGE_FALLING>;
+		pinctrl-0 = <&touch_rst>;
+		pinctrl-names = "default";
+		reset-gpios = <&gpio4 RK_PA6 GPIO_ACTIVE_LOW>;
+		touchscreen-size-x = <640>;
+		touchscreen-size-y = <480>;
+		status = "okay";
+	};
 };
 
 &pinctrl {
Signature · 1 line
2.25.1
#1 lore raw

PATCH 1/1 arm64: dts: rockchip: add panel to Anbernic RG353 series

From: Chris Morgan <[email protected]>

Add support for the newly mainlined panel to the RG353 series of devices.

https://lore.kernel.org/dri-devel/CACRpkdatn3SFaSDwj33QVvx_B-020TaTDoPz3p_9K=EiT7A_7w@mail.gmail.com/

---
 .../dts/rockchip/rk3566-anbernic-rg353x.dtsi  | 58 +++++++++++++++++++
 1 file changed, 58 insertions(+)
arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg353x.dtsi +58 -0
index 65a80d1f6d91..17450aa283b9 100644
@@ -20,6 +20,48 @@ &cru {
 	assigned-clock-rates = <1200000000>, <200000000>, <241500000>;
 };
 
+&dsi_dphy0 {
+	status = "okay";
+};
+
+&dsi0 {
+	status = "okay";
+	#address-cells = <1>;
+	#size-cells = <0>;
+
+	ports {
+		dsi0_in: port@0 {
+			reg = <0>;
+			dsi0_in_vp1: endpoint {
+				remote-endpoint = <&vp1_out_dsi0>;
+			};
+		};
+
+		dsi0_out: port@1 {
+			reg = <1>;
+			mipi_out_panel: endpoint {
+				remote-endpoint = <&mipi_in_panel>;
+			};
+		};
+	};
+
+	panel: panel@0 {
+		compatible = "anbernic,rg353p-panel", "newvision,nv3051d";
+		reg = <0>;
+		backlight = <&backlight>;
+		pinctrl-names = "default";
+		pinctrl-0 = <&lcd_rst>;
+		reset-gpios = <&gpio4 RK_PA0 GPIO_ACTIVE_LOW>;
+		vdd-supply = <&vcc3v3_lcd0_n>;
+
+		port {
+			mipi_in_panel: endpoint {
+				remote-endpoint = <&mipi_out_panel>;
+			};
+		};
+	};
+};
+
 &gpio_keys_control {
 	button-a {
 		gpios = <&gpio3 RK_PC2 GPIO_ACTIVE_LOW>;
@@ -55,6 +97,22 @@ power-monitor@62 {
 	};
 };
 
+&pinctrl {
+	gpio-lcd {
+		lcd_rst: lcd-rst {
+			rockchip,pins =
+				<4 RK_PA0 RK_FUNC_GPIO &pcfg_pull_none>;
+		};
+	};
+};
+
 &pwm4 {
 	status = "okay";
 };
+
+&vp1 {
+	vp1_out_dsi0: endpoint@ROCKCHIP_VOP2_EP_MIPI0 {
+		reg = <ROCKCHIP_VOP2_EP_MIPI0>;
+		remote-endpoint = <&dsi0_in_vp1>;
+	};
+};
Signature · 1 line
2.25.1
maintainer Applied
#2 lore raw

Re: [PATCH] arm64: dts: rockchip: add panel to Anbernic RG353 series

Quoted 8 lines · Chris Morgan

From: Chris Morgan <[email protected]>

Add support for the newly mainlined panel to the RG353 series of devices.

https://lore.kernel.org/dri-devel/CACRpkdatn3SFaSDwj33QVvx_B-020TaTDoPz3p_9K=EiT7A_7w@mail.gmail.com/

[...]

Applied, thanks!

[1/1] arm64: dts: rockchip: add panel to Anbernic RG353 series

      commit: 5e60ec02ec30e2db3088196a10fd20be5432bb6d

Best regards,

Signature · 1 line
Heiko Stuebner <[email protected]>
#3 lore raw
In reply to Chris Morgan
Quoted 24 lines · Chris Morgan

From: Chris Morgan <[email protected]>

Add support for the Hynitron cst340 touchscreen driver to the Anbernic RG353P and RG353V devices. Note the RG353VS device does not have a touchscreen.

https://lore.kernel.org/linux-input/Y1y9e9sgE%[email protected]/

---
 .../dts/rockchip/rk3566-anbernic-rg353p.dts   | 20 +++++++++++++++++++
 .../dts/rockchip/rk3566-anbernic-rg353v.dts   | 13 ++++++++++++
 2 files changed, 33 insertions(+)
arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg353p.dts +2 -0
index 63cff402f3a8..06222dead921 100644
@@ -95,6 +95,19 @@ &i2c2 {
 	pintctrl-names = "default";
 	pinctrl-0 = <&i2c2m1_xfer>;
 	status = "okay";
+
+	touch@1a {

arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg353p.dts &i2c2 { · line 109

Quoted 10 lines
arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg353p.dts +10 -0
+		compatible = "hynitron,cst340";
+		reg = <0x1a>;
+		interrupt-parent = <&gpio4>;
+		interrupts = <RK_PB1 IRQ_TYPE_EDGE_FALLING>;
+		pinctrl-0 = <&touch_rst>;
+		pinctrl-names = "default";
+		reset-gpios = <&gpio4 RK_PA6 GPIO_ACTIVE_LOW>;
+		touchscreen-size-x = <640>;
+		touchscreen-size-y = <480>;
+		status = "okay";

Was it disabled anywhere?

Quoted 28 lines
arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg353p.dts +8 -0
+	};
 };
 
 &pinctrl {
@@ -104,6 +117,13 @@ spk_amp_enable_h: spk-amp-enable-h {
 				<4 RK_PC2 RK_FUNC_GPIO &pcfg_pull_none>;
 		};
 	};
+
+	touch {
+		touch_rst: touch-rst {
+			rockchip,pins =
+				<4 RK_PA6 RK_FUNC_GPIO &pcfg_pull_up>;
+		};
+	};
 };
 
 &rk817 {
arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg353v.dts +2 -0
index 885234a023e1..dc3fc67f5853 100644
@@ -82,6 +82,19 @@ &i2c2 {
 	pintctrl-names = "default";
 	pinctrl-0 = <&i2c2m1_xfer>;
 	status = "okay";
+
+	touch@1a {

arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg353v.dts &i2c2 { · line 96

Quoted 10 lines
arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg353v.dts +10 -0
+		compatible = "hynitron,cst340";
+		reg = <0x1a>;
+		interrupt-parent = <&gpio4>;
+		interrupts = <RK_PB1 IRQ_TYPE_EDGE_FALLING>;
+		pinctrl-0 = <&touch_rst>;
+		pinctrl-names = "default";
+		reset-gpios = <&gpio4 RK_PA6 GPIO_ACTIVE_LOW>;
+		touchscreen-size-x = <640>;
+		touchscreen-size-y = <480>;
+		status = "okay";

Same question.

Best regards,
Krzysztof