soc/tegra: pmc: Add SD wake event for Tegra234

Message ID 20240216080450.456135-1-petlozup@nvidia.com
State New
Headers
Series soc/tegra: pmc: Add SD wake event for Tegra234 |

Commit Message

Petlozu Pravareshwar Feb. 16, 2024, 8:04 a.m. UTC
  From: Prathamesh Shete <pshete@nvidia.com>

Add SD wake event for Tegra234 so that system can be woken up from
suspend when SD card hot-plug/unplug event is detected.

Signed-off-by: Prathamesh Shete <pshete@nvidia.com>
Signed-off-by: Petlozu Pravareshwar <petlozup@nvidia.com>
---
 drivers/soc/tegra/pmc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
  

Comments

Thierry Reding Feb. 16, 2024, 11:34 a.m. UTC | #1
On Fri Feb 16, 2024 at 9:04 AM CET, Petlozu Pravareshwar wrote:
> From: Prathamesh Shete <pshete@nvidia.com>
>
> Add SD wake event for Tegra234 so that system can be woken up from
> suspend when SD card hot-plug/unplug event is detected.
>
> Signed-off-by: Prathamesh Shete <pshete@nvidia.com>
> Signed-off-by: Petlozu Pravareshwar <petlozup@nvidia.com>
> ---
>  drivers/soc/tegra/pmc.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/soc/tegra/pmc.c b/drivers/soc/tegra/pmc.c
> index 6dfcc7f50ece..dc4eab3191c2 100644
> --- a/drivers/soc/tegra/pmc.c
> +++ b/drivers/soc/tegra/pmc.c
> @@ -3,7 +3,7 @@
>   * drivers/soc/tegra/pmc.c
>   *
>   * Copyright (c) 2010 Google, Inc
> - * Copyright (c) 2018-2023, NVIDIA CORPORATION. All rights reserved.
> + * Copyright (c) 2018-2024, NVIDIA CORPORATION. All rights reserved.
>   *
>   * Author:
>   *	Colin Cross <ccross@google.com>
> @@ -4199,6 +4199,7 @@ static const struct tegra_wake_event tegra234_wake_events[] = {
>  	TEGRA_WAKE_IRQ("pmu", 24, 209),
>  	TEGRA_WAKE_GPIO("power", 29, 1, TEGRA234_AON_GPIO(EE, 4)),
>  	TEGRA_WAKE_GPIO("mgbe", 56, 0, TEGRA234_MAIN_GPIO(Y, 3)),
> +	TEGRA_WAKE_GPIO("sd_wake", 8, 0, TEGRA234_MAIN_GPIO(G, 7)),

I'd prefer to stick with - instead of _ in these names, like we do with
sw-wake. No need to resend, I can make that change when applying,
provided you don't have any objections.

Thierry

>  	TEGRA_WAKE_IRQ("rtc", 73, 10),
>  	TEGRA_WAKE_IRQ("sw-wake", SW_WAKE_ID, 179),
>  };
  
