Message ID | 1413933557-25684-1-git-send-email-zyw@rock-chips.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Chris, On Tue, Oct 21, 2014 at 4:19 PM, Chris Zhong <zyw@rock-chips.com> wrote: > From: Chris <zyw@rock-chips.com> I think your git is misconfigured. The above "From" line will make the author end up without your last name. Heiko mentioned this in v4. > diff --git a/drivers/pinctrl/pinctrl-rockchip.c b/drivers/pinctrl/pinctrl-rockchip.c > index 016f457..c4a988d 100644 > --- a/drivers/pinctrl/pinctrl-rockchip.c > +++ b/drivers/pinctrl/pinctrl-rockchip.c > @@ -1770,6 +1770,25 @@ static struct rockchip_pin_ctrl *rockchip_pinctrl_get_soc_data( > return ctrl; > } > > +#ifdef CONFIG_PM_SLEEP > +static int rockchip_pinctrl_suspend(struct device *dev) Why didn't you take Dmitry's suggestion from v3? I think you can get rid of the #ifdef and add the "__maybe_unused" annotation to avoid errors when PM_SLEEP isn't defined. This does work, though, so: Tested-by: Doug Anderson <dianders@chromium.org>
On Wed, Oct 22, 2014 at 1:19 AM, Chris Zhong <zyw@rock-chips.com> wrote: > From: Chris <zyw@rock-chips.com> > > support suspend/resume of pinctrl, it allows handling sleep mode > for hogged pins in pinctrl > > Signed-off-by: Chris Zhong <zyw@rock-chips.com> Looks good but I'm delegating to Heiko to collect and review patches on the Rockchip pin control driver. I will point out if I see something immediately disturbing. Yours, Linus Walleij
diff --git a/drivers/pinctrl/pinctrl-rockchip.c b/drivers/pinctrl/pinctrl-rockchip.c index 016f457..c4a988d 100644 --- a/drivers/pinctrl/pinctrl-rockchip.c +++ b/drivers/pinctrl/pinctrl-rockchip.c @@ -1770,6 +1770,25 @@ static struct rockchip_pin_ctrl *rockchip_pinctrl_get_soc_data( return ctrl; } +#ifdef CONFIG_PM_SLEEP +static int rockchip_pinctrl_suspend(struct device *dev) +{ + struct rockchip_pinctrl *info = dev_get_drvdata(dev); + + return pinctrl_force_sleep(info->pctl_dev); +} + +static int rockchip_pinctrl_resume(struct device *dev) +{ + struct rockchip_pinctrl *info = dev_get_drvdata(dev); + + return pinctrl_force_default(info->pctl_dev); +} +#endif + +static SIMPLE_DEV_PM_OPS(rockchip_pinctrl_dev_pm_ops, rockchip_pinctrl_suspend, + rockchip_pinctrl_resume); + static int rockchip_pinctrl_probe(struct platform_device *pdev) { struct rockchip_pinctrl *info; @@ -1983,6 +2002,7 @@ static struct platform_driver rockchip_pinctrl_driver = { .driver = { .name = "rockchip-pinctrl", .owner = THIS_MODULE, + .pm = &rockchip_pinctrl_dev_pm_ops, .of_match_table = rockchip_pinctrl_dt_match, }, };