lkml.org 
[lkml]   [2014]   [Oct]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v4 2/6] pinctrl: rockchip: save and restore gpio6_c6 pinmux in suspend/resume
From
Chris,

On Tue, Oct 21, 2014 at 4:19 PM, Chris Zhong <zyw@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@chromium.org>
Reviewed-by: Doug Anderson <dianders@chromium.org>


\
 
 \ /
  Last update: 2014-10-22 07:01    [W:0.105 / U:0.504 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site