lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220511012612.3297577-1-jstultz@google.com>
Date:   Wed, 11 May 2022 01:26:11 +0000
From:   John Stultz <jstultz@...gle.com>
To:     linux-kernel@...r.kernel.org
Cc:     John Stultz <jstultz@...gle.com>,
        Yongqin Liu <yongqin.liu@...aro.org>,
        Amit Pundir <amit.pundir@...aro.org>,
        Peter Collingbourne <pcc@...gle.com>,
        Vinod Koul <vkoul@...nel.org>,
        Bjorn Andersson <bjorn.andersson@...aro.org>,
        Robert Foss <robert.foss@...aro.org>, kernel-team@...roid.com
Subject: [PATCH 1/2] drm/bridge: lt9611: Consolidate detection logic

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

Cc: Yongqin Liu <yongqin.liu@...aro.org>
Cc: Amit Pundir <amit.pundir@...aro.org>
Cc: Peter Collingbourne <pcc@...gle.com>
Cc: Vinod Koul <vkoul@...nel.org>
Cc: Bjorn Andersson <bjorn.andersson@...aro.org>
Cc: Robert Foss <robert.foss@...aro.org>
Cc: kernel-team@...roid.com
Reviewed-by: Robert Foss <robert.foss@...aro.org>
Signed-off-by: John Stultz <jstultz@...gle.com>
---
 drivers/gpu/drm/bridge/lontium-lt9611.c | 22 ++++++++--------------
 1 file changed, 8 insertions(+), 14 deletions(-)

diff --git a/drivers/gpu/drm/bridge/lontium-lt9611.c b/drivers/gpu/drm/bridge/lontium-lt9611.c
index 63df2e8a8abc..bf66af668f61 100644
--- a/drivers/gpu/drm/bridge/lontium-lt9611.c
+++ b/drivers/gpu/drm/bridge/lontium-lt9611.c
@@ -578,10 +578,8 @@ static struct lt9611_mode *lt9611_find_mode(const struct drm_display_mode *mode)
 }
 
 /* connector funcs */
-static enum drm_connector_status
-lt9611_connector_detect(struct drm_connector *connector, bool force)
+static enum drm_connector_status __lt9611_detect(struct lt9611 *lt9611)
 {
-	struct lt9611 *lt9611 = connector_to_lt9611(connector);
 	unsigned int reg_val = 0;
 	int connected = 0;
 
@@ -594,6 +592,12 @@ lt9611_connector_detect(struct drm_connector *connector, bool force)
 	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)
 {
 	unsigned int temp;
@@ -887,17 +891,7 @@ static void lt9611_bridge_mode_set(struct drm_bridge *bridge,
 
 static enum drm_connector_status lt9611_bridge_detect(struct drm_bridge *bridge)
 {
-	struct lt9611 *lt9611 = 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;
+	return __lt9611_detect(bridge_to_lt9611(bridge));
 }
 
 static struct edid *lt9611_bridge_get_edid(struct drm_bridge *bridge,
-- 
2.36.0.512.ge40c2bad7a-goog

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