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

drm/panel: panasonic-vvx10f034n00: Stop tracking prepared/enabled

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.

Cc: Werner Johansson <werner.johansson@sonymobile.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Maxime Ripard <mripard@kernel.org>
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20240604172305.v3.13.I7278e956ffd1cf686e737834578d4bb3ea527c7f@changeid
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20240604172305.v3.13.I7278e956ffd1cf686e737834578d4bb3ea527c7f@changeid

authored by

Douglas Anderson and committed by
Neil Armstrong
e9864996 c8f67cd1

+1 -34
+1 -34
drivers/gpu/drm/panel/panel-panasonic-vvx10f034n00.c
··· 32 32 33 33 struct regulator *supply; 34 34 35 - bool prepared; 36 - bool enabled; 37 - 38 35 ktime_t earliest_wake; 39 36 40 37 const struct drm_display_mode *mode; ··· 50 53 static int wuxga_nt_panel_disable(struct drm_panel *panel) 51 54 { 52 55 struct wuxga_nt_panel *wuxga_nt = to_wuxga_nt_panel(panel); 53 - int mipi_ret, bl_ret = 0; 54 56 55 - if (!wuxga_nt->enabled) 56 - return 0; 57 - 58 - mipi_ret = mipi_dsi_shutdown_peripheral(wuxga_nt->dsi); 59 - 60 - wuxga_nt->enabled = false; 61 - 62 - return mipi_ret ? mipi_ret : bl_ret; 57 + return mipi_dsi_shutdown_peripheral(wuxga_nt->dsi); 63 58 } 64 59 65 60 static int wuxga_nt_panel_unprepare(struct drm_panel *panel) 66 61 { 67 62 struct wuxga_nt_panel *wuxga_nt = to_wuxga_nt_panel(panel); 68 63 69 - if (!wuxga_nt->prepared) 70 - return 0; 71 - 72 64 regulator_disable(wuxga_nt->supply); 73 65 wuxga_nt->earliest_wake = ktime_add_ms(ktime_get_real(), MIN_POFF_MS); 74 - wuxga_nt->prepared = false; 75 66 76 67 return 0; 77 68 } ··· 69 84 struct wuxga_nt_panel *wuxga_nt = to_wuxga_nt_panel(panel); 70 85 int ret; 71 86 s64 enablewait; 72 - 73 - if (wuxga_nt->prepared) 74 - return 0; 75 87 76 88 /* 77 89 * If the user re-enabled the panel before the required off-time then ··· 99 117 goto poweroff; 100 118 } 101 119 102 - wuxga_nt->prepared = true; 103 - 104 120 return 0; 105 121 106 122 poweroff: 107 123 regulator_disable(wuxga_nt->supply); 108 124 109 125 return ret; 110 - } 111 - 112 - static int wuxga_nt_panel_enable(struct drm_panel *panel) 113 - { 114 - struct wuxga_nt_panel *wuxga_nt = to_wuxga_nt_panel(panel); 115 - 116 - if (wuxga_nt->enabled) 117 - return 0; 118 - 119 - wuxga_nt->enabled = true; 120 - 121 - return 0; 122 126 } 123 127 124 128 static const struct drm_display_mode default_mode = { ··· 146 178 .disable = wuxga_nt_panel_disable, 147 179 .unprepare = wuxga_nt_panel_unprepare, 148 180 .prepare = wuxga_nt_panel_prepare, 149 - .enable = wuxga_nt_panel_enable, 150 181 .get_modes = wuxga_nt_panel_get_modes, 151 182 }; 152 183