* [PATCH v2 1/3] dt-bindings: i3c: dw: Add apb clock binding
2024-06-24 5:28 ` [PATCH v2 0/3] i3c: dw: Add apb clk Aniket
@ 2024-06-24 5:28 ` Aniket
2024-06-25 5:54 ` Krzysztof Kozlowski
2024-06-24 5:28 ` [PATCH v2 2/3] i3c: dw: Add optional apb clock Aniket
` (7 subsequent siblings)
8 siblings, 1 reply; 26+ messages in thread
From: Aniket @ 2024-06-24 5:28 UTC (permalink / raw)
To: Alexandre Belloni, Jeremy Kerr, Joel Stanley, Billy Tsai,
Rob Herring, Krzysztof Kozlowski
Cc: linux-i3c, linux-kernel, devicetree, Aniket
Add dt binding for optional apb clock. Core clock is mandatory.
Signed-off-by: Aniket <aniketmaurya@google.com>
---
.../devicetree/bindings/i3c/snps,dw-i3c-master.yaml | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/i3c/snps,dw-i3c-master.yaml b/Documentation/devicetree/bindings/i3c/snps,dw-i3c-master.yaml
index c0e805e531be..4fc13e3c0f75 100644
--- a/Documentation/devicetree/bindings/i3c/snps,dw-i3c-master.yaml
+++ b/Documentation/devicetree/bindings/i3c/snps,dw-i3c-master.yaml
@@ -20,7 +20,16 @@ properties:
maxItems: 1
clocks:
- maxItems: 1
+ minItems: 1
+ items:
+ - description: Core clock
+ - description: APB clock
+
+ clock-names:
+ minItems: 1
+ items:
+ - const: core
+ - const: apb
interrupts:
maxItems: 1
--
2.45.2.741.gdbec12cfda-goog
^ permalink raw reply related [flat|nested] 26+ messages in thread* Re: [PATCH v2 1/3] dt-bindings: i3c: dw: Add apb clock binding
2024-06-24 5:28 ` [PATCH v2 1/3] dt-bindings: i3c: dw: Add apb clock binding Aniket
@ 2024-06-25 5:54 ` Krzysztof Kozlowski
2024-06-25 6:59 ` Aniket .
0 siblings, 1 reply; 26+ messages in thread
From: Krzysztof Kozlowski @ 2024-06-25 5:54 UTC (permalink / raw)
To: Aniket, Alexandre Belloni, Jeremy Kerr, Joel Stanley, Billy Tsai,
Rob Herring, Krzysztof Kozlowski
Cc: linux-i3c, linux-kernel, devicetree
On 24/06/2024 07:28, Aniket wrote:
> Add dt binding for optional apb clock. Core clock is mandatory.
>
> Signed-off-by: Aniket <aniketmaurya@google.com>
Your email still suggests mismatch with name. Please confirm that above
this is you full name or known identity which you want to consistently
use across all contributions. In case of doubts: please consult
colleagues in Google (or your legal department, dunno).
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH v2 1/3] dt-bindings: i3c: dw: Add apb clock binding
2024-06-25 5:54 ` Krzysztof Kozlowski
@ 2024-06-25 6:59 ` Aniket .
0 siblings, 0 replies; 26+ messages in thread
From: Aniket . @ 2024-06-25 6:59 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: Alexandre Belloni, Jeremy Kerr, Joel Stanley, Billy Tsai,
Rob Herring, Krzysztof Kozlowski, linux-i3c, linux-kernel,
devicetree
> Your email still suggests mismatch with name. Please confirm that above
> this is you full name or known identity which you want to consistently
> use across all contributions. In case of doubts: please consult
> colleagues in Google (or your legal department, dunno).
Hey, my full legal name is "Aniket". Please don't mind the text in the email-id.
Thanks,
Aniket.
^ permalink raw reply [flat|nested] 26+ messages in thread
* [PATCH v2 2/3] i3c: dw: Add optional apb clock
2024-06-24 5:28 ` [PATCH v2 0/3] i3c: dw: Add apb clk Aniket
2024-06-24 5:28 ` [PATCH v2 1/3] dt-bindings: i3c: dw: Add apb clock binding Aniket
@ 2024-06-24 5:28 ` Aniket
2024-06-24 5:28 ` [PATCH v2 3/3] i3c: dw: Use new *_enabled clk APIs Aniket
` (6 subsequent siblings)
8 siblings, 0 replies; 26+ messages in thread
From: Aniket @ 2024-06-24 5:28 UTC (permalink / raw)
To: Alexandre Belloni, Jeremy Kerr, Joel Stanley, Billy Tsai,
Rob Herring, Krzysztof Kozlowski
Cc: linux-i3c, linux-kernel, devicetree, Aniket
Besides the core clock, IP also has an apb interface clock.
Add an optional hook for the same and appropriately enable/disable.
Signed-off-by: Aniket <aniketmaurya@google.com>
---
drivers/i3c/master/dw-i3c-master.c | 12 ++++++++++++
drivers/i3c/master/dw-i3c-master.h | 1 +
2 files changed, 13 insertions(+)
diff --git a/drivers/i3c/master/dw-i3c-master.c b/drivers/i3c/master/dw-i3c-master.c
index 77a2a1c3fd1d..41cdfd6741e3 100644
--- a/drivers/i3c/master/dw-i3c-master.c
+++ b/drivers/i3c/master/dw-i3c-master.c
@@ -1470,12 +1470,20 @@ int dw_i3c_common_probe(struct dw_i3c_master *master,
if (IS_ERR(master->core_clk))
return PTR_ERR(master->core_clk);
+ master->pclk = devm_clk_get_optional(&pdev->dev, "pclk");
+ if (IS_ERR(master->pclk))
+ return PTR_ERR(master->pclk);
+
master->core_rst = devm_reset_control_get_optional_exclusive(&pdev->dev,
"core_rst");
if (IS_ERR(master->core_rst))
return PTR_ERR(master->core_rst);
ret = clk_prepare_enable(master->core_clk);
+ if (ret)
+ return ret;
+
+ ret = clk_prepare_enable(master->pclk);
if (ret)
goto err_disable_core_clk;
@@ -1520,6 +1528,8 @@ int dw_i3c_common_probe(struct dw_i3c_master *master,
err_assert_rst:
reset_control_assert(master->core_rst);
+ clk_disable_unprepare(master->pclk);
+
err_disable_core_clk:
clk_disable_unprepare(master->core_clk);
@@ -1533,6 +1543,8 @@ void dw_i3c_common_remove(struct dw_i3c_master *master)
reset_control_assert(master->core_rst);
+ clk_disable_unprepare(master->pclk);
+
clk_disable_unprepare(master->core_clk);
}
EXPORT_SYMBOL_GPL(dw_i3c_common_remove);
diff --git a/drivers/i3c/master/dw-i3c-master.h b/drivers/i3c/master/dw-i3c-master.h
index 8cb617b8147e..50c38e790c0e 100644
--- a/drivers/i3c/master/dw-i3c-master.h
+++ b/drivers/i3c/master/dw-i3c-master.h
@@ -36,6 +36,7 @@ struct dw_i3c_master {
void __iomem *regs;
struct reset_control *core_rst;
struct clk *core_clk;
+ struct clk *pclk;
char version[5];
char type[5];
bool ibi_capable;
--
2.45.2.741.gdbec12cfda-goog
^ permalink raw reply related [flat|nested] 26+ messages in thread* [PATCH v2 3/3] i3c: dw: Use new *_enabled clk APIs
2024-06-24 5:28 ` [PATCH v2 0/3] i3c: dw: Add apb clk Aniket
2024-06-24 5:28 ` [PATCH v2 1/3] dt-bindings: i3c: dw: Add apb clock binding Aniket
2024-06-24 5:28 ` [PATCH v2 2/3] i3c: dw: Add optional apb clock Aniket
@ 2024-06-24 5:28 ` Aniket
2024-06-24 5:50 ` [PATCH v2 0/3] i3c: dw: Add apb clk Krzysztof Kozlowski
` (5 subsequent siblings)
8 siblings, 0 replies; 26+ messages in thread
From: Aniket @ 2024-06-24 5:28 UTC (permalink / raw)
To: Alexandre Belloni, Jeremy Kerr, Joel Stanley, Billy Tsai,
Rob Herring, Krzysztof Kozlowski
Cc: linux-i3c, linux-kernel, devicetree, Aniket
Move to "enabled" variant of clk_get APIs. It takes care
of enable and disable calls during the probe and remove.
Signed-off-by: Aniket <aniketmaurya@google.com>
---
drivers/i3c/master/dw-i3c-master.c | 21 ++-------------------
1 file changed, 2 insertions(+), 19 deletions(-)
diff --git a/drivers/i3c/master/dw-i3c-master.c b/drivers/i3c/master/dw-i3c-master.c
index 41cdfd6741e3..37092b8e964f 100644
--- a/drivers/i3c/master/dw-i3c-master.c
+++ b/drivers/i3c/master/dw-i3c-master.c
@@ -1466,11 +1466,11 @@ int dw_i3c_common_probe(struct dw_i3c_master *master,
if (IS_ERR(master->regs))
return PTR_ERR(master->regs);
- master->core_clk = devm_clk_get(&pdev->dev, NULL);
+ master->core_clk = devm_clk_get_enabled(&pdev->dev, NULL);
if (IS_ERR(master->core_clk))
return PTR_ERR(master->core_clk);
- master->pclk = devm_clk_get_optional(&pdev->dev, "pclk");
+ master->pclk = devm_clk_get_optional_enabled(&pdev->dev, "pclk");
if (IS_ERR(master->pclk))
return PTR_ERR(master->pclk);
@@ -1479,14 +1479,6 @@ int dw_i3c_common_probe(struct dw_i3c_master *master,
if (IS_ERR(master->core_rst))
return PTR_ERR(master->core_rst);
- ret = clk_prepare_enable(master->core_clk);
- if (ret)
- return ret;
-
- ret = clk_prepare_enable(master->pclk);
- if (ret)
- goto err_disable_core_clk;
-
reset_control_deassert(master->core_rst);
spin_lock_init(&master->xferqueue.lock);
@@ -1528,11 +1520,6 @@ int dw_i3c_common_probe(struct dw_i3c_master *master,
err_assert_rst:
reset_control_assert(master->core_rst);
- clk_disable_unprepare(master->pclk);
-
-err_disable_core_clk:
- clk_disable_unprepare(master->core_clk);
-
return ret;
}
EXPORT_SYMBOL_GPL(dw_i3c_common_probe);
@@ -1542,10 +1529,6 @@ void dw_i3c_common_remove(struct dw_i3c_master *master)
i3c_master_unregister(&master->base);
reset_control_assert(master->core_rst);
-
- clk_disable_unprepare(master->pclk);
-
- clk_disable_unprepare(master->core_clk);
}
EXPORT_SYMBOL_GPL(dw_i3c_common_remove);
--
2.45.2.741.gdbec12cfda-goog
^ permalink raw reply related [flat|nested] 26+ messages in thread* Re: [PATCH v2 0/3] i3c: dw: Add apb clk
2024-06-24 5:28 ` [PATCH v2 0/3] i3c: dw: Add apb clk Aniket
` (2 preceding siblings ...)
2024-06-24 5:28 ` [PATCH v2 3/3] i3c: dw: Use new *_enabled clk APIs Aniket
@ 2024-06-24 5:50 ` Krzysztof Kozlowski
2024-06-24 8:48 ` Aniket .
2024-06-27 22:12 ` Alexandre Belloni
` (4 subsequent siblings)
8 siblings, 1 reply; 26+ messages in thread
From: Krzysztof Kozlowski @ 2024-06-24 5:50 UTC (permalink / raw)
To: Aniket, Alexandre Belloni, Jeremy Kerr, Joel Stanley, Billy Tsai,
Rob Herring, Krzysztof Kozlowski
Cc: linux-i3c, linux-kernel, devicetree
On 24/06/2024 07:28, Aniket wrote:
> These patches add APB clk aka pclk to the dw i3c driver
> and the binding doc. Also move to _enabled clk_get APIs.
Where is the changelog?
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 26+ messages in thread* Re: [PATCH v2 0/3] i3c: dw: Add apb clk
2024-06-24 5:50 ` [PATCH v2 0/3] i3c: dw: Add apb clk Krzysztof Kozlowski
@ 2024-06-24 8:48 ` Aniket .
0 siblings, 0 replies; 26+ messages in thread
From: Aniket . @ 2024-06-24 8:48 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: Alexandre Belloni, Jeremy Kerr, Joel Stanley, Billy Tsai,
Rob Herring, Krzysztof Kozlowski, linux-i3c, linux-kernel,
devicetree
> Where is the changelog?
Sorry, I missed the changelog.
Changes from v1 to v2
- extra example removed from yaml file, minor renaming.
- 3rd patch added to migrate to *_enabled clk_get APIs.
Thanks,
Aniket.
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH v2 0/3] i3c: dw: Add apb clk
2024-06-24 5:28 ` [PATCH v2 0/3] i3c: dw: Add apb clk Aniket
` (3 preceding siblings ...)
2024-06-24 5:50 ` [PATCH v2 0/3] i3c: dw: Add apb clk Krzysztof Kozlowski
@ 2024-06-27 22:12 ` Alexandre Belloni
2024-06-28 15:01 ` Aniket .
2024-06-28 15:38 ` [PATCH v3 " Aniket
` (3 subsequent siblings)
8 siblings, 1 reply; 26+ messages in thread
From: Alexandre Belloni @ 2024-06-27 22:12 UTC (permalink / raw)
To: Aniket
Cc: Jeremy Kerr, Joel Stanley, Billy Tsai, Rob Herring,
Krzysztof Kozlowski, linux-i3c, linux-kernel, devicetree
On 24/06/2024 05:28:48+0000, Aniket wrote:
> These patches add APB clk aka pclk to the dw i3c driver
> and the binding doc. Also move to _enabled clk_get APIs.
>
> Aniket (3):
> dt-bindings: i3c: dw: Add apb clock binding
> i3c: dw: Add optional apb clock
> i3c: dw: Use new *_enabled clk APIs
You should reorder your patches to have 3/3 before 2/3, else you
introduce code that you immediately remove.
>
> .../bindings/i3c/snps,dw-i3c-master.yaml | 11 ++++++++++-
> drivers/i3c/master/dw-i3c-master.c | 15 +++++----------
> drivers/i3c/master/dw-i3c-master.h | 1 +
> 3 files changed, 16 insertions(+), 11 deletions(-)
>
> --
> 2.45.2.741.gdbec12cfda-goog
>
--
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 26+ messages in thread* Re: [PATCH v2 0/3] i3c: dw: Add apb clk
2024-06-27 22:12 ` Alexandre Belloni
@ 2024-06-28 15:01 ` Aniket .
0 siblings, 0 replies; 26+ messages in thread
From: Aniket . @ 2024-06-28 15:01 UTC (permalink / raw)
To: Alexandre Belloni
Cc: Jeremy Kerr, Joel Stanley, Billy Tsai, Rob Herring,
Krzysztof Kozlowski, linux-i3c, linux-kernel, devicetree
> > dt-bindings: i3c: dw: Add apb clock binding
> > i3c: dw: Add optional apb clock
> > i3c: dw: Use new *_enabled clk APIs
>
> You should reorder your patches to have 3/3 before 2/3, else you
> introduce code that you immediately remove.
Ahh! Sorry, let me fix this.
Thanks,
Aniket.
^ permalink raw reply [flat|nested] 26+ messages in thread
* [PATCH v3 0/3] i3c: dw: Add apb clk
2024-06-24 5:28 ` [PATCH v2 0/3] i3c: dw: Add apb clk Aniket
` (4 preceding siblings ...)
2024-06-27 22:12 ` Alexandre Belloni
@ 2024-06-28 15:38 ` Aniket
2024-07-02 15:46 ` Alexandre Belloni
2024-06-28 15:45 ` [PATCH v3 1/3] dt-bindings: i3c: dw: Add apb clock binding Aniket
` (2 subsequent siblings)
8 siblings, 1 reply; 26+ messages in thread
From: Aniket @ 2024-06-28 15:38 UTC (permalink / raw)
To: Alexandre Belloni, Jeremy Kerr, Joel Stanley, Billy Tsai,
Rob Herring, Krzysztof Kozlowski
Cc: linux-i3c, linux-kernel, devicetree, Aniket
These patches add APB clk aka pclk to the dw i3c driver
and the binding doc. Also move to _enabled clk_get APIs.
Changes from v2 to v3
- moved to _enabled API first and then added apb clk.
Changes from v1 to v2
- extra example removed from yaml file, minor renaming.
- 3rd patch added to migrate to *_enabled clk_get APIs.
Aniket (3):
dt-bindings: i3c: dw: Add apb clock binding
i3c: dw: Use new *_enabled clk API
i3c: dw: Add optional apb clock
.../bindings/i3c/snps,dw-i3c-master.yaml | 11 ++++++++++-
drivers/i3c/master/dw-i3c-master.c | 15 +++++----------
drivers/i3c/master/dw-i3c-master.h | 1 +
3 files changed, 16 insertions(+), 11 deletions(-)
--
2.45.2.803.g4e1b14247a-goog
^ permalink raw reply [flat|nested] 26+ messages in thread* Re: [PATCH v3 0/3] i3c: dw: Add apb clk
2024-06-28 15:38 ` [PATCH v3 " Aniket
@ 2024-07-02 15:46 ` Alexandre Belloni
0 siblings, 0 replies; 26+ messages in thread
From: Alexandre Belloni @ 2024-07-02 15:46 UTC (permalink / raw)
To: Jeremy Kerr, Joel Stanley, Billy Tsai, Rob Herring,
Krzysztof Kozlowski, Aniket
Cc: linux-i3c, linux-kernel, devicetree
On Fri, 28 Jun 2024 15:38:26 +0000, Aniket wrote:
> These patches add APB clk aka pclk to the dw i3c driver
> and the binding doc. Also move to _enabled clk_get APIs.
>
> Changes from v2 to v3
> - moved to _enabled API first and then added apb clk.
>
> Changes from v1 to v2
> - extra example removed from yaml file, minor renaming.
> - 3rd patch added to migrate to *_enabled clk_get APIs.
>
> [...]
Applied, thanks!
[1/3] dt-bindings: i3c: dw: Add apb clock binding
https://git.kernel.org/abelloni/c/a75d62ef7c30
[2/3] i3c: dw: Use new *_enabled clk API
https://git.kernel.org/abelloni/c/48a74bb38b24
[3/3] i3c: dw: Add optional apb clock
https://git.kernel.org/abelloni/c/145ca7b61e95
Best regards,
--
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 26+ messages in thread
* [PATCH v3 1/3] dt-bindings: i3c: dw: Add apb clock binding
2024-06-24 5:28 ` [PATCH v2 0/3] i3c: dw: Add apb clk Aniket
` (5 preceding siblings ...)
2024-06-28 15:38 ` [PATCH v3 " Aniket
@ 2024-06-28 15:45 ` Aniket
2024-06-28 16:30 ` Conor Dooley
2024-06-28 15:46 ` [PATCH v3 2/3] i3c: dw: Use new *_enabled clk API Aniket
2024-06-28 15:46 ` [PATCH v3 3/3] i3c: dw: Add optional apb clock Aniket
8 siblings, 1 reply; 26+ messages in thread
From: Aniket @ 2024-06-28 15:45 UTC (permalink / raw)
To: Alexandre Belloni, Jeremy Kerr, Joel Stanley, Billy Tsai,
Rob Herring, Krzysztof Kozlowski
Cc: linux-i3c, linux-kernel, devicetree, Aniket
Add dt binding for optional apb clock. Core clock is mandatory.
Signed-off-by: Aniket <aniketmaurya@google.com>
---
.../devicetree/bindings/i3c/snps,dw-i3c-master.yaml | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/i3c/snps,dw-i3c-master.yaml b/Documentation/devicetree/bindings/i3c/snps,dw-i3c-master.yaml
index c0e805e531be..4fc13e3c0f75 100644
--- a/Documentation/devicetree/bindings/i3c/snps,dw-i3c-master.yaml
+++ b/Documentation/devicetree/bindings/i3c/snps,dw-i3c-master.yaml
@@ -20,7 +20,16 @@ properties:
maxItems: 1
clocks:
- maxItems: 1
+ minItems: 1
+ items:
+ - description: Core clock
+ - description: APB clock
+
+ clock-names:
+ minItems: 1
+ items:
+ - const: core
+ - const: apb
interrupts:
maxItems: 1
--
2.45.2.803.g4e1b14247a-goog
^ permalink raw reply related [flat|nested] 26+ messages in thread* Re: [PATCH v3 1/3] dt-bindings: i3c: dw: Add apb clock binding
2024-06-28 15:45 ` [PATCH v3 1/3] dt-bindings: i3c: dw: Add apb clock binding Aniket
@ 2024-06-28 16:30 ` Conor Dooley
2024-07-01 3:39 ` Aniket .
0 siblings, 1 reply; 26+ messages in thread
From: Conor Dooley @ 2024-06-28 16:30 UTC (permalink / raw)
To: Aniket
Cc: Alexandre Belloni, Jeremy Kerr, Joel Stanley, Billy Tsai,
Rob Herring, Krzysztof Kozlowski, linux-i3c, linux-kernel,
devicetree
[-- Attachment #1: Type: text/plain, Size: 466 bytes --]
On Fri, Jun 28, 2024 at 03:45:26PM +0000, Aniket wrote:
> Add dt binding for optional apb clock. Core clock is mandatory.
>
> Signed-off-by: Aniket <aniketmaurya@google.com>
Missing a review from Krzysztof:
https://lore.kernel.org/all/e3160411-59e0-4806-a00d-b99564384180@linaro.org/
Also, please do not send a new version of a series as a reply to a
previous version. It'll bury it in people's mailboxes depending on how
they sort.
Cheers,
Conor.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH v3 1/3] dt-bindings: i3c: dw: Add apb clock binding
2024-06-28 16:30 ` Conor Dooley
@ 2024-07-01 3:39 ` Aniket .
0 siblings, 0 replies; 26+ messages in thread
From: Aniket . @ 2024-07-01 3:39 UTC (permalink / raw)
To: Conor Dooley
Cc: Alexandre Belloni, Jeremy Kerr, Joel Stanley, Billy Tsai,
Rob Herring, Krzysztof Kozlowski, linux-i3c, linux-kernel,
devicetree
> Missing a review from Krzysztof:
> https://lore.kernel.org/all/e3160411-59e0-4806-a00d-b99564384180@linaro.org/
>
> Also, please do not send a new version of a series as a reply to a
> previous version. It'll bury it in people's mailboxes depending on how
> they sort.
Got it, will keep in mind next time.
Thanks,
Aniket
^ permalink raw reply [flat|nested] 26+ messages in thread
* [PATCH v3 2/3] i3c: dw: Use new *_enabled clk API
2024-06-24 5:28 ` [PATCH v2 0/3] i3c: dw: Add apb clk Aniket
` (6 preceding siblings ...)
2024-06-28 15:45 ` [PATCH v3 1/3] dt-bindings: i3c: dw: Add apb clock binding Aniket
@ 2024-06-28 15:46 ` Aniket
2024-06-28 15:46 ` [PATCH v3 3/3] i3c: dw: Add optional apb clock Aniket
8 siblings, 0 replies; 26+ messages in thread
From: Aniket @ 2024-06-28 15:46 UTC (permalink / raw)
To: Alexandre Belloni, Jeremy Kerr, Joel Stanley, Billy Tsai,
Rob Herring, Krzysztof Kozlowski
Cc: linux-i3c, linux-kernel, devicetree, Aniket
Move to "enabled" variant of clk_get API. It takes care
of enable and disable calls during the probe and remove.
Signed-off-by: Aniket <aniketmaurya@google.com>
---
drivers/i3c/master/dw-i3c-master.c | 11 +----------
1 file changed, 1 insertion(+), 10 deletions(-)
diff --git a/drivers/i3c/master/dw-i3c-master.c b/drivers/i3c/master/dw-i3c-master.c
index 9aae5c8dba8d..4e3335641dcd 100644
--- a/drivers/i3c/master/dw-i3c-master.c
+++ b/drivers/i3c/master/dw-i3c-master.c
@@ -1450,7 +1450,7 @@ int dw_i3c_common_probe(struct dw_i3c_master *master,
if (IS_ERR(master->regs))
return PTR_ERR(master->regs);
- master->core_clk = devm_clk_get(&pdev->dev, NULL);
+ master->core_clk = devm_clk_get_enabled(&pdev->dev, NULL);
if (IS_ERR(master->core_clk))
return PTR_ERR(master->core_clk);
@@ -1459,10 +1459,6 @@ int dw_i3c_common_probe(struct dw_i3c_master *master,
if (IS_ERR(master->core_rst))
return PTR_ERR(master->core_rst);
- ret = clk_prepare_enable(master->core_clk);
- if (ret)
- goto err_disable_core_clk;
-
reset_control_deassert(master->core_rst);
spin_lock_init(&master->xferqueue.lock);
@@ -1501,9 +1497,6 @@ int dw_i3c_common_probe(struct dw_i3c_master *master,
err_assert_rst:
reset_control_assert(master->core_rst);
-err_disable_core_clk:
- clk_disable_unprepare(master->core_clk);
-
return ret;
}
EXPORT_SYMBOL_GPL(dw_i3c_common_probe);
@@ -1513,8 +1506,6 @@ void dw_i3c_common_remove(struct dw_i3c_master *master)
i3c_master_unregister(&master->base);
reset_control_assert(master->core_rst);
-
- clk_disable_unprepare(master->core_clk);
}
EXPORT_SYMBOL_GPL(dw_i3c_common_remove);
--
2.45.2.803.g4e1b14247a-goog
^ permalink raw reply related [flat|nested] 26+ messages in thread* [PATCH v3 3/3] i3c: dw: Add optional apb clock
2024-06-24 5:28 ` [PATCH v2 0/3] i3c: dw: Add apb clk Aniket
` (7 preceding siblings ...)
2024-06-28 15:46 ` [PATCH v3 2/3] i3c: dw: Use new *_enabled clk API Aniket
@ 2024-06-28 15:46 ` Aniket
8 siblings, 0 replies; 26+ messages in thread
From: Aniket @ 2024-06-28 15:46 UTC (permalink / raw)
To: Alexandre Belloni, Jeremy Kerr, Joel Stanley, Billy Tsai,
Rob Herring, Krzysztof Kozlowski
Cc: linux-i3c, linux-kernel, devicetree, Aniket
Besides the core clock, IP also has an apb interface clock.
Add an optional hook for the same.
Signed-off-by: Aniket <aniketmaurya@google.com>
---
drivers/i3c/master/dw-i3c-master.c | 4 ++++
drivers/i3c/master/dw-i3c-master.h | 1 +
2 files changed, 5 insertions(+)
diff --git a/drivers/i3c/master/dw-i3c-master.c b/drivers/i3c/master/dw-i3c-master.c
index 4e3335641dcd..0ca41782f3a6 100644
--- a/drivers/i3c/master/dw-i3c-master.c
+++ b/drivers/i3c/master/dw-i3c-master.c
@@ -1454,6 +1454,10 @@ int dw_i3c_common_probe(struct dw_i3c_master *master,
if (IS_ERR(master->core_clk))
return PTR_ERR(master->core_clk);
+ master->pclk = devm_clk_get_optional_enabled(&pdev->dev, "pclk");
+ if (IS_ERR(master->pclk))
+ return PTR_ERR(master->pclk);
+
master->core_rst = devm_reset_control_get_optional_exclusive(&pdev->dev,
"core_rst");
if (IS_ERR(master->core_rst))
diff --git a/drivers/i3c/master/dw-i3c-master.h b/drivers/i3c/master/dw-i3c-master.h
index 7e76ca381d9f..fb7121c6c687 100644
--- a/drivers/i3c/master/dw-i3c-master.h
+++ b/drivers/i3c/master/dw-i3c-master.h
@@ -36,6 +36,7 @@ struct dw_i3c_master {
void __iomem *regs;
struct reset_control *core_rst;
struct clk *core_clk;
+ struct clk *pclk;
char version[5];
char type[5];
u32 sir_rej_mask;
--
2.45.2.803.g4e1b14247a-goog
^ permalink raw reply related [flat|nested] 26+ messages in thread