public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
From: Wolfram Sang <wsa+renesas@sang-engineering.com>
To: linux-renesas-soc@vger.kernel.org
Cc: linux-mmc@vger.kernel.org,
	Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	Wolfram Sang <wsa+renesas@sang-engineering.com>
Subject: [RFC PATCH v2 01/21] clk: renesas: rcar-gen3: add dummy SDnH clock
Date: Wed, 10 Nov 2021 20:15:50 +0100	[thread overview]
Message-ID: <20211110191610.5664-2-wsa+renesas@sang-engineering.com> (raw)
In-Reply-To: <20211110191610.5664-1-wsa+renesas@sang-engineering.com>

Currently, SDnH is handled together with SDn. This caused lots of
problems, so we want SDnH as a separate clock. Introduce a dummy SDnH
type here which creates a fixed-factor clock with factor 1. That allows
us to convert the per-SoC CPG drivers while keeping the old behaviour
for now. A later patch then will add the proper functionality.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
---

Changes since RFC v1:
* fixed typo in commit message
* added tag from Geert

 drivers/clk/renesas/rcar-cpg-lib.c  | 9 +++++++++
 drivers/clk/renesas/rcar-cpg-lib.h  | 4 ++++
 drivers/clk/renesas/rcar-gen3-cpg.c | 4 ++++
 drivers/clk/renesas/rcar-gen3-cpg.h | 4 ++++
 4 files changed, 21 insertions(+)

