Lines Matching +full:back +full:- +full:powering

1 // SPDX-License-Identifier: GPL-2.0
6 * by the DRM_PANEL_SIMPLE driver because its power sequencing is non-standard.
68 * powering off. in atana33xc20_suspend()
70 if (p->el3_was_on) in atana33xc20_suspend()
71 atana33xc20_wait(p->el_on3_off_time, 150); in atana33xc20_suspend()
73 drm_dp_dpcd_set_powered(p->aux, false); in atana33xc20_suspend()
74 ret = regulator_disable(p->supply); in atana33xc20_suspend()
77 p->powered_off_time = ktime_get_boottime(); in atana33xc20_suspend()
78 p->el3_was_on = false; in atana33xc20_suspend()
90 atana33xc20_wait(p->powered_off_time, 500); in atana33xc20_resume()
92 ret = regulator_enable(p->supply); in atana33xc20_resume()
95 drm_dp_dpcd_set_powered(p->aux, true); in atana33xc20_resume()
96 p->powered_on_time = ktime_get_boottime(); in atana33xc20_resume()
98 if (p->no_hpd) { in atana33xc20_resume()
103 if (p->hpd_gpio) { in atana33xc20_resume()
104 ret = readx_poll_timeout(gpiod_get_value_cansleep, p->hpd_gpio, in atana33xc20_resume()
114 } else if (p->aux->wait_hpd_asserted) { in atana33xc20_resume()
115 ret = p->aux->wait_hpd_asserted(p->aux, HPD_MAX_US); in atana33xc20_resume()
134 drm_dp_dpcd_set_powered(p->aux, false); in atana33xc20_resume()
135 regulator_disable(p->supply); in atana33xc20_resume()
144 gpiod_set_value_cansleep(p->el_on3_gpio, 0); in atana33xc20_disable()
145 p->el_on3_off_time = ktime_get_boottime(); in atana33xc20_disable()
154 p->el3_was_on = true; in atana33xc20_disable()
158 * powering off. in atana33xc20_disable()
175 * non-obvious. in atana33xc20_enable()
177 if (WARN_ON(p->el3_was_on)) in atana33xc20_enable()
178 return -EIO; in atana33xc20_enable()
182 * to wait 400 ms after powering on before asserting EL3_on. in atana33xc20_enable()
184 atana33xc20_wait(p->powered_on_time, 400); in atana33xc20_enable()
186 gpiod_set_value_cansleep(p->el_on3_gpio, 1); in atana33xc20_enable()
198 * the best way to ensure it will come back. in atana33xc20_unprepare()
203 ret = pm_runtime_put_sync_suspend(panel->dev); in atana33xc20_unprepare()
214 ret = pm_runtime_get_sync(panel->dev); in atana33xc20_prepare()
216 pm_runtime_put_autosuspend(panel->dev); in atana33xc20_prepare()
227 struct dp_aux_ep_device *aux_ep = to_dp_aux_ep_dev(panel->dev); in atana33xc20_get_modes()
230 pm_runtime_get_sync(panel->dev); in atana33xc20_get_modes()
232 if (!p->drm_edid) in atana33xc20_get_modes()
233 p->drm_edid = drm_edid_read_ddc(connector, &aux_ep->aux->ddc); in atana33xc20_get_modes()
235 drm_edid_connector_update(connector, p->drm_edid); in atana33xc20_get_modes()
239 pm_runtime_mark_last_busy(panel->dev); in atana33xc20_get_modes()
240 pm_runtime_put_autosuspend(panel->dev); in atana33xc20_get_modes()
266 struct device *dev = &aux_ep->dev; in atana33xc20_probe()
271 return -ENOMEM; in atana33xc20_probe()
274 panel->aux = aux_ep->aux; in atana33xc20_probe()
276 panel->supply = devm_regulator_get(dev, "power"); in atana33xc20_probe()
277 if (IS_ERR(panel->supply)) in atana33xc20_probe()
278 return dev_err_probe(dev, PTR_ERR(panel->supply), in atana33xc20_probe()
281 panel->el_on3_gpio = devm_gpiod_get(dev, "enable", GPIOD_OUT_LOW); in atana33xc20_probe()
282 if (IS_ERR(panel->el_on3_gpio)) in atana33xc20_probe()
283 return dev_err_probe(dev, PTR_ERR(panel->el_on3_gpio), in atana33xc20_probe()
286 panel->no_hpd = of_property_read_bool(dev->of_node, "no-hpd"); in atana33xc20_probe()
287 if (!panel->no_hpd) { in atana33xc20_probe()
288 panel->hpd_gpio = devm_gpiod_get_optional(dev, "hpd", GPIOD_IN); in atana33xc20_probe()
289 if (IS_ERR(panel->hpd_gpio)) in atana33xc20_probe()
290 return dev_err_probe(dev, PTR_ERR(panel->hpd_gpio), in atana33xc20_probe()
304 drm_panel_init(&panel->base, dev, &atana33xc20_funcs, DRM_MODE_CONNECTOR_eDP); in atana33xc20_probe()
307 ret = drm_panel_dp_aux_backlight(&panel->base, aux_ep->aux); in atana33xc20_probe()
319 drm_panel_add(&panel->base); in atana33xc20_probe()
326 struct device *dev = &aux_ep->dev; in atana33xc20_remove()
329 drm_panel_remove(&panel->base); in atana33xc20_remove()
331 drm_edid_free(panel->drm_edid); in atana33xc20_remove()