public inbox for linuxppc-dev@ozlabs.org
 help / color / mirror / Atom feed
From: Jean Delvare <khali@linux-fr.org>
To: "Jon Smirl" <jonsmirl@gmail.com>
Cc: linuxppc-dev@ozlabs.org, Tjernlund <tjernlund@tjernlund.se>,
	i2c@lm-sensors.org
Subject: Re: [RFC] Rework of i2c-mpc.c - Freescale i2c driver
Date: Tue, 6 Nov 2007 19:17:54 +0100	[thread overview]
Message-ID: <20071106191754.6ad2569c@hyperion.delvare> (raw)
In-Reply-To: <9e4733910711060945t35284f8atb36c0d6ed35abf71@mail.gmail.com>

Hi Jon,

On Tue, 6 Nov 2007 12:45:24 -0500, Jon Smirl wrote:
> On 11/6/07, Jean Delvare wrote:
> > I agree with Scott here, I don't want to fork the drivers. It is
> > possible (and easy) to support both methods in the same module, let's
> > just to that. See for example David Brownell's work on the lm75 driver:
> > http://lists.lm-sensors.org/pipermail/lm-sensors/2007-September/021270.html
> 
> I agree that it is easy to make make a chip driver support both new
> and old style.
> 
> But when I call i2c_new_device() on an old style chip driver it exits
> saying that it doesn't work for the old style adapters. Checks for
> is_newstyle_driver() are in the i2c_new_device code. That's what
> caused me to rewrite the rtc-pcf8563 driver for the new style. This
> probably related to probing, I have to pass the address in struct
> i2c_board_info. The old style drivers don't support having their
> address passed in.

I know that. The trick is to register two struct i2c_driver (again see
the lm75 example), one old-style, one new-style. I agree it's not very
elegant, but it works. Hopefully we can get rid of the old-style one
after some time, and it allows for a smooth transition.

> This may be complicated by the fact that the rtc drivers I'm working
> on are not probable. That's why I want to add device tree support for
> them.
> 
> If this is going to work on an old style driver, how do I get the
> address to it?

Old-style drivers probe for supported chips on all possible addresses
(for the chip in question). If the chip can't be probed, then module
parameters must be used. That's not terribly convenient, and new-style
drivers are much preferred in this case.

-- 
Jean Delvare

  reply	other threads:[~2007-11-06 18:17 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-05 15:14 [RFC] Rework of i2c-mpc.c - Freescale i2c driver Jon Smirl
2007-11-05 19:22 ` Matt Sealey
2007-11-05 19:51   ` Jon Smirl
2007-11-05 19:55     ` Scott Wood
2007-11-05 20:04       ` Jon Smirl
2007-11-05 20:06         ` Scott Wood
2007-11-05 20:11   ` Grant Likely
2007-11-05 19:43 ` Scott Wood
2007-11-05 20:30   ` Jon Smirl
2007-11-05 20:51     ` Scott Wood
2007-11-05 21:52       ` Matt Sealey
2007-11-05 21:55         ` Scott Wood
2007-11-05 23:03           ` Grant Likely
2007-11-06 17:32         ` Jean Delvare
2007-11-06 18:53           ` Matt Sealey
2007-11-06 20:31             ` Jean Delvare
2007-11-06 21:06               ` Matt Sealey
2007-11-05 22:46       ` Grant Likely
2007-11-06  0:33         ` Jon Smirl
2007-11-06 22:20         ` David Gibson
2007-11-06  0:41       ` Jon Smirl
2007-11-06 17:02         ` Scott Wood
2007-11-06  4:25       ` Jon Smirl
2007-11-06  4:40         ` Stephen Rothwell
2007-11-06 19:02           ` Jon Smirl
2007-11-06 22:22             ` David Gibson
2007-11-06 17:29       ` Jean Delvare
2007-11-06 17:36         ` Scott Wood
2007-11-06 18:10           ` Jean Delvare
2007-11-06 18:26             ` Grant Likely
2007-11-06 18:26               ` Grant Likely
2007-11-06 19:34               ` Jean Delvare
2007-11-06 18:29             ` Scott Wood
2007-11-06 17:45         ` Jon Smirl
2007-11-06 18:17           ` Jean Delvare [this message]
2007-11-06 19:07             ` Jon Smirl
2007-11-06  1:34   ` Jon Smirl
2007-11-06  2:28     ` Stephen Rothwell
2007-11-05 20:03 ` Grant Likely
2007-11-05 20:41 ` Jon Smirl

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=20071106191754.6ad2569c@hyperion.delvare \
    --to=khali@linux-fr.org \
    --cc=i2c@lm-sensors.org \
    --cc=jonsmirl@gmail.com \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=tjernlund@tjernlund.se \
    /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