Re: [PATCH 1/2] firmware: ti_sci: Bind sysreset driver when enabled

2024-04-10 Thread Jon Humphreys
Andrew Davis  writes:

> The sysreset TI-SCI API is available with TI-SCI always, there is no need
> for a DT node to describe the availability of this. If the sysreset driver
> is available then bind it during ti-sci probe.
>
> Remove the unneeded device tree matching.
>
> Signed-off-by: Andrew Davis 
> ---
>  drivers/firmware/ti_sci.c  | 7 +++
>  drivers/sysreset/sysreset-ti-sci.c | 6 --
>  2 files changed, 7 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/firmware/ti_sci.c b/drivers/firmware/ti_sci.c
> index ee092185588..6c581b9df9c 100644
> --- a/drivers/firmware/ti_sci.c
> +++ b/drivers/firmware/ti_sci.c
> @@ -16,6 +16,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  #include 
>  #include 
>  #include 
> @@ -2840,6 +2841,12 @@ static int ti_sci_probe(struct udevice *dev)
>  
>   INIT_LIST_HEAD(>dev_list);
>  
> + if (IS_ENABLED(CONFIG_SYSRESET_TI_SCI)) {
> + ret = device_bind_driver(dev, "ti-sci-sysreset", "sysreset", 
> NULL);
> + if (ret)
> + dev_warn(dev, "cannot bind SYSRESET (ret = %d)\n", ret);
> + }
> +
>   return 0;
>  }
>  
> diff --git a/drivers/sysreset/sysreset-ti-sci.c 
> b/drivers/sysreset/sysreset-ti-sci.c
> index 5fc05c46cb0..0de132633a8 100644
> --- a/drivers/sysreset/sysreset-ti-sci.c
> +++ b/drivers/sysreset/sysreset-ti-sci.c
> @@ -60,15 +60,9 @@ static struct sysreset_ops ti_sci_sysreset_ops = {
>   .request = ti_sci_sysreset_request,
>  };
>  
> -static const struct udevice_id ti_sci_sysreset_of_match[] = {
> - { .compatible = "ti,sci-sysreset", },
> - { /* sentinel */ },
> -};
> -
>  U_BOOT_DRIVER(ti_sci_sysreset) = {
>   .name = "ti-sci-sysreset",
>   .id = UCLASS_SYSRESET,
> - .of_match = ti_sci_sysreset_of_match,
>   .probe = ti_sci_sysreset_probe,
>   .priv_auto  = sizeof(struct ti_sci_sysreset_data),
>   .ops = _sci_sysreset_ops,
> -- 
> 2.39.2

Tested-by: Jonathan Humphreys 


Re: [PATCH 1/2] firmware: ti_sci: Bind sysreset driver when enabled

2024-04-03 Thread Neha Malcom Francis

Hi Andrew

On 02/04/24 21:39, Andrew Davis wrote:

The sysreset TI-SCI API is available with TI-SCI always, there is no need
for a DT node to describe the availability of this. If the sysreset driver
is available then bind it during ti-sci probe.

Remove the unneeded device tree matching.

Signed-off-by: Andrew Davis 
---
  drivers/firmware/ti_sci.c  | 7 +++
  drivers/sysreset/sysreset-ti-sci.c | 6 --
  2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/drivers/firmware/ti_sci.c b/drivers/firmware/ti_sci.c
index ee092185588..6c581b9df9c 100644
--- a/drivers/firmware/ti_sci.c
+++ b/drivers/firmware/ti_sci.c
@@ -16,6 +16,7 @@
  #include 
  #include 
  #include 
+#include 
  #include 
  #include 
  #include 
@@ -2840,6 +2841,12 @@ static int ti_sci_probe(struct udevice *dev)
  
  	INIT_LIST_HEAD(>dev_list);
  
+	if (IS_ENABLED(CONFIG_SYSRESET_TI_SCI)) {

+   ret = device_bind_driver(dev, "ti-sci-sysreset", "sysreset", 
NULL);
+   if (ret)
+   dev_warn(dev, "cannot bind SYSRESET (ret = %d)\n", ret);
+   }
+
return 0;
  }
  
diff --git a/drivers/sysreset/sysreset-ti-sci.c b/drivers/sysreset/sysreset-ti-sci.c

index 5fc05c46cb0..0de132633a8 100644
--- a/drivers/sysreset/sysreset-ti-sci.c
+++ b/drivers/sysreset/sysreset-ti-sci.c
@@ -60,15 +60,9 @@ static struct sysreset_ops ti_sci_sysreset_ops = {
.request = ti_sci_sysreset_request,
  };
  
-static const struct udevice_id ti_sci_sysreset_of_match[] = {

-   { .compatible = "ti,sci-sysreset", },
-   { /* sentinel */ },
-};
-
  U_BOOT_DRIVER(ti_sci_sysreset) = {
.name = "ti-sci-sysreset",
.id = UCLASS_SYSRESET,
-   .of_match = ti_sci_sysreset_of_match,
.probe = ti_sci_sysreset_probe,
.priv_auto  = sizeof(struct ti_sci_sysreset_data),
.ops = _sci_sysreset_ops,


Reviewed-by: Neha Malcom Francis 

--
Thanking You
Neha Malcom Francis


[PATCH 1/2] firmware: ti_sci: Bind sysreset driver when enabled

2024-04-02 Thread Andrew Davis
The sysreset TI-SCI API is available with TI-SCI always, there is no need
for a DT node to describe the availability of this. If the sysreset driver
is available then bind it during ti-sci probe.

Remove the unneeded device tree matching.

Signed-off-by: Andrew Davis 
---
 drivers/firmware/ti_sci.c  | 7 +++
 drivers/sysreset/sysreset-ti-sci.c | 6 --
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/drivers/firmware/ti_sci.c b/drivers/firmware/ti_sci.c
index ee092185588..6c581b9df9c 100644
--- a/drivers/firmware/ti_sci.c
+++ b/drivers/firmware/ti_sci.c
@@ -16,6 +16,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -2840,6 +2841,12 @@ static int ti_sci_probe(struct udevice *dev)
 
INIT_LIST_HEAD(>dev_list);
 
+   if (IS_ENABLED(CONFIG_SYSRESET_TI_SCI)) {
+   ret = device_bind_driver(dev, "ti-sci-sysreset", "sysreset", 
NULL);
+   if (ret)
+   dev_warn(dev, "cannot bind SYSRESET (ret = %d)\n", ret);
+   }
+
return 0;
 }
 
diff --git a/drivers/sysreset/sysreset-ti-sci.c 
b/drivers/sysreset/sysreset-ti-sci.c
index 5fc05c46cb0..0de132633a8 100644
--- a/drivers/sysreset/sysreset-ti-sci.c
+++ b/drivers/sysreset/sysreset-ti-sci.c
@@ -60,15 +60,9 @@ static struct sysreset_ops ti_sci_sysreset_ops = {
.request = ti_sci_sysreset_request,
 };
 
-static const struct udevice_id ti_sci_sysreset_of_match[] = {
-   { .compatible = "ti,sci-sysreset", },
-   { /* sentinel */ },
-};
-
 U_BOOT_DRIVER(ti_sci_sysreset) = {
.name = "ti-sci-sysreset",
.id = UCLASS_SYSRESET,
-   .of_match = ti_sci_sysreset_of_match,
.probe = ti_sci_sysreset_probe,
.priv_auto  = sizeof(struct ti_sci_sysreset_data),
.ops = _sci_sysreset_ops,
-- 
2.39.2