diff --git a/drivers/clk/renesas/rcar-cpg-lib.c b/drivers/clk/renesas/rcar-cpg-lib.c
index 5678768ee1f2..351cb9c04f5c 100644
--- a/drivers/clk/renesas/rcar-cpg-lib.c
+++ b/drivers/clk/renesas/rcar-cpg-lib.c
@@ -65,6 +65,15 @@ void cpg_simple_notifier_register(struct raw_notifier_head *notifiers,
 /*
  * SDn Clock
  */
+
+struct clk * __init cpg_sdh_clk_register(const char *name,
+	void __iomem *sdnckcr, const char *parent_name,
+	struct raw_notifier_head *notifiers)
+{
+	/* placeholder during transition */
+	return clk_register_fixed_factor(NULL, name, parent_name, 0, 1, 1);
+}
+
 #define CPG_SD_STP_HCK		BIT(9)
 #define CPG_SD_STP_CK		BIT(8)
 
diff --git a/drivers/clk/renesas/rcar-cpg-lib.h b/drivers/clk/renesas/rcar-cpg-lib.h
index d00c91b116ca..548cb9562f35 100644
--- a/drivers/clk/renesas/rcar-cpg-lib.h
+++ b/drivers/clk/renesas/rcar-cpg-lib.h
@@ -26,6 +26,10 @@ void cpg_simple_notifier_register(struct raw_notifier_head *notifiers,
 
 void cpg_reg_modify(void __iomem *reg, u32 clear, u32 set);
 
+struct clk * __init cpg_sdh_clk_register(const char *name,
+	void __iomem *sdnckcr, const char *parent_name,
+	struct raw_notifier_head *notifiers);
+
 struct clk * __init cpg_sd_clk_register(const char *name,
 	void __iomem *base, unsigned int offset, const char *parent_name,
 	struct raw_notifier_head *notifiers, bool skip_first);
diff --git a/drivers/clk/renesas/rcar-gen3-cpg.c b/drivers/clk/renesas/rcar-gen3-cpg.c
index 558191c99b48..182b189bc8f4 100644
--- a/drivers/clk/renesas/rcar-gen3-cpg.c
+++ b/drivers/clk/renesas/rcar-gen3-cpg.c
@@ -486,6 +486,10 @@ struct clk * __init rcar_gen3_cpg_clk_register(struct device *dev,
 			mult *= 2;
 		break;
 
+	case CLK_TYPE_GEN3_SDH:
+		return cpg_sdh_clk_register(core->name, base + core->offset,
+					   __clk_get_name(parent), notifiers);
+
 	case CLK_TYPE_GEN3_SD:
 		return cpg_sd_clk_register(core->name, base, core->offset,
 					   __clk_get_name(parent), notifiers,
diff --git a/drivers/clk/renesas/rcar-gen3-cpg.h b/drivers/clk/renesas/rcar-gen3-cpg.h
index 3d949c4a3244..2bc0afadf604 100644
--- a/drivers/clk/renesas/rcar-gen3-cpg.h
+++ b/drivers/clk/renesas/rcar-gen3-cpg.h
@@ -17,6 +17,7 @@ enum rcar_gen3_clk_types {
 	CLK_TYPE_GEN3_PLL2,
 	CLK_TYPE_GEN3_PLL3,
 	CLK_TYPE_GEN3_PLL4,
+	CLK_TYPE_GEN3_SDH,
 	CLK_TYPE_GEN3_SD,
 	CLK_TYPE_GEN3_R,
 	CLK_TYPE_GEN3_MDSEL,	/* Select parent/divider using mode pin */
@@ -32,6 +33,9 @@ enum rcar_gen3_clk_types {
 	CLK_TYPE_GEN3_SOC_BASE,
 };
 
+#define DEF_GEN3_SDH(_name, _id, _parent, _offset)	\
+	DEF_BASE(_name, _id, CLK_TYPE_GEN3_SDH, _parent, .offset = _offset)
+
 #define DEF_GEN3_SD(_name, _id, _parent, _offset)	\
 	DEF_BASE(_name, _id, CLK_TYPE_GEN3_SD, _parent, .offset = _offset)
 
-- 
2.30.2


  reply	other threads:[~2021-11-10 19:16 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-10 19:15 [RFC PATCH v2 00/21] clk/mmc: renesas_sdhi: refactor SDnH to be a separate clock Wolfram Sang
2021-11-10 19:15 ` Wolfram Sang [this message]
2021-11-12 13:38   ` [RFC PATCH v2 01/21] clk: renesas: rcar-gen3: add dummy SDnH clock Geert Uytterhoeven
2021-11-10 19:15 ` [RFC PATCH v2 02/21] clk: renesas: rcar-gen3: add " Wolfram Sang
2021-11-12 13:04   ` Geert Uytterhoeven
2021-11-12 13:07     ` Wolfram Sang
2021-11-12 13:39   ` Geert Uytterhoeven
2021-11-10 19:15 ` [RFC PATCH v2 03/21] clk: renesas: r8a779a0: add SDnH clock to V3U Wolfram Sang
2021-11-12 13:40   ` Geert Uytterhoeven
2021-11-10 19:15 ` [RFC PATCH v2 04/21] mmc: sdhi: internal_dmac: flag non-standard SDnH handling for V3M Wolfram Sang
2021-11-11  9:48   ` Ulf Hansson
2021-11-12 13:06   ` Geert Uytterhoeven
2021-11-10 19:15 ` [RFC PATCH v2 05/21] clk: renesas: rcar-gen3: switch to new SD clock handling Wolfram Sang
2021-11-11  9:48   ` Ulf Hansson
2021-11-12 13:24   ` Geert Uytterhoeven
2021-11-12 13:41   ` Geert Uytterhoeven
2021-11-10 19:15 ` [RFC PATCH v2 06/21] clk: renesas: rcar-gen3: remove outdated SD_SKIP_FIRST Wolfram Sang
2021-11-12 13:42   ` Geert Uytterhoeven
2021-11-10 19:15 ` [RFC PATCH v2 07/21] dt-bindings: mmc: renesas,sdhi: add optional SDnH clock Wolfram Sang
2021-11-11  9:48   ` Ulf Hansson
2021-11-12 11:10   ` Geert Uytterhoeven
2021-11-12 11:57     ` Wolfram Sang
2021-11-12 12:13       ` Geert Uytterhoeven
2021-11-10 19:15 ` [RFC PATCH v2 08/21] arm64: dts: reneas: r8a774a1: add SDnH clocks Wolfram Sang
2021-11-12 13:26   ` Geert Uytterhoeven
2021-11-12 13:41     ` Wolfram Sang
2021-11-10 19:15 ` [RFC PATCH v2 09/21] arm64: dts: reneas: r8a774b1: " Wolfram Sang
2021-11-12 13:27   ` Geert Uytterhoeven
2021-11-10 19:15 ` [RFC PATCH v2 10/21] arm64: dts: reneas: r8a774c0: " Wolfram Sang
2021-11-12 13:27   ` Geert Uytterhoeven
2021-11-10 19:16 ` [RFC PATCH v2 11/21] arm64: dts: reneas: r8a774e1: " Wolfram Sang
2021-11-12 13:27   ` Geert Uytterhoeven
2021-11-10 19:16 ` [RFC PATCH v2 12/21] arm64: dts: reneas: r8a77951: " Wolfram Sang
2021-11-10 19:16 ` [RFC PATCH v2 13/21] arm64: dts: reneas: r8a77960: " Wolfram Sang
2021-11-12 13:30   ` Geert Uytterhoeven
2021-11-10 19:16 ` [RFC PATCH v2 14/21] arm64: dts: reneas: r8a77961: " Wolfram Sang
2021-11-12 13:30   ` Geert Uytterhoeven
2021-11-10 19:16 ` [RFC PATCH v2 15/21] arm64: dts: reneas: r8a77965: " Wolfram Sang
2021-11-12 13:29   ` Geert Uytterhoeven
2021-11-10 19:16 ` [RFC PATCH v2 16/21] arm64: dts: reneas: r8a77980: " Wolfram Sang
2021-11-12 13:31   ` Geert Uytterhoeven
2021-11-10 19:16 ` [RFC PATCH v2 17/21] arm64: dts: reneas: r8a77990: " Wolfram Sang
2021-11-12 13:31   ` Geert Uytterhoeven
2021-11-10 19:16 ` [RFC PATCH v2 18/21] arm64: dts: reneas: r8a77995: " Wolfram Sang
2021-11-12 13:31   ` Geert Uytterhoeven
2021-11-10 19:16 ` [RFC PATCH v2 19/21] mmc: sdhi: use dev_err_probe when getting clock fails Wolfram Sang
2021-11-11  9:48   ` Ulf Hansson
2021-11-12 13:32   ` Geert Uytterhoeven
2021-11-12 13:33     ` Geert Uytterhoeven
2021-11-10 19:16 ` [RFC PATCH v2 20/21] mmc: sdhi: parse DT for SDnH Wolfram Sang
2021-11-11  9:48   ` Ulf Hansson
2021-11-12 13:34   ` Geert Uytterhoeven
2021-11-10 19:16 ` [RFC PATCH v2 21/21] arm64: dts: reneas: r8a779a0: add SDnH clocks Wolfram Sang
2021-11-12 13:35   ` Geert Uytterhoeven
2021-11-12 13:38 ` [RFC PATCH v2 00/21] clk/mmc: renesas_sdhi: refactor SDnH to be a separate clock Geert Uytterhoeven
2021-11-15 14:34 ` Biju Das
2021-11-15 15:23   ` Wolfram Sang

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=20211110191610.5664-2-wsa+renesas@sang-engineering.com \
    --to=wsa+renesas@sang-engineering.com \
    --cc=geert+renesas@glider.be \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=yoshihiro.shimoda.uh@renesas.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox