summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm
diff options
context:
space:
mode:
authorChiawen Huang <chiawen.huang@amd.com>2018-09-05 15:34:57 +0300
committerAlex Deucher <alexander.deucher@amd.com>2018-09-14 23:47:56 +0300
commit16f4c69549ef676bc278be8b267a811b6f8f59ad (patch)
treee5f8aaab544f2b3fae8b509d7286199ddfeb68b8 /drivers/gpu/drm
parentcac7643a27ff15a3be2bf375fe7abd4cced228c3 (diff)
downloadlinux-16f4c69549ef676bc278be8b267a811b6f8f59ad.tar.xz
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: Chiawen Huang <chiawen.huang@amd.com> Reviewed-by: Tony Cheng <Tony.Cheng@amd.com> Acked-by: Leo Li <sunpeng.li@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r--drivers/gpu/drm/amd/display/dc/core/dc_link.c18
-rw-r--r--drivers/gpu/drm/amd/display/dc/dc_link.h1
2 files changed, 19 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link.c b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
index 9d8dc2c1ca65..bd58dbae7d3e 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_link.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
@@ -890,6 +890,24 @@ bool dc_link_detect(struct dc_link *link, enum dc_detect_reason reason)
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(
struct dc_link *link)
{
diff --git a/drivers/gpu/drm/amd/display/dc/dc_link.h b/drivers/gpu/drm/amd/display/dc/dc_link.h
index d43cefbc43d3..438fb35d87b8 100644
--- a/drivers/gpu/drm/amd/display/dc/dc_link.h
+++ b/drivers/gpu/drm/amd/display/dc/dc_link.h
@@ -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_get_hpd_state(struct dc_link *dc_link);
/* Notify DC about DP RX Interrupt (aka Short Pulse Interrupt).
* Return: