Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Panel driver for both clover variants unified #41

Merged
merged 5 commits into from
Sep 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 23 additions & 4 deletions arch/arm64/boot/dts/qcom/sdm660-xiaomi-clover-common.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,17 @@
voltage-max-design-microvolt = <4408000>;
};

lcd_pwr: lcd-power-regulator {
compatible = "regulator-fixed";
regulator-name = "lcd_pwr";
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
gpio = <&pm660l_gpios 5 GPIO_ACTIVE_HIGH>;
enable-active-high;
pinctrl-names = "default";
pinctrl-0 = <&lcd_pwr_en_default>;
};

vph_pwr: vph-pwr-regulator {
compatible = "regulator-fixed";
regulator-name = "vph_pwr";
Expand Down Expand Up @@ -107,7 +118,7 @@
};

&adreno_gpu {
status = "disabled"; // TODO: set to okay when display stack works
status = "okay";

zap-shader {
memory-region = <&zap_shader_region>;
Expand Down Expand Up @@ -148,7 +159,7 @@
};

&mdss {
status = "disabled"; // TODO: enable this when panel works
status = "okay";
};

&mmcc {
Expand All @@ -174,6 +185,14 @@
status = "okay";
};

&pm660l_gpios {
lcd_pwr_en_default: lcd-pwr-en-default-state {
pins = "gpio5";
function = "normal";
bias-disable;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's hard to find documentation sometimes, but for pmic GPIOs valid function names are documented here https://elixir.bootlin.com/linux/v6.11/source/Documentation/devicetree/bindings/pinctrl/qcom,pmic-gpio.yaml#L500

and also as CI check-dtbs says

gpio' is not one of ['normal', 'paired', 'func1', 'func2', 'dtest1', 'dtest2', 'dtest3', 'dtest4', 'func3', 'func4']
	from schema $id: http://devicetree.org/schemas/mfd/qcom,spmi-pmic.yaml#
/home/runner/work/linux/linux/build-dtbs-check/arch/arm64/boot/dts/qcom/sdm660-xiaomi-clover-plus.dtb: gpio@c000: lcd-pwr-en-default-state: 'oneOf' conditional failed, one must be fixed:
	'bias-disable', 'function', 'pins' do not match any of the regexes: '(pinconf|-pins)$', 'pinctrl-[0-9]+'
	'gpio' is not one of ['normal', 'paired', 'func1', 'func2', 'dtest1', 'dtest2', 'dtest3', 'dtest4', 'func3', 'func4']
	from schema $id: http://devicetree.org/schemas/pinctrl/qcom,pmic-gpio.yaml#

so at least "function" should be changed to "normal" I guess

Valid names for functions are also here: https://elixir.bootlin.com/linux/v6.11/source/include/dt-bindings/pinctrl/qcom,pmic-gpio.h#L98

};
};

&pm660_rradc {
status = "okay";
};
Expand Down Expand Up @@ -553,14 +572,14 @@
&tlmm {
gpio-reserved-ranges = <0 4>;

mdss_dsi_active: mdss-dsi-active-state {
mdss_dsi_reset: mdss-dsi-reset-state {
pins = "gpio62";
function = "gpio";
drive-strength = <8>;
bias-disable;
};

mdss_te_active: mdss-te-active-state {
mdss_vsync_active: mdss-vsync-active-state {
pins = "gpio59";
function = "mdp_vsync";
drive-strength = <2>;
Expand Down
14 changes: 5 additions & 9 deletions arch/arm64/boot/dts/qcom/sdm660-xiaomi-clover-plus.dts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
regulator-min-microvolt = <3150000>;
regulator-max-microvolt = <3150000>;

gpio = <&tlmm 72 0>;
gpio = <&tlmm 72 GPIO_ACTIVE_HIGH>;
enable-active-high;

startup-delay-us = <70000>;
Expand Down Expand Up @@ -101,27 +101,23 @@
};

&mdss_dsi0 {
status = "disabled";
status = "okay";

#address-cells = <1>;
#size-cells = <0>;
vdd-supply = <&vreg_l1b_0p925>;
vdda-supply = <&vreg_l1a_1p225>;
//vdda-1p2-supply = <0x109>; // pm660_ldoa1
//vdda-0p9-supply = <0x105>; // pm660l_ldob1
//vdda-3p3-supply = <0x197>; // pm660l_ldob6
//wqhd-vddio-supply = <0x17e>; // pm660_ldoa11

panel: panel@0 {
compatible = "boe,nt51021-10wu";
reg = <0>;

backlight = <&i2c_backlight>;

reset-gpios = <&tlmm 62 GPIO_ACTIVE_HIGH>;
avdd-supply = <&lcd_pwr>;
reset-gpios = <&tlmm 62 GPIO_ACTIVE_LOW>;

pinctrl-names = "default";
pinctrl-0 = <&mdss_dsi_active &mdss_te_active>;
pinctrl-0 = <&mdss_dsi_reset &mdss_vsync_active>;

port {
panel_in: endpoint {
Expand Down
46 changes: 46 additions & 0 deletions arch/arm64/boot/dts/qcom/sdm660-xiaomi-clover.dts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,52 @@
};
};

&mdss_dsi0 {
status = "okay";

#address-cells = <1>;
#size-cells = <0>;
vdd-supply = <&vreg_l1b_0p925>;
vdda-supply = <&vreg_l1a_1p225>;

panel: panel@0 {
compatible = "boe,nt51021";
reg = <0>;

backlight = <&pm660l_wled>;

avdd-supply = <&lcd_pwr>;
reset-gpios = <&tlmm 62 GPIO_ACTIVE_LOW>;

pinctrl-names = "default";
pinctrl-0 = <&mdss_dsi_reset &mdss_vsync_active>;

port {
panel_in: endpoint {
remote-endpoint = <&mdss_dsi0_out>;
};
};
};
};

&mdss_dsi0_out {
data-lanes = <0 1 2 3>;
remote-endpoint = <&panel_in>;
};

&mdss_dsi0_phy {
vcca-supply = <&vreg_l1b_0p925>;
status = "okay";
};

&pm660l_wled {
status = "okay";

qcom,switching-freq = <800>;
qcom,current-limit-microamp = <20000>;
qcom,num-strings = <3>;
};

&simplefb {
/*
* Prevent unused clocks and power domains from being disabled. It's
Expand Down
1 change: 1 addition & 0 deletions arch/arm64/configs/sdm660_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,7 @@ CONFIG_DRM_MSM=m
# CONFIG_DRM_MSM_MDP4 is not set
# CONFIG_DRM_MSM_HDMI is not set
CONFIG_DRM_PANEL_BOE_TD4320=m
CONFIG_DRM_PANEL_BOE_NT51021=m
CONFIG_DRM_PANEL_BOE_TV101WUM_NL6=m
CONFIG_DRM_PANEL_FT8716U=m
CONFIG_DRM_PANEL_DSI_CM=y
Expand Down
10 changes: 10 additions & 0 deletions drivers/gpu/drm/panel/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,16 @@ config DRM_PANEL_BOE_TD4320
Say Y here if you want to enable support for BOE TD4320 panel
used in Xiaomi Redmi Note 7 phone.

config DRM_PANEL_BOE_NT51021
tristate "BOE NT51021-based panels for Xiaomi Mi Pad 4"
depends on OF
depends on DRM_MIPI_DSI
depends on BACKLIGHT_CLASS_DEVICE
help
Say Y here if you want to enable support for BOE NT51021
8-inch and 10-inch DSI video mode panels used in Xiaomi Mi Pad 4
and Xiaomi Mi Pad 4 PLUS.

config DRM_PANEL_BOE_TV101WUM_NL6
tristate "BOE TV101WUM and AUO KD101N80 45NA 1200x1920 panel"
depends on OF
Expand Down
1 change: 1 addition & 0 deletions drivers/gpu/drm/panel/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ obj-$(CONFIG_DRM_PANEL_BOE_BF060Y8M_AJ0) += panel-boe-bf060y8m-aj0.o
obj-$(CONFIG_DRM_PANEL_BOE_HIMAX8279D) += panel-boe-himax8279d.o
obj-$(CONFIG_DRM_PANEL_BOE_TH101MB31UIG002_28A) += panel-boe-th101mb31ig002-28a.o
obj-$(CONFIG_DRM_PANEL_BOE_TD4320) += panel-boe-td4320.o
obj-$(CONFIG_DRM_PANEL_BOE_NT51021) += panel-boe-nt51021.o
obj-$(CONFIG_DRM_PANEL_BOE_TV101WUM_NL6) += panel-boe-tv101wum-nl6.o
obj-$(CONFIG_DRM_PANEL_DSI_CM) += panel-dsi-cm.o
obj-$(CONFIG_DRM_PANEL_LVDS) += panel-lvds.o
Expand Down
Loading