Thread (70 messages) 70 messages, 7 authors, 2022-10-14

Re: [PATCH v1 05/17] drm/mediatek: hdmi: use a syscon/regmap instead of iomem

From: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Date: 2022-09-20 10:19:00
Also in: dri-devel, linux-clk, linux-devicetree, linux-mediatek, linux-phy, lkml

Il 19/09/22 18:56, Guillaume Ranquet ha scritto:
quoted hunk ↗ jump to hunk
To prepare support for newer chips that need to share their address
range with a dedicated ddc driver, move to a syscon.

Signed-off-by: Guillaume Ranquet <redacted>
diff --git a/drivers/gpu/drm/mediatek/mtk_hdmi.c b/drivers/gpu/drm/mediatek/mtk_hdmi.c
index 3196189429bc..5cd05d4fe1a9 100644
--- a/drivers/gpu/drm/mediatek/mtk_hdmi.c
+++ b/drivers/gpu/drm/mediatek/mtk_hdmi.c
..snip..
quoted hunk ↗ jump to hunk
@@ -1428,7 +1413,6 @@ static int mtk_hdmi_dt_parse_pdata(struct mtk_hdmi *hdmi,
  	struct device_node *cec_np, *remote, *i2c_np;
  	struct platform_device *cec_pdev;
  	struct regmap *regmap;
-	struct resource *mem;
  	int ret;
  
  	ret = mtk_hdmi_get_all_clk(hdmi, np);
@@ -1474,8 +1458,7 @@ static int mtk_hdmi_dt_parse_pdata(struct mtk_hdmi *hdmi,
  	}
  	hdmi->sys_regmap = regmap;
  
-	mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	hdmi->regs = devm_ioremap_resource(dev, mem);
+	hdmi->regs = syscon_node_to_regmap(dev->of_node);
Nack. You're breaking ABI, this will force everyone to add syscon to devicetree,
hence this breaks retrocompatibility with old devicetrees.

Hint: not here, device_node_to_regmap()

Regards,
Angelo
  	if (IS_ERR(hdmi->regs)) {
  		ret = PTR_ERR(hdmi->regs);
  		goto put_device;


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help