[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1337289262.8872.4.camel@joe2Laptop>
Date: Thu, 17 May 2012 14:14:22 -0700
From: Joe Perches <joe@...ches.com>
To: Grant Likely <grant.likely@...retlab.ca>
Cc: Vivien Didelot <vivien.didelot@...oirfairelinux.com>,
x86@...nel.org,
Jerome Oufella <jerome.oufella@...oirfairelinux.com>,
Ingo Molnar <mingo@...hat.com>,
Thomas Gleixner <tglx@...utronix.de>,
"H. Peter Anvin" <hpa@...or.com>, linux-kernel@...r.kernel.org,
lm-sensors@...sensors.org,
Guenter Roeck <guenter.roeck@...csson.com>,
Jean Delvare <khali@...ux-fr.org>,
Linus Walleij <linus.walleij@...ricsson.com>
Subject: Re: [PATCH v6 3/3] gpio: TS-5500 GPIO support
On Thu, 2012-05-17 at 15:06 -0600, Grant Likely wrote:
> On Thu, 12 Apr 2012 20:28:55 -0400, Vivien Didelot <vivien.didelot@...oirfairelinux.com> wrote:
> > From: Jerome Oufella <jerome.oufella@...oirfairelinux.com>
[]
> > +/* "DIO" line to IO port mapping table for line's value */
> > +static const unsigned long line_to_port_map[] = {
> > + 0x7B, 0x7B, 0x7B, 0x7B, 0x7B, 0x7B, 0x7B, 0x7B, /* DIO1_[0-7] */
> > + 0x7C, 0x7C, 0x7C, 0x7C, 0x7C, 0x7C, /* DIO1_[8-13] */
> > + 0x7E, 0x7E, 0x7E, 0x7E, 0x7E, 0x7E, 0x7E, 0x7E, /* DIO2_[0-7] */
> > + 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, /* DIO2_[8-13] */
> > + 0x72, 0x72, 0x72, 0x72, 0x72, 0x72, 0x72, 0x72, /* LCD_[0-7] */
> > + 0x73, 0x73, 0x73 /* LCD_{EN,RS,WR} */
> > +};
There doesn't seem to be a reason to make this a ulong.
uchar would suffice.
> > +
> > +/* "DIO" line to IO port's bit map for line's value */
> > +static const int line_to_bit_map[] = {
> > + 0, 1, 2, 3, 4, 5, 6, 7, /* DIO1_[0-7] */
> > + 0, 1, 2, 3, 4, 5, /* DIO1_[8-13] */
> > + 0, 1, 2, 3, 4, 5, 6, 7, /* DIO2_[0-7] */
> > + 0, 1, 2, 3, 4, 5, /* DIO2_[8-13] */
> > + 0, 1, 2, 3, 4, 5, 6, 7, /* LCD_[0-7] */
> > + 0, 7, 6 /* LCD_{EN,RS,WR} */
Nor this an int, s8 maybe.
> > +/* "DIO" line's direction control mapping table */
> > +static const unsigned long line_to_dir_map[] = {
> > + 0x7A, 0x7A, 0x7A, 0x7A, 0x7A, 0x7A, 0x7A, 0x7A, /* DIO1_[0-7] */
> > + 0x7A, 0x7A, 0x7A, 0x7A, 0, 0, /* DIO1_[8-13] */
> > + 0x7D, 0x7D, 0x7D, 0x7D, 0x7D, 0x7D, 0x7D, 0x7D, /* DIO2_[0-7] */
> > + 0x7D, 0x7D, 0x7D, 0x7D, 0, 0, /* DIO2_[8-13] */
> > + 0x7D, 0x7D, 0x7D, 0x7D, 0x7D, 0x7D, 0x7D, 0x7D, /* LCD_[0-7] */
> > + 0, 0, 0 /* LCD_{EN,RS,WR} */
uchar
> > +/* "DIO" line's direction control bit-mapping table */
> > +static const int line_to_dir_bit_map[] = {
> > + 0, 0, 0, 0, 1, 1, 1, 1, /* DIO1_[0-7] */
> > + 5, 5, 5, 5, -1, -1, /* DIO1_[8-13] */
> > + 0, 0, 0, 0, 1, 1, 1, 1, /* DIO2_[0-7] */
> > + 5, 5, 5, 5, -1, -1, /* DIO2_[8-13] */
> > + 2, 2, 2, 2, 3, 3, 3, 3, /* LCD_[0-7] */
> > + -1, -1, -1 /* LCD_{EN,RS,WR} */
> > +};
s8?
> Splitting up this data into 4 arrays seems odd. I think it would be
> better to define a single table with a tuple for each line.
yup.
--
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