From 0ea70dad0103bf2fff3ea6af27bdbc520593a3da Mon Sep 17 00:00:00 2001 From: Icenowy Zheng Date: Thu, 18 Oct 2018 15:33:25 +0800 Subject: [PATCH] arm64: allwinner: a64: enable LCD-related hardware for Pinebook 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. There're pinebooks with 3 different panels in the wild, all 3 with different timings. Add all the compatibles to panel node and hope that we can get correct timings from EDID. If reading EDID fails it's up to firmware to fixup compatible string. Enable all this hardware in device tree. Signed-off-by: Icenowy Zheng Signed-off-by: Vasily Khoruzhick --- .../dts/allwinner/sun50i-a64-pinebook.dts | 78 +++++++++++++++++++ 1 file changed, 78 insertions(+) diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts index b868739fcce2..eca90e5b036c 100644 --- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts @@ -63,6 +63,26 @@ }; }; + edp: edp-connector { + /* Pine64 used 3 different panels in Pinebooks: + * 14" 768p panel - boe,hb140wx1-501, + * 11" 768p panel - innolux,n116bge, + * 11" 1080p panel - neweast,wjfh116008a. + * It's not really important what compatible to use here since bridge + * driver will get modes from EDID nevertheless, so use boe compatible. + * if EDID or AUX line is broken it's up to bootloader to fix it up. + */ + compatible = "boe,hb140wx1-501", "edp-connector"; + backlight = <&backlight>; + power-supply = <®_dc1sw>; + + port { + edp_connector_in: endpoint { + remote-endpoint = <&anx6345_out_edp>; + }; + }; + }; + hdmi-connector { compatible = "hdmi-connector"; type = "c"; @@ -146,6 +166,10 @@ status = "okay"; }; +&mixer0 { + status = "okay"; +}; + &mmc0 { pinctrl-names = "default"; pinctrl-0 = <&mmc0_pins>; @@ -197,6 +221,46 @@ status = "okay"; }; +&r_i2c { + pinctrl-names = "default"; + pinctrl-0 = <&r_i2c_pins_a>; + status = "okay"; + + anx6345: anx6345@38 { + compatible = "analogix,anx6345"; + reg = <0x38>; + reset-gpios = <&pio 3 24 GPIO_ACTIVE_HIGH>; /* PD24 */ + dvdd25-supply = <®_dldo2>; + dvdd12-supply = <®_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 = <&edp_connector_in>; + }; + }; + }; + }; +}; + &r_rsb { status = "okay"; @@ -372,6 +436,20 @@ status = "okay"; }; +&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>; + }; +}; + &ths { status = "okay"; };