diff mbox series

[6/6] arm64: allwinner: a64: enable LCD-related hardware for Pinebook

Message ID 20200220083508.792071-7-anarsoul@gmail.com (mailing list archive)
State New, archived
Headers show
Series Add LCD support for Pine64 Pinebook 1080p | expand

Commit Message

Vasily Khoruzhick Feb. 20, 2020, 8:35 a.m. UTC
From: Icenowy Zheng <icenowy@aosc.io>

Pinebook has an ANX6345 bridge connected to the RGB666 LCD output and
eDP panel input. The bridge is controlled via I2C that's connected to
R_I2C bus.

Enable all this hardware in device tree.

Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
---
 .../dts/allwinner/sun50i-a64-pinebook.dts     | 69 ++++++++++++++++++-
 1 file changed, 68 insertions(+), 1 deletion(-)

Comments

Laurent Pinchart Feb. 20, 2020, 2:17 p.m. UTC | #1
Hi Vasily,

Thank you for the patch.

On Thu, Feb 20, 2020 at 12:35:08AM -0800, Vasily Khoruzhick wrote:
> From: Icenowy Zheng <icenowy@aosc.io>
> 
> Pinebook has an ANX6345 bridge connected to the RGB666 LCD output and
> eDP panel input. The bridge is controlled via I2C that's connected to
> R_I2C bus.
> 
> Enable all this hardware in device tree.
> 
> Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
> Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
> ---
>  .../dts/allwinner/sun50i-a64-pinebook.dts     | 69 ++++++++++++++++++-
>  1 file changed, 68 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts
> index c06c540e6c08..f5633f550d8a 100644
> --- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts
> +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts
> @@ -48,6 +48,18 @@ lid_switch {
>  		};
>  	};
>  
> +	panel_edp: panel-edp {
> +		compatible = "neweast,wjfh116008a";
> +		backlight = <&backlight>;
> +		power-supply = <&reg_dc1sw>;
> +
> +		port {
> +			panel_edp_in: endpoint {
> +				remote-endpoint = <&anx6345_out_edp>;
> +			};
> +		};
> +	};
> +
>  	reg_vbklt: vbklt {
>  		compatible = "regulator-fixed";
>  		regulator-name = "vbklt";
> @@ -109,6 +121,10 @@ &dai {
>  	status = "okay";
>  };
>  
> +&de {
> +	status = "okay";
> +};
> +
>  &ehci0 {
>  	phys = <&usbphy 0>;
>  	phy-names = "usb";
> @@ -119,6 +135,10 @@ &ehci1 {
>  	status = "okay";
>  };
>  
> +&mixer0 {
> +	status = "okay";
> +};
> +
>  &mmc0 {
>  	pinctrl-names = "default";
>  	pinctrl-0 = <&mmc0_pins>;
> @@ -177,12 +197,45 @@ &pwm {
>  	status = "okay";
>  };
>  
> -/* The ANX6345 eDP-bridge is on r_i2c */
>  &r_i2c {
>  	clock-frequency = <100000>;
>  	pinctrl-names = "default";
>  	pinctrl-0 = <&r_i2c_pl89_pins>;
>  	status = "okay";
> +
> +	anx6345: anx6345@38 {
> +		compatible = "analogix,anx6345";
> +		reg = <0x38>;
> +		reset-gpios = <&pio 3 24 GPIO_ACTIVE_LOW>; /* PD24 */
> +		dvdd25-supply = <&reg_dldo2>;
> +		dvdd12-supply = <&reg_fldo1>;
> +
> +		ports {
> +			#address-cells = <1>;
> +			#size-cells = <0>;
> +
> +			anx6345_in: port@0 {
> +				#address-cells = <1>;
> +				#size-cells = <0>;
> +				reg = <0>;
> +				anx6345_in_tcon0: endpoint@0 {
> +					reg = <0>;
> +					remote-endpoint = <&tcon0_out_anx6345>;
> +				};

As there's a single endpoint, you can drop the reg property, the @0
suffix, and the #address-cells and #size-cells property in the port@0
node (but not in the ports node).

> +			};
> +
> +			anx6345_out: port@1 {
> +				#address-cells = <1>;
> +				#size-cells = <0>;
> +				reg = <1>;
> +
> +				anx6345_out_edp: endpoint@0 {
> +					reg = <0>;
> +					remote-endpoint = <&panel_edp_in>;
> +				};

Same here.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> +			};
> +		};
> +	};
>  };
>  
>  &r_pio {
> @@ -357,6 +410,20 @@ &sound {
>  			"MIC2", "Internal Microphone Right";
>  };
>  
> +&tcon0 {
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&lcd_rgb666_pins>;
> +
> +	status = "okay";
> +};
> +
> +&tcon0_out {
> +	tcon0_out_anx6345: endpoint@0 {
> +		reg = <0>;
> +		remote-endpoint = <&anx6345_in_tcon0>;
> +	};
> +};
> +
>  &uart0 {
>  	pinctrl-names = "default";
>  	pinctrl-0 = <&uart0_pb_pins>;
Vasily Khoruzhick Feb. 20, 2020, 9:37 p.m. UTC | #2
On Thu, Feb 20, 2020 at 6:17 AM Laurent Pinchart
<laurent.pinchart@ideasonboard.com> wrote:
>
> Hi Vasily,

Hi Laurent,

> Thank you for the patch.
>
> On Thu, Feb 20, 2020 at 12:35:08AM -0800, Vasily Khoruzhick wrote:
> > From: Icenowy Zheng <icenowy@aosc.io>
> >
> > Pinebook has an ANX6345 bridge connected to the RGB666 LCD output and
> > eDP panel input. The bridge is controlled via I2C that's connected to
> > R_I2C bus.
> >
> > Enable all this hardware in device tree.
> >
> > Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
> > Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
> > ---
> >  .../dts/allwinner/sun50i-a64-pinebook.dts     | 69 ++++++++++++++++++-
> >  1 file changed, 68 insertions(+), 1 deletion(-)
> >
> > diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts
> > index c06c540e6c08..f5633f550d8a 100644
> > --- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts
> > +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts
> > @@ -48,6 +48,18 @@ lid_switch {
> >               };
> >       };
> >
> > +     panel_edp: panel-edp {
> > +             compatible = "neweast,wjfh116008a";
> > +             backlight = <&backlight>;
> > +             power-supply = <&reg_dc1sw>;
> > +
> > +             port {
> > +                     panel_edp_in: endpoint {
> > +                             remote-endpoint = <&anx6345_out_edp>;
> > +                     };
> > +             };
> > +     };
> > +
> >       reg_vbklt: vbklt {
> >               compatible = "regulator-fixed";
> >               regulator-name = "vbklt";
> > @@ -109,6 +121,10 @@ &dai {
> >       status = "okay";
> >  };
> >
> > +&de {
> > +     status = "okay";
> > +};
> > +
> >  &ehci0 {
> >       phys = <&usbphy 0>;
> >       phy-names = "usb";
> > @@ -119,6 +135,10 @@ &ehci1 {
> >       status = "okay";
> >  };
> >
> > +&mixer0 {
> > +     status = "okay";
> > +};
> > +
> >  &mmc0 {
> >       pinctrl-names = "default";
> >       pinctrl-0 = <&mmc0_pins>;
> > @@ -177,12 +197,45 @@ &pwm {
> >       status = "okay";
> >  };
> >
> > -/* The ANX6345 eDP-bridge is on r_i2c */
> >  &r_i2c {
> >       clock-frequency = <100000>;
> >       pinctrl-names = "default";
> >       pinctrl-0 = <&r_i2c_pl89_pins>;
> >       status = "okay";
> > +
> > +     anx6345: anx6345@38 {
> > +             compatible = "analogix,anx6345";
> > +             reg = <0x38>;
> > +             reset-gpios = <&pio 3 24 GPIO_ACTIVE_LOW>; /* PD24 */
> > +             dvdd25-supply = <&reg_dldo2>;
> > +             dvdd12-supply = <&reg_fldo1>;
> > +
> > +             ports {
> > +                     #address-cells = <1>;
> > +                     #size-cells = <0>;
> > +
> > +                     anx6345_in: port@0 {
> > +                             #address-cells = <1>;
> > +                             #size-cells = <0>;
> > +                             reg = <0>;
> > +                             anx6345_in_tcon0: endpoint@0 {
> > +                                     reg = <0>;
> > +                                     remote-endpoint = <&tcon0_out_anx6345>;
> > +                             };
>
> As there's a single endpoint, you can drop the reg property, the @0
> suffix, and the #address-cells and #size-cells property in the port@0
> node (but not in the ports node).

Will do

> > +                     };
> > +
> > +                     anx6345_out: port@1 {
> > +                             #address-cells = <1>;
> > +                             #size-cells = <0>;
> > +                             reg = <1>;
> > +
> > +                             anx6345_out_edp: endpoint@0 {
> > +                                     reg = <0>;
> > +                                     remote-endpoint = <&panel_edp_in>;
> > +                             };
>
> Same here.

Will do

> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

Thanks for reviewing the series!


>
> > +                     };
> > +             };
> > +     };
> >  };
> >
> >  &r_pio {
> > @@ -357,6 +410,20 @@ &sound {
> >                       "MIC2", "Internal Microphone Right";
> >  };
> >
> > +&tcon0 {
> > +     pinctrl-names = "default";
> > +     pinctrl-0 = <&lcd_rgb666_pins>;
> > +
> > +     status = "okay";
> > +};
> > +
> > +&tcon0_out {
> > +     tcon0_out_anx6345: endpoint@0 {
> > +             reg = <0>;
> > +             remote-endpoint = <&anx6345_in_tcon0>;
> > +     };
> > +};
> > +
> >  &uart0 {
> >       pinctrl-names = "default";
> >       pinctrl-0 = <&uart0_pb_pins>;
>
> --
> Regards,
>
> Laurent Pinchart
diff mbox series

Patch

diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts
index c06c540e6c08..f5633f550d8a 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts
@@ -48,6 +48,18 @@  lid_switch {
 		};
 	};
 
+	panel_edp: panel-edp {
+		compatible = "neweast,wjfh116008a";
+		backlight = <&backlight>;
+		power-supply = <&reg_dc1sw>;
+
+		port {
+			panel_edp_in: endpoint {
+				remote-endpoint = <&anx6345_out_edp>;
+			};
+		};
+	};
+
 	reg_vbklt: vbklt {
 		compatible = "regulator-fixed";
 		regulator-name = "vbklt";
@@ -109,6 +121,10 @@  &dai {
 	status = "okay";
 };
 
+&de {
+	status = "okay";
+};
+
 &ehci0 {
 	phys = <&usbphy 0>;
 	phy-names = "usb";
@@ -119,6 +135,10 @@  &ehci1 {
 	status = "okay";
 };
 
+&mixer0 {
+	status = "okay";
+};
+
 &mmc0 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&mmc0_pins>;
@@ -177,12 +197,45 @@  &pwm {
 	status = "okay";
 };
 
-/* The ANX6345 eDP-bridge is on r_i2c */
 &r_i2c {
 	clock-frequency = <100000>;
 	pinctrl-names = "default";
 	pinctrl-0 = <&r_i2c_pl89_pins>;
 	status = "okay";
+
+	anx6345: anx6345@38 {
+		compatible = "analogix,anx6345";
+		reg = <0x38>;
+		reset-gpios = <&pio 3 24 GPIO_ACTIVE_LOW>; /* PD24 */
+		dvdd25-supply = <&reg_dldo2>;
+		dvdd12-supply = <&reg_fldo1>;
+
+		ports {
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			anx6345_in: port@0 {
+				#address-cells = <1>;
+				#size-cells = <0>;
+				reg = <0>;
+				anx6345_in_tcon0: endpoint@0 {
+					reg = <0>;
+					remote-endpoint = <&tcon0_out_anx6345>;
+				};
+			};
+
+			anx6345_out: port@1 {
+				#address-cells = <1>;
+				#size-cells = <0>;
+				reg = <1>;
+
+				anx6345_out_edp: endpoint@0 {
+					reg = <0>;
+					remote-endpoint = <&panel_edp_in>;
+				};
+			};
+		};
+	};
 };
 
 &r_pio {
@@ -357,6 +410,20 @@  &sound {
 			"MIC2", "Internal Microphone Right";
 };
 
+&tcon0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&lcd_rgb666_pins>;
+
+	status = "okay";
+};
+
+&tcon0_out {
+	tcon0_out_anx6345: endpoint@0 {
+		reg = <0>;
+		remote-endpoint = <&anx6345_in_tcon0>;
+	};
+};
+
 &uart0 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&uart0_pb_pins>;