diff mbox series

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

Message ID 20220430025145.640305-2-marex@denx.de (mailing list archive)
State New, archived
Headers show
Series [1/2,RFC] regmap: Add bulk read/write callbacks into regmap_config | expand

Commit Message

Marek Vasut April 30, 2022, 2:51 a.m. UTC
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@denx.de>
Cc: Jagan Teki <jagan@amarulasolutions.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: Maxime Ripard <maxime@cerno.tech>
Cc: Robert Foss <robert.foss@linaro.org>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Thomas Zimmermann <tzimmermann@suse.de>
To: dri-devel@lists.freedesktop.org
---
 drivers/gpu/drm/bridge/chipone-icn6211.c | 38 ++++++++++++++----------
 1 file changed, 22 insertions(+), 16 deletions(-)
diff mbox series

Patch

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);