Commit 1ff72d43 authored by John Stultz's avatar John Stultz Committed by Robert Foss

drm/bridge: lt9611: Consolidate detection logic

This patch simply consolidates the duplicated detection
functionality in the driver.

Cc: Yongqin Liu <yongqin.liu@linaro.org>
Cc: Amit Pundir <amit.pundir@linaro.org>
Cc: Peter Collingbourne <pcc@google.com>
Cc: Vinod Koul <vkoul@kernel.org>
Cc: Bjorn Andersson <bjorn.andersson@linaro.org>
Cc: Robert Foss <robert.foss@linaro.org>
Cc: kernel-team@android.com
Reviewed-by: default avatarRobert Foss <robert.foss@linaro.org>
Signed-off-by: default avatarJohn Stultz <jstultz@google.com>
Reviewed-by: default avatarRobert Foss <robert.foss@linaro.org>
Signed-off-by: default avatarRobert Foss <robert.foss@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20220511012612.3297577-1-jstultz@google.com
parent 670c87fd
...@@ -578,10 +578,8 @@ static struct lt9611_mode *lt9611_find_mode(const struct drm_display_mode *mode) ...@@ -578,10 +578,8 @@ static struct lt9611_mode *lt9611_find_mode(const struct drm_display_mode *mode)
} }
/* connector funcs */ /* connector funcs */
static enum drm_connector_status static enum drm_connector_status __lt9611_detect(struct lt9611 *lt9611)
lt9611_connector_detect(struct drm_connector *connector, bool force)
{ {
struct lt9611 *lt9611 = connector_to_lt9611(connector);
unsigned int reg_val = 0; unsigned int reg_val = 0;
int connected = 0; int connected = 0;
...@@ -594,6 +592,12 @@ lt9611_connector_detect(struct drm_connector *connector, bool force) ...@@ -594,6 +592,12 @@ lt9611_connector_detect(struct drm_connector *connector, bool force)
return lt9611->status; return lt9611->status;
} }
static enum drm_connector_status
lt9611_connector_detect(struct drm_connector *connector, bool force)
{
return __lt9611_detect(connector_to_lt9611(connector));
}
static int lt9611_read_edid(struct lt9611 *lt9611) static int lt9611_read_edid(struct lt9611 *lt9611)
{ {
unsigned int temp; unsigned int temp;
...@@ -893,17 +897,7 @@ static void lt9611_bridge_mode_set(struct drm_bridge *bridge, ...@@ -893,17 +897,7 @@ static void lt9611_bridge_mode_set(struct drm_bridge *bridge,
static enum drm_connector_status lt9611_bridge_detect(struct drm_bridge *bridge) static enum drm_connector_status lt9611_bridge_detect(struct drm_bridge *bridge)
{ {
struct lt9611 *lt9611 = bridge_to_lt9611(bridge); return __lt9611_detect(bridge_to_lt9611(bridge));
unsigned int reg_val = 0;
int connected;
regmap_read(lt9611->regmap, 0x825e, &reg_val);
connected = reg_val & BIT(0);
lt9611->status = connected ? connector_status_connected :
connector_status_disconnected;
return lt9611->status;
} }
static struct edid *lt9611_bridge_get_edid(struct drm_bridge *bridge, static struct edid *lt9611_bridge_get_edid(struct drm_bridge *bridge,
......
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