[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20111208223144.GQ4585@pengutronix.de>
Date: Thu, 8 Dec 2011 23:31:44 +0100
From: Uwe Kleine-König
<u.kleine-koenig@...gutronix.de>
To: Stephen Warren <swarren@...dia.com>
Cc: Linus Walleij <linus.walleij@...aro.org>,
Randy Dunlap <rdunlap@...otime.net>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>,
"linux-doc@...r.kernel.org" <linux-doc@...r.kernel.org>
Subject: Re: [PATCH] Documentation/pinctrl: various minor fixes
On Thu, Dec 08, 2011 at 02:24:46PM -0800, Stephen Warren wrote:
> Uwe Kleine-König wrote at Thursday, December 08, 2011 3:22 PM:
> > - add some consts
> > - don't use the group index alone to determine the value to write to
> > foo's mux register. For spi and i2c the group index is always 0.
> > Additionally using the function index makes much more sense as it
> > generates a different value for each function/group pair.
> > - fix a few syntax errors
>
> > @@ -600,7 +600,7 @@ static int foo_get_groups(struct pinctrl_dev *pctldev, unsigned selector,
> > int foo_enable(struct pinctrl_dev *pctldev, unsigned selector,
> > unsigned group)
> > {
> > - u8 regbit = (1 << group);
> > + u8 regbit = (1 << selector + group);
> >
> > writeb((readb(MUX)|regbit), MUX)
> > return 0;
> > @@ -609,7 +609,7 @@ int foo_enable(struct pinctrl_dev *pctldev, unsigned selector,
> > int foo_disable(struct pinctrl_dev *pctldev, unsigned selector,
> > unsigned group)
> > {
> > - u8 regbit = (1 << group);
> > + u8 regbit = (1 << selector);
> >
> > writeb((readb(MUX) & ~(regbit)), MUX)
> > return 0;
>
> Shouldn't those two regbit calculations match?
Yes, of course. (Well, it depends on the register model ...)
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | http://www.pengutronix.de/ |
--
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