tT2-4g R32.3.1 LCD0_BKLT_PWM

Err…

I don’t understand why your kernel goes to board-panel.c

Open the default source code of board-panel.c and you shall see below.

void tegra_pwm_bl_ops_register(struct device *dev)
{
bool ret = 0;
if (tegra_dc_is_nvdisplay())
return;
ret = tegra_available_pwm_bl_ops_register(dev);
if (!ret)

If you are using TX2, then that it is nvdisplay so it will return directly.

board-panel.c should not do anything to parse the DT as you pointed put.

It appears that pwm and backlight is getting called before any of my mipi DSI code, so tegra_dc_is_nvdisplay() might not be set correctly yet. putting in debug prints to determine this.

FYI: Also found that the WARN is crashing in tegra_available_pwm_bl_ops_register
pn_compat = of_get_property(np_bl, “compatible”, NULL);
if (!pn_compat) {
printk("%s(%d) %p No compatible prop in backlight node 2\n ", FUNCTION, LINE, np_bl);
// WARN(1, “No compatible prop in backlight node 2\n”);
goto end;
}

BINGO, tegra_dc_is_nvdisplay is 0 when tegra_pwm_bl_ops_register is called, That is why my system is acting different.

So what controls tegra_dc_is_nvdisplay?

If you are TX2 series or Xavier series, then they are all nvdisplay unless you modify something.

Check the definition of tegra_dc_is_nvdisplay shall help you find the answer.

will look into these two messages.

[ 0.983241] Node path /chosen/display-board not found
[ 0.983278] pwm_bl_ops are not required

will debug pwm-backlight

pwm_backlight_probe appears to be working correctly

You don’t really need to check that. What you should do is find out why your TX2 board is not nvdisplay.

This will cause your driver flow totally different from our general path.

Yes, you should check this.

Maybe that is why I had so much trouble getting mipi dsi to work! Remember this is r32.3.1… tx2

I did not change anything in this tegra_dc_is_nvdisplay area, so how is this set in the system?

Actually, I didn’t check this before, because such error does not happen to any users.

Open your dc.c file and you shall see

inline bool tegra_dc_is_nvdisplay(void)
{
return (tegra_dc_is_t18x() || tegra_dc_is_t19x());
}

Since you are tx2 series, tegra_dc_is_t18x() will return true.

If that does not return true, check tegra_dc_hw_init(void) in dc.c and see why tegra_dc_populate_t18x_hw_data does not exist.

Looks like the tegra_dc_populate_xxxx_hw_data gets called after the pwm backlight calls in my system

snippet from my dmesg

[ 1.089108] tegra_pwm_bl_ops_register(371) tegra_dc_is_nvdisplay 0

[ 1.089272] tegra_available_pwm_bl_ops_register(222) ffffffc0f71b27e0 No compatible prop in backlight node 2

[ 1.089277] tegra_available_pwm_bl_ops_register(276)
[ 1.089393] Node path /chosen/display-board not found
[ 1.089428] pwm_bl_ops are not required
[ 1.089592] OF: /backlight: could not get #pwm-cells for /i2c@3160000/gpio@74
[ 1.089653] OF: /backlight: could not get #pwm-cells for /i2c@3160000/gpio@74
[ 1.089683] pwm-backlight backlight: unable to request PWM
[ 1.089705] pwm_backlight_probe(521)

[ 1.089773] pwm-backlight: probe of backlight failed with error -22
[ 1.089964] tegra_camera_platform tegra-camera-platform: tegra_camera_probe:camera_platform_driver probe
[ 1.090201] misc tegra_camera_ctrl: tegra_camera_isomgr_register isp_iso_bw=4687500, vi_iso_bw=1500000, max_bw=4687500
[ 1.091744] tegra-pcie 10003000.pcie-controller: probing port 2, using 1 lanes
[ 1.093125] tsec 15500000.tsec: initialized
[ 1.094278] tsec 15100000.tsecb: initialized
[ 1.096841] nvdec 15480000.nvdec: initialized
[ 1.101259] falcon 15340000.vic: initialized
[ 1.103182] falcon 154c0000.nvenc: initialized
[ 1.104761] falcon 15380000.nvjpg: initialized
[ 1.108549] iommu_context_dev 13e10000.host1x:ctx0: initialized (streamid=56)
[ 1.110242] iommu_context_dev 13e10000.host1x:ctx1: initialized (streamid=57)
[ 1.111866] iommu_context_dev 13e10000.host1x:ctx2: initialized (streamid=58)
[ 1.113515] iommu_context_dev 13e10000.host1x:ctx3: initialized (streamid=59)
[ 1.115095] iommu_context_dev 13e10000.host1x:ctx4: initialized (streamid=60)
[ 1.116777] iommu_context_dev 13e10000.host1x:ctx5: initialized (streamid=61)
[ 1.118402] iommu_context_dev 13e10000.host1x:ctx6: initialized (streamid=62)
[ 1.119914] iommu_context_dev 13e10000.host1x:ctx7: initialized (streamid=63)
[ 1.122350] tegra_dc_populate_t21x_hw_data(7691)
[ 1.122356] tegra_dc_populate_t18x_hw_data(4543)

I added printk to the tegra_dc_populate_t21x_hw_data and tegra_dc_populate_t18x_hw_data

I would like to confirm is “ pwm_backlight_probe“ being called after you add backlight node in your dts?

Yes pwm_backlight_probe is called because dts change. The dmesg snippet shows [ 1.089705] pwm_backlight_probe(521)

and then later [ 1.122356] tegra_dc_populate_t18x_hw_data(4543)
being called.

Terry

Please check the dtsi file panel-s-wuxga-8-0.dtsi. This should be included in the souce code tarball.

This one shall have the backlight node you need.

please send me a copy of the file, my file does not have any backlight lines in it. r32.3.1 appears to be missing a bunch of mipi dsi and associated backlight files. This has been a problem the whole time during my deveolpment.

Terry

Should I move the backlight lines to my mipi dsi device tree file?

Could you share me how does the path of your “hardware/nvidia/platforms/“ look like on your side?

I am sorry that I cannot access my computer in office so cannot share it right now.

The whole file name is panel-s-wuxga-8-0.dtsi. Can you use find command in your DT folder for it?

This is the file I started with to build the mipi dsi driver. no backlight stuff in it.

tbuckley@tbuckley-Latitude-3440:~/tmp/seattle_tx2_kernel/sources/hardware/nvidia/platform$ ls
total 16K
drwxrwxr-x 4 tbuckley tbuckley 4.0K Jul 24 18:43 ./
drwxrwxr-x 4 tbuckley tbuckley 4.0K Jul 24 18:43 …/
drwxrwxr-x 4 tbuckley tbuckley 4.0K Jul 24 18:43 t18x/
drwxrwxr-x 3 tbuckley tbuckley 4.0K Jul 24 18:43 tegra/

cat ./tegra/common/kernel-dts/panels/panel-s-wuxga-8-0.dtsi
/*

  • arch/arm/boot/dts/panel-s-wuxga-8-0.dtsi
  • Copyright (c) 2015-2017, NVIDIA CORPORATION. All rights reserved.
  • This program is free software; you can redistribute it and/or modify
  • it under the terms of the GNU General Public License as published by
  • the Free Software Foundation; either version 2 of the License, or
  • (at your option) any later version.
  • This program is distributed in the hope that it will be useful, but WITHOUT
  • ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  • FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  • more details.
  • You should have received a copy of the GNU General Public License along
  • with this program; if not, write to the Free Software Foundation, Inc.,
  • 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
    */
    #include <dt-bindings/display/tegra-dc.h>
    #include <dt-bindings/display/tegra-panel.h>

/ {
host1x {
dsi {
panel_s_wuxga_8_0: panel-s-wuxga-8-0 {
compatible = “s,wuxga-8-0”;
nvidia,dsi-instance = <DSI_INSTANCE_0>;
nvidia,dsi-pixel-format = <TEGRA_DSI_PIXEL_FORMAT_24BIT_P>;
nvidia,dsi-refresh-rate = <60>;
nvidia,dsi-video-data-type = <TEGRA_DSI_VIDEO_TYPE_VIDEO_MODE>;
nvidia,dsi-video-clock-mode = <TEGRA_DSI_VIDEO_CLOCK_CONTINUOUS>;
nvidia,dsi-controller-vs = <DSI_VS_1>;
nvidia,dsi-virtual-channel = <TEGRA_DSI_VIRTUAL_CHANNEL_0>;
nvidia,dsi-panel-reset = <TEGRA_DSI_ENABLE>;
nvidia,dsi-suspend-stop-stream-late = <TEGRA_DSI_ENABLE>;
nvidia,dsi-power-saving-suspend = <TEGRA_DSI_ENABLE>;
nvidia,dsi-ulpm-not-support = <TEGRA_DSI_DISABLE>;
nvidia,dsi-ganged-type = <TEGRA_DSI_DISABLE>;
nvidia,dsi-n-data-lanes = <2>;
nvidia,default_color_space = <1>; /default color profile:adobeRGB/

                            nvidia,dsi-suspend-cmd =
                                    <TEGRA_DSI_PACKET_CMD DSI_DCS_WRITE_0_PARAM DSI_DCS_SET_DISPLAY_OFF 0x0 0x0>,
                                    <TEGRA_DSI_SEND_FRAME 3>,
                                    <TEGRA_DSI_PACKET_CMD DSI_DCS_WRITE_0_PARAM DSI_DCS_ENTER_SLEEP_MODE 0x0 0x0>,
                                    <TEGRA_DSI_SEND_FRAME 10>;
                            nvidia,dsi-n-suspend-cmd = <4>;

                            disp-default-out {
                                    nvidia,out-parent-clk = "pll_d";
                                    nvidia,out-type = <TEGRA_DC_OUT_DSI>;
                                    nvidia,out-width = <480>;
                                    nvidia,out-height = <800>;
                                    nvidia,out-flags = <TEGRA_DC_OUT_CONTINUOUS_MODE>;
                                    nvidia,out-xres = <480>;
                                    nvidia,out-yres = <800>;
                            };

                            display-timings {
                                    480x800-24-60Hz {
                                            clock-frequency = <32256000>;
                                            hactive = <480>;
                                            vactive = <800>;
                                            hfront-porch = <100>;
                                            hback-porch = <50>;
                                            vfront-porch = <20>;
                                            vback-porch = <16>;
                                            hsync-len = <10>;
                                            vsync-len = <4>;

/* nvidia,h-ref-to-sync = <1>; /
/
nvidia.v-ref-to-sync = <1>; */
};
};
};
};
};
};

nv-tegra.nvidia Code Review - device/hardware/nvidia/platform/tegra/common.git/tree - kernel-dts/panels/

nv-tegra.nvidia Code Review - device/hardware/nvidia/platform/tegra/common.git/summary

This is the git sever that maintained by NV.

You can see that file has backlight node and this is from rel32.3.1. Where did you get your source code?

Need to check if the file has anything corrupted.

I used source_sync.sh a while back.

Both links you gave me give forbidden access probs.

Terry