Hi, On Fri, May 19, 2023 at 1:02 AM Cong Yang <yangcong5@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote: > > The Starry-himax83102-j02 panel is a TDDI IC. From the datasheet[1], > it seems that the touch can communicate successfully only when the RST > signal is high. Since i2c_hid_core_probe comes after boe_panel_prepare > let's set the default high for RST at boe_panel_add. No, that doesn't work. There are no guarantees about the ordering of the probe of the i2c_hid device and the panel and the order could change from version to version of Linux. Also: deasserting this reset early like this (before regulators are turned on) can cause leakage since that will make the signal go high and the touchscreen can suck current out of that line. Is it possible to change the hardware to fix this and have separate reset lines for the touchscreen and the panel? For a long time, I have felt like we needed a better solution in Linux for stuff like this, but I've never found a clean way to do it. We really want the touchscreen to power on and off together with the panel, where the panel is in charge and the touchscreen always powers on after the panel and powers off before the panel. I can't promise anything, but I can see if I can find some time to whip up a prototype. > @@ -1698,6 +1768,34 @@ static const struct panel_desc starry_qfh032011_53g_desc = { > .init_cmds = starry_qfh032011_53g_init_cmd, > }; > > +static const struct drm_display_mode starry_himax83102_j02_default_mode = { > + .clock = 161600, > + .hdisplay = 1200, > + .hsync_start = 1200 + 40, > + .hsync_end = 1200 + 40 + 20, > + .htotal = 1200 + 40 + 20 + 40, > + .vdisplay = 1920, > + .vsync_start = 1920 + 116, > + .vsync_end = 1920 + 116 + 8, > + .vtotal = 1920 + 116 + 8 + 12, > + .type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED, > +}; > + > +static const struct panel_desc starry_himax83102_j02_desc = { > + .modes = &starry_himax83102_j02_default_mode, > + .bpc = 8, > + .size = { > + .width_mm = 141, > + .height_mm = 226, > + }, > + .lanes = 4, > + .format = MIPI_DSI_FMT_RGB888, > + .mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_SYNC_PULSE | > + MIPI_DSI_MODE_LPM, > + .init_cmds = starry_himax83102_j02_init_cmd, > + .enable_gpio_init_value = 1, > + .lp11_before_reset = true, > +}; > static int boe_panel_get_modes(struct drm_panel *panel, nit: put a blank line above. > @@ -1871,6 +1969,9 @@ static const struct of_device_id boe_of_match[] = { > { .compatible = "starry,2081101qfh032011-53g", > .data = &starry_qfh032011_53g_desc > }, > + { .compatible = "starry,himax83102-j02", > + .data = &starry_himax83102_j02_desc You need device tree bindings for the above compatible string.