[PATCH 3/7] drm/bridge: lt9211: use regmap_write_bits

Philipp Zabel <[email protected]>
Newsgroups org.freedesktop.lists.dri-devel,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
Replace regmap_read/regmap_write() pairs with regmap_write_bits().

Signed-off-by: Philipp Zabel <[email protected]>
---
 drivers/gpu/drm/bridge/lontium-lt9211.c | 18 +++---------------
 1 file changed, 3 insertions(+), 15 deletions(-)

diff --git a/drivers/gpu/drm/bridge/lontium-lt9211.c b/drivers/gpu/drm/bridge/lontium-lt9211.c
index bf72d1bcdb48..9888119f5287 100644
--- a/drivers/gpu/drm/bridge/lontium-lt9211.c
+++ b/drivers/gpu/drm/bridge/lontium-lt9211.c
@@ -589,11 +589,7 @@ static int lt9211c_configure_rx(struct lt9211 *ctx)
 	if (ret)
 		return ret;
 
-	ret = regmap_read(ctx->regmap, 0x8180, &pval);
-	if (ret)
-		return ret;
-
-	ret = regmap_write(ctx->regmap, 0x8180, ((pval & 0xfc) | 0x03));
+	ret = regmap_write_bits(ctx->regmap, 0x8180, 0x3, 0x3);
 	if (ret)
 		return ret;
 
@@ -609,11 +605,7 @@ static int lt9211c_configure_rx(struct lt9211 *ctx)
 	if (ret)
 		return ret;
 
-	ret = regmap_read(ctx->regmap, 0x8530, &pval);
-	if (ret)
-		return ret;
-
-	ret = regmap_write(ctx->regmap, 0x8530, ((pval & 0xf8) | 0x11));
+	ret = regmap_write_bits(ctx->regmap, 0x8530, 0x17, 0x11);
 	if (ret)
 		return ret;
 
@@ -998,11 +990,7 @@ static int lt9211c_configure_tx(struct lt9211 *ctx, bool jeida, bool bpp24,
 	if (ret)
 		return ret;
 
-	ret = regmap_read(ctx->regmap, 0x8530, &pval);
-	if (ret)
-		return ret;
-
-	ret = regmap_write(ctx->regmap, 0x8530, ((pval & 0x3f) | 0x40));
+	ret = regmap_write_bits(ctx->regmap, 0x8530, 0xc0, 0x40);
 	if (ret)
 		return ret;
 
-- 
2.47.3
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.