[PATCH] pinmux: add a driver for the CSR SiRFprimaII pinmux

Linus Walleij linus.walleij at linaro.org
Mon Aug 29 08:15:38 EDT 2011


On Mon, Aug 29, 2011 at 1:58 PM, Barry Song <21cnbao at gmail.com> wrote:
>> > +static const struct sirfsoc_muxmask lcd_16bits_sirfsoc_muxmask[] = {
>> > +       {
>> > +               .group = 3,
>> > +               .mask = 0x7FFFF,
>>
>> These things look a bit magic...
>
> register seems to be magic by itself. this is register set mask of
> group 3 for LCD. group in the structure is also an offset of register
> layout.

No big deal anyway.

What some people like myself do is make #defines for most
things:

#define SIRFSOC_LCD_GROUP_OFFSET 3
#define SIRFSOC_LCD_GROUP_MASK 0x7FFFF
#define SIRFSOC_LCD_ENABLE BIT(5)

sometimes I even define shifts for masks etc.

But a comment inline explaining the magic bits is just as
fine with me.

Yours,
Linus Walleij



More information about the linux-arm-kernel mailing list