Commit 16f4c695 authored by Chiawen Huang's avatar Chiawen Huang Committed by Alex Deucher

drm/amd/display: add query HPD interface.

[Why]
current dc_link_detect function is not only detection but also update some link data.

[How]
added a pure get HPD state function.
Signed-off-by: default avatarChiawen Huang <chiawen.huang@amd.com>
Reviewed-by: default avatarTony Cheng <Tony.Cheng@amd.com>
Acked-by: default avatarLeo Li <sunpeng.li@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent cac7643a
...@@ -890,6 +890,24 @@ bool dc_link_detect(struct dc_link *link, enum dc_detect_reason reason) ...@@ -890,6 +890,24 @@ bool dc_link_detect(struct dc_link *link, enum dc_detect_reason reason)
return true; return true;
} }
bool dc_link_get_hpd_state(struct dc_link *dc_link)
{
struct gpio *hpd_pin;
uint32_t state;
hpd_pin = get_hpd_gpio(dc_link->ctx->dc_bios,
dc_link->link_id, dc_link->ctx->gpio_service);
if (hpd_pin == NULL)
ASSERT(false);
dal_gpio_open(hpd_pin, GPIO_MODE_INTERRUPT);
dal_gpio_get_value(hpd_pin, &state);
dal_gpio_close(hpd_pin);
dal_gpio_destroy_irq(&hpd_pin);
return state;
}
static enum hpd_source_id get_hpd_line( static enum hpd_source_id get_hpd_line(
struct dc_link *link) struct dc_link *link)
{ {
......
...@@ -167,6 +167,7 @@ enum dc_detect_reason { ...@@ -167,6 +167,7 @@ enum dc_detect_reason {
}; };
bool dc_link_detect(struct dc_link *dc_link, enum dc_detect_reason reason); bool dc_link_detect(struct dc_link *dc_link, enum dc_detect_reason reason);
bool dc_link_get_hpd_state(struct dc_link *dc_link);
/* Notify DC about DP RX Interrupt (aka Short Pulse Interrupt). /* Notify DC about DP RX Interrupt (aka Short Pulse Interrupt).
* Return: * Return:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment