public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Adrian Cox <adrian@humboldt.co.uk>
To: Michael Hunold <hunold-ml@web.de>
Cc: Jon Smirl <jonsmirl@gmail.com>, Greg KH <greg@kroah.com>,
	Michael Hunold <hunold@linuxtv.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@osdl.org>, Linus Torvalds <torvalds@osdl.org>,
	sensors@stimpy.netroedge.com
Subject: Re: [PATCH][2.6] Add command function to struct i2c_adapter
Date: Wed, 22 Sep 2004 09:56:06 +0100	[thread overview]
Message-ID: <1095843365.18365.48.camel@localhost> (raw)
In-Reply-To: <41506D78.6030106@web.de>

On Tue, 2004-09-21 at 19:05, Michael Hunold wrote:

> With that addition, it's possible for the i2c core to check if the 
> .class entries of the adapter and the client match. If they don't then 
> there is no need to probe a driver. This will help to keep non-i2c 
> drivers to be probed on dvb i2c busses (and screw them up accidently). 
> Currently it's up to the driver to decide wheter to probe a bus or not.

I've said it before, but:
This is all the wrong way round. I2C probing is a solution for the
problem of finding sensors on a pre-ACPI PC. We'd never have invented it
if all we had was DVB cards and monitor detection. 

These .class entries are workarounds that shouldn't be required. For DVB
cards, TV capture cards, monitor detection, and embedded systems the
required behaviour is normally known in advance. Why should the top
level driver have to use these workarounds to steer the result of
probing when it already has all the information?

My rough proposal would be:
1) One by one, disable probing on these I2C adapters.

2) In the pci probe function of the DVB or capture card, do a sequence
like this:
my_dev_priv->i2c_adapter = i2c_adapter_create(...);
my_dev_priv->tea6415 = tea6415_create(my_dev_priv->i2c_adapter,
                                      &my_tea6415_parameters);
my_dev_priv->saa7111 = saa7111_create(my_dev_priv->i2c_adapter);

3) Then to use the i2c client:
tea6415_switch(my_dev_priv->tea6415, &vm);

This is type safe, it allows out of tree DVB and capture drivers, and it
never ever sends an unexpected event down an I2C bus. It doesn't even
need to change the I2C core very much.

- Adrian Cox
Humboldt Solutions Ltd.



  reply	other threads:[~2004-09-22  8:56 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-20 17:19 [PATCH][2.6] Add command function to struct i2c_adapter Michael Hunold
2004-09-21 15:41 ` Greg KH
2004-09-21 17:10   ` Michael Hunold
2004-09-21 17:39     ` Jon Smirl
2004-09-21 18:05       ` Michael Hunold
2004-09-22  8:56         ` Adrian Cox [this message]
2004-09-22 12:08           ` Jean Delvare
2004-09-22 11:54             ` Adrian Cox
2004-09-22 13:38               ` Jean Delvare
2004-09-22 13:13                 ` Adrian Cox
2004-09-22 15:40                 ` Jon Smirl
2004-09-22 15:56                   ` Adrian Cox
2004-09-22 16:07                     ` Jon Smirl
2004-09-22 16:51                       ` Adrian Cox
2004-09-22 17:17                         ` Jon Smirl
2004-09-22 18:55                         ` Jean Delvare
2004-09-22 18:32                 ` Adrian Cox
2004-09-22 20:04                   ` Mark M. Hoffman
2004-09-23  7:41                   ` Michael Hunold
2004-09-23  7:48                   ` Michael Hunold
2004-09-23  7:09               ` Michael Hunold
2004-09-23 20:18                 ` Adrian Cox
2004-09-21 20:33       ` Jean Delvare
2004-09-21 21:02         ` Jon Smirl
2004-09-24 17:06   ` Michael Hunold
2004-09-24 18:05     ` Jean Delvare
2004-09-24 20:21       ` Michael Hunold
2004-10-01  6:52         ` Greg KH
2004-10-01 12:22           ` Adrian Cox
2004-10-01 13:57             ` Jean Delvare
2004-10-01 23:41             ` Greg KH
     [not found] <41500BED.8090607@linuxtv.org>
2004-09-21 13:28 ` Jean Delvare
2004-09-21 14:38   ` Michael Hunold

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=1095843365.18365.48.camel@localhost \
    --to=adrian@humboldt.co.uk \
    --cc=akpm@osdl.org \
    --cc=greg@kroah.com \
    --cc=hunold-ml@web.de \
    --cc=hunold@linuxtv.org \
    --cc=jonsmirl@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sensors@stimpy.netroedge.com \
    --cc=torvalds@osdl.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