Re: [PATCH v2 5/8] pinctrl: Add core support for Aspeed SoCs

From: Andrew Jeffery
Date: Mon Aug 22 2016 - 22:31:14 EST


On Mon, 2016-08-22 at 15:45 +0200, Linus Walleij wrote:
> On Fri, Aug 19, 2016 at 2:44 PM, Andrew Jeffery <andrew@xxxxxxxx> wrote:
>
> >
> > +++ b/drivers/pinctrl/aspeed/Kconfig
> > @@ -0,0 +1,8 @@
> > +config PINCTRL_ASPEED
> > +ÂÂÂÂÂÂÂbool
> > +ÂÂÂÂÂÂÂdepends on (ARCH_ASPEED || COMPILE_TEST) && OF
> > +ÂÂÂÂÂÂÂselect PINMUX
> > +ÂÂÂÂÂÂÂselect PINCONF
> > +ÂÂÂÂÂÂÂselect GENERIC_PINCONF
> > +ÂÂÂÂÂÂÂselect MFD_SYSCON
> > +ÂÂÂÂÂÂÂselect REGMAP_MMIO
> Since this device is spawn from the syscon, should it not be
> "depends on MFD_SYSCON"?
>
> (No big deal, if you think this is right then go with it.)

I think that's a fair point, I will look at rearranging it.

>
> >
> > +#include
> What is this include for?

Cruft from past iterations. Will remove.

>
> >
> > +#include
> > +#include
> > +#include
> > +#include
> > +#include "../core.h"
> > +#include "pinctrl-aspeed.h"
> No #include ?
>
> Maybe some #includes are centralized to pinctrl-aspeed.h
> I don't know, just make sure you don't have implicit includes.

linux/regmap.h is included in pinctrl-aspeed.h

>
> >
> > +ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂif (regmap_read(map, desc->reg, &val) < 0)
> > +ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂreturn false;
> > +
> > +ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂval &= ~desc->mask;
> > +ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂval |= pattern << __ffs(desc->mask);
> > +
> > +ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂif (regmap_write(map, desc->reg, val) < 0)
> > +ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂreturn false;
> Use:
>
> regmap_update_bits(map,
> ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂdesc->reg,
> ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂdesc->mask,
> ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂpattern << __ffs->desc->mask);
>
> Or something like that instead of reimplementing
> mask-and-set. Regmap already knows how to do the
> business.
>
> (Applied everywhere in the driver where you have a
> mask-and-set like this).

Right, I will clean that up.

>
> The expression core engine is still a complete mystery
> for me, I will just trust you that it works as intended.

Gah! However, thanks!

I will clean up the issues above and re-send.

Cheers,

Andrew

Attachment: signature.asc
Description: This is a digitally signed message part