Thierry Reding Feb. 16, 2024, 11:36 a.m. UTC | #2
On Fri Feb 16, 2024 at 9:04 AM CET, Petlozu Pravareshwar wrote:
> From: Prathamesh Shete <pshete@nvidia.com>
>
> Add SD wake event for Tegra234 so that system can be woken up from
> suspend when SD card hot-plug/unplug event is detected.
>
> Signed-off-by: Prathamesh Shete <pshete@nvidia.com>
> Signed-off-by: Petlozu Pravareshwar <petlozup@nvidia.com>
> ---
>  drivers/soc/tegra/pmc.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/soc/tegra/pmc.c b/drivers/soc/tegra/pmc.c
> index 6dfcc7f50ece..dc4eab3191c2 100644
> --- a/drivers/soc/tegra/pmc.c
> +++ b/drivers/soc/tegra/pmc.c
> @@ -3,7 +3,7 @@
>   * drivers/soc/tegra/pmc.c
>   *
>   * Copyright (c) 2010 Google, Inc
> - * Copyright (c) 2018-2023, NVIDIA CORPORATION. All rights reserved.
> + * Copyright (c) 2018-2024, NVIDIA CORPORATION. All rights reserved.
>   *
>   * Author:
>   *	Colin Cross <ccross@google.com>
> @@ -4199,6 +4199,7 @@ static const struct tegra_wake_event tegra234_wake_events[] = {
>  	TEGRA_WAKE_IRQ("pmu", 24, 209),
>  	TEGRA_WAKE_GPIO("power", 29, 1, TEGRA234_AON_GPIO(EE, 4)),
>  	TEGRA_WAKE_GPIO("mgbe", 56, 0, TEGRA234_MAIN_GPIO(Y, 3)),
> +	TEGRA_WAKE_GPIO("sd_wake", 8, 0, TEGRA234_MAIN_GPIO(G, 7)),

These are also meant to be ordered by wake ID, so I've moved this up to
where it belongs.

Thierry
  
Petlozu Pravareshwar Feb. 16, 2024, 12:35 p.m. UTC | #3
> On Fri Feb 16, 2024 at 9:04 AM CET, Petlozu Pravareshwar wrote:
> > From: Prathamesh Shete <pshete@nvidia.com>
> >
> > Add SD wake event for Tegra234 so that system can be woken up from
> > suspend when SD card hot-plug/unplug event is detected.
> >
> > Signed-off-by: Prathamesh Shete <pshete@nvidia.com>
> > Signed-off-by: Petlozu Pravareshwar <petlozup@nvidia.com>
> > ---
> >  drivers/soc/tegra/pmc.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/soc/tegra/pmc.c b/drivers/soc/tegra/pmc.c index
> > 6dfcc7f50ece..dc4eab3191c2 100644
> > --- a/drivers/soc/tegra/pmc.c
> > +++ b/drivers/soc/tegra/pmc.c
> > @@ -3,7 +3,7 @@
> >   * drivers/soc/tegra/pmc.c
> >   *
> >   * Copyright (c) 2010 Google, Inc
> > - * Copyright (c) 2018-2023, NVIDIA CORPORATION. All rights reserved.
> > + * Copyright (c) 2018-2024, NVIDIA CORPORATION. All rights reserved.
> >   *
> >   * Author:
> >   *	Colin Cross <ccross@google.com>
> > @@ -4199,6 +4199,7 @@ static const struct tegra_wake_event
> tegra234_wake_events[] = {
> >  	TEGRA_WAKE_IRQ("pmu", 24, 209),
> >  	TEGRA_WAKE_GPIO("power", 29, 1, TEGRA234_AON_GPIO(EE, 4)),
> >  	TEGRA_WAKE_GPIO("mgbe", 56, 0, TEGRA234_MAIN_GPIO(Y, 3)),
> > +	TEGRA_WAKE_GPIO("sd_wake", 8, 0, TEGRA234_MAIN_GPIO(G, 7)),
> 
> I'd prefer to stick with - instead of _ in these names, like we do with sw-wake.
> No need to resend, I can make that change when applying, provided you
> don't have any objections.
> 
Yes, let's stick with - only instead of _ in the names for consistency.
Thanks.
 
> Thierry
> 
> >  	TEGRA_WAKE_IRQ("rtc", 73, 10),
> >  	TEGRA_WAKE_IRQ("sw-wake", SW_WAKE_ID, 179),  };
  
Petlozu Pravareshwar Feb. 16, 2024, 12:40 p.m. UTC | #4
> On Fri Feb 16, 2024 at 9:04 AM CET, Petlozu Pravareshwar wrote:
> > From: Prathamesh Shete <pshete@nvidia.com>
> >
> > Add SD wake event for Tegra234 so that system can be woken up from
> > suspend when SD card hot-plug/unplug event is detected.
> >
> > Signed-off-by: Prathamesh Shete <pshete@nvidia.com>
> > Signed-off-by: Petlozu Pravareshwar <petlozup@nvidia.com>
> > ---
> >  drivers/soc/tegra/pmc.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/soc/tegra/pmc.c b/drivers/soc/tegra/pmc.c index
> > 6dfcc7f50ece..dc4eab3191c2 100644
> > --- a/drivers/soc/tegra/pmc.c
> > +++ b/drivers/soc/tegra/pmc.c
> > @@ -3,7 +3,7 @@
> >   * drivers/soc/tegra/pmc.c
> >   *
> >   * Copyright (c) 2010 Google, Inc
> > - * Copyright (c) 2018-2023, NVIDIA CORPORATION. All rights reserved.
> > + * Copyright (c) 2018-2024, NVIDIA CORPORATION. All rights reserved.
> >   *
> >   * Author:
> >   *	Colin Cross <ccross@google.com>
> > @@ -4199,6 +4199,7 @@ static const struct tegra_wake_event
> tegra234_wake_events[] = {
> >  	TEGRA_WAKE_IRQ("pmu", 24, 209),
> >  	TEGRA_WAKE_GPIO("power", 29, 1, TEGRA234_AON_GPIO(EE, 4)),
> >  	TEGRA_WAKE_GPIO("mgbe", 56, 0, TEGRA234_MAIN_GPIO(Y, 3)),
> > +	TEGRA_WAKE_GPIO("sd_wake", 8, 0, TEGRA234_MAIN_GPIO(G, 7)),
> 
> These are also meant to be ordered by wake ID, so I've moved this up to
> where it belongs.
> 
> Thierry
Got it. Thanks for taking care of this.
  

Patch

diff --git a/drivers/soc/tegra/pmc.c b/drivers/soc/tegra/pmc.c
index 6dfcc7f50ece..dc4eab3191c2 100644
--- a/drivers/soc/tegra/pmc.c
+++ b/drivers/soc/tegra/pmc.c
@@ -3,7 +3,7 @@ 
  * drivers/soc/tegra/pmc.c
  *
  * Copyright (c) 2010 Google, Inc
- * Copyright (c) 2018-2023, NVIDIA CORPORATION. All rights reserved.
+ * Copyright (c) 2018-2024, NVIDIA CORPORATION. All rights reserved.
  *
  * Author:
  *	Colin Cross <ccross@google.com>
@@ -4199,6 +4199,7 @@  static const struct tegra_wake_event tegra234_wake_events[] = {
 	TEGRA_WAKE_IRQ("pmu", 24, 209),
 	TEGRA_WAKE_GPIO("power", 29, 1, TEGRA234_AON_GPIO(EE, 4)),
 	TEGRA_WAKE_GPIO("mgbe", 56, 0, TEGRA234_MAIN_GPIO(Y, 3)),
+	TEGRA_WAKE_GPIO("sd_wake", 8, 0, TEGRA234_MAIN_GPIO(G, 7)),
 	TEGRA_WAKE_IRQ("rtc", 73, 10),
 	TEGRA_WAKE_IRQ("sw-wake", SW_WAKE_ID, 179),
 };