How to switch between two types of display?


#1

How to switch between two types of display?

version : debian-qcom-dragonboard410c-16.09

What I want to do is …
After rebooting, GPIO is input to Input, and the display is switched according to the status.

“panel @ 0” is commented out, and adv7533 only works.

Please support input gpio processing and .dtsi file modification.

/************* apq8016-sbc.dtsi file ***************/
&blsp_i2c4 {
	status = "ok";

	adv_bridge: bridge@39 {
		status = "ok";
		compatible = "adi,adv7533";
		reg = <0x39>;
		interrupt-parent = <&msmgpio>;
		interrupts = <31 2>;
		avdd-supply = <&pm8916_l6>;
		v3p3-supply = <&pm8916_l17>;
		adi,dsi-lanes = <4>;
		pd-gpios = <&msmgpio 32 0>;
		pinctrl-names = "default","sleep";
		pinctrl-0 = <&adv7533_int_active &adv7533_switch_active>;
		pinctrl-1 = <&adv7533_int_suspend &adv7533_switch_suspend>;
		#sound-dai-cells = <1>;

		port {
			adv_in: endpoint {
				remote-endpoint = <&dsi_out>;
			};
		};
	};

};

&blsp_i2c6 {
	status = "ok";
};

&mdss_dsi0 {
	status = "ok";

	port {
		dsi_out: endpoint {
			remote-endpoint = <&adv_in>;
		};
	};
/****************
	panel@0 {
		compatible = "auo,rm69052";
		reg = <0>;

		reset-gpios = <&msmgpio 25 GPIO_ACTIVE_HIGH>;
		power-on-delay= <50>;
		reset-delay = <100>;
		init-delay = <100>;
		flip-horizontal;
		flip-vertical;
		panel-width-mm = <160>;
		panel-height-mm = <90>;

		display-timings {
			timing-0 {
				clock-frequency = <57153600>;
				hactive = <720>;
				vactive = <1280>;
				hfront-porch = <16>;
				hback-porch = <11>;
				hsync-len = <5>;
				vfront-porch = <16>;
				vback-porch = <11>;
				vsync-len = <2>;
			};
		};

		port {
			panel0_in: endpoint {
				remote-endpoint = <&dsi_out>;
			};
		};
	};

	ports {
		port@1 {						
			dsi_out: endpoint {
				remote-endpoint = <&panel0_in>;
			};
		};
	};
***************/	
};

#2

Take a look at the LittleKernel sources. There is a library included
that allows the DT to be tweaked and it should be relatively easy for
you to read GPIO state from there.

Instructions are in the release notes under “How to get and customize
the bootloader”:
https://releases.linaro.org/96boards/dragonboard410c/linaro/debian/latest/


#3

I did not understand.

Is it possible to select DT according to GPIO state after flashing several DTs?


#4

hi,

yes, it is, well, if you implement the support in LK :wink: One of the purpose of LK is to pick the DTB and pass it over to the kernel. LK has support for GPIO, so you can use GPIO data to assist the selection of the DT before giving it to the kernel. It is not a kernel or DT feature, it is something that can be hacked up in the bootloader.


#5

Thank you very much.
Do you have a simple example or manual?


#6

No tutorial information that I’m aware of. It’s just source code (https://git.linaro.org/landing-teams/working/qualcomm/lk.git ) so you’ll need a decent source navigator to study the code and find suitable examples to use as inspiration. Personally I use git grep to find code of interest and then use cscope to work my way through the code.