Lines Matching refs:p

383 	struct panel_edp *p = to_panel_edp(panel);  in panel_edp_disable()  local
385 if (!p->enabled) in panel_edp_disable()
388 if (p->desc->delay.disable) in panel_edp_disable()
389 msleep(p->desc->delay.disable); in panel_edp_disable()
391 p->enabled = false; in panel_edp_disable()
398 struct panel_edp *p = dev_get_drvdata(dev); in panel_edp_suspend() local
400 drm_dp_dpcd_set_powered(p->aux, false); in panel_edp_suspend()
401 gpiod_set_value_cansleep(p->enable_gpio, 0); in panel_edp_suspend()
402 regulator_disable(p->supply); in panel_edp_suspend()
403 p->unprepared_time = ktime_get_boottime(); in panel_edp_suspend()
410 struct panel_edp *p = to_panel_edp(panel); in panel_edp_unprepare() local
414 if (!p->prepared) in panel_edp_unprepare()
420 p->prepared = false; in panel_edp_unprepare()
425 static int panel_edp_get_hpd_gpio(struct device *dev, struct panel_edp *p) in panel_edp_get_hpd_gpio() argument
427 p->hpd_gpio = devm_gpiod_get_optional(dev, "hpd", GPIOD_IN); in panel_edp_get_hpd_gpio()
428 if (IS_ERR(p->hpd_gpio)) in panel_edp_get_hpd_gpio()
429 return dev_err_probe(dev, PTR_ERR(p->hpd_gpio), in panel_edp_get_hpd_gpio()
435 static bool panel_edp_can_read_hpd(struct panel_edp *p) in panel_edp_can_read_hpd() argument
437 return !p->no_hpd && (p->hpd_gpio || (p->aux && p->aux->wait_hpd_asserted)); in panel_edp_can_read_hpd()
440 static int panel_edp_prepare_once(struct panel_edp *p) in panel_edp_prepare_once() argument
442 struct device *dev = p->base.dev; in panel_edp_prepare_once()
448 panel_edp_wait(p->unprepared_time, p->desc->delay.unprepare); in panel_edp_prepare_once()
450 err = regulator_enable(p->supply); in panel_edp_prepare_once()
456 gpiod_set_value_cansleep(p->enable_gpio, 1); in panel_edp_prepare_once()
457 drm_dp_dpcd_set_powered(p->aux, true); in panel_edp_prepare_once()
459 delay = p->desc->delay.hpd_reliable; in panel_edp_prepare_once()
460 if (p->no_hpd) in panel_edp_prepare_once()
461 delay = max(delay, p->desc->delay.hpd_absent); in panel_edp_prepare_once()
465 if (panel_edp_can_read_hpd(p)) { in panel_edp_prepare_once()
466 if (p->desc->delay.hpd_absent) in panel_edp_prepare_once()
467 hpd_wait_us = p->desc->delay.hpd_absent * 1000UL; in panel_edp_prepare_once()
471 if (p->hpd_gpio) { in panel_edp_prepare_once()
473 p->hpd_gpio, hpd_asserted, in panel_edp_prepare_once()
478 err = p->aux->wait_hpd_asserted(p->aux, hpd_wait_us); in panel_edp_prepare_once()
489 p->prepared_time = ktime_get_boottime(); in panel_edp_prepare_once()
494 drm_dp_dpcd_set_powered(p->aux, false); in panel_edp_prepare_once()
495 gpiod_set_value_cansleep(p->enable_gpio, 0); in panel_edp_prepare_once()
496 regulator_disable(p->supply); in panel_edp_prepare_once()
497 p->unprepared_time = ktime_get_boottime(); in panel_edp_prepare_once()
510 struct panel_edp *p = dev_get_drvdata(dev); in panel_edp_resume() local
515 ret = panel_edp_prepare_once(p); in panel_edp_resume()
530 struct panel_edp *p = to_panel_edp(panel); in panel_edp_prepare() local
534 if (p->prepared) in panel_edp_prepare()
543 p->prepared = true; in panel_edp_prepare()
550 struct panel_edp *p = to_panel_edp(panel); in panel_edp_enable() local
553 if (p->enabled) in panel_edp_enable()
556 delay = p->desc->delay.enable; in panel_edp_enable()
575 if (p->desc->delay.prepare_to_enable && in panel_edp_enable()
576 !panel_edp_can_read_hpd(p) && !p->no_hpd) in panel_edp_enable()
577 delay = max(delay, p->desc->delay.prepare_to_enable); in panel_edp_enable()
582 panel_edp_wait(p->prepared_time, p->desc->delay.prepare_to_enable); in panel_edp_enable()
584 p->enabled = true; in panel_edp_enable()
592 struct panel_edp *p = to_panel_edp(panel); in panel_edp_get_modes() local
594 bool has_override_edid_mode = p->detected_panel && in panel_edp_get_modes()
595 p->detected_panel != ERR_PTR(-EINVAL) && in panel_edp_get_modes()
596 p->detected_panel->override_edid_mode; in panel_edp_get_modes()
599 if (p->ddc) { in panel_edp_get_modes()
602 if (!p->edid) in panel_edp_get_modes()
603 p->edid = drm_get_edid(connector, p->ddc); in panel_edp_get_modes()
604 if (p->edid) { in panel_edp_get_modes()
610 num += panel_edp_override_edid_mode(p, connector, in panel_edp_get_modes()
611 p->detected_panel->override_edid_mode); in panel_edp_get_modes()
613 num += drm_add_edid_modes(connector, p->edid); in panel_edp_get_modes()
626 if (p->desc->num_timings || p->desc->num_modes) in panel_edp_get_modes()
627 num += panel_edp_get_non_edid_modes(p, connector); in panel_edp_get_modes()
629 dev_warn(p->base.dev, "No display modes\n"); in panel_edp_get_modes()
635 drm_connector_set_panel_orientation(connector, p->orientation); in panel_edp_get_modes()
644 struct panel_edp *p = to_panel_edp(panel); in panel_edp_get_timings() local
647 if (p->desc->num_timings < num_timings) in panel_edp_get_timings()
648 num_timings = p->desc->num_timings; in panel_edp_get_timings()
652 timings[i] = p->desc->timings[i]; in panel_edp_get_timings()
654 return p->desc->num_timings; in panel_edp_get_timings()
659 struct panel_edp *p = to_panel_edp(panel); in panel_edp_get_orientation() local
661 return p->orientation; in panel_edp_get_orientation()
667 struct panel_edp *p = to_panel_edp(panel); in detected_panel_show() local
669 if (IS_ERR(p->detected_panel)) in detected_panel_show()
671 else if (!p->detected_panel) in detected_panel_show()
674 seq_printf(s, "%s\n", p->detected_panel->name); in detected_panel_show()