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

drm/panel: innolux-p079zca: 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: Chris Zhong <zyw@rock-chips.com>
Cc: Lin Huang <hl@rock-chips.com>
Cc: Brian Norris <briannorris@chromium.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Maxime Ripard <mripard@kernel.org>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20240503143327.RFT.v2.8.I99c73621fe3fba067a5e7ee6a1f6293c23371e1e@changeid

-39
-39
drivers/gpu/drm/panel/panel-innolux-p079zca.c
··· 44 44 45 45 struct regulator_bulk_data *supplies; 46 46 struct gpio_desc *enable_gpio; 47 - 48 - bool prepared; 49 - bool enabled; 50 47 }; 51 48 52 49 static inline struct innolux_panel *to_innolux_panel(struct drm_panel *panel) ··· 51 54 return container_of(panel, struct innolux_panel, base); 52 55 } 53 56 54 - static int innolux_panel_disable(struct drm_panel *panel) 55 - { 56 - struct innolux_panel *innolux = to_innolux_panel(panel); 57 - 58 - if (!innolux->enabled) 59 - return 0; 60 - 61 - innolux->enabled = false; 62 - 63 - return 0; 64 - } 65 - 66 57 static int innolux_panel_unprepare(struct drm_panel *panel) 67 58 { 68 59 struct innolux_panel *innolux = to_innolux_panel(panel); 69 60 int err; 70 - 71 - if (!innolux->prepared) 72 - return 0; 73 61 74 62 err = mipi_dsi_dcs_set_display_off(innolux->link); 75 63 if (err < 0) ··· 79 97 if (err < 0) 80 98 return err; 81 99 82 - innolux->prepared = false; 83 - 84 100 return 0; 85 101 } 86 102 ··· 86 106 { 87 107 struct innolux_panel *innolux = to_innolux_panel(panel); 88 108 int err; 89 - 90 - if (innolux->prepared) 91 - return 0; 92 109 93 110 gpiod_set_value_cansleep(innolux->enable_gpio, 0); 94 111 ··· 126 149 /* T7: 5ms */ 127 150 usleep_range(5000, 6000); 128 151 129 - innolux->prepared = true; 130 - 131 152 return 0; 132 153 133 154 poweroff: ··· 133 158 regulator_bulk_disable(innolux->desc->num_supplies, innolux->supplies); 134 159 135 160 return err; 136 - } 137 - 138 - static int innolux_panel_enable(struct drm_panel *panel) 139 - { 140 - struct innolux_panel *innolux = to_innolux_panel(panel); 141 - 142 - if (innolux->enabled) 143 - return 0; 144 - 145 - innolux->enabled = true; 146 - 147 - return 0; 148 161 } 149 162 150 163 static const char * const innolux_p079zca_supply_names[] = { ··· 359 396 } 360 397 361 398 static const struct drm_panel_funcs innolux_panel_funcs = { 362 - .disable = innolux_panel_disable, 363 399 .unprepare = innolux_panel_unprepare, 364 400 .prepare = innolux_panel_prepare, 365 - .enable = innolux_panel_enable, 366 401 .get_modes = innolux_panel_get_modes, 367 402 }; 368 403