[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <201305162319.48168.heiko@sntech.de>
Date: Thu, 16 May 2013 23:19:47 +0200
From: Heiko Stübner <heiko@...ech.de>
To: Tomasz Figa <tomasz.figa@...il.com>
Cc: Doug Anderson <dianders@...omium.org>,
Kukjin Kim <kgene.kim@...sung.com>,
Olof Johansson <olof@...om.net>,
Stephen Warren <swarren@...dotorg.org>,
Thomas Abraham <thomas.abraham@...aro.org>,
Linus Walleij <linus.walleij@...aro.org>,
Prathyush K <prathyush.k@...sung.com>,
linux-samsung-soc@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/2] pinctrl: samsung: fix suspend/resume functionality
Am Donnerstag, 16. Mai 2013, 21:19:20 schrieb Tomasz Figa:
[...]
> > +
> > + if (type->fld_width[PINCFG_TYPE_CON_PDN]) {
> > + bank->pm_save.conpdn = readl(reg +
> > + type->reg_offset[PINCFG_TYPE_CON_PDN]);
> > + bank->pm_save.pudpdn = readl(reg +
> > + type->reg_offset[PINCFG_TYPE_PUD_PDN]);
> > + }
>
> I wonder if you couldn't do all the saving here in a single loop over all
> pin control types, like:
>
> unsigned int offsets = bank->type->reg_offsets;
> unsigned int widths = bank->type->fld_width;
>
> for (i = 0; i < PINCFG_TYPE_NUM; ++i)
> if (widths[i])
> bank->pm_save[i] = readl(reg + offsets[i]);
>
> The only thing not handled by this loop is second CON registers in banks
> with two of them. I can't think of any better solution for this other than
> just adding a special case after the loop.
doing this in the loop over the pinctrl types like Tomasz suggests, also
nicely fixes the problem of s3c24xx [0] only having FUNC, DAT and PUD and some
(gpa) not even having the PUD, which was not checked in the original patch.
Heiko
[0] patch is with Kgene currently, so should make it into 3.11
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists