All of lore.kernel.org
 help / color / mirror / Atom feed
From: "H. Nikolaus Schaller" <hns@goldelico.com>
To: Paul Cercueil <paul@crapouillou.net>,
	Rob Herring <robh+dt@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	"H. Nikolaus Schaller" <hns@goldelico.com>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	Kees Cook <keescook@chromium.org>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	Miquel Raynal <miquel.raynal@bootlin.com>,
	David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>,
	Neil Armstrong <narmstrong@baylibre.com>,
	Robert Foss <robert.foss@linaro.org>,
	Laurent Pinchart <Laurent.pinchart@ideasonboard.com>,
	Jernej Skrabec <jernej.skrabec@gmail.com>,
	Harry Wentland <harry.wentland@amd.com>,
	Sam Ravnborg <sam@ravnborg.org>,
	Maxime Ripard <maxime@cerno.tech>,
	Hans Verkuil <hverkuil-cisco@xs4all.nl>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>, Paul Boddie <paul@boddie.org.uk>,
	Andrzej Hajda <andrzej.hajda@intel.com>,
	Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Cc: devicetree@vger.kernel.org, linux-mips@vger.kernel.org,
	linux-kernel@vger.kernel.org, letux-kernel@openphoenux.org,
	Jonas Karlman <jonas@kwiboo.se>,
	dri-devel@lists.freedesktop.org
Subject: [PATCH v12 1/9] drm/ingenic: prepare ingenic drm for later addition of JZ4780
Date: Mon, 31 Jan 2022 13:26:47 +0100	[thread overview]
Message-ID: <a326a2db8a8b517355b3f47ed91964694d7df19c.1643632014.git.hns@goldelico.com> (raw)
In-Reply-To: <cover.1643632014.git.hns@goldelico.com>

This changes the way the regmap is allocated to prepare for the
later addition of the JZ4780 which has more registers and bits
than the others.

Therefore we make the regmap as big as the reg property in
the device tree tells.

Suggested-by: Paul Cercueil <paul@crapouillou.net>
Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
---
 drivers/gpu/drm/ingenic/ingenic-drm-drv.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c
index b4943a56be09b..9c60fc4605e4b 100644
--- a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c
+++ b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c
@@ -173,7 +173,6 @@ static const struct regmap_config ingenic_drm_regmap_config = {
 	.val_bits = 32,
 	.reg_stride = 4,
 
-	.max_register = JZ_REG_LCD_SIZE1,
 	.writeable_reg = ingenic_drm_writeable_reg,
 };
 
@@ -1011,6 +1010,8 @@ static int ingenic_drm_bind(struct device *dev, bool has_components)
 	struct ingenic_drm_bridge *ib;
 	struct drm_device *drm;
 	void __iomem *base;
+	struct resource *res;
+	struct regmap_config regmap_config;
 	long parent_rate;
 	unsigned int i, clone_mask = 0;
 	int ret, irq;
@@ -1056,14 +1057,16 @@ static int ingenic_drm_bind(struct device *dev, bool has_components)
 	drm->mode_config.funcs = &ingenic_drm_mode_config_funcs;
 	drm->mode_config.helper_private = &ingenic_drm_mode_config_helpers;
 
-	base = devm_platform_ioremap_resource(pdev, 0);
+	base = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
 	if (IS_ERR(base)) {
 		dev_err(dev, "Failed to get memory resource\n");
 		return PTR_ERR(base);
 	}
 
