diff mbox

[RFC,v5,5/8] ARM: r8a7779: pm: Convert to multiple states

Message ID 1429896924-21540-6-git-send-email-ahaslam@baylibre.com (mailing list archive)
State Superseded, archived
Headers show

Commit Message

Axel Haslam April 24, 2015, 5:35 p.m. UTC
From: Axel Haslam <ahaslam@baylibre.com>

The generic power domain framework added structure changes
to support multiple intermediate states when powering off a domain.

These changes are needed to prevent compilation breaks with
the new structures.

Signed-off-by: Axel Haslam <ahaslam@baylibre.com>
---
 arch/arm/mach-shmobile/pm-r8a7779.c | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Geert Uytterhoeven April 26, 2015, 8:43 a.m. UTC | #1
On Fri, Apr 24, 2015 at 7:35 PM,  <ahaslam@baylibre.com> wrote:
> --- a/arch/arm/mach-shmobile/pm-r8a7779.c
> +++ b/arch/arm/mach-shmobile/pm-r8a7779.c
> @@ -79,6 +79,12 @@ static bool pd_active_wakeup(struct device *dev)
>         return true;
>  }
>
> +struct genpd_power_state r8a7779_genpd_states[] = {
> +       {
> +               .name = "OFF",
> +       }
> +};
> +
>  static void r8a7779_init_pm_domain(struct r8a7779_pm_domain *r8a7779_pd)
>  {
>         struct generic_pm_domain *genpd = &r8a7779_pd->genpd;
> @@ -88,6 +94,8 @@ static void r8a7779_init_pm_domain(struct r8a7779_pm_domain *r8a7779_pd)
>         genpd->dev_ops.active_wakeup = pd_active_wakeup;
>         genpd->power_off = pd_power_down;
>         genpd->power_on = pd_power_up;
> +       genpd->states = r8a7779_genpd_states;
> +       genpd->state_count = ARRAY_SIZE(r8a7779_genpd_states);

The states are set _after_ pm_genpd_init(), so this won't work.

BTW, no idea why all these genpd fields are set after that call. Perhaps
originally they had to override defaults set by pm_genpd_init()?

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe linux-pm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Axel Haslam April 27, 2015, 9:32 a.m. UTC | #2
Hi Geert,

On 26/04/2015 10:43, Geert Uytterhoeven wrote:
> On Fri, Apr 24, 2015 at 7:35 PM,  <ahaslam@baylibre.com> wrote:
>> --- a/arch/arm/mach-shmobile/pm-r8a7779.c
>> +++ b/arch/arm/mach-shmobile/pm-r8a7779.c
>> @@ -79,6 +79,12 @@ static bool pd_active_wakeup(struct device *dev)
>>          return true;
>>   }
>>
>> +struct genpd_power_state r8a7779_genpd_states[] = {
>> +       {
>> +               .name = "OFF",
>> +       }
>> +};
>> +
>>   static void r8a7779_init_pm_domain(struct r8a7779_pm_domain *r8a7779_pd)
>>   {
>>          struct generic_pm_domain *genpd = &r8a7779_pd->genpd;
>> @@ -88,6 +94,8 @@ static void r8a7779_init_pm_domain(struct r8a7779_pm_domain *r8a7779_pd)
>>          genpd->dev_ops.active_wakeup = pd_active_wakeup;
>>          genpd->power_off = pd_power_down;
>>          genpd->power_on = pd_power_up;
>> +       genpd->states = r8a7779_genpd_states;
>> +       genpd->state_count = ARRAY_SIZE(r8a7779_genpd_states);
>
> The states are set _after_ pm_genpd_init(), so this won't work.
>
> BTW, no idea why all these genpd fields are set after that call. Perhaps
> originally they had to override defaults set by pm_genpd_init()?

good catch!

im not sure why they are set after either. i guess they should be moved. 
non of those fields seem to be set by the init today.

Anyways, the issue with the states array will be fixed once they are 
passed as paramers to the init, on the next spin.


Thanks,
Axel


>
> Gr{oetje,eeting}s,
>
>                          Geert
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
>
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
>                                  -- Linus Torvalds
>
--
To unsubscribe from this list: send the line "unsubscribe linux-pm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/arch/arm/mach-shmobile/pm-r8a7779.c b/arch/arm/mach-shmobile/pm-r8a7779.c
index 44a74c4..2ecca87 100644
--- a/arch/arm/mach-shmobile/pm-r8a7779.c
+++ b/arch/arm/mach-shmobile/pm-r8a7779.c
@@ -79,6 +79,12 @@  static bool pd_active_wakeup(struct device *dev)
 	return true;
 }
 
+struct genpd_power_state r8a7779_genpd_states[] = {
+	{
+		.name = "OFF",
+	}
+};
+
 static void r8a7779_init_pm_domain(struct r8a7779_pm_domain *r8a7779_pd)
 {
 	struct generic_pm_domain *genpd = &r8a7779_pd->genpd;
@@ -88,6 +94,8 @@  static void r8a7779_init_pm_domain(struct r8a7779_pm_domain *r8a7779_pd)
 	genpd->dev_ops.active_wakeup = pd_active_wakeup;
 	genpd->power_off = pd_power_down;
 	genpd->power_on = pd_power_up;
+	genpd->states = r8a7779_genpd_states;
+	genpd->state_count = ARRAY_SIZE(r8a7779_genpd_states);
 
 	if (pd_is_off(&r8a7779_pd->genpd))
 		pd_power_up(&r8a7779_pd->genpd);