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: samsung-atna33xc20: 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.

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.24.Ibb4f923363a27167c480a432e52884b117221974@changeid

-24
-24
drivers/gpu/drm/panel/panel-samsung-atna33xc20.c
··· 25 25 26 26 struct atana33xc20_panel { 27 27 struct drm_panel base; 28 - bool prepared; 29 - bool enabled; 30 28 bool el3_was_on; 31 29 32 30 bool no_hpd; ··· 141 143 { 142 144 struct atana33xc20_panel *p = to_atana33xc20(panel); 143 145 144 - /* Disabling when already disabled is a no-op */ 145 - if (!p->enabled) 146 - return 0; 147 - 148 146 gpiod_set_value_cansleep(p->el_on3_gpio, 0); 149 147 p->el_on3_off_time = ktime_get_boottime(); 150 - p->enabled = false; 151 148 152 149 /* 153 150 * Keep track of the fact that EL_ON3 was on but we haven't power ··· 166 173 { 167 174 struct atana33xc20_panel *p = to_atana33xc20(panel); 168 175 169 - /* Enabling when already enabled is a no-op */ 170 - if (p->enabled) 171 - return 0; 172 - 173 176 /* 174 177 * Once EL_ON3 drops we absolutely need a power cycle before the next 175 178 * enable or the backlight will never come on again. The code ensures ··· 184 195 atana33xc20_wait(p->powered_on_time, 400); 185 196 186 197 gpiod_set_value_cansleep(p->el_on3_gpio, 1); 187 - p->enabled = true; 188 198 189 199 return 0; 190 200 } 191 201 192 202 static int atana33xc20_unprepare(struct drm_panel *panel) 193 203 { 194 - struct atana33xc20_panel *p = to_atana33xc20(panel); 195 204 int ret; 196 - 197 - /* Unpreparing when already unprepared is a no-op */ 198 - if (!p->prepared) 199 - return 0; 200 205 201 206 /* 202 207 * Purposely do a put_sync, don't use autosuspend. The panel's tcon ··· 203 220 ret = pm_runtime_put_sync_suspend(panel->dev); 204 221 if (ret < 0) 205 222 return ret; 206 - p->prepared = false; 207 223 208 224 return 0; 209 225 } 210 226 211 227 static int atana33xc20_prepare(struct drm_panel *panel) 212 228 { 213 - struct atana33xc20_panel *p = to_atana33xc20(panel); 214 229 int ret; 215 - 216 - /* Preparing when already prepared is a no-op */ 217 - if (p->prepared) 218 - return 0; 219 230 220 231 ret = pm_runtime_get_sync(panel->dev); 221 232 if (ret < 0) { 222 233 pm_runtime_put_autosuspend(panel->dev); 223 234 return ret; 224 235 } 225 - p->prepared = true; 226 236 227 237 return 0; 228 238 }