From: Tony Lindgren <tony@atomide.com>
To: Ben Dooks <ben-linux@fluff.org>
Cc: linux-i2c@vger.kernel.org, Paul Walmsley <paul@pwsan.com>,
linux-omap@vger.kernel.org
Subject: Re: [PATCH 10/12] i2c-omap: convert 'rev1' flag to generic 'rev' u8
Date: Tue, 16 Dec 2008 13:34:46 -0800 [thread overview]
Message-ID: <20081216213443.GA6746@atomide.com> (raw)
In-Reply-To: <20081216220700.GF8032@fluff.org.uk>
* Ben Dooks <ben-linux@fluff.org> [081216 14:07]:
> On Tue, Dec 16, 2008 at 09:59:59PM +0000, Ben Dooks wrote:
> > On Fri, Nov 28, 2008 at 05:34:57PM -0800, Tony Lindgren wrote:
> > > From: Paul Walmsley <paul@pwsan.com>
> > >
> > > i2c-omap discriminates only between "revision 1" or "greater than
> > > revision 1." A following patch introduces code that must also
> > > discriminate between rev2.x, rev3.6, and rev3.12 controllers. Support
> > > this by storing the full revision data from the I2C_REV register, rather
> > > than just a single bit.
> > >
> > > The revision definitions may need to be extended for other ES levels
> > > that aren't currently available here. rev3.6 is what's present on the
> > > 2430SDP here (unknown ES revision); rev3.12 is used on the 3430ES2
> > > here.
> > >
> > > Signed-off-by: Paul Walmsley <paul@pwsan.com>
> > > Signed-off-by: Tony Lindgren <tony@atomide.com>
> > > ---
> > > drivers/i2c/busses/i2c-omap.c | 25 ++++++++++++++++---------
> > > 1 files changed, 16 insertions(+), 9 deletions(-)
> > >
> > > diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
> > > index 40a1e4b..3ac510d 100644
> > > --- a/drivers/i2c/busses/i2c-omap.c
> > > +++ b/drivers/i2c/busses/i2c-omap.c
> > > @@ -38,6 +38,13 @@
> > > #include <linux/clk.h>
> > > #include <linux/io.h>
> > >
> > > +/* I2C controller revisions */
> > > +#define OMAP_I2C_REV_2 0x20
> > > +
> > > +/* I2C controller revisions present on specific hardware */
> > > +#define OMAP_I2C_REV_ON_2430 0x36
> > > +#define OMAP_I2C_REV_ON_3430 0x3C
> > > +
> > > /* timeout waiting for the controller to respond */
> > > #define OMAP_I2C_TIMEOUT (msecs_to_jiffies(1000))
> > >
> > > @@ -139,7 +146,7 @@ struct omap_i2c_dev {
> > > * fifo_size==0 implies no fifo
> > > * if set, should be trsh+1
> > > */
> > > - unsigned rev1:1;
> > > + u8 rev;
> > > unsigned b_hw:1; /* bad h/w fixes */
> > > unsigned idle:1;
> > > u16 iestate; /* Saved interrupt register */
> > > @@ -209,7 +216,7 @@ static void omap_i2c_idle(struct omap_i2c_dev *dev)
> > >
> > > dev->iestate = omap_i2c_read_reg(dev, OMAP_I2C_IE_REG);
> > > omap_i2c_write_reg(dev, OMAP_I2C_IE_REG, 0);
> > > - if (dev->rev1) {
> > > + if (dev->rev < OMAP_I2C_REV_2) {
> > > iv = omap_i2c_read_reg(dev, OMAP_I2C_IV_REG); /* Read clears */
> > > } else {
> > > omap_i2c_write_reg(dev, OMAP_I2C_STAT_REG, dev->iestate);
> > > @@ -231,7 +238,7 @@ static int omap_i2c_init(struct omap_i2c_dev *dev)
> > > unsigned long timeout;
> > > unsigned long internal_clk = 0;
> > >
> > > - if (!dev->rev1) {
> > > + if (dev->rev >= OMAP_I2C_REV_2) {
> > > omap_i2c_write_reg(dev, OMAP_I2C_SYSC_REG, OMAP_I2C_SYSC_SRST);
> > > /* For some reason we need to set the EN bit before the
> > > * reset done bit gets set. */
> > > @@ -710,6 +717,7 @@ omap_i2c_probe(struct platform_device *pdev)
> > > struct omap_i2c_dev *dev;
> > > struct i2c_adapter *adap;
> > > struct resource *mem, *irq, *ioarea;
> > > + void *isr;
> >
> > There is a proper definition for the function type in
> > <linux/interrupt.h>
>
> I'm feeling a bit of Christmas spirit finally, will pull these and
> add a fix myself for this.
Thanks, I'll owe you a holiday ale for that :)
Tony
next prev parent reply other threads:[~2008-12-16 22:31 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-29 1:33 [PATCH 00/12] Updates for i2c-omap for 2.6.29 merge window, v5 Tony Lindgren
2008-11-29 1:33 ` [PATCH 01/12] i2c-omap: Do not use interruptible wait call in omap_i2c_xfer_msg Tony Lindgren
2008-11-29 1:34 ` [PATCH 02/12] i2c-omap: Close suspected race between omap_i2c_idle() and omap_i2c_isr() Tony Lindgren
2008-11-29 1:34 ` [PATCH 03/12] i2c-omap: Add high-speed support to omap-i2c Tony Lindgren
2008-11-29 1:34 ` [PATCH 04/12] i2c-omap: FIFO handling support and broken hw workaround for i2c-omap Tony Lindgren
2008-11-29 1:34 ` [PATCH 05/12] i2c-omap: Add support for omap34xx Tony Lindgren
2008-11-29 1:34 ` [PATCH 06/12] i2c-omap: Mark init-only functions as __init Tony Lindgren
2008-11-29 1:34 ` [PATCH 07/12] i2c-omap: Don't compile in OMAP15xx I2C ISR for non-OMAP15xx builds Tony Lindgren
2008-11-29 1:34 ` [PATCH 08/12] i2c-omap: Clean-up i2c-omap Tony Lindgren
2008-11-29 1:34 ` [PATCH 09/12] i2c-omap: fix I2C timeouts due to recursive omap_i2c_{un, }idle() Tony Lindgren
2008-11-29 1:34 ` [PATCH 10/12] i2c-omap: convert 'rev1' flag to generic 'rev' u8 Tony Lindgren
2008-12-16 21:59 ` Ben Dooks
2008-12-16 22:07 ` Ben Dooks
2008-12-16 21:34 ` Tony Lindgren [this message]
2008-11-29 1:35 ` [PATCH 11/12] i2c-omap: reprogram OCP_SYSCONFIG register after reset Tony Lindgren
2008-11-29 1:35 ` [PATCH 12/12] i2c-omap: Enable I2C wakeups for 34xx Tony Lindgren
2008-11-29 1:56 ` git-pull request for i2c-omap updates (Re: [PATCH 00/12] Updates for i2c-omap for 2.6.29 merge window, v5) Tony Lindgren
[not found] ` <20081129015611.GK6640-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2008-12-05 0:25 ` Ben Dooks
-- strict thread matches above, loose matches on Subject: below --
2008-11-29 1:28 [PATCH 00/12] Updates for i2c-omap for 2.6.29 merge window, v4 Tony Lindgren
2008-11-29 1:29 ` [PATCH 10/12] i2c-omap: convert 'rev1' flag to generic 'rev' u8 Tony Lindgren
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=20081216213443.GA6746@atomide.com \
--to=tony@atomide.com \
--cc=ben-linux@fluff.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=paul@pwsan.com \
/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