+	regmap_config = ingenic_drm_regmap_config;
+	regmap_config.max_register = res->end - res->start;
 	priv->map = devm_regmap_init_mmio(dev, base,
-					  &ingenic_drm_regmap_config);
+					  &regmap_config);
 	if (IS_ERR(priv->map)) {
 		dev_err(dev, "Failed to create regmap\n");
 		return PTR_ERR(priv->map);
-- 
2.33.0


WARNING: multiple messages have this Message-ID (diff)
From: "H. Nikolaus Schaller" <hns@goldelico.com>
To: Paul Cercueil <paul@crapouillou.net>,
	Rob Herring <robh+dt@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	"H. Nikolaus Schaller" <hns@goldelico.com>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	Kees Cook <keescook@chromium.org>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	Miquel Raynal <miquel.raynal@bootlin.com>,
	David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>,
	Neil Armstrong <narmstrong@baylibre.com>,
	Robert Foss <robert.foss@linaro.org>,
	Laurent Pinchart <Laurent.pinchart@ideasonboard.com>,
	Jernej Skrabec <jernej.skrabec@gmail.com>,
	Harry Wentland <harry.wentland@amd.com>,
	Sam Ravnborg <sam@ravnborg.org>,
	Maxime Ripard <maxime@cerno.tech>,
	Hans Verkuil <hverkuil-cisco@xs4all.nl>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>, Paul Boddie <paul@boddie.org.uk>,
	Andrzej Hajda <andrzej.hajda@intel.com>,
	Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Cc: devicetree@vger.kernel.org, Jonas Karlman <jonas@kwiboo.se>,
	linux-mips@vger.kernel.org, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org, letux-kernel@openphoenux.org
Subject: [PATCH v12 1/9] drm/ingenic: prepare ingenic drm for later addition of JZ4780
Date: Mon, 31 Jan 2022 13:26:47 +0100	[thread overview]
Message-ID: <a326a2db8a8b517355b3f47ed91964694d7df19c.1643632014.git.hns@goldelico.com> (raw)
In-Reply-To: <cover.1643632014.git.hns@goldelico.com>

This changes the way the regmap is allocated to prepare for the
later addition of the JZ4780 which has more registers and bits
than the others.

Therefore we make the regmap as big as the reg property in
the device tree tells.

Suggested-by: Paul Cercueil <paul@crapouillou.net>
Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
---
 drivers/gpu/drm/ingenic/ingenic-drm-drv.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c
index b4943a56be09b..9c60fc4605e4b 100644
--- a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c
+++ b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c
@@ -173,7 +173,6 @@ static const struct regmap_config ingenic_drm_regmap_config = {
 	.val_bits = 32,
 	.reg_stride = 4,
 
-	.max_register = JZ_REG_LCD_SIZE1,
 	.writeable_reg = ingenic_drm_writeable_reg,
 };
 
@@ -1011,6 +1010,8 @@ static int ingenic_drm_bind(struct device *dev, bool has_components)
 	struct ingenic_drm_bridge *ib;
 	struct drm_device *drm;
 	void __iomem *base;
+	struct resource *res;
+	struct regmap_config regmap_config;
 	long parent_rate;
 	unsigned int i, clone_mask = 0;
 	int ret, irq;
@@ -1056,14 +1057,16 @@ static int ingenic_drm_bind(struct device *dev, bool has_components)
 	drm->mode_config.funcs = &ingenic_drm_mode_config_funcs;
 	drm->mode_config.helper_private = &ingenic_drm_mode_config_helpers;
 
-	base = devm_platform_ioremap_resource(pdev, 0);
+	base = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
 	if (IS_ERR(base)) {
 		dev_err(dev, "Failed to get memory resource\n");
 		return PTR_ERR(base);
 	}
 
+	regmap_config = ingenic_drm_regmap_config;
+	regmap_config.max_register = res->end - res->start;
 	priv->map = devm_regmap_init_mmio(dev, base,
-					  &ingenic_drm_regmap_config);
+					  &regmap_config);
 	if (IS_ERR(priv->map)) {
 		dev_err(dev, "Failed to create regmap\n");
 		return PTR_ERR(priv->map);
-- 
2.33.0


  reply	other threads:[~2022-01-31 12:27 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-31 12:26 [PATCH v12 0/9] MIPS: JZ4780 and CI20 HDMI H. Nikolaus Schaller
2022-01-31 12:26 ` H. Nikolaus Schaller
2022-01-31 12:26 ` H. Nikolaus Schaller [this message]
2022-01-31 12:26   ` [PATCH v12 1/9] drm/ingenic: prepare ingenic drm for later addition of JZ4780 H. Nikolaus Schaller
2022-01-31 12:26 ` [PATCH v12 2/9] drm/ingenic: Add support for JZ4780 and HDMI output H. Nikolaus Schaller
2022-01-31 12:26   ` H. Nikolaus Schaller
2022-02-02 10:23   ` Paul Cercueil
2022-02-02 10:23     ` Paul Cercueil
2022-02-02 11:56     ` H. Nikolaus Schaller
2022-02-02 11:56       ` H. Nikolaus Schaller
2022-02-02 12:06       ` Paul Cercueil
2022-02-02 12:06         ` Paul Cercueil
2022-02-02 12:17         ` H. Nikolaus Schaller
2022-02-02 12:17           ` H. Nikolaus Schaller
2022-02-02 12:28           ` Paul Cercueil
2022-02-02 12:28             ` Paul Cercueil
2022-02-02 12:33             ` H. Nikolaus Schaller
2022-02-02 12:33               ` H. Nikolaus Schaller
2022-02-02 12:41               ` Paul Cercueil
2022-02-02 12:41                 ` Paul Cercueil
2022-02-02 12:48                 ` H. Nikolaus Schaller
2022-02-02 12:48                   ` H. Nikolaus Schaller
2022-02-02 17:04                 ` Paul Boddie
2022-02-02 17:04                   ` Paul Boddie
2022-01-31 12:26 ` [PATCH v12 3/9] dt-bindings: display: Add ingenic,jz4780-dw-hdmi DT Schema H. Nikolaus Schaller
2022-01-31 12:26   ` [PATCH v12 3/9] dt-bindings: display: Add ingenic, jz4780-dw-hdmi " H. Nikolaus Schaller
2022-02-01 23:49   ` [PATCH v12 3/9] dt-bindings: display: Add ingenic,jz4780-dw-hdmi " Rob Herring
2022-02-01 23:49     ` [PATCH v12 3/9] dt-bindings: display: Add ingenic, jz4780-dw-hdmi " Rob Herring
2022-02-02  9:59   ` [PATCH v12 3/9] dt-bindings: display: Add ingenic,jz4780-dw-hdmi " Paul Cercueil
2022-02-02  9:59     ` [PATCH v12 3/9] dt-bindings: display: Add ingenic, jz4780-dw-hdmi " Paul Cercueil
2022-02-02 11:59     ` [PATCH v12 3/9] dt-bindings: display: Add ingenic,jz4780-dw-hdmi " H. Nikolaus Schaller
2022-02-02 11:59       ` [PATCH v12 3/9] dt-bindings: display: Add ingenic, jz4780-dw-hdmi " H. Nikolaus Schaller
2022-01-31 12:26 ` [PATCH v12 4/9] drm/ingenic: Add dw-hdmi driver specialization for jz4780 H. Nikolaus Schaller
2022-01-31 12:26   ` H. Nikolaus Schaller
2022-02-02 10:16   ` Paul Cercueil
2022-02-02 10:16     ` Paul Cercueil
2022-02-02 11:42     ` H. Nikolaus Schaller
2022-02-02 11:42       ` H. Nikolaus Schaller
2022-01-31 12:26 ` [PATCH v12 5/9] drm/synopsys+ingenic: repair hot plug detection H. Nikolaus Schaller
2022-01-31 12:26   ` H. Nikolaus Schaller
2022-01-31 12:26 ` [PATCH v12 6/9] dw-hdmi/ingenic-dw-hdmi: repair interworking with hdmi-connector H. Nikolaus Schaller
2022-01-31 12:26   ` H. Nikolaus Schaller
2022-01-31 12:26 ` [PATCH v12 7/9] drm/bridge: display-connector: add ddc-en gpio support H. Nikolaus Schaller
2022-01-31 12:26   ` H. Nikolaus Schaller
2022-02-02 10:32   ` Paul Cercueil
2022-02-02 10:32     ` Paul Cercueil
2022-02-02 11:45     ` H. Nikolaus Schaller
2022-02-02 11:45       ` H. Nikolaus Schaller
2022-01-31 12:26 ` [PATCH v12 8/9] MIPS: DTS: CI20: fix how ddc power is enabled H. Nikolaus Schaller
2022-01-31 12:26   ` H. Nikolaus Schaller
2022-02-02 10:34   ` Paul Cercueil
2022-02-02 10:34     ` Paul Cercueil

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a326a2db8a8b517355b3f47ed91964694d7df19c.1643632014.git.hns@goldelico.com \
    --to=hns@goldelico.com \
    --cc=Laurent.pinchart@ideasonboard.com \
    --cc=airlied@linux.ie \
    --cc=andrzej.hajda@intel.com \
    --cc=broonie@kernel.org \
    --cc=daniel@ffwll.ch \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=ebiederm@xmission.com \
    --cc=geert+renesas@glider.be \
    --cc=harry.wentland@amd.com \
    --cc=hverkuil-cisco@xs4all.nl \
    --cc=jernej.skrabec@gmail.com \
    --cc=jonas@kwiboo.se \
    --cc=keescook@chromium.org \
    --cc=kieran.bingham+renesas@ideasonboard.com \
    --cc=letux-kernel@openphoenux.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=maxime@cerno.tech \
    --cc=miquel.raynal@bootlin.com \
    --cc=narmstrong@baylibre.com \
    --cc=paul@boddie.org.uk \
    --cc=paul@crapouillou.net \
    --cc=robert.foss@linaro.org \
    --cc=robh+dt@kernel.org \
    --cc=sam@ravnborg.org \
    --cc=tsbogend@alpha.franken.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.