public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Grant Likely <grant.likely@secretlab.ca>
Cc: Vivien Didelot <vivien.didelot@savoirfairelinux.com>,
	x86@kernel.org,
	Jerome Oufella <jerome.oufella@savoirfairelinux.com>,
	Ingo Molnar <mingo@redhat.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	"H. Peter Anvin" <hpa@zytor.com>,
	linux-kernel@vger.kernel.org, lm-sensors@lm-sensors.org,
	Guenter Roeck <guenter.roeck@ericsson.com>,
	Jean Delvare <khali@linux-fr.org>,
	Linus Walleij <linus.walleij@stericsson.com>
Subject: Re: [PATCH v6 3/3] gpio: TS-5500 GPIO support
Date: Thu, 17 May 2012 14:14:22 -0700	[thread overview]
Message-ID: <1337289262.8872.4.camel@joe2Laptop> (raw)
In-Reply-To: <20120517210633.400633E0621@localhost>

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@savoirfairelinux.com> wrote:
> > From: Jerome Oufella <jerome.oufella@savoirfairelinux.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.



  reply	other threads:[~2012-05-17 21:14 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-13  0:28 [PATCH v6 0/3] TS-5500 platform support Vivien Didelot
2012-04-13  0:28 ` [PATCH v6 1/3] hwmon: Maxim MAX197 support Vivien Didelot
2012-04-14  0:46   ` Guenter Roeck
2012-04-13  0:28 ` [PATCH v6 2/3] x86/platform: TS-5500 basic platform support Vivien Didelot
2012-04-13 10:37   ` Thomas Gleixner
2012-04-13 20:46     ` Vivien Didelot
2012-04-13  0:28 ` [PATCH v6 3/3] gpio: TS-5500 GPIO support Vivien Didelot
2012-04-13 19:04   ` Mark Brown
2012-05-17 21:06   ` Grant Likely
2012-05-17 21:14     ` Joe Perches [this message]
2012-05-17 21:40     ` Vivien Didelot
2012-05-17 22:59       ` Grant Likely
2012-05-18 14:37         ` Vivien Didelot
2012-05-18 19:59           ` Grant Likely

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1337289262.8872.4.camel@joe2Laptop \
    --to=joe@perches.com \
    --cc=grant.likely@secretlab.ca \
    --cc=guenter.roeck@ericsson.com \
    --cc=hpa@zytor.com \
    --cc=jerome.oufella@savoirfairelinux.com \
    --cc=khali@linux-fr.org \
    --cc=linus.walleij@stericsson.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lm-sensors@lm-sensors.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=vivien.didelot@savoirfairelinux.com \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox