Lines Matching refs:dp
195 struct msm_dp *dp = dev_get_drvdata(dev); in dev_get_dp_display_private() local
197 return container_of(dp, struct dp_display_private, dp_display); in dev_get_dp_display_private()
256 struct dp_display_private *dp; in dp_display_signal_audio_start() local
258 dp = container_of(dp_display, struct dp_display_private, dp_display); in dp_display_signal_audio_start()
260 reinit_completion(&dp->audio_comp); in dp_display_signal_audio_start()
265 struct dp_display_private *dp; in dp_display_signal_audio_complete() local
267 dp = container_of(dp_display, struct dp_display_private, dp_display); in dp_display_signal_audio_complete()
269 complete_all(&dp->audio_comp); in dp_display_signal_audio_complete()
278 struct dp_display_private *dp = dev_get_dp_display_private(dev); in dp_display_bind() local
282 dp->dp_display.drm_dev = drm; in dp_display_bind()
283 priv->dp[dp->id] = &dp->dp_display; in dp_display_bind()
285 rc = dp->parser->parse(dp->parser); in dp_display_bind()
292 dp->drm_dev = drm; in dp_display_bind()
293 dp->aux->drm_dev = drm; in dp_display_bind()
294 rc = dp_aux_register(dp->aux); in dp_display_bind()
300 rc = dp_power_client_init(dp->power); in dp_display_bind()
306 rc = dp_register_audio_driver(dev, dp->audio); in dp_display_bind()
312 rc = dp_hpd_event_thread_start(dp); in dp_display_bind()
326 struct dp_display_private *dp = dev_get_dp_display_private(dev); in dp_display_unbind() local
330 if (dp->core_initialized) in dp_display_unbind()
331 dp_catalog_hpd_config_intr(dp->catalog, DP_DP_HPD_INT_MASK, false); in dp_display_unbind()
333 kthread_stop(dp->ev_tsk); in dp_display_unbind()
335 of_dp_aux_depopulate_bus(dp->aux); in dp_display_unbind()
337 dp_power_client_deinit(dp->power); in dp_display_unbind()
338 dp_unregister_audio_driver(dev, dp->audio); in dp_display_unbind()
339 dp_aux_unregister(dp->aux); in dp_display_unbind()
340 dp->drm_dev = NULL; in dp_display_unbind()
341 dp->aux->drm_dev = NULL; in dp_display_unbind()
342 priv->dp[dp->id] = NULL; in dp_display_unbind()
356 static bool dp_display_is_sink_count_zero(struct dp_display_private *dp) in dp_display_is_sink_count_zero() argument
358 drm_dbg_dp(dp->drm_dev, "present=%#x sink_count=%d\n", in dp_display_is_sink_count_zero()
359 dp->panel->dpcd[DP_DOWNSTREAMPORT_PRESENT], in dp_display_is_sink_count_zero()
360 dp->link->sink_count); in dp_display_is_sink_count_zero()
361 return dp_display_is_ds_bridge(dp->panel) && in dp_display_is_sink_count_zero()
362 (dp->link->sink_count == 0); in dp_display_is_sink_count_zero()
367 struct dp_display_private *dp; in dp_display_send_hpd_event() local
370 dp = container_of(dp_display, struct dp_display_private, dp_display); in dp_display_send_hpd_event()
372 connector = dp->dp_display.connector; in dp_display_send_hpd_event()
377 static int dp_display_send_hpd_notification(struct dp_display_private *dp, in dp_display_send_hpd_notification() argument
380 if ((hpd && dp->dp_display.is_connected) || in dp_display_send_hpd_notification()
381 (!hpd && !dp->dp_display.is_connected)) { in dp_display_send_hpd_notification()
382 drm_dbg_dp(dp->drm_dev, "HPD already %s\n", in dp_display_send_hpd_notification()
389 dp->panel->video_test = false; in dp_display_send_hpd_notification()
391 dp->dp_display.is_connected = hpd; in dp_display_send_hpd_notification()
393 drm_dbg_dp(dp->drm_dev, "type=%d hpd=%d\n", in dp_display_send_hpd_notification()
394 dp->dp_display.connector_type, hpd); in dp_display_send_hpd_notification()
395 dp_display_send_hpd_event(&dp->dp_display); in dp_display_send_hpd_notification()
400 static int dp_display_process_hpd_high(struct dp_display_private *dp) in dp_display_process_hpd_high() argument
405 dp->panel->max_dp_lanes = dp->parser->max_dp_lanes; in dp_display_process_hpd_high()
406 dp->panel->max_dp_link_rate = dp->parser->max_dp_link_rate; in dp_display_process_hpd_high()
408 drm_dbg_dp(dp->drm_dev, "max_lanes=%d max_link_rate=%d\n", in dp_display_process_hpd_high()
409 dp->panel->max_dp_lanes, dp->panel->max_dp_link_rate); in dp_display_process_hpd_high()
411 rc = dp_panel_read_sink_caps(dp->panel, dp->dp_display.connector); in dp_display_process_hpd_high()
415 dp_link_process_request(dp->link); in dp_display_process_hpd_high()
417 edid = dp->panel->edid; in dp_display_process_hpd_high()
419 dp->dp_display.psr_supported = dp->panel->psr_cap.version && psr_enabled; in dp_display_process_hpd_high()
421 dp->audio_supported = drm_detect_monitor_audio(edid); in dp_display_process_hpd_high()
422 dp_panel_handle_sink_request(dp->panel); in dp_display_process_hpd_high()
424 dp->dp_display.max_dp_lanes = dp->parser->max_dp_lanes; in dp_display_process_hpd_high()
430 dp_link_psm_config(dp->link, &dp->panel->link_info, false); in dp_display_process_hpd_high()
432 dp_link_reset_phy_params_vx_px(dp->link); in dp_display_process_hpd_high()
433 rc = dp_ctrl_on_link(dp->ctrl); in dp_display_process_hpd_high()
439 dp_add_event(dp, EV_USER_NOTIFICATION, true, 0); in dp_display_process_hpd_high()
445 static void dp_display_host_phy_init(struct dp_display_private *dp) in dp_display_host_phy_init() argument
447 drm_dbg_dp(dp->drm_dev, "type=%d core_init=%d phy_init=%d\n", in dp_display_host_phy_init()
448 dp->dp_display.connector_type, dp->core_initialized, in dp_display_host_phy_init()
449 dp->phy_initialized); in dp_display_host_phy_init()
451 if (!dp->phy_initialized) { in dp_display_host_phy_init()
452 dp_ctrl_phy_init(dp->ctrl); in dp_display_host_phy_init()
453 dp->phy_initialized = true; in dp_display_host_phy_init()
457 static void dp_display_host_phy_exit(struct dp_display_private *dp) in dp_display_host_phy_exit() argument
459 drm_dbg_dp(dp->drm_dev, "type=%d core_init=%d phy_init=%d\n", in dp_display_host_phy_exit()
460 dp->dp_display.connector_type, dp->core_initialized, in dp_display_host_phy_exit()
461 dp->phy_initialized); in dp_display_host_phy_exit()
463 if (dp->phy_initialized) { in dp_display_host_phy_exit()
464 dp_ctrl_phy_exit(dp->ctrl); in dp_display_host_phy_exit()
465 dp->phy_initialized = false; in dp_display_host_phy_exit()
469 static void dp_display_host_init(struct dp_display_private *dp) in dp_display_host_init() argument
471 drm_dbg_dp(dp->drm_dev, "type=%d core_init=%d phy_init=%d\n", in dp_display_host_init()
472 dp->dp_display.connector_type, dp->core_initialized, in dp_display_host_init()
473 dp->phy_initialized); in dp_display_host_init()
475 dp_power_init(dp->power); in dp_display_host_init()
476 dp_ctrl_reset_irq_ctrl(dp->ctrl, true); in dp_display_host_init()
477 dp_aux_init(dp->aux); in dp_display_host_init()
478 dp->core_initialized = true; in dp_display_host_init()
481 static void dp_display_host_deinit(struct dp_display_private *dp) in dp_display_host_deinit() argument
483 drm_dbg_dp(dp->drm_dev, "type=%d core_init=%d phy_init=%d\n", in dp_display_host_deinit()
484 dp->dp_display.connector_type, dp->core_initialized, in dp_display_host_deinit()
485 dp->phy_initialized); in dp_display_host_deinit()
487 dp_ctrl_reset_irq_ctrl(dp->ctrl, false); in dp_display_host_deinit()
488 dp_aux_deinit(dp->aux); in dp_display_host_deinit()
489 dp_power_deinit(dp->power); in dp_display_host_deinit()
490 dp->core_initialized = false; in dp_display_host_deinit()
495 struct dp_display_private *dp = dev_get_dp_display_private(dev); in dp_display_usbpd_configure_cb() local
497 dp_display_host_phy_init(dp); in dp_display_usbpd_configure_cb()
499 return dp_display_process_hpd_high(dp); in dp_display_usbpd_configure_cb()
504 struct dp_display_private *dp = dev_get_dp_display_private(dev); in dp_display_notify_disconnect() local
506 dp_add_event(dp, EV_USER_NOTIFICATION, false, 0); in dp_display_notify_disconnect()
511 static void dp_display_handle_video_request(struct dp_display_private *dp) in dp_display_handle_video_request() argument
513 if (dp->link->sink_request & DP_TEST_LINK_VIDEO_PATTERN) { in dp_display_handle_video_request()
514 dp->panel->video_test = true; in dp_display_handle_video_request()
515 dp_link_send_test_response(dp->link); in dp_display_handle_video_request()
519 static int dp_display_handle_port_ststus_changed(struct dp_display_private *dp) in dp_display_handle_port_ststus_changed() argument
523 if (dp_display_is_sink_count_zero(dp)) { in dp_display_handle_port_ststus_changed()
524 drm_dbg_dp(dp->drm_dev, "sink count is zero, nothing to do\n"); in dp_display_handle_port_ststus_changed()
525 if (dp->hpd_state != ST_DISCONNECTED) { in dp_display_handle_port_ststus_changed()
526 dp->hpd_state = ST_DISCONNECT_PENDING; in dp_display_handle_port_ststus_changed()
527 dp_add_event(dp, EV_USER_NOTIFICATION, false, 0); in dp_display_handle_port_ststus_changed()
530 if (dp->hpd_state == ST_DISCONNECTED) { in dp_display_handle_port_ststus_changed()
531 dp->hpd_state = ST_MAINLINK_READY; in dp_display_handle_port_ststus_changed()
532 rc = dp_display_process_hpd_high(dp); in dp_display_handle_port_ststus_changed()
534 dp->hpd_state = ST_DISCONNECTED; in dp_display_handle_port_ststus_changed()
541 static int dp_display_handle_irq_hpd(struct dp_display_private *dp) in dp_display_handle_irq_hpd() argument
543 u32 sink_request = dp->link->sink_request; in dp_display_handle_irq_hpd()
545 drm_dbg_dp(dp->drm_dev, "%d\n", sink_request); in dp_display_handle_irq_hpd()
546 if (dp->hpd_state == ST_DISCONNECTED) { in dp_display_handle_irq_hpd()
548 drm_dbg_dp(dp->drm_dev, "Disconnected sink_request: %d\n", in dp_display_handle_irq_hpd()
555 dp_ctrl_handle_sink_request(dp->ctrl); in dp_display_handle_irq_hpd()
558 dp_display_handle_video_request(dp); in dp_display_handle_irq_hpd()
567 struct dp_display_private *dp = dev_get_dp_display_private(dev); in dp_display_usbpd_attention_cb() local
570 rc = dp_link_process_request(dp->link); in dp_display_usbpd_attention_cb()
572 sink_request = dp->link->sink_request; in dp_display_usbpd_attention_cb()
573 drm_dbg_dp(dp->drm_dev, "hpd_state=%d sink_request=%d\n", in dp_display_usbpd_attention_cb()
574 dp->hpd_state, sink_request); in dp_display_usbpd_attention_cb()
576 rc = dp_display_handle_port_ststus_changed(dp); in dp_display_usbpd_attention_cb()
578 rc = dp_display_handle_irq_hpd(dp); in dp_display_usbpd_attention_cb()
584 static int dp_hpd_plug_handle(struct dp_display_private *dp, u32 data) in dp_hpd_plug_handle() argument
589 mutex_lock(&dp->event_mutex); in dp_hpd_plug_handle()
591 state = dp->hpd_state; in dp_hpd_plug_handle()
592 drm_dbg_dp(dp->drm_dev, "Before, type=%d hpd_state=%d\n", in dp_hpd_plug_handle()
593 dp->dp_display.connector_type, state); in dp_hpd_plug_handle()
596 mutex_unlock(&dp->event_mutex); in dp_hpd_plug_handle()
601 mutex_unlock(&dp->event_mutex); in dp_hpd_plug_handle()
607 dp_add_event(dp, EV_HPD_PLUG_INT, 0, 1); /* delay = 1 */ in dp_hpd_plug_handle()
608 mutex_unlock(&dp->event_mutex); in dp_hpd_plug_handle()
612 ret = dp_display_usbpd_configure_cb(&dp->pdev->dev); in dp_hpd_plug_handle()
614 dp->hpd_state = ST_DISCONNECTED; in dp_hpd_plug_handle()
616 dp->hpd_state = ST_MAINLINK_READY; in dp_hpd_plug_handle()
619 drm_dbg_dp(dp->drm_dev, "After, type=%d hpd_state=%d\n", in dp_hpd_plug_handle()
620 dp->dp_display.connector_type, state); in dp_hpd_plug_handle()
621 mutex_unlock(&dp->event_mutex); in dp_hpd_plug_handle()
630 struct dp_display_private *dp; in dp_display_handle_plugged_change() local
632 dp = container_of(dp_display, in dp_display_handle_plugged_change()
637 dp->audio_supported) in dp_display_handle_plugged_change()
641 static int dp_hpd_unplug_handle(struct dp_display_private *dp, u32 data) in dp_hpd_unplug_handle() argument
645 mutex_lock(&dp->event_mutex); in dp_hpd_unplug_handle()
647 state = dp->hpd_state; in dp_hpd_unplug_handle()
649 drm_dbg_dp(dp->drm_dev, "Before, type=%d hpd_state=%d\n", in dp_hpd_unplug_handle()
650 dp->dp_display.connector_type, state); in dp_hpd_unplug_handle()
653 dp_del_event(dp, EV_IRQ_HPD_INT); in dp_hpd_unplug_handle()
657 if (dp->link->sink_count == 0) { in dp_hpd_unplug_handle()
658 dp_display_host_phy_exit(dp); in dp_hpd_unplug_handle()
660 dp_display_notify_disconnect(&dp->pdev->dev); in dp_hpd_unplug_handle()
661 mutex_unlock(&dp->event_mutex); in dp_hpd_unplug_handle()
664 mutex_unlock(&dp->event_mutex); in dp_hpd_unplug_handle()
667 dp_ctrl_off_link(dp->ctrl); in dp_hpd_unplug_handle()
668 dp_display_host_phy_exit(dp); in dp_hpd_unplug_handle()
669 dp->hpd_state = ST_DISCONNECTED; in dp_hpd_unplug_handle()
670 dp_display_notify_disconnect(&dp->pdev->dev); in dp_hpd_unplug_handle()
671 mutex_unlock(&dp->event_mutex); in dp_hpd_unplug_handle()
679 dp_display_notify_disconnect(&dp->pdev->dev); in dp_hpd_unplug_handle()
682 dp->hpd_state = ST_DISCONNECTED; in dp_hpd_unplug_handle()
684 dp->hpd_state = ST_DISCONNECT_PENDING; in dp_hpd_unplug_handle()
688 dp_display_handle_plugged_change(&dp->dp_display, false); in dp_hpd_unplug_handle()
690 drm_dbg_dp(dp->drm_dev, "After, type=%d hpd_state=%d\n", in dp_hpd_unplug_handle()
691 dp->dp_display.connector_type, state); in dp_hpd_unplug_handle()
694 mutex_unlock(&dp->event_mutex); in dp_hpd_unplug_handle()
698 static int dp_irq_hpd_handle(struct dp_display_private *dp, u32 data) in dp_irq_hpd_handle() argument
702 mutex_lock(&dp->event_mutex); in dp_irq_hpd_handle()
705 state = dp->hpd_state; in dp_irq_hpd_handle()
706 drm_dbg_dp(dp->drm_dev, "Before, type=%d hpd_state=%d\n", in dp_irq_hpd_handle()
707 dp->dp_display.connector_type, state); in dp_irq_hpd_handle()
710 mutex_unlock(&dp->event_mutex); in dp_irq_hpd_handle()
716 dp_add_event(dp, EV_IRQ_HPD_INT, 0, 1); /* delay = 1 */ in dp_irq_hpd_handle()
717 mutex_unlock(&dp->event_mutex); in dp_irq_hpd_handle()
721 dp_display_usbpd_attention_cb(&dp->pdev->dev); in dp_irq_hpd_handle()
723 drm_dbg_dp(dp->drm_dev, "After, type=%d hpd_state=%d\n", in dp_irq_hpd_handle()
724 dp->dp_display.connector_type, state); in dp_irq_hpd_handle()
726 mutex_unlock(&dp->event_mutex); in dp_irq_hpd_handle()
731 static void dp_display_deinit_sub_modules(struct dp_display_private *dp) in dp_display_deinit_sub_modules() argument
733 dp_debug_put(dp->debug); in dp_display_deinit_sub_modules()
734 dp_audio_put(dp->audio); in dp_display_deinit_sub_modules()
735 dp_panel_put(dp->panel); in dp_display_deinit_sub_modules()
736 dp_aux_put(dp->aux); in dp_display_deinit_sub_modules()
739 static int dp_init_sub_modules(struct dp_display_private *dp) in dp_init_sub_modules() argument
742 struct device *dev = &dp->pdev->dev; in dp_init_sub_modules()
747 dp->parser = dp_parser_get(dp->pdev); in dp_init_sub_modules()
748 if (IS_ERR(dp->parser)) { in dp_init_sub_modules()
749 rc = PTR_ERR(dp->parser); in dp_init_sub_modules()
751 dp->parser = NULL; in dp_init_sub_modules()
755 dp->catalog = dp_catalog_get(dev, &dp->parser->io); in dp_init_sub_modules()
756 if (IS_ERR(dp->catalog)) { in dp_init_sub_modules()
757 rc = PTR_ERR(dp->catalog); in dp_init_sub_modules()
759 dp->catalog = NULL; in dp_init_sub_modules()
763 dp->power = dp_power_get(dev, dp->parser); in dp_init_sub_modules()
764 if (IS_ERR(dp->power)) { in dp_init_sub_modules()
765 rc = PTR_ERR(dp->power); in dp_init_sub_modules()
767 dp->power = NULL; in dp_init_sub_modules()
771 dp->aux = dp_aux_get(dev, dp->catalog, dp->dp_display.is_edp); in dp_init_sub_modules()
772 if (IS_ERR(dp->aux)) { in dp_init_sub_modules()
773 rc = PTR_ERR(dp->aux); in dp_init_sub_modules()
775 dp->aux = NULL; in dp_init_sub_modules()
779 dp->link = dp_link_get(dev, dp->aux); in dp_init_sub_modules()
780 if (IS_ERR(dp->link)) { in dp_init_sub_modules()
781 rc = PTR_ERR(dp->link); in dp_init_sub_modules()
783 dp->link = NULL; in dp_init_sub_modules()
787 panel_in.aux = dp->aux; in dp_init_sub_modules()
788 panel_in.catalog = dp->catalog; in dp_init_sub_modules()
789 panel_in.link = dp->link; in dp_init_sub_modules()
791 dp->panel = dp_panel_get(&panel_in); in dp_init_sub_modules()
792 if (IS_ERR(dp->panel)) { in dp_init_sub_modules()
793 rc = PTR_ERR(dp->panel); in dp_init_sub_modules()
795 dp->panel = NULL; in dp_init_sub_modules()
799 dp->ctrl = dp_ctrl_get(dev, dp->link, dp->panel, dp->aux, in dp_init_sub_modules()
800 dp->power, dp->catalog, dp->parser); in dp_init_sub_modules()
801 if (IS_ERR(dp->ctrl)) { in dp_init_sub_modules()
802 rc = PTR_ERR(dp->ctrl); in dp_init_sub_modules()
804 dp->ctrl = NULL; in dp_init_sub_modules()
808 dp->audio = dp_audio_get(dp->pdev, dp->panel, dp->catalog); in dp_init_sub_modules()
809 if (IS_ERR(dp->audio)) { in dp_init_sub_modules()
810 rc = PTR_ERR(dp->audio); in dp_init_sub_modules()
812 dp->audio = NULL; in dp_init_sub_modules()
817 dp->ctrl->wide_bus_en = dp->wide_bus_en; in dp_init_sub_modules()
818 dp->catalog->wide_bus_en = dp->wide_bus_en; in dp_init_sub_modules()
823 dp_panel_put(dp->panel); in dp_init_sub_modules()
825 dp_aux_put(dp->aux); in dp_init_sub_modules()
833 struct dp_display_private *dp; in dp_display_set_mode() local
835 dp = container_of(dp_display, struct dp_display_private, dp_display); in dp_display_set_mode()
837 drm_mode_copy(&dp->panel->dp_mode.drm_mode, &mode->drm_mode); in dp_display_set_mode()
838 dp->panel->dp_mode.bpp = mode->bpp; in dp_display_set_mode()
839 dp->panel->dp_mode.capabilities = mode->capabilities; in dp_display_set_mode()
840 dp_panel_init_panel_info(dp->panel); in dp_display_set_mode()
844 static int dp_display_enable(struct dp_display_private *dp, bool force_link_train) in dp_display_enable() argument
847 struct msm_dp *dp_display = &dp->dp_display; in dp_display_enable()
849 drm_dbg_dp(dp->drm_dev, "sink_count=%d\n", dp->link->sink_count); in dp_display_enable()
851 drm_dbg_dp(dp->drm_dev, "Link already setup, return\n"); in dp_display_enable()
855 rc = dp_ctrl_on_stream(dp->ctrl, force_link_train); in dp_display_enable()
864 struct dp_display_private *dp; in dp_display_post_enable() local
867 dp = container_of(dp_display, struct dp_display_private, dp_display); in dp_display_post_enable()
869 rate = dp->link->link_params.rate; in dp_display_post_enable()
871 if (dp->audio_supported) { in dp_display_post_enable()
872 dp->audio->bw_code = drm_dp_link_rate_to_bw_code(rate); in dp_display_post_enable()
873 dp->audio->lane_count = dp->link->link_params.num_lanes; in dp_display_post_enable()
880 dp_ctrl_config_psr(dp->ctrl); in dp_display_post_enable()
885 static int dp_display_disable(struct dp_display_private *dp) in dp_display_disable() argument
887 struct msm_dp *dp_display = &dp->dp_display; in dp_display_disable()
896 if (!wait_for_completion_timeout(&dp->audio_comp, in dp_display_disable()
903 if (dp->link->sink_count == 0) { in dp_display_disable()
908 dp_ctrl_off_link_stream(dp->ctrl); in dp_display_disable()
914 dp_ctrl_off(dp->ctrl); in dp_display_disable()
915 dp_display_host_phy_exit(dp); in dp_display_disable()
920 drm_dbg_dp(dp->drm_dev, "sink count: %d\n", dp->link->sink_count); in dp_display_disable()
952 struct msm_dp *dp; in dp_bridge_mode_valid() local
955 dp = to_dp_bridge(bridge)->dp_display; in dp_bridge_mode_valid()
957 if (!dp || !mode_pclk_khz || !dp->connector) { in dp_bridge_mode_valid()
965 dp_display = container_of(dp, struct dp_display_private, dp_display); in dp_bridge_mode_valid()
968 mode_bpp = dp->connector->display_info.bpc * num_components; in dp_bridge_mode_valid()
984 int dp_display_get_modes(struct msm_dp *dp) in dp_display_get_modes() argument
988 if (!dp) { in dp_display_get_modes()
993 dp_display = container_of(dp, struct dp_display_private, dp_display); in dp_display_get_modes()
996 dp->connector); in dp_display_get_modes()
999 bool dp_display_check_video_test(struct msm_dp *dp) in dp_display_check_video_test() argument
1003 dp_display = container_of(dp, struct dp_display_private, dp_display); in dp_display_check_video_test()
1008 int dp_display_get_test_bpp(struct msm_dp *dp) in dp_display_get_test_bpp() argument
1012 if (!dp) { in dp_display_get_test_bpp()
1017 dp_display = container_of(dp, struct dp_display_private, dp_display); in dp_display_get_test_bpp()
1023 void msm_dp_snapshot(struct msm_disp_state *disp_state, struct msm_dp *dp) in msm_dp_snapshot() argument
1027 dp_display = container_of(dp, struct dp_display_private, dp_display); in msm_dp_snapshot()
1038 if (!dp->power_on) { in msm_dp_snapshot()
1050 struct dp_display_private *dp; in dp_display_set_psr() local
1057 dp = container_of(dp_display, struct dp_display_private, dp_display); in dp_display_set_psr()
1058 dp_ctrl_set_psr(dp->ctrl, enter); in dp_display_set_psr()
1160 struct dp_display_private *dp = dev_id; in dp_display_irq_handler() local
1164 if (!dp) { in dp_display_irq_handler()
1169 hpd_isr_status = dp_catalog_hpd_get_intr_status(dp->catalog); in dp_display_irq_handler()
1172 drm_dbg_dp(dp->drm_dev, "type=%d isr=0x%x\n", in dp_display_irq_handler()
1173 dp->dp_display.connector_type, hpd_isr_status); in dp_display_irq_handler()
1176 dp_add_event(dp, EV_HPD_PLUG_INT, 0, 0); in dp_display_irq_handler()
1179 dp_add_event(dp, EV_IRQ_HPD_INT, 0, 0); in dp_display_irq_handler()
1183 dp_add_event(dp, EV_HPD_UNPLUG_INT, 0, 0); in dp_display_irq_handler()
1184 dp_add_event(dp, EV_HPD_PLUG_INT, 0, 3); in dp_display_irq_handler()
1188 dp_add_event(dp, EV_HPD_UNPLUG_INT, 0, 0); in dp_display_irq_handler()
1194 ret |= dp_ctrl_isr(dp->ctrl); in dp_display_irq_handler()
1197 ret |= dp_aux_isr(dp->aux); in dp_display_irq_handler()
1205 struct dp_display_private *dp; in dp_display_request_irq() local
1212 dp = container_of(dp_display, struct dp_display_private, dp_display); in dp_display_request_irq()
1214 dp->irq = irq_of_parse_and_map(dp->pdev->dev.of_node, 0); in dp_display_request_irq()
1215 if (!dp->irq) { in dp_display_request_irq()
1220 rc = devm_request_irq(dp_display->drm_dev->dev, dp->irq, in dp_display_request_irq()
1222 IRQF_TRIGGER_HIGH, "dp_display_isr", dp); in dp_display_request_irq()
1225 dp->irq, rc); in dp_display_request_irq()
1254 struct dp_display_private *dp; in dp_display_probe() local
1262 dp = devm_kzalloc(&pdev->dev, sizeof(*dp), GFP_KERNEL); in dp_display_probe()
1263 if (!dp) in dp_display_probe()
1270 dp->pdev = pdev; in dp_display_probe()
1271 dp->name = "drm_dp"; in dp_display_probe()
1272 dp->id = desc->id; in dp_display_probe()
1273 dp->dp_display.connector_type = desc->connector_type; in dp_display_probe()
1274 dp->wide_bus_en = desc->wide_bus_en; in dp_display_probe()
1275 dp->dp_display.is_edp = in dp_display_probe()
1276 (dp->dp_display.connector_type == DRM_MODE_CONNECTOR_eDP); in dp_display_probe()
1278 rc = dp_init_sub_modules(dp); in dp_display_probe()
1285 mutex_init(&dp->event_mutex); in dp_display_probe()
1286 init_waitqueue_head(&dp->event_q); in dp_display_probe()
1287 spin_lock_init(&dp->event_lock); in dp_display_probe()
1290 dp->dp_display.dp_audio = dp->audio; in dp_display_probe()
1292 init_completion(&dp->audio_comp); in dp_display_probe()
1294 platform_set_drvdata(pdev, &dp->dp_display); in dp_display_probe()
1299 dp_display_deinit_sub_modules(dp); in dp_display_probe()
1307 struct dp_display_private *dp = dev_get_dp_display_private(&pdev->dev); in dp_display_remove() local
1310 dp_display_deinit_sub_modules(dp); in dp_display_remove()
1321 struct dp_display_private *dp; in dp_pm_resume() local
1324 dp = container_of(dp_display, struct dp_display_private, dp_display); in dp_pm_resume()
1326 mutex_lock(&dp->event_mutex); in dp_pm_resume()
1328 drm_dbg_dp(dp->drm_dev, in dp_pm_resume()
1330 dp->dp_display.connector_type, dp->core_initialized, in dp_pm_resume()
1331 dp->phy_initialized, dp_display->power_on); in dp_pm_resume()
1334 dp->hpd_state = ST_DISCONNECTED; in dp_pm_resume()
1337 dp_display_host_init(dp); in dp_pm_resume()
1340 dp_catalog_ctrl_hpd_enable(dp->catalog); in dp_pm_resume()
1342 if (dp_catalog_link_is_connected(dp->catalog)) { in dp_pm_resume()
1347 dp_display_host_phy_init(dp); in dp_pm_resume()
1348 dp_link_psm_config(dp->link, &dp->panel->link_info, false); in dp_pm_resume()
1349 sink_count = drm_dp_read_sink_count(dp->aux); in dp_pm_resume()
1353 dp_display_host_phy_exit(dp); in dp_pm_resume()
1356 dp->link->sink_count = sink_count; in dp_pm_resume()
1363 if (dp->link->sink_count) { in dp_pm_resume()
1364 dp->dp_display.is_connected = true; in dp_pm_resume()
1366 dp->dp_display.is_connected = false; in dp_pm_resume()
1370 drm_dbg_dp(dp->drm_dev, in dp_pm_resume()
1372 dp->dp_display.connector_type, dp->link->sink_count, in dp_pm_resume()
1373 dp->dp_display.is_connected, dp->core_initialized, in dp_pm_resume()
1374 dp->phy_initialized, dp_display->power_on); in dp_pm_resume()
1376 mutex_unlock(&dp->event_mutex); in dp_pm_resume()
1385 struct dp_display_private *dp; in dp_pm_suspend() local
1387 dp = container_of(dp_display, struct dp_display_private, dp_display); in dp_pm_suspend()
1389 mutex_lock(&dp->event_mutex); in dp_pm_suspend()
1391 drm_dbg_dp(dp->drm_dev, in dp_pm_suspend()
1393 dp->dp_display.connector_type, dp->core_initialized, in dp_pm_suspend()
1394 dp->phy_initialized, dp_display->power_on); in dp_pm_suspend()
1397 if (dp_power_clk_status(dp->power, DP_CTRL_PM)) in dp_pm_suspend()
1398 dp_ctrl_off_link_stream(dp->ctrl); in dp_pm_suspend()
1400 dp_display_host_phy_exit(dp); in dp_pm_suspend()
1403 dp_display_host_deinit(dp); in dp_pm_suspend()
1405 dp->hpd_state = ST_SUSPENDED; in dp_pm_suspend()
1407 drm_dbg_dp(dp->drm_dev, in dp_pm_suspend()
1409 dp->dp_display.connector_type, dp->core_initialized, in dp_pm_suspend()
1410 dp->phy_initialized, dp_display->power_on); in dp_pm_suspend()
1412 mutex_unlock(&dp->event_mutex); in dp_pm_suspend()
1451 struct dp_display_private *dp; in msm_dp_irq_postinstall() local
1456 dp = container_of(dp_display, struct dp_display_private, dp_display); in msm_dp_irq_postinstall()
1459 dp_add_event(dp, EV_HPD_INIT_SETUP, 0, 0); in msm_dp_irq_postinstall()
1464 struct dp_display_private *dp; in msm_dp_wide_bus_available() local
1466 dp = container_of(dp_display, struct dp_display_private, dp_display); in msm_dp_wide_bus_available()
1468 return dp->wide_bus_en; in msm_dp_wide_bus_available()
1473 struct dp_display_private *dp; in msm_dp_debugfs_init() local
1477 dp = container_of(dp_display, struct dp_display_private, dp_display); in msm_dp_debugfs_init()
1478 dev = &dp->pdev->dev; in msm_dp_debugfs_init()
1480 dp->debug = dp_debug_get(dev, dp->panel, in msm_dp_debugfs_init()
1481 dp->link, dp->dp_display.connector, in msm_dp_debugfs_init()
1483 if (IS_ERR(dp->debug)) { in msm_dp_debugfs_init()
1484 rc = PTR_ERR(dp->debug); in msm_dp_debugfs_init()
1486 dp->debug = NULL; in msm_dp_debugfs_init()
1490 static int dp_display_get_next_bridge(struct msm_dp *dp) in dp_display_get_next_bridge() argument
1497 dp_priv = container_of(dp, struct dp_display_private, dp_display); in dp_display_get_next_bridge()
1501 if (aux_bus && dp->is_edp) { in dp_display_get_next_bridge()
1517 } else if (dp->is_edp) { in dp_display_get_next_bridge()
1529 rc = devm_dp_parser_find_next_bridge(dp->drm_dev->dev, dp_priv->parser); in dp_display_get_next_bridge()
1530 if (!dp->is_edp && rc == -ENODEV) in dp_display_get_next_bridge()
1534 dp->next_bridge = dp_priv->parser->next_bridge; in dp_display_get_next_bridge()
1539 if (dp->is_edp) { in dp_display_get_next_bridge()
1597 struct msm_dp *dp = dp_bridge->dp_display; in dp_bridge_atomic_enable() local
1603 dp_display = container_of(dp, struct dp_display_private, dp_display); in dp_bridge_atomic_enable()
1609 if (dp->is_edp) in dp_bridge_atomic_enable()
1620 rc = dp_display_set_mode(dp, &dp_display->dp_mode); in dp_bridge_atomic_enable()
1636 rc = dp_display_post_enable(dp); in dp_bridge_atomic_enable()
1645 drm_dbg_dp(dp->drm_dev, "type=%d Done\n", dp->connector_type); in dp_bridge_atomic_enable()
1653 struct msm_dp *dp = dp_bridge->dp_display; in dp_bridge_atomic_disable() local
1656 dp_display = container_of(dp, struct dp_display_private, dp_display); in dp_bridge_atomic_disable()
1665 struct msm_dp *dp = dp_bridge->dp_display; in dp_bridge_atomic_post_disable() local
1669 dp_display = container_of(dp, struct dp_display_private, dp_display); in dp_bridge_atomic_post_disable()
1671 if (dp->is_edp) in dp_bridge_atomic_post_disable()
1692 drm_dbg_dp(dp->drm_dev, "type=%d Done\n", dp->connector_type); in dp_bridge_atomic_post_disable()
1701 struct msm_dp *dp = dp_bridge->dp_display; in dp_bridge_mode_set() local
1704 dp_display = container_of(dp, struct dp_display_private, dp_display); in dp_bridge_mode_set()
1708 if (dp_display_check_video_test(dp)) in dp_bridge_mode_set()
1709 dp_display->dp_mode.bpp = dp_display_get_test_bpp(dp); in dp_bridge_mode_set()
1711 dp_display->dp_mode.bpp = dp->connector->display_info.bpc * 3; in dp_bridge_mode_set()
1729 struct dp_display_private *dp = container_of(dp_display, struct dp_display_private, dp_display); in dp_bridge_hpd_enable() local
1731 mutex_lock(&dp->event_mutex); in dp_bridge_hpd_enable()
1732 dp_catalog_ctrl_hpd_enable(dp->catalog); in dp_bridge_hpd_enable()
1735 dp_catalog_hpd_config_intr(dp->catalog, DP_DP_HPD_INT_MASK, true); in dp_bridge_hpd_enable()
1738 mutex_unlock(&dp->event_mutex); in dp_bridge_hpd_enable()
1745 struct dp_display_private *dp = container_of(dp_display, struct dp_display_private, dp_display); in dp_bridge_hpd_disable() local
1747 mutex_lock(&dp->event_mutex); in dp_bridge_hpd_disable()
1749 dp_catalog_hpd_config_intr(dp->catalog, DP_DP_HPD_INT_MASK, false); in dp_bridge_hpd_disable()
1750 dp_catalog_ctrl_hpd_disable(dp->catalog); in dp_bridge_hpd_disable()
1753 mutex_unlock(&dp->event_mutex); in dp_bridge_hpd_disable()
1761 struct dp_display_private *dp = container_of(dp_display, struct dp_display_private, dp_display); in dp_bridge_hpd_notify() local
1767 if (!dp->core_initialized) { in dp_bridge_hpd_notify()
1768 drm_dbg_dp(dp->drm_dev, "not initialized\n"); in dp_bridge_hpd_notify()
1773 dp_add_event(dp, EV_HPD_PLUG_INT, 0, 0); in dp_bridge_hpd_notify()
1775 dp_add_event(dp, EV_HPD_UNPLUG_INT, 0, 0); in dp_bridge_hpd_notify()