* [PATCH v5 1/4] clk: en7523: Rework clock handling for different clock numbers
@ 2025-01-12 13:39 Christian Marangi
2025-01-12 13:39 ` [PATCH v5 2/4] dt-bindings: clock: drop NUM_CLOCKS define for EN7581 Christian Marangi
` (3 more replies)
0 siblings, 4 replies; 14+ messages in thread
From: Christian Marangi @ 2025-01-12 13:39 UTC (permalink / raw)
To: Michael Turquette, Stephen Boyd, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, linux-clk, linux-kernel, devicetree, upstream
Cc: Christian Marangi
Airoha EN7581 SoC have additional clock compared to EN7523 but current
driver permits to only support up to EN7523 clock numbers.
To handle this, rework the clock handling and permit to declare the
clocks number in match_data and alloca clk_data based on the compatible
match_data.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
---
Changes v5:
- Set clk_data->num before accessing hws to follow counted_by
Changes v4:
- Move to patch 1 (improve bisectability)
Changes v3:
- Rework num_clocks for en7523
Changes v2:
- Add this patch
drivers/clk/clk-en7523.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/drivers/clk/clk-en7523.c b/drivers/clk/clk-en7523.c
index 495c0d607c7d..3a4b7ed40af4 100644
--- a/drivers/clk/clk-en7523.c
+++ b/drivers/clk/clk-en7523.c
@@ -75,6 +75,7 @@ struct en_rst_data {
};
struct en_clk_soc_data {
+ u32 num_clocks;
const struct clk_ops pcie_ops;
int (*hw_init)(struct platform_device *pdev,
struct clk_hw_onecell_data *clk_data);
@@ -504,8 +505,6 @@ static void en7523_register_clocks(struct device *dev, struct clk_hw_onecell_dat
u32 rate;
int i;
- clk_data->num = EN7523_NUM_CLOCKS;
-
for (i = 0; i < ARRAY_SIZE(en7523_base_clks); i++) {
const struct en_clk_desc *desc = &en7523_base_clks[i];
u32 reg = desc->div_reg ? desc->div_reg : desc->base_reg;
@@ -587,8 +586,6 @@ static void en7581_register_clocks(struct device *dev, struct clk_hw_onecell_dat
hw = en7523_register_pcie_clk(dev, base);
clk_data->hws[EN7523_CLK_PCIE] = hw;
-
- clk_data->num = EN7523_NUM_CLOCKS;
}
static int en7523_reset_update(struct reset_controller_dev *rcdev,
@@ -702,13 +699,15 @@ static int en7523_clk_probe(struct platform_device *pdev)
struct clk_hw_onecell_data *clk_data;
int r;
+ soc_data = device_get_match_data(&pdev->dev);
+
clk_data = devm_kzalloc(&pdev->dev,
- struct_size(clk_data, hws, EN7523_NUM_CLOCKS),
+ struct_size(clk_data, hws, soc_data->num_clocks),
GFP_KERNEL);
if (!clk_data)
return -ENOMEM;
- soc_data = device_get_match_data(&pdev->dev);
+ clk_data->num = soc_data->num_clocks;
r = soc_data->hw_init(pdev, clk_data);
if (r)
return r;
@@ -717,6 +716,7 @@ static int en7523_clk_probe(struct platform_device *pdev)
}
static const struct en_clk_soc_data en7523_data = {
+ .num_clocks = ARRAY_SIZE(en7523_base_clks) + 1,
.pcie_ops = {
.is_enabled = en7523_pci_is_enabled,
.prepare = en7523_pci_prepare,
@@ -726,6 +726,8 @@ static const struct en_clk_soc_data en7523_data = {
};
static const struct en_clk_soc_data en7581_data = {
+ /* We increment num_clocks by 1 to account for additional PCIe clock */
+ .num_clocks = ARRAY_SIZE(en7581_base_clks) + 1,
.pcie_ops = {
.is_enabled = en7581_pci_is_enabled,
.enable = en7581_pci_enable,
--
2.45.2
^ permalink raw reply related [flat|nested] 14+ messages in thread* [PATCH v5 2/4] dt-bindings: clock: drop NUM_CLOCKS define for EN7581
2025-01-12 13:39 [PATCH v5 1/4] clk: en7523: Rework clock handling for different clock numbers Christian Marangi
@ 2025-01-12 13:39 ` Christian Marangi
2025-01-13 21:31 ` Stephen Boyd
2025-01-13 21:33 ` Stephen Boyd
2025-01-12 13:39 ` [PATCH v5 3/4] dt-bindings: clock: add ID for eMMC " Christian Marangi
` (2 subsequent siblings)
3 siblings, 2 replies; 14+ messages in thread
From: Christian Marangi @ 2025-01-12 13:39 UTC (permalink / raw)
To: Michael Turquette, Stephen Boyd, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, linux-clk, linux-kernel, devicetree, upstream
Cc: Christian Marangi, Krzysztof Kozlowski
Drop NUM_CLOCKS define for EN7581 include. This is not a binding and
should not be placed here. Value is derived internally in the user
driver.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
Changes v5:
- Add ack tag
Changes v4:
- Move to patch 2 (improves bisectability)
Changes v3:
- Add this patch
include/dt-bindings/clock/en7523-clk.h | 2 --
1 file changed, 2 deletions(-)
diff --git a/include/dt-bindings/clock/en7523-clk.h b/include/dt-bindings/clock/en7523-clk.h
index 717d23a5e5ae..28e56745ccff 100644
--- a/include/dt-bindings/clock/en7523-clk.h
+++ b/include/dt-bindings/clock/en7523-clk.h
@@ -12,6 +12,4 @@
#define EN7523_CLK_CRYPTO 6
#define EN7523_CLK_PCIE 7
-#define EN7523_NUM_CLOCKS 8
-
#endif /* _DT_BINDINGS_CLOCK_AIROHA_EN7523_H_ */
--
2.45.2
^ permalink raw reply related [flat|nested] 14+ messages in thread* Re: [PATCH v5 2/4] dt-bindings: clock: drop NUM_CLOCKS define for EN7581
2025-01-12 13:39 ` [PATCH v5 2/4] dt-bindings: clock: drop NUM_CLOCKS define for EN7581 Christian Marangi
@ 2025-01-13 21:31 ` Stephen Boyd
2025-01-13 21:33 ` Stephen Boyd
1 sibling, 0 replies; 14+ messages in thread
From: Stephen Boyd @ 2025-01-13 21:31 UTC (permalink / raw)
To: Christian Marangi, Conor Dooley, Krzysztof Kozlowski,
Michael Turquette, Rob Herring, devicetree, linux-clk,
linux-kernel, upstream
Cc: Christian Marangi, Krzysztof Kozlowski
Quoting Christian Marangi (2025-01-12 05:39:38)
> Drop NUM_CLOCKS define for EN7581 include. This is not a binding and
> should not be placed here. Value is derived internally in the user
> driver.
>
> Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
> Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---
Applied to clk-next
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v5 2/4] dt-bindings: clock: drop NUM_CLOCKS define for EN7581
2025-01-12 13:39 ` [PATCH v5 2/4] dt-bindings: clock: drop NUM_CLOCKS define for EN7581 Christian Marangi
2025-01-13 21:31 ` Stephen Boyd
@ 2025-01-13 21:33 ` Stephen Boyd
2025-01-13 21:37 ` Christian Marangi
1 sibling, 1 reply; 14+ messages in thread
From: Stephen Boyd @ 2025-01-13 21:33 UTC (permalink / raw)
To: Christian Marangi, Conor Dooley, Krzysztof Kozlowski,
Michael Turquette, Rob Herring, devicetree, linux-clk,
linux-kernel, upstream
Cc: Christian Marangi, Krzysztof Kozlowski
Subject says EN7581....
Quoting Christian Marangi (2025-01-12 05:39:38)
> Drop NUM_CLOCKS define for EN7581 include. This is not a binding and
> should not be placed here. Value is derived internally in the user
> driver.
>
> Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
> Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---
> Changes v5:
> - Add ack tag
> Changes v4:
> - Move to patch 2 (improves bisectability)
> Changes v3:
> - Add this patch
>
> include/dt-bindings/clock/en7523-clk.h | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/include/dt-bindings/clock/en7523-clk.h b/include/dt-bindings/clock/en7523-clk.h
> index 717d23a5e5ae..28e56745ccff 100644
> --- a/include/dt-bindings/clock/en7523-clk.h
> +++ b/include/dt-bindings/clock/en7523-clk.h
> @@ -12,6 +12,4 @@
> #define EN7523_CLK_CRYPTO 6
> #define EN7523_CLK_PCIE 7
>
> -#define EN7523_NUM_CLOCKS 8
But this is EN7523
drivers/clk/clk-en7523.c:539:25: error: ‘EN7523_NUM_CLOCKS’ undeclared (first use in this function)
539 | clk_data->num = EN7523_NUM_CLOCKS;
| ^~~~~~~~~~~~~~~~~
^ permalink raw reply [flat|nested] 14+ messages in thread* Re: [PATCH v5 2/4] dt-bindings: clock: drop NUM_CLOCKS define for EN7581
2025-01-13 21:33 ` Stephen Boyd
@ 2025-01-13 21:37 ` Christian Marangi
2025-01-13 21:53 ` Stephen Boyd
0 siblings, 1 reply; 14+ messages in thread
From: Christian Marangi @ 2025-01-13 21:37 UTC (permalink / raw)
To: Stephen Boyd
Cc: Conor Dooley, Krzysztof Kozlowski, Michael Turquette, Rob Herring,
devicetree, linux-clk, linux-kernel, upstream,
Krzysztof Kozlowski
On Mon, Jan 13, 2025 at 01:33:35PM -0800, Stephen Boyd wrote:
> Subject says EN7581....
>
> Quoting Christian Marangi (2025-01-12 05:39:38)
> > Drop NUM_CLOCKS define for EN7581 include. This is not a binding and
> > should not be placed here. Value is derived internally in the user
> > driver.
> >
> > Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
> > Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> > ---
> > Changes v5:
> > - Add ack tag
> > Changes v4:
> > - Move to patch 2 (improves bisectability)
> > Changes v3:
> > - Add this patch
> >
> > include/dt-bindings/clock/en7523-clk.h | 2 --
> > 1 file changed, 2 deletions(-)
> >
> > diff --git a/include/dt-bindings/clock/en7523-clk.h b/include/dt-bindings/clock/en7523-clk.h
> > index 717d23a5e5ae..28e56745ccff 100644
> > --- a/include/dt-bindings/clock/en7523-clk.h
> > +++ b/include/dt-bindings/clock/en7523-clk.h
> > @@ -12,6 +12,4 @@
> > #define EN7523_CLK_CRYPTO 6
> > #define EN7523_CLK_PCIE 7
> >
> > -#define EN7523_NUM_CLOCKS 8
>
> But this is EN7523
>
> drivers/clk/clk-en7523.c:539:25: error: ‘EN7523_NUM_CLOCKS’ undeclared (first use in this function)
> 539 | clk_data->num = EN7523_NUM_CLOCKS;
> | ^~~~~~~~~~~~~~~~~
Hi Stephen,
the same define is used for both EN7523 and EN7581, do you want me to resubmit with a
better description?
Both clock are updated so no regression.
--
Ansuel
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v5 2/4] dt-bindings: clock: drop NUM_CLOCKS define for EN7581
2025-01-13 21:37 ` Christian Marangi
@ 2025-01-13 21:53 ` Stephen Boyd
2025-01-13 22:17 ` Christian Marangi
0 siblings, 1 reply; 14+ messages in thread
From: Stephen Boyd @ 2025-01-13 21:53 UTC (permalink / raw)
To: Christian Marangi
Cc: Conor Dooley, Krzysztof Kozlowski, Michael Turquette, Rob Herring,
devicetree, linux-clk, linux-kernel, upstream,
Krzysztof Kozlowski
Quoting Christian Marangi (2025-01-13 13:37:56)
> On Mon, Jan 13, 2025 at 01:33:35PM -0800, Stephen Boyd wrote:
> > Subject says EN7581....
> >
> > Quoting Christian Marangi (2025-01-12 05:39:38)
> > > Drop NUM_CLOCKS define for EN7581 include. This is not a binding and
> > > should not be placed here. Value is derived internally in the user
> > > driver.
> > >
> > > Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
> > > Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> > > ---
> > > Changes v5:
> > > - Add ack tag
> > > Changes v4:
> > > - Move to patch 2 (improves bisectability)
> > > Changes v3:
> > > - Add this patch
> > >
> > > include/dt-bindings/clock/en7523-clk.h | 2 --
> > > 1 file changed, 2 deletions(-)
> > >
> > > diff --git a/include/dt-bindings/clock/en7523-clk.h b/include/dt-bindings/clock/en7523-clk.h
> > > index 717d23a5e5ae..28e56745ccff 100644
> > > --- a/include/dt-bindings/clock/en7523-clk.h
> > > +++ b/include/dt-bindings/clock/en7523-clk.h
> > > @@ -12,6 +12,4 @@
> > > #define EN7523_CLK_CRYPTO 6
> > > #define EN7523_CLK_PCIE 7
> > >
> > > -#define EN7523_NUM_CLOCKS 8
> >
> > But this is EN7523
> >
> > drivers/clk/clk-en7523.c:539:25: error: ‘EN7523_NUM_CLOCKS’ undeclared (first use in this function)
> > 539 | clk_data->num = EN7523_NUM_CLOCKS;
> > | ^~~~~~~~~~~~~~~~~
>
> Hi Stephen,
>
> the same define is used for both EN7523 and EN7581, do you want me to resubmit with a
> better description?
>
> Both clock are updated so no regression.
>
Please resubmit the entire patchset. It doesn't compile.
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v5 2/4] dt-bindings: clock: drop NUM_CLOCKS define for EN7581
2025-01-13 21:53 ` Stephen Boyd
@ 2025-01-13 22:17 ` Christian Marangi
2025-01-13 22:45 ` Stephen Boyd
0 siblings, 1 reply; 14+ messages in thread
From: Christian Marangi @ 2025-01-13 22:17 UTC (permalink / raw)
To: Stephen Boyd
Cc: Conor Dooley, Krzysztof Kozlowski, Michael Turquette, Rob Herring,
devicetree, linux-clk, linux-kernel, upstream,
Krzysztof Kozlowski
On Mon, Jan 13, 2025 at 01:53:46PM -0800, Stephen Boyd wrote:
> Quoting Christian Marangi (2025-01-13 13:37:56)
> > On Mon, Jan 13, 2025 at 01:33:35PM -0800, Stephen Boyd wrote:
> > > Subject says EN7581....
> > >
> > > Quoting Christian Marangi (2025-01-12 05:39:38)
> > > > Drop NUM_CLOCKS define for EN7581 include. This is not a binding and
> > > > should not be placed here. Value is derived internally in the user
> > > > driver.
> > > >
> > > > Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
> > > > Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> > > > ---
> > > > Changes v5:
> > > > - Add ack tag
> > > > Changes v4:
> > > > - Move to patch 2 (improves bisectability)
> > > > Changes v3:
> > > > - Add this patch
> > > >
> > > > include/dt-bindings/clock/en7523-clk.h | 2 --
> > > > 1 file changed, 2 deletions(-)
> > > >
> > > > diff --git a/include/dt-bindings/clock/en7523-clk.h b/include/dt-bindings/clock/en7523-clk.h
> > > > index 717d23a5e5ae..28e56745ccff 100644
> > > > --- a/include/dt-bindings/clock/en7523-clk.h
> > > > +++ b/include/dt-bindings/clock/en7523-clk.h
> > > > @@ -12,6 +12,4 @@
> > > > #define EN7523_CLK_CRYPTO 6
> > > > #define EN7523_CLK_PCIE 7
> > > >
> > > > -#define EN7523_NUM_CLOCKS 8
> > >
> > > But this is EN7523
> > >
> > > drivers/clk/clk-en7523.c:539:25: error: ‘EN7523_NUM_CLOCKS’ undeclared (first use in this function)
> > > 539 | clk_data->num = EN7523_NUM_CLOCKS;
> > > | ^~~~~~~~~~~~~~~~~
> >
> > Hi Stephen,
> >
> > the same define is used for both EN7523 and EN7581, do you want me to resubmit with a
> > better description?
> >
> > Both clock are updated so no regression.
> >
>
> Please resubmit the entire patchset. It doesn't compile.
Hope I don't get annoying and sorry for this extra mail.
I can't repro the compile error, it seems patch 1 of this series wasn't
applied and changes were tested only with patch 2?
Patch 2 depends on patch 1 as we drop the define.
--
Ansuel
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v5 2/4] dt-bindings: clock: drop NUM_CLOCKS define for EN7581
2025-01-13 22:17 ` Christian Marangi
@ 2025-01-13 22:45 ` Stephen Boyd
2025-01-13 23:12 ` Christian Marangi
0 siblings, 1 reply; 14+ messages in thread
From: Stephen Boyd @ 2025-01-13 22:45 UTC (permalink / raw)
To: Christian Marangi
Cc: Conor Dooley, Krzysztof Kozlowski, Michael Turquette, Rob Herring,
devicetree, linux-clk, linux-kernel, upstream,
Krzysztof Kozlowski
Quoting Christian Marangi (2025-01-13 14:17:49)
> On Mon, Jan 13, 2025 at 01:53:46PM -0800, Stephen Boyd wrote:
> >
> > Please resubmit the entire patchset. It doesn't compile.
>
> Hope I don't get annoying and sorry for this extra mail.
No worries.
>
> I can't repro the compile error, it seems patch 1 of this series wasn't
> applied and changes were tested only with patch 2?
>
> Patch 2 depends on patch 1 as we drop the define.
>
I applied the first patch, but on top of v6.13-rc1 like all other
patches that don't tell me their base.
What's the base of the patch series? Please resend with a cover letter
and use --base=<commitish> when formatting the patch series. When I
applied the first patch I got this diffstat
drivers/clk/clk-en7523.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
so I suspect I'm missing something in clk-fixes for this patch series.
Please call out dependencies in the cover letter.
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v5 2/4] dt-bindings: clock: drop NUM_CLOCKS define for EN7581
2025-01-13 22:45 ` Stephen Boyd
@ 2025-01-13 23:12 ` Christian Marangi
0 siblings, 0 replies; 14+ messages in thread
From: Christian Marangi @ 2025-01-13 23:12 UTC (permalink / raw)
To: Stephen Boyd
Cc: Conor Dooley, Krzysztof Kozlowski, Michael Turquette, Rob Herring,
devicetree, linux-clk, linux-kernel, upstream,
Krzysztof Kozlowski
On Mon, Jan 13, 2025 at 02:45:21PM -0800, Stephen Boyd wrote:
> Quoting Christian Marangi (2025-01-13 14:17:49)
> > On Mon, Jan 13, 2025 at 01:53:46PM -0800, Stephen Boyd wrote:
> > >
> > > Please resubmit the entire patchset. It doesn't compile.
> >
> > Hope I don't get annoying and sorry for this extra mail.
>
> No worries.
>
> >
> > I can't repro the compile error, it seems patch 1 of this series wasn't
> > applied and changes were tested only with patch 2?
> >
> > Patch 2 depends on patch 1 as we drop the define.
> >
>
> I applied the first patch, but on top of v6.13-rc1 like all other
> patches that don't tell me their base.
>
> What's the base of the patch series? Please resend with a cover letter
> and use --base=<commitish> when formatting the patch series. When I
> applied the first patch I got this diffstat
>
> drivers/clk/clk-en7523.c | 12 ++++++++----
> 1 file changed, 8 insertions(+), 4 deletions(-)
>
> so I suspect I'm missing something in clk-fixes for this patch series.
> Please call out dependencies in the cover letter.
Indeed v6.13-rc1 didn't had the counted_by fix. I referenced the
clk-next base branch and sent v6 with the cover letter. Hope it's clear
now.
--
Ansuel
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH v5 3/4] dt-bindings: clock: add ID for eMMC for EN7581
2025-01-12 13:39 [PATCH v5 1/4] clk: en7523: Rework clock handling for different clock numbers Christian Marangi
2025-01-12 13:39 ` [PATCH v5 2/4] dt-bindings: clock: drop NUM_CLOCKS define for EN7581 Christian Marangi
@ 2025-01-12 13:39 ` Christian Marangi
2025-01-13 21:31 ` Stephen Boyd
2025-01-12 13:39 ` [PATCH v5 4/4] clk: en7523: Add clock " Christian Marangi
2025-01-13 21:31 ` [PATCH v5 1/4] clk: en7523: Rework clock handling for different clock numbers Stephen Boyd
3 siblings, 1 reply; 14+ messages in thread
From: Christian Marangi @ 2025-01-12 13:39 UTC (permalink / raw)
To: Michael Turquette, Stephen Boyd, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, linux-clk, linux-kernel, devicetree, upstream
Cc: Christian Marangi, Conor Dooley
Add ID for eMMC for EN7581. This is to control clock selection of eMMC
between 200MHz and 150MHz.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
---
Changes v4:
- Move to patch 3
Changes v3:
- Add ack tag
Changes v2:
- Drop additional define for EN7581_NUM_CLOCKS
include/dt-bindings/clock/en7523-clk.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/include/dt-bindings/clock/en7523-clk.h b/include/dt-bindings/clock/en7523-clk.h
index 28e56745ccff..edfa64045f52 100644
--- a/include/dt-bindings/clock/en7523-clk.h
+++ b/include/dt-bindings/clock/en7523-clk.h
@@ -12,4 +12,6 @@
#define EN7523_CLK_CRYPTO 6
#define EN7523_CLK_PCIE 7
+#define EN7581_CLK_EMMC 8
+
#endif /* _DT_BINDINGS_CLOCK_AIROHA_EN7523_H_ */
--
2.45.2
^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [PATCH v5 3/4] dt-bindings: clock: add ID for eMMC for EN7581
2025-01-12 13:39 ` [PATCH v5 3/4] dt-bindings: clock: add ID for eMMC " Christian Marangi
@ 2025-01-13 21:31 ` Stephen Boyd
0 siblings, 0 replies; 14+ messages in thread
From: Stephen Boyd @ 2025-01-13 21:31 UTC (permalink / raw)
To: Christian Marangi, Conor Dooley, Krzysztof Kozlowski,
Michael Turquette, Rob Herring, devicetree, linux-clk,
linux-kernel, upstream
Cc: Christian Marangi, Conor Dooley
Quoting Christian Marangi (2025-01-12 05:39:39)
> Add ID for eMMC for EN7581. This is to control clock selection of eMMC
> between 200MHz and 150MHz.
>
> Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
> Acked-by: Conor Dooley <conor.dooley@microchip.com>
> ---
Applied to clk-next
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH v5 4/4] clk: en7523: Add clock for eMMC for EN7581
2025-01-12 13:39 [PATCH v5 1/4] clk: en7523: Rework clock handling for different clock numbers Christian Marangi
2025-01-12 13:39 ` [PATCH v5 2/4] dt-bindings: clock: drop NUM_CLOCKS define for EN7581 Christian Marangi
2025-01-12 13:39 ` [PATCH v5 3/4] dt-bindings: clock: add ID for eMMC " Christian Marangi
@ 2025-01-12 13:39 ` Christian Marangi
2025-01-13 21:31 ` Stephen Boyd
2025-01-13 21:31 ` [PATCH v5 1/4] clk: en7523: Rework clock handling for different clock numbers Stephen Boyd
3 siblings, 1 reply; 14+ messages in thread
From: Christian Marangi @ 2025-01-12 13:39 UTC (permalink / raw)
To: Michael Turquette, Stephen Boyd, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, linux-clk, linux-kernel, devicetree, upstream
Cc: Christian Marangi
Add clock for eMMC for EN7581. This is used to give info of the current
eMMC source clock and to switch it from 200MHz or 150MHz.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
---
Changes v4:
- Move to patch 4
Changes v2:
- Rename emmc_base to emmc7581_base to make it more clear
drivers/clk/clk-en7523.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/drivers/clk/clk-en7523.c b/drivers/clk/clk-en7523.c
index 3a4b7ed40af4..6a763bc9ac1a 100644
--- a/drivers/clk/clk-en7523.c
+++ b/drivers/clk/clk-en7523.c
@@ -91,6 +91,7 @@ static const u32 emi7581_base[] = { 540000000, 480000000, 400000000, 300000000 }
static const u32 bus7581_base[] = { 600000000, 540000000 };
static const u32 npu7581_base[] = { 800000000, 750000000, 720000000, 600000000 };
static const u32 crypto_base[] = { 540000000, 480000000 };
+static const u32 emmc7581_base[] = { 200000000, 150000000 };
static const struct en_clk_desc en7523_base_clks[] = {
{
@@ -281,6 +282,15 @@ static const struct en_clk_desc en7581_base_clks[] = {
.base_shift = 0,
.base_values = crypto_base,
.n_base_values = ARRAY_SIZE(crypto_base),
+ }, {
+ .id = EN7581_CLK_EMMC,
+ .name = "emmc",
+
+ .base_reg = REG_CRYPTO_CLKSRC2,
+ .base_bits = 1,
+ .base_shift = 12,
+ .base_values = emmc7581_base,
+ .n_base_values = ARRAY_SIZE(emmc7581_base),
}
};
--
2.45.2
^ permalink raw reply related [flat|nested] 14+ messages in thread* Re: [PATCH v5 1/4] clk: en7523: Rework clock handling for different clock numbers
2025-01-12 13:39 [PATCH v5 1/4] clk: en7523: Rework clock handling for different clock numbers Christian Marangi
` (2 preceding siblings ...)
2025-01-12 13:39 ` [PATCH v5 4/4] clk: en7523: Add clock " Christian Marangi
@ 2025-01-13 21:31 ` Stephen Boyd
3 siblings, 0 replies; 14+ messages in thread
From: Stephen Boyd @ 2025-01-13 21:31 UTC (permalink / raw)
To: Christian Marangi, Conor Dooley, Krzysztof Kozlowski,
Michael Turquette, Rob Herring, devicetree, linux-clk,
linux-kernel, upstream
Cc: Christian Marangi
Quoting Christian Marangi (2025-01-12 05:39:37)
> Airoha EN7581 SoC have additional clock compared to EN7523 but current
> driver permits to only support up to EN7523 clock numbers.
>
> To handle this, rework the clock handling and permit to declare the
> clocks number in match_data and alloca clk_data based on the compatible
> match_data.
>
> Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
> ---
Applied to clk-next
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2025-01-13 23:12 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-12 13:39 [PATCH v5 1/4] clk: en7523: Rework clock handling for different clock numbers Christian Marangi
2025-01-12 13:39 ` [PATCH v5 2/4] dt-bindings: clock: drop NUM_CLOCKS define for EN7581 Christian Marangi
2025-01-13 21:31 ` Stephen Boyd
2025-01-13 21:33 ` Stephen Boyd
2025-01-13 21:37 ` Christian Marangi
2025-01-13 21:53 ` Stephen Boyd
2025-01-13 22:17 ` Christian Marangi
2025-01-13 22:45 ` Stephen Boyd
2025-01-13 23:12 ` Christian Marangi
2025-01-12 13:39 ` [PATCH v5 3/4] dt-bindings: clock: add ID for eMMC " Christian Marangi
2025-01-13 21:31 ` Stephen Boyd
2025-01-12 13:39 ` [PATCH v5 4/4] clk: en7523: Add clock " Christian Marangi
2025-01-13 21:31 ` Stephen Boyd
2025-01-13 21:31 ` [PATCH v5 1/4] clk: en7523: Rework clock handling for different clock numbers Stephen Boyd
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).