All of lore.kernel.org
 help / color / mirror / Atom feed
From: Samuel Holland <samuel@sholland.org>
To: Chen-Yu Tsai <wens@csie.org>,
	Jernej Skrabec <jernej.skrabec@gmail.com>,
	Maxime Ripard <mripard@kernel.org>
Cc: Samuel Holland <samuel@sholland.org>,
	Daniel Vetter <daniel@ffwll.ch>, David Airlie <airlied@linux.ie>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Rob Herring <robh+dt@kernel.org>,
	devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, linux-sunxi@lists.linux.dev
Subject: [PATCH v3 12/14] drm/sun4i: Add support for D1 TCON TOP
Date: Sun, 24 Apr 2022 11:26:30 -0500	[thread overview]
Message-ID: <20220424162633.12369-13-samuel@sholland.org> (raw)
In-Reply-To: <20220424162633.12369-1-samuel@sholland.org>

D1 has a TCON TOP with TCON TV0 and DSI, but no TCON TV1. This puts the
DSI clock name at index 1 in clock-output-names. Support this by only
incrementing the index for clocks that are actually supported.

Signed-off-by: Samuel Holland <samuel@sholland.org>
---

(no changes since v1)

 drivers/gpu/drm/sun4i/sun8i_tcon_top.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/sun4i/sun8i_tcon_top.c b/drivers/gpu/drm/sun4i/sun8i_tcon_top.c
index 1b9b8b48f4a7..da97682b6835 100644
--- a/drivers/gpu/drm/sun4i/sun8i_tcon_top.c
+++ b/drivers/gpu/drm/sun4i/sun8i_tcon_top.c
@@ -189,22 +189,23 @@ static int sun8i_tcon_top_bind(struct device *dev, struct device *master,
 	 * if TVE is active on each TCON TV. If it is, mux should be switched
 	 * to TVE clock parent.
 	 */
+	i = 0;
 	clk_data->hws[CLK_TCON_TOP_TV0] =
 		sun8i_tcon_top_register_gate(dev, "tcon-tv0", regs,
 					     &tcon_top->reg_lock,
-					     TCON_TOP_TCON_TV0_GATE, 0);
+					     TCON_TOP_TCON_TV0_GATE, i++);
 
 	if (quirks->has_tcon_tv1)
 		clk_data->hws[CLK_TCON_TOP_TV1] =
 			sun8i_tcon_top_register_gate(dev, "tcon-tv1", regs,
 						     &tcon_top->reg_lock,
-						     TCON_TOP_TCON_TV1_GATE, 1);
+						     TCON_TOP_TCON_TV1_GATE, i++);
 
 	if (quirks->has_dsi)
 		clk_data->hws[CLK_TCON_TOP_DSI] =
 			sun8i_tcon_top_register_gate(dev, "dsi", regs,
 						     &tcon_top->reg_lock,
-						     TCON_TOP_TCON_DSI_GATE, 2);
+						     TCON_TOP_TCON_DSI_GATE, i++);
 
 	for (i = 0; i < CLK_NUM; i++)
 		if (IS_ERR(clk_data->hws[i])) {
@@ -272,6 +273,10 @@ static const struct sun8i_tcon_top_quirks sun8i_r40_tcon_top_quirks = {
 	.has_dsi	= true,
 };
 
+static const struct sun8i_tcon_top_quirks sun20i_d1_tcon_top_quirks = {
+	.has_dsi	= true,
+};
+
 static const struct sun8i_tcon_top_quirks sun50i_h6_tcon_top_quirks = {
 	/* Nothing special */
 };
@@ -282,6 +287,10 @@ const struct of_device_id sun8i_tcon_top_of_table[] = {
 		.compatible = "allwinner,sun8i-r40-tcon-top",
 		.data = &sun8i_r40_tcon_top_quirks
 	},
+	{
+		.compatible = "allwinner,sun20i-d1-tcon-top",
+		.data = &sun20i_d1_tcon_top_quirks
+	},
 	{
 		.compatible = "allwinner,sun50i-h6-tcon-top",
 		.data = &sun50i_h6_tcon_top_quirks
-- 
2.35.1


WARNING: multiple messages have this Message-ID (diff)
From: Samuel Holland <samuel@sholland.org>
To: Chen-Yu Tsai <wens@csie.org>,
	Jernej Skrabec <jernej.skrabec@gmail.com>,
	Maxime Ripard <mripard@kernel.org>
Cc: devicetree@vger.kernel.org, Samuel Holland <samuel@sholland.org>,
	David Airlie <airlied@linux.ie>,
	linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
	Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	linux-sunxi@lists.linux.dev,
	linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 12/14] drm/sun4i: Add support for D1 TCON TOP
Date: Sun, 24 Apr 2022 11:26:30 -0500	[thread overview]
Message-ID: <20220424162633.12369-13-samuel@sholland.org> (raw)
In-Reply-To: <20220424162633.12369-1-samuel@sholland.org>

D1 has a TCON TOP with TCON TV0 and DSI, but no TCON TV1. This puts the
DSI clock name at index 1 in clock-output-names. Support this by only
incrementing the index for clocks that are actually supported.

Signed-off-by: Samuel Holland <samuel@sholland.org>
---

(no changes since v1)

 drivers/gpu/drm/sun4i/sun8i_tcon_top.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/sun4i/sun8i_tcon_top.c b/drivers/gpu/drm/sun4i/sun8i_tcon_top.c
index 1b9b8b48f4a7..da97682b6835 100644
--- a/drivers/gpu/drm/sun4i/sun8i_tcon_top.c
+++ b/drivers/gpu/drm/sun4i/sun8i_tcon_top.c
@@ -189,22 +189,23 @@ static int sun8i_tcon_top_bind(struct device *dev, struct device *master,
 	 * if TVE is active on each TCON TV. If it is, mux should be switched
 	 * to TVE clock parent.
 	 */
+	i = 0;
 	clk_data->hws[CLK_TCON_TOP_TV0] =
 		sun8i_tcon_top_register_gate(dev, "tcon-tv0", regs,
 					     &tcon_top->reg_lock,
-					     TCON_TOP_TCON_TV0_GATE, 0);
+					     TCON_TOP_TCON_TV0_GATE, i++);
 
 	if (quirks->has_tcon_tv1)
 		clk_data->hws[CLK_TCON_TOP_TV1] =
 			sun8i_tcon_top_register_gate(dev, "tcon-tv1", regs,
 						     &tcon_top->reg_lock,
-						     TCON_TOP_TCON_TV1_GATE, 1);
+						     TCON_TOP_TCON_TV1_GATE, i++);
 
 	if (quirks->has_dsi)
 		clk_data->hws[CLK_TCON_TOP_DSI] =
 			sun8i_tcon_top_register_gate(dev, "dsi", regs,
 						     &tcon_top->reg_lock,
-						     TCON_TOP_TCON_DSI_GATE, 2);
+						     TCON_TOP_TCON_DSI_GATE, i++);
 
 	for (i = 0; i < CLK_NUM; i++)
 		if (IS_ERR(clk_data->hws[i])) {
@@ -272,6 +273,10 @@ static const struct sun8i_tcon_top_quirks sun8i_r40_tcon_top_quirks = {
 	.has_dsi	= true,
 };
 
+static const struct sun8i_tcon_top_quirks sun20i_d1_tcon_top_quirks = {
+	.has_dsi	= true,
+};
+
 static const struct sun8i_tcon_top_quirks sun50i_h6_tcon_top_quirks = {
 	/* Nothing special */
 };
@@ -282,6 +287,10 @@ const struct of_device_id sun8i_tcon_top_of_table[] = {
 		.compatible = "allwinner,sun8i-r40-tcon-top",
 		.data = &sun8i_r40_tcon_top_quirks
 	},
+	{
+		.compatible = "allwinner,sun20i-d1-tcon-top",
+		.data = &sun20i_d1_tcon_top_quirks
+	},
 	{
 		.compatible = "allwinner,sun50i-h6-tcon-top",
 		.data = &sun50i_h6_tcon_top_quirks
-- 
2.35.1


WARNING: multiple messages have this Message-ID (diff)
From: Samuel Holland <samuel@sholland.org>
To: Chen-Yu Tsai <wens@csie.org>,
	Jernej Skrabec <jernej.skrabec@gmail.com>,
	Maxime Ripard <mripard@kernel.org>
Cc: Samuel Holland <samuel@sholland.org>,
	Daniel Vetter <daniel@ffwll.ch>, David Airlie <airlied@linux.ie>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Rob Herring <robh+dt@kernel.org>,
	devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, linux-sunxi@lists.linux.dev
Subject: [PATCH v3 12/14] drm/sun4i: Add support for D1 TCON TOP
Date: Sun, 24 Apr 2022 11:26:30 -0500	[thread overview]
Message-ID: <20220424162633.12369-13-samuel@sholland.org> (raw)
In-Reply-To: <20220424162633.12369-1-samuel@sholland.org>

D1 has a TCON TOP with TCON TV0 and DSI, but no TCON TV1. This puts the
DSI clock name at index 1 in clock-output-names. Support this by only
incrementing the index for clocks that are actually supported.

Signed-off-by: Samuel Holland <samuel@sholland.org>
---

(no changes since v1)

 drivers/gpu/drm/sun4i/sun8i_tcon_top.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/sun4i/sun8i_tcon_top.c b/drivers/gpu/drm/sun4i/sun8i_tcon_top.c
index 1b9b8b48f4a7..da97682b6835 100644
--- a/drivers/gpu/drm/sun4i/sun8i_tcon_top.c
+++ b/drivers/gpu/drm/sun4i/sun8i_tcon_top.c
@@ -189,22 +189,23 @@ static int sun8i_tcon_top_bind(struct device *dev, struct device *master,
 	 * if TVE is active on each TCON TV. If it is, mux should be switched
 	 * to TVE clock parent.
 	 */
+	i = 0;
 	clk_data->hws[CLK_TCON_TOP_TV0] =
 		sun8i_tcon_top_register_gate(dev, "tcon-tv0", regs,
 					     &tcon_top->reg_lock,
-					     TCON_TOP_TCON_TV0_GATE, 0);
+					     TCON_TOP_TCON_TV0_GATE, i++);
 
 	if (quirks->has_tcon_tv1)
 		clk_data->hws[CLK_TCON_TOP_TV1] =
 			sun8i_tcon_top_register_gate(dev, "tcon-tv1", regs,
 						     &tcon_top->reg_lock,
-						     TCON_TOP_TCON_TV1_GATE, 1);
+						     TCON_TOP_TCON_TV1_GATE, i++);
 
 	if (quirks->has_dsi)
 		clk_data->hws[CLK_TCON_TOP_DSI] =
 			sun8i_tcon_top_register_gate(dev, "dsi", regs,
 						     &tcon_top->reg_lock,
-						     TCON_TOP_TCON_DSI_GATE, 2);
+						     TCON_TOP_TCON_DSI_GATE, i++);
 
 	for (i = 0; i < CLK_NUM; i++)
 		if (IS_ERR(clk_data->hws[i])) {
@@ -272,6 +273,10 @@ static const struct sun8i_tcon_top_quirks sun8i_r40_tcon_top_quirks = {
 	.has_dsi	= true,
 };
 
+static const struct sun8i_tcon_top_quirks sun20i_d1_tcon_top_quirks = {
+	.has_dsi	= true,
+};
+
 static const struct sun8i_tcon_top_quirks sun50i_h6_tcon_top_quirks = {
 	/* Nothing special */
 };
@@ -282,6 +287,10 @@ const struct of_device_id sun8i_tcon_top_of_table[] = {
 		.compatible = "allwinner,sun8i-r40-tcon-top",
 		.data = &sun8i_r40_tcon_top_quirks
 	},
+	{
+		.compatible = "allwinner,sun20i-d1-tcon-top",
+		.data = &sun20i_d1_tcon_top_quirks
+	},
 	{
 		.compatible = "allwinner,sun50i-h6-tcon-top",
 		.data = &sun50i_h6_tcon_top_quirks
-- 
2.35.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2022-04-24 16:26 UTC|newest]

Thread overview: 102+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-24 16:26 [PATCH v3 00/14] drm/sun4i: Allwinner D1 Display Engine 2.0 Support Samuel Holland
2022-04-24 16:26 ` Samuel Holland
2022-04-24 16:26 ` Samuel Holland
2022-04-24 16:26 ` [PATCH v3 01/14] dt-bindings: display: Separate clock item lists by compatible Samuel Holland
2022-04-24 16:26   ` Samuel Holland
2022-04-24 16:26   ` Samuel Holland
2022-04-26 12:41   ` (subset) " Maxime Ripard
2022-04-26 12:41     ` Maxime Ripard
2022-04-26 12:41     ` Maxime Ripard
2022-04-24 16:26 ` [PATCH v3 02/14] dt-bindings: display: Add D1 display engine compatibles Samuel Holland
2022-04-24 16:26   ` Samuel Holland
2022-04-24 16:26   ` Samuel Holland
2022-04-26 12:41   ` (subset) " Maxime Ripard
2022-04-26 12:41     ` Maxime Ripard
2022-04-26 12:41     ` Maxime Ripard
2022-04-24 16:26 ` [PATCH v3 03/14] drm/sun4i: Remove obsolete references to PHYS_OFFSET Samuel Holland
2022-04-24 16:26   ` Samuel Holland
2022-04-24 16:26   ` Samuel Holland
2022-04-26 12:41   ` (subset) " Maxime Ripard
2022-04-26 12:41     ` Maxime Ripard
2022-04-26 12:41     ` Maxime Ripard
2022-04-24 16:26 ` [PATCH v3 04/14] drm/sun4i: hdmi: Use more portable I/O helpers Samuel Holland
2022-04-24 16:26   ` Samuel Holland
2022-04-24 16:26   ` Samuel Holland
2022-04-24 19:59   ` Jernej Škrabec
2022-04-24 19:59     ` Jernej Škrabec
2022-04-24 19:59     ` Jernej Škrabec
2022-04-26 12:41   ` (subset) " Maxime Ripard
2022-04-26 12:41     ` Maxime Ripard
2022-04-26 12:41     ` Maxime Ripard
2022-04-24 16:26 ` [PATCH v3 05/14] drm/sun4i: Allow building the driver on RISC-V Samuel Holland
2022-04-24 16:26   ` Samuel Holland
2022-04-24 16:26   ` Samuel Holland
2022-04-26 12:41   ` (subset) " Maxime Ripard
2022-04-26 12:41     ` Maxime Ripard
2022-04-26 12:41     ` Maxime Ripard
2022-04-24 16:26 ` [PATCH v3 06/14] sun4i/drm: engine: Add mode_set callback Samuel Holland
2022-04-24 16:26   ` Samuel Holland
2022-04-24 16:26   ` Samuel Holland
2022-04-26 12:41   ` (subset) " Maxime Ripard
2022-04-26 12:41     ` Maxime Ripard
2022-04-26 12:41     ` Maxime Ripard
2022-04-24 16:26 ` [PATCH v3 07/14] sun4i/drm: backend: use mode_set engine callback Samuel Holland
2022-04-24 16:26   ` Samuel Holland
2022-04-24 16:26   ` Samuel Holland
2022-04-26 12:41   ` (subset) " Maxime Ripard
2022-04-26 12:41     ` Maxime Ripard
2022-04-26 12:41     ` Maxime Ripard
2022-04-24 16:26 ` [PATCH v3 08/14] sun4i/drm: sun8i: " Samuel Holland
2022-04-24 16:26   ` Samuel Holland
2022-04-24 16:26   ` Samuel Holland
2022-04-26 12:41   ` (subset) " Maxime Ripard
2022-04-26 12:41     ` Maxime Ripard
2022-04-26 12:41     ` Maxime Ripard
2022-04-24 16:26 ` [PATCH v3 09/14] drm/sun4i: Allow VI layers to be primary planes Samuel Holland
2022-04-24 16:26   ` Samuel Holland
2022-04-24 16:26   ` Samuel Holland
2022-04-24 20:01   ` Jernej Škrabec
2022-04-24 20:01     ` Jernej Škrabec
2022-04-24 20:01     ` Jernej Škrabec
2022-04-26 12:41   ` (subset) " Maxime Ripard
2022-04-26 12:41     ` Maxime Ripard
2022-04-26 12:41     ` Maxime Ripard
2022-04-24 16:26 ` [PATCH v3 10/14] drm/sun4i: csc: Add support for the new MMIO layout Samuel Holland
2022-04-24 16:26   ` Samuel Holland
2022-04-24 16:26   ` Samuel Holland
2022-04-24 20:02   ` Jernej Škrabec
2022-04-24 20:02     ` Jernej Škrabec
2022-04-24 20:02     ` Jernej Škrabec
2022-04-26 12:41   ` (subset) " Maxime Ripard
2022-04-26 12:41     ` Maxime Ripard
2022-04-26 12:41     ` Maxime Ripard
2022-04-24 16:26 ` [PATCH v3 11/14] drm/sun4i: Add support for D1 mixers Samuel Holland
2022-04-24 16:26   ` Samuel Holland
2022-04-24 16:26   ` Samuel Holland
2022-04-26 12:41   ` (subset) " Maxime Ripard
2022-04-26 12:41     ` Maxime Ripard
2022-04-26 12:41     ` Maxime Ripard
2022-04-24 16:26 ` Samuel Holland [this message]
2022-04-24 16:26   ` [PATCH v3 12/14] drm/sun4i: Add support for D1 TCON TOP Samuel Holland
2022-04-24 16:26   ` Samuel Holland
2022-04-24 20:06   ` Jernej Škrabec
2022-04-24 20:06     ` Jernej Škrabec
2022-04-24 20:06     ` Jernej Škrabec
2022-04-26 12:41   ` (subset) " Maxime Ripard
2022-04-26 12:41     ` Maxime Ripard
2022-04-26 12:41     ` Maxime Ripard
2022-04-24 16:26 ` [PATCH v3 13/14] drm/sun4i: Add support for D1 TCONs Samuel Holland
2022-04-24 16:26   ` Samuel Holland
2022-04-24 16:26   ` Samuel Holland
2022-04-24 20:08   ` Jernej Škrabec
2022-04-24 20:08     ` Jernej Škrabec
2022-04-24 20:08     ` Jernej Škrabec
2022-04-26 12:41   ` (subset) " Maxime Ripard
2022-04-26 12:41     ` Maxime Ripard
2022-04-26 12:41     ` Maxime Ripard
2022-04-24 16:26 ` [PATCH v3 14/14] drm/sun4i: Add compatible for D1 display engine Samuel Holland
2022-04-24 16:26   ` Samuel Holland
2022-04-24 16:26   ` Samuel Holland
2022-04-26 12:41   ` (subset) " Maxime Ripard
2022-04-26 12:41     ` Maxime Ripard
2022-04-26 12:41     ` Maxime Ripard

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=20220424162633.12369-13-samuel@sholland.org \
    --to=samuel@sholland.org \
    --cc=airlied@linux.ie \
    --cc=daniel@ffwll.ch \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jernej.skrabec@gmail.com \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sunxi@lists.linux.dev \
    --cc=mripard@kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=wens@csie.org \
    /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.