devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] hwrng: starfive: Add support for JH8100
@ 2023-12-06  1:42 Jia Jie Ho
  2023-12-06  1:42 ` [PATCH 1/3] dt-bindings: rng: starfive: Add jh8100 compatible string Jia Jie Ho
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Jia Jie Ho @ 2023-12-06  1:42 UTC (permalink / raw)
  To: Olivia Mackall, Herbert Xu, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, linux-crypto, devicetree, linux-kernel

This series adds driver support for StarFive JH8100 trng. It also adds
suspend-to-idle support for the original driver.

Thanks,
Jia Jie

Jia Jie Ho (3):
  dt-bindings: rng: starfive: Add jh8100 compatible string
  hwrng: starfive - Update compatible string
  hwrng: starfive - Add suspend-to-idle support

 .../devicetree/bindings/rng/starfive,jh7110-trng.yaml |  4 +++-
 drivers/char/hw_random/jh7110-trng.c                  | 11 ++++++++---
 2 files changed, 11 insertions(+), 4 deletions(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/3] dt-bindings: rng: starfive: Add jh8100 compatible string
  2023-12-06  1:42 [PATCH 0/3] hwrng: starfive: Add support for JH8100 Jia Jie Ho
@ 2023-12-06  1:42 ` Jia Jie Ho
  2023-12-06 10:17   ` Krzysztof Kozlowski
  2023-12-06  1:42 ` [PATCH 2/3] hwrng: starfive - Update " Jia Jie Ho
  2023-12-06  1:42 ` [PATCH 3/3] hwrng: starfive - Add suspend-to-idle support Jia Jie Ho
  2 siblings, 1 reply; 6+ messages in thread
From: Jia Jie Ho @ 2023-12-06  1:42 UTC (permalink / raw)
  To: Olivia Mackall, Herbert Xu, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, linux-crypto, devicetree, linux-kernel

Add compatible string for StarFive JH8100 trng.

Signed-off-by: Jia Jie Ho <jiajie.ho@starfivetech.com>
---
 .../devicetree/bindings/rng/starfive,jh7110-trng.yaml         | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/rng/starfive,jh7110-trng.yaml b/Documentation/devicetree/bindings/rng/starfive,jh7110-trng.yaml
index 2b76ce25acc4..d275bdc4d009 100644
--- a/Documentation/devicetree/bindings/rng/starfive,jh7110-trng.yaml
+++ b/Documentation/devicetree/bindings/rng/starfive,jh7110-trng.yaml
@@ -11,7 +11,9 @@ maintainers:
 
 properties:
   compatible:
-    const: starfive,jh7110-trng
+    enum:
+      - starfive,jh7110-trng
+      - starfive,jh8100-trng
 
   reg:
     maxItems: 1
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/3] hwrng: starfive - Update compatible string
  2023-12-06  1:42 [PATCH 0/3] hwrng: starfive: Add support for JH8100 Jia Jie Ho
  2023-12-06  1:42 ` [PATCH 1/3] dt-bindings: rng: starfive: Add jh8100 compatible string Jia Jie Ho
@ 2023-12-06  1:42 ` Jia Jie Ho
  2023-12-06  1:42 ` [PATCH 3/3] hwrng: starfive - Add suspend-to-idle support Jia Jie Ho
  2 siblings, 0 replies; 6+ messages in thread
From: Jia Jie Ho @ 2023-12-06  1:42 UTC (permalink / raw)
  To: Olivia Mackall, Herbert Xu, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, linux-crypto, devicetree, linux-kernel

Add compatible string for StarFive JH8100 SoC.

Signed-off-by: Jia Jie Ho <jiajie.ho@starfivetech.com>
---
 drivers/char/hw_random/jh7110-trng.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/char/hw_random/jh7110-trng.c b/drivers/char/hw_random/jh7110-trng.c
