[PATCH 2/2] [RFC] drm: bridge: icn6211: Convert to regmap_config bulk read/write

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Instead of working around the missing bulk register read/write in
regmap_config using regmap_bus callbacks, switch to new regmap_config
read/write callbacks.

Signed-off-by: Marek Vasut <marex@xxxxxxx>
Cc: Jagan Teki <jagan@xxxxxxxxxxxxxxxxxxxx>
Cc: Mark Brown <broonie@xxxxxxxxxx>
Cc: Maxime Ripard <maxime@xxxxxxxxxx>
Cc: Robert Foss <robert.foss@xxxxxxxxxx>
Cc: Sam Ravnborg <sam@xxxxxxxxxxxx>
Cc: Thomas Zimmermann <tzimmermann@xxxxxxx>
To: dri-devel@xxxxxxxxxxxxxxxxxxxxx
---
 drivers/gpu/drm/bridge/chipone-icn6211.c | 38 ++++++++++++++----------
 1 file changed, 22 insertions(+), 16 deletions(-)

diff --git a/drivers/gpu/drm/bridge/chipone-icn6211.c b/drivers/gpu/drm/bridge/chipone-icn6211.c
index 45bb89ac3fff..e1f632940e00 100644
--- a/drivers/gpu/drm/bridge/chipone-icn6211.c
+++ b/drivers/gpu/drm/bridge/chipone-icn6211.c
@@ -181,15 +181,6 @@ static const struct regmap_access_table chipone_dsi_writeable_table = {
 	.n_yes_ranges = ARRAY_SIZE(chipone_dsi_writeable_ranges),
 };
 
-static const struct regmap_config chipone_regmap_config = {
-	.reg_bits = 8,
-	.val_bits = 8,
-	.rd_table = &chipone_dsi_readable_table,
-	.wr_table = &chipone_dsi_writeable_table,
-	.cache_type = REGCACHE_RBTREE,
-	.max_register = MIPI_ATE_STATUS(1),
-};
-
 static int chipone_dsi_read(void *context,
 			    const void *reg, size_t reg_size,
 			    void *val, size_t val_size)
@@ -210,11 +201,26 @@ static int chipone_dsi_write(void *context, const void *data, size_t count)
 	return mipi_dsi_generic_write(dsi, data, 2);
 }
 
-static const struct regmap_bus chipone_dsi_regmap_bus = {
-	.read				= chipone_dsi_read,
-	.write				= chipone_dsi_write,
-	.reg_format_endian_default	= REGMAP_ENDIAN_NATIVE,
-	.val_format_endian_default	= REGMAP_ENDIAN_NATIVE,
+static const struct regmap_config chipone_regmap_config = {
+	.name = "chipone-i2c",
+	.reg_bits = 8,
+	.val_bits = 8,
+	.rd_table = &chipone_dsi_readable_table,
+	.wr_table = &chipone_dsi_writeable_table,
+	.cache_type = REGCACHE_RBTREE,
+	.max_register = MIPI_ATE_STATUS(1),
+};
+
+static const struct regmap_config chipone_dsi_regmap_config = {
+	.name = "chipone-dsi",
+	.reg_bits = 8,
+	.val_bits = 8,
+	.rd_table = &chipone_dsi_readable_table,
+	.wr_table = &chipone_dsi_writeable_table,
+	.cache_type = REGCACHE_RBTREE,
+	.max_register = MIPI_ATE_STATUS(1),
+	.read = chipone_dsi_read,
+	.write = chipone_dsi_write,
 };
 
 static inline struct chipone *bridge_to_chipone(struct drm_bridge *bridge)
@@ -691,8 +697,8 @@ static int chipone_dsi_probe(struct mipi_dsi_device *dsi)
 	if (ret)
 		return ret;
 
-	icn->regmap = devm_regmap_init(dev, &chipone_dsi_regmap_bus,
-				       dsi, &chipone_regmap_config);
+	icn->regmap = devm_regmap_init(dev, NULL,
+				       dsi, &chipone_dsi_regmap_config);
 	if (IS_ERR(icn->regmap))
 		return PTR_ERR(icn->regmap);
 
-- 
2.35.1




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux