About HDMI / DSI switch signal DSI_SW_SEL_APQ


#1

Hi, I’m trying to switch 410c display output from HDMI to DSI

I have edit my code follow dsi_porting_guide

but i check logcat the log is

“D/PPDaemon( 318): Panel Name: dsi_adv7533_1080p”

It is HDMI/DSI bridge

in hardware manual

Please note that the 96Boards specifications calls for a MIPI-DSI interface to be routed to the High Speed Expansion connector. Since the APQ8016 has only one MIPI-DSI interface. A muxing device(U11, FSA644UCK) is being use on the board. Only one interface, HDMI, or the Expansion MIPI-DSI can be active at a given time. The controlling signal is named ‘DSI_SW_SEL_APQ’. When this signal is logic low, ‘0’, the MIPI-DSI is routed to the DSI-HDMI Bridge. When ‘DSI_SW_SEL_APQ’ is logic level high, ‘1’, the MIPI-DSI is routed to the High Speed Expansion connector. This design assigned the ‘DSI_SW_SEL_APQ’ function to GPIO_32

where should i define dsi_sw_sel_aqp to HI?

Thanks


#2

Take a look at kernel/arch/arm/boot/dts/qcom/apq8016-sbc.dtsi:95
See how it is setting gpio 32 to 0x0? Try changing that to 0x1.

Note that you may ALSO need to specify your alternate panel configuration via the bootloader.
fastboot oem select-display-panel whatever_your_panel_name_is


#3

Thanks doitright ,I have find that but if I change that to 0x1 , it seems like change the gpio_32 to hi only,But it doesn’t change to boot to select panel in oem_panel.c?how does baseband switch dsi output/hdmi out put?
In the guild

