From: Ben Dooks <ben-i2c-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org>
To: Alan Cox <alan-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
Cc: Ben Dooks <ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org>,
linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [CORRECTED] I2C driver supporting Moorestown and Medfield platform
Date: Tue, 31 Aug 2010 23:44:45 +0100 [thread overview]
Message-ID: <20100831224445.GD24761@trinity.fluff.org> (raw)
In-Reply-To: <20100809132345.44fdbaea-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
On Mon, Aug 09, 2010 at 01:23:45PM +0100, Alan Cox wrote:
> > I would much prefer this to be called i2c-moorsetown, we have modern
> > systems which can handle >8 character names.
>
> Moorestown. Everything else in the kernel uses 'mrst' so this would
> make the driver differ from the rest of the tree. I don't care too much
> what its called. Given its now for Medfield etc as well it probably
> should be i2c_intel_mid to match the rest of the kernel
Ok.
> > Hmm, if this is a synopsys block, then is it a standard one and if so
> > can we get some standard support?
>
> See other reply on this one.
Annoying, I'd much rather have a core driver with some bus support
added as needed.
> > > + if ((p1->flags ^ p2->flags) & I2C_M_TEN)
> > > + return 1;
> > > + return 0;
> > > +}
> >
> > would have been better to return bool.
>
> Can do but most of the kernel never uses bool so again it would be a
> quirky style. If its preferred i2c style no problem.
I thought it was introduced for this sort of thing... I've been using
it in all my new driver work.
>
> > > + for (i = 0; i < length; i++)
> > > + mrst_i2c_write(i2c->base + IC_DATA_CMD,
> > > + (uint16_t)(*(buf + i)));
> >
> > you say length in bytes, but write u16?
> > also, would be neater to have a u16 *buf?
>
> Ermm no - that would be most peculiar as you'd then only send every
> alternate byte of data. Then again the cast ought to be implied by the
> types of mrst_i2c_write - will review
This code is rather easy to mis-understand, how about making it
easier to read, ie:
(uint16_t)buf[i]
--
Ben
Q: What's a light-year?
A: One-third less calories than a regular year.
prev parent reply other threads:[~2010-08-31 22:44 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-03 14:34 [CORRECTED] I2C driver supporting Moorestown and Medfield platform Alan Cox
[not found] ` <20100803143431.23655.31975.stgit-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2010-08-09 5:52 ` Shinya Kuribayashi
[not found] ` <4C5F97AC.1020509-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org>
2010-08-09 11:07 ` Alan Cox
[not found] ` <20100809120743.05e22ef4-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2010-08-09 23:58 ` Shinya Kuribayashi
2010-08-09 10:59 ` Ben Dooks
[not found] ` <4C5FDFA9.60703-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org>
2010-08-09 12:23 ` Alan Cox
[not found] ` <20100809132345.44fdbaea-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2010-08-31 22:44 ` Ben Dooks [this message]
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=20100831224445.GD24761@trinity.fluff.org \
--to=ben-i2c-elnmno+kys3ytjvyw6ydsg@public.gmane.org \
--cc=alan-VuQAYsv1563Yd54FQh9/CA@public.gmane.org \
--cc=ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org \
--cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.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;
as well as URLs for NNTP newsgroup(s).