Message ID | 1429896924-21540-6-git-send-email-ahaslam@baylibre.com (mailing list archive) |
---|---|
State | Superseded, archived |
Headers | show |
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
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 --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);