Modify the msm8xxx-qrd.dts at arch/arm/boot/dts/qcom/ by adding the panel device tree.
For example,
/include/ “dsi-panel-<vendor>-720p-video.dtsi”
&mdss_mdp {
qcom,mdss-pref-prim-intf = “dsi”;
};
&mdss_pinmux {
qcom,num-grp-pins = <3>;
qcom,pins = <&gp 32>, <&gp 25>, <&gp 97>;
};
&mdss_dsi0 {
qcom,dsi-pref-prim-pan = <&dsi_<vendor>_720p_video>;
pinctrl-names = “default”, “sleep”;
pinctrl-0 = <&mdss_dsi_active>;
pinctrl-1 = <&mdss_dsi_suspend>;

I have add this code in msm8916-qrd.dts and change apq8016-sbc.dtsi:95 to 0x1 in log file it’s still not go in to the
oem_panel.c to select panel


#4

The DSI doesn’t care if you are using an adp7533 or not, which means that the panel configurations that are specific for the adp7533 can still be loaded even if the adp7533 is off.

Forget about the file the document points you to, that is a general file. You need to make your changes to apq8016-sbc.dtsi.

Notice at line 16 that it includes dsi-panel-jdi-1080p-video.dtsi.

If you look at that file, it is a panel configuration just like the two that are embedded in apq8016-sbc.dtsi.

oem_panel.c is part of littlekernel, NOT LINUX KERNEL.
littlekernel (LK) can feed a panel NAME to the linux kernel, or nothing at all.
You don’t need valid output from LK to get valid output from Linux.

NOTHING you change in the linux kernel will have any impact on LK.

You have two choices for setting which panel configuration you want;

  1. hard code it in the linux kernel. apq8016-sbc.dtsi:482
  2. use the fastboot command I showed in the previous message to pass the desired panel name from LK to linux.

What you need to do:

  1. set gpio 32 to hi to set the DSI output to the HS expansion port DSI pins.
  2. write a panel configuration file for your panel.
  3. include that panel configuration file in apq8016-sbc.dtsi
  4. instruct the linux kernel on which panel configuration to use.

Perhaps to make that just a little more clear with respect to HOW it switches; in the most crude manner relating to things like cars and tractors, gpio 32 is like the power wire to a relay. When it is ON, the inputs on the relay connect electrically to one set of outputs. When it is OFF, the inputs on the relay connect electrically to the other set of outputs. Thus the DSI output pins on the SoC will be connected to the DSI pins on the HS IO port when gpio32 is HI (on) and those same output pins on the SoC will be connected to the adv7533 input pins when gpio32 is LOW (off).

The panel configuration, regardless of what it is named, is just the settings given to the DSI so that its output will match the panel’s input. dsi_adv7533_1080p and dsi_adv7533_720p are just names for two possible DSI configurations. That they are loaded DOES NOT imply that the DSI signal is routed to the adv7533.


#5

Hi,I have some question

in apq8016-sbc.dtsi

i2c@78b8000 { /* BLSP1 QUP4 /
/
DSI_TO_HDMI I2C configuration /
adv7533@39 {
compatible = “adv7533”;
reg = <0x39>;
adv7533,video-mode = <3>; /
3 = 1080p */
adv7533,main-addr = <0x39>;
adv7533,cec-dsi-addr = <0x3C>;
adv7533,audio = <1>;
pinctrl-names = “pmx_adv7533_active”,“pmx_adv7533_suspend”;
pinctrl-0 = <&adv7533_int_active &adv7533_hpd_int_active &adv7533_switch_active>;
pinctrl-1 = <&adv7533_int_suspend &adv7533_hpd_int_suspend &adv7533_switch_suspend>;
adv7533,irq-gpio = <&msm_gpio 31 0x2002>;
adv7533,hpd-irq-gpio = <&msm_gpio 20 0x2003>;
adv7533,switch-gpio = <&msm_gpio 32 0x1>;
};

Is it give adv7533 setting?but this setting is called by which program?
And how can I decide when I compiler the kernel will call this apq8016-sbc.dtsi?not msm8916.dtsi , msm8916-qrd.dtsi or otohers dts files?

Thank you


#6

The adv7533 settings block is used by the adv7533 driver.
kernel/drivers/video/msm/mdss/adv7533_dsi2hdmi.c
kernel/Documentation/devicetree/bindings/fb/adv7533.txt

*** You need to stop fixating on the adv7533. Set the DSI switch to point the DSI signal to the HS expansion plug and be done with it. If the DSI switch is set to connect the DSI OUTPUT to the HS EXPANSION PLUG, then it doesn’t make ANY DIFFERENCE what the adv7533 is doing, because it doesn’t have the DSI signal to work with.

For your second question, I think you need to understand a bit more about a devicetree. In this case, ALL of those files are pulled in to build the devicetree. Look at the content of kernel/arch/arm/boot/dts/qcom/Makefile – or more specifically, look at lines 67-104 of that file which tells what files specific to CONFIG_ARCH_MSM8916 get compiled. Note: dtb = Device Tree Binary, dts = Device Tree Source, dtsi = Device Tree Source Include.

One of those dtb’s is apq8016-sbc.dtb, which is built out of apq8016-sbc.dts. If you look at apq8016-sbc.dts, there are a couple of include lines (each of which can have their own includes), and a couple of lines that filter which hardware that devicetree applies to, in this case, qcom,msm-id of 206 (MSM8916) or 247 (APQ8016) which are the two possible SoC’s that DB410c ships with (they are virtually identical, except that the MSM has a modem that isn’t connected to anywhere). Also a qcom,board-id of 24 (SBC). You can look at android/bootable/bootloader/lk/platform/msm_shared/smem.h for the list.

So when the kernel is compiled, ALL of these devicetrees are built and included in the boot.img that is produced. The bootloader, lk, picks the appropriate device tree and passes it to the linux kernel.


#7

Hi,Doitright Thank for your help,But I have some question

Now I edit kernel/arch/arm/boot/dts/qcom/apq8016-sbc.dtsi:95 Set GPIO 32 to high

and I probe the DSI pin , but i can’t measure any thing,Is it possible?

Now my setting is only change kernel/arch/arm/boot/dts/qcom/apq8016-sbc.dtsi:95 Set GPIO 32 to high

All I do is only switch the DSI signal from adv7533 to connector

But why can i measure DSI signal in connector?

Thank you~


#8

Have you confirmed that that GPIO actually is being set (and remaining) high? I think you should be able to read the state of that GPIO through debugfs. Please refer to the GPIO, hardware, and processor documentation.

As far as “probing the DSI pin” goes, you are well beyond my experience in dealing with DSI displays. I’m just relaying to you as much as I’ve learned/observed in studying the display architecture on this device.

Also, I know this is going to sound like a dumb question, but are you certain that the device is actually booting up on the kernel YOU built with this adjustment?

What I mean is this;
I’ve observed that making changes to the dts/dtsi files and then hitting “make” does NOT cause those updated devicetree files to be incorporated into the boot.img. I have had to run a “make clean” first, and follow that by a “make”. I actually use “make bootimg” from the full android source tree to generate the boot.img.

Second thing to note is that a broken kernel will sometimes cause the device to reboot. So if you are running your kernel via “fastboot boot boot.img” rather than actually installing it to the boot partition, it is possible that it is rebooting from a broken kernel and starting the installed kernel without being noticed.


#9

Thank you,I check the signal from HDMI output,IF I edit apq8016-sbc.dtsi:95 Set GPIO 32 to high,The HDMI is

still have output,And i edit

&mdss_dsi0 {
qcom,dsi-pref-prim-pan = <&dsi_adv7533_1080p> to <&dsi_jdi_1080_vid>;

The HDMI have no output,Then I edit the “dsi-panel-jdi-1080p-video.dtsi” make that setting the same as

adv7533,HDMI have output again,So I think I really change the setting

Now i am thinking adv7533,switch-gpio = <&msm_gpio 32 0x1> is the only way to switch GPIO 32?

Thank you


#10

It could be that the adv7533 driver itself is changing the state of the gpio, after all, the switch-gpio value being handed over to the adv7533 driver is effectively telling it what to do about it.

Ah, yeah. Look at drivers/video/msm/mdss/adv7533_dsi2hdmi.c line 710. Looks like it is flipping it on and off depending on the state of adv_output, which will be set at line 699 or 647 (different conditions that flip it on or off).

adv7533 could also be switching its OUTPUT on and off, depending on whether or not the input it receives is actually compatible.

So I’m thinking that you are in a state where the switch is being flipped back to adv7533, but the adv7533 is not liking the input, so disabling its outputs.

Some different options to make sure that the adv7533 does not get the output;

  1. module parameter panel=dsi (or anything else that does NOT include the substring “hdmi”)
  2. hack the driver at line 699 --> change true to false AND comment out line 700 if maybe the bootloader is sending in the parameter (cat /proc/cmdline to check if it is).

Note that the module parameter is overriding, since it is processed after line 699.


#11

Update

i2c@78b8000 { /* BLSP1 QUP4 /
/
DSI_TO_HDMI I2C configuration /
adv7533@39 {
compatible = “adv7533”;
reg = <0x39>;
adv7533,video-mode = <3>; /
3 = 1080p */
adv7533,main-addr = <0x39>;
adv7533,cec-dsi-addr = <0x3C>;
adv7533,audio = <1>;
pinctrl-names = “pmx_adv7533_active”,“pmx_adv7533_suspend”;
pinctrl-0 = <&adv7533_int_active &adv7533_hpd_int_active &adv7533_switch_active>;
pinctrl-1 = <&adv7533_int_suspend &adv7533_hpd_int_suspend &adv7533_switch_suspend>;
adv7533,irq-gpio = <&msm_gpio 31 0x2002>;
adv7533,hpd-irq-gpio = <&msm_gpio 20 0x2003>;
adv7533,switch-gpio = <&msm_gpio 32 0x0>;
adv7533,disable-gpios = <1>; //Add this line can switch MIPI to HS connector
};