On Thu, Mar 27, 2025 at 07:37:45PM +0300, Alexander Baransky wrote: > Add the driver for Visionox G2647FB105 6.47" FHD Plus CMD mode AMOLED panel > support found in: > - Xiaomi Mi Note 10 / CC9 Pro (sm7150-xiaomi-tucana) > - Xiaomi Mi Note 10 Lite (sm7150-xiaomi-toco) > > Signed-off-by: Alexander Baransky <sanyapilot...@gmail.com> > --- > drivers/gpu/drm/panel/Kconfig | 9 + > drivers/gpu/drm/panel/Makefile | 1 + > .../gpu/drm/panel/panel-visionox-g2647fb105.c | 282 ++++++++++++++++++ > 3 files changed, 292 insertions(+) > create mode 100644 drivers/gpu/drm/panel/panel-visionox-g2647fb105.c > > + > +static int visionox_g2647fb105_prepare(struct drm_panel *panel) > +{ > + struct visionox_g2647fb105 *ctx = to_visionox_g2647fb105(panel); > + struct device *dev = &ctx->dsi->dev; > + int ret; > + > + ret = regulator_bulk_enable(ARRAY_SIZE(visionox_g2647fb105_supplies), > ctx->supplies); > + if (ret < 0) { > + dev_err(dev, "Failed to enable regulators: %d\n", ret); > + return ret; > + } > + > + visionox_g2647fb105_reset(ctx); > + > + ret = visionox_g2647fb105_on(ctx); > + if (ret < 0) { > + dev_err(dev, "Failed to initialize panel: %d\n", ret); > + gpiod_set_value_cansleep(ctx->reset_gpio, 1); > + > regulator_bulk_disable(ARRAY_SIZE(visionox_g2647fb105_supplies), > ctx->supplies);
Unfortunately, you can't disable the regulators here. panel bridge doesn't check for an error (and it can not further propagate an error), so if visionox_g2647fb105_on() fails, then there will be an extra call to regulator_bulk_disable() in visionox_g2647fb105_unprepare(). > + return ret; > + } > + > + return 0; > +} > + LGTM otherwise -- With best wishes Dmitry