index 38474d48a25e..46272a9e5964 100644
--- a/drivers/char/hw_random/jh7110-trng.c
+++ b/drivers/char/hw_random/jh7110-trng.c
@@ -374,6 +374,7 @@ static DEFINE_SIMPLE_DEV_PM_OPS(starfive_trng_pm_ops, starfive_trng_suspend,
 
 static const struct of_device_id trng_dt_ids[] __maybe_unused = {
 	{ .compatible = "starfive,jh7110-trng" },
+	{ .compatible = "starfive,jh8100-trng" },
 	{ }
 };
 MODULE_DEVICE_TABLE(of, trng_dt_ids);
@@ -381,7 +382,7 @@ MODULE_DEVICE_TABLE(of, trng_dt_ids);
 static struct platform_driver starfive_trng_driver = {
 	.probe	= starfive_trng_probe,
 	.driver	= {
-		.name		= "jh7110-trng",
+		.name		= "starfive-trng",
 		.pm		= &starfive_trng_pm_ops,
 		.of_match_table	= of_match_ptr(trng_dt_ids),
 	},
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 3/3] hwrng: starfive - Add suspend-to-idle support
  2023-12-06  1:42 [PATCH 0/3] hwrng: starfive: Add support for JH8100 Jia Jie Ho
  2023-12-06  1:42 ` [PATCH 1/3] dt-bindings: rng: starfive: Add jh8100 compatible string Jia Jie Ho
  2023-12-06  1:42 ` [PATCH 2/3] hwrng: starfive - Update " Jia Jie Ho
@ 2023-12-06  1:42 ` Jia Jie Ho
  2 siblings, 0 replies; 6+ messages in thread
From: Jia Jie Ho @ 2023-12-06  1:42 UTC (permalink / raw)
  To: Olivia Mackall, Herbert Xu, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, linux-crypto, devicetree, linux-kernel

Define SET_SYSTEM_SLEEP_PM_OPS for StarFive TRNG driver.

Signed-off-by: Jia Jie Ho <jiajie.ho@starfivetech.com>
---
 drivers/char/hw_random/jh7110-trng.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/char/hw_random/jh7110-trng.c b/drivers/char/hw_random/jh7110-trng.c
index 46272a9e5964..2f77f811a383 100644
--- a/drivers/char/hw_random/jh7110-trng.c
+++ b/drivers/char/hw_random/jh7110-trng.c
@@ -369,8 +369,12 @@ static int __maybe_unused starfive_trng_resume(struct device *dev)
 	return 0;
 }
 
-static DEFINE_SIMPLE_DEV_PM_OPS(starfive_trng_pm_ops, starfive_trng_suspend,
-				starfive_trng_resume);
+static const struct dev_pm_ops starfive_trng_pm_ops = {
+	SET_SYSTEM_SLEEP_PM_OPS(starfive_trng_suspend,
+				starfive_trng_resume)
+	SET_RUNTIME_PM_OPS(starfive_trng_suspend,
+			   starfive_trng_resume, NULL)
+};
 
 static const struct of_device_id trng_dt_ids[] __maybe_unused = {
 	{ .compatible = "starfive,jh7110-trng" },
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/3] dt-bindings: rng: starfive: Add jh8100 compatible string
  2023-12-06  1:42 ` [PATCH 1/3] dt-bindings: rng: starfive: Add jh8100 compatible string Jia Jie Ho
@ 2023-12-06 10:17   ` Krzysztof Kozlowski
  2023-12-07  2:33     ` Jia Jie Ho
  0 siblings, 1 reply; 6+ messages in thread
From: Krzysztof Kozlowski @ 2023-12-06 10:17 UTC (permalink / raw)
  To: Jia Jie Ho, Olivia Mackall, Herbert Xu, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, linux-crypto, devicetree,
	linux-kernel

On 06/12/2023 02:42, Jia Jie Ho wrote:
> Add compatible string for StarFive JH8100 trng.
> 
> Signed-off-by: Jia Jie Ho <jiajie.ho@starfivetech.com>
> ---
>  .../devicetree/bindings/rng/starfive,jh7110-trng.yaml         | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/rng/starfive,jh7110-trng.yaml b/Documentation/devicetree/bindings/rng/starfive,jh7110-trng.yaml
> index 2b76ce25acc4..d275bdc4d009 100644
> --- a/Documentation/devicetree/bindings/rng/starfive,jh7110-trng.yaml
> +++ b/Documentation/devicetree/bindings/rng/starfive,jh7110-trng.yaml
> @@ -11,7 +11,9 @@ maintainers:
>  
>  properties:
>    compatible:
> -    const: starfive,jh7110-trng
> +    enum:
> +      - starfive,jh7110-trng
> +      - starfive,jh8100-trng

Your driver change suggests these are compatible, so express this here
and drop driver change.

Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/3] dt-bindings: rng: starfive: Add jh8100 compatible string
  2023-12-06 10:17   ` Krzysztof Kozlowski
@ 2023-12-07  2:33     ` Jia Jie Ho
  0 siblings, 0 replies; 6+ messages in thread
From: Jia Jie Ho @ 2023-12-07  2:33 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Olivia Mackall, Herbert Xu, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, linux-crypto, devicetree,
	linux-kernel

On 6/12/2023 6:17 pm, Krzysztof Kozlowski wrote:
> On 06/12/2023 02:42, Jia Jie Ho wrote:
>> Add compatible string for StarFive JH8100 trng.
>> 
>> Signed-off-by: Jia Jie Ho <jiajie.ho@starfivetech.com>
>> ---
>>  .../devicetree/bindings/rng/starfive,jh7110-trng.yaml         | 4 +++-
>>  1 file changed, 3 insertions(+), 1 deletion(-)
>> 
>> diff --git a/Documentation/devicetree/bindings/rng/starfive,jh7110-trng.yaml b/Documentation/devicetree/bindings/rng/starfive,jh7110-trng.yaml
>> index 2b76ce25acc4..d275bdc4d009 100644
>> --- a/Documentation/devicetree/bindings/rng/starfive,jh7110-trng.yaml
>> +++ b/Documentation/devicetree/bindings/rng/starfive,jh7110-trng.yaml
>> @@ -11,7 +11,9 @@ maintainers:
>>  
>>  properties:
>>    compatible:
>> -    const: starfive,jh7110-trng
>> +    enum:
>> +      - starfive,jh7110-trng
>> +      - starfive,jh8100-trng
> 
> Your driver change suggests these are compatible, so express this here
> and drop driver change.
> 

I'll update the series accordingly. Thanks for reviewing this.

Best regards,
Jia Jie


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-12-07  2:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-06  1:42 [PATCH 0/3] hwrng: starfive: Add support for JH8100 Jia Jie Ho
2023-12-06  1:42 ` [PATCH 1/3] dt-bindings: rng: starfive: Add jh8100 compatible string Jia Jie Ho
2023-12-06 10:17   ` Krzysztof Kozlowski
2023-12-07  2:33     ` Jia Jie Ho
2023-12-06  1:42 ` [PATCH 2/3] hwrng: starfive - Update " Jia Jie Ho
2023-12-06  1:42 ` [PATCH 3/3] hwrng: starfive - Add suspend-to-idle support Jia Jie Ho

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).