Commit ef6ce28b authored by Andrzej Hajda's avatar Andrzej Hajda Committed by Inki Dae

drm/exynos/hdmi: Simplify HPD gpio handling

GPIO is tested only in hdmi_detect, so there is no reason to set it in
other places and to preserve its value in context.
Signed-off-by: default avatarAndrzej Hajda <a.hajda@samsung.com>
Reviewed-by: default avatarJoonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: default avatarInki Dae <inki.dae@samsung.com>
parent d36b3004
...@@ -186,7 +186,6 @@ struct hdmi_context { ...@@ -186,7 +186,6 @@ struct hdmi_context {
struct drm_device *drm_dev; struct drm_device *drm_dev;
struct drm_connector connector; struct drm_connector connector;
struct drm_encoder *encoder; struct drm_encoder *encoder;
bool hpd;
bool powered; bool powered;
bool dvi_mode; bool dvi_mode;
struct mutex hdmi_mutex; struct mutex hdmi_mutex;
...@@ -1037,10 +1036,10 @@ static enum drm_connector_status hdmi_detect(struct drm_connector *connector, ...@@ -1037,10 +1036,10 @@ static enum drm_connector_status hdmi_detect(struct drm_connector *connector,
{ {
struct hdmi_context *hdata = ctx_from_connector(connector); struct hdmi_context *hdata = ctx_from_connector(connector);
hdata->hpd = gpio_get_value(hdata->hpd_gpio); if (gpio_get_value(hdata->hpd_gpio))
return connector_status_connected;
return hdata->hpd ? connector_status_connected : return connector_status_disconnected;
connector_status_disconnected;
} }
static void hdmi_connector_destroy(struct drm_connector *connector) static void hdmi_connector_destroy(struct drm_connector *connector)
...@@ -2156,10 +2155,6 @@ static void hdmi_hotplug_work_func(struct work_struct *work) ...@@ -2156,10 +2155,6 @@ static void hdmi_hotplug_work_func(struct work_struct *work)
hdata = container_of(work, struct hdmi_context, hotplug_work.work); hdata = container_of(work, struct hdmi_context, hotplug_work.work);
mutex_lock(&hdata->hdmi_mutex);
hdata->hpd = gpio_get_value(hdata->hpd_gpio);
mutex_unlock(&hdata->hdmi_mutex);
if (hdata->drm_dev) if (hdata->drm_dev)
drm_helper_hpd_irq_event(hdata->drm_dev); drm_helper_hpd_irq_event(hdata->drm_dev);
} }
...@@ -2428,8 +2423,6 @@ static int hdmi_probe(struct platform_device *pdev) ...@@ -2428,8 +2423,6 @@ static int hdmi_probe(struct platform_device *pdev)
goto err_hdmiphy; goto err_hdmiphy;
} }
hdata->hpd = gpio_get_value(hdata->hpd_gpio);
INIT_DELAYED_WORK(&hdata->hotplug_work, hdmi_hotplug_work_func); INIT_DELAYED_WORK(&hdata->hotplug_work, hdmi_hotplug_work_func);
ret = devm_request_threaded_irq(dev, hdata->irq, NULL, ret = devm_request_threaded_irq(dev, hdata->irq, NULL,
......
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