Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/panel: sitronix-st7703: Stop tracking prepared

As talked about in commit d2aacaf07395 ("drm/panel: Check for already
prepared/enabled in drm_panel"), we want to remove needless code from
panel drivers that was storing and double-checking the
prepared/enabled state. Even if someone was relying on the
double-check before, that double-check is now in the core and not
needed in individual drivers.

One thing to note for st7703 is that it has a special "allpixelson"
debugfs file. When this file is written the driver hacks a
disable/unprepare and then a prepare/enable to try to reset the
panel. Potentially that might have been relying on the old booleans we
removed. It'll still "work" because of the checks in the core but it
deserves a comment. This debugfs file didn't appear to be particularly
safe to use even before this patch since it would cause a
disabled/unprepared panel to become prepared/enabled.

Cc: Guido Günther <agx@sigxcpu.org>
Cc: Ondřej Jirman <megi@xff.cz>
Cc: Chris Morgan <macromorgan@hotmail.com>
Cc: Frank Oltmanns <frank@oltmanns.dev>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Maxime Ripard <mripard@kernel.org>
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20240503143327.RFT.v2.42.Ifc436b262d72f1a33ddef10adfd7578d4acb60d8@changeid

+7 -11
+7 -11
drivers/gpu/drm/panel/panel-sitronix-st7703.c
··· 58 58 struct gpio_desc *reset_gpio; 59 59 struct regulator *vcc; 60 60 struct regulator *iovcc; 61 - bool prepared; 62 61 63 62 struct dentry *debugfs; 64 63 const struct st7703_panel_desc *desc; ··· 751 752 { 752 753 struct st7703 *ctx = panel_to_st7703(panel); 753 754 754 - if (!ctx->prepared) 755 - return 0; 756 - 757 755 gpiod_set_value_cansleep(ctx->reset_gpio, 1); 758 756 regulator_disable(ctx->iovcc); 759 757 regulator_disable(ctx->vcc); 760 - ctx->prepared = false; 761 758 762 759 return 0; 763 760 } ··· 762 767 { 763 768 struct st7703 *ctx = panel_to_st7703(panel); 764 769 int ret; 765 - 766 - if (ctx->prepared) 767 - return 0; 768 770 769 771 dev_dbg(ctx->dev, "Resetting the panel\n"); 770 772 gpiod_set_value_cansleep(ctx->reset_gpio, 1); ··· 784 792 785 793 gpiod_set_value_cansleep(ctx->reset_gpio, 0); 786 794 usleep_range(15000, 20000); 787 - 788 - ctx->prepared = true; 789 795 790 796 return 0; 791 797 } ··· 844 854 dev_dbg(ctx->dev, "Setting all pixels on\n"); 845 855 mipi_dsi_generic_write_seq(dsi, ST7703_CMD_ALL_PIXEL_ON); 846 856 msleep(val * 1000); 847 - /* Reset the panel to get video back */ 857 + 858 + /* 859 + * Reset the panel to get video back. NOTE: This isn't a 860 + * particularly safe thing to do in general because it assumes 861 + * that the screen was on to begin with, but this is just a 862 + * debugfs file so it's not a huge deal. 863 + */ 848 864 drm_panel_disable(&ctx->panel); 849 865 drm_panel_unprepare(&ctx->panel); 850 866 drm_panel_prepare(&ctx->panel);