[PATCH v4 2/6] pinctrl: rockchip: save and restore gpio6_c6 pinmux in suspend/resume

Doug Anderson dianders at chromium.org
Tue Oct 21 21:33:19 PDT 2014


Chris,

On Tue, Oct 21, 2014 at 4:19 PM, Chris Zhong <zyw at rock-chips.com> wrote:

> +static u32 rk3288_grf_gpio6c_iomux;

Somehow my instinct says that this should be in the "info" structure,
but I can't say exactly why (since by definition there can be only one
gpio6_c6).  ...no need to change this in my opinion.


>  static int rockchip_pinctrl_suspend(struct device *dev)
>  {
>         struct rockchip_pinctrl *info = dev_get_drvdata(dev);
> +       int ret = pinctrl_force_sleep(info->pctl_dev);
> +
> +       if (ret)
> +               return ret;
> +
> +       /*
> +        * RK3288 GPIO6_C6 mux would be modified by Maskrom when resume, so save
> +        * the setting here, and restore it at resume.
> +        */
> +       if (info->ctrl->type == RK3288) {
> +               ret = regmap_read(info->regmap_base, RK3288_GRF_GPIO6C_IOMUX,
> +                                 &rk3288_grf_gpio6c_iomux);
> +               if (ret)
> +                       return ret;

I seriously doubt it matters, but as a nit it seems like you should
call pinctrl_force_default() in the error case (to undo
pinctrl_force_sleep).


Everything is just nits and this works for me, so:

Tested-by: Doug Anderson <dianders at chromium.org>
Reviewed-by: Doug Anderson <dianders at chromium.org>



More information about the linux-arm-kernel mailing list