[i2c] [PATCH 1/5] Implement module aliasing for i2c to translate

Jon Smirl jonsmirl at gmail.com
Thu Dec 13 04:16:34 CET 2007


On 12/12/07, David Brownell <david-b at pacbell.net> wrote:
> On Wednesday 12 December 2007, Jon Smirl wrote:
> > On 12/12/07, David Brownell <david-b at pacbell.net> wrote:
> > > But the thing is:  you're adding an I2C-only scheme.  PCI or USB
> > > can't use this code at all.  So why not add this I2C-only scheme
> > > in a way that won't break existing code?
> >
> > PCI/USB use the generic versions of the same code I am using.This is
> > the core code that implements dynamic module loading.
>
> The only generic stuff I know about is the driver model infrastructure,
> You didn't change how that's used, except by adding an I2C-only match
> scheme.
>
>
> > So what do you suggest? I've already spun over ten revisions of these
> > patches and I can't afford to put much more time into this.
>
> I don't object to the device table stuff ... as an *optional* add-on.
> So my comments this time around only relate to reducing the costs of
> allowing that mechanism.  Surely it'd be simple to:
>
>  - add an optional id table to the i2c_driver struct
>  - export it via file2alias for {hot,cold}plugging via modprobe
>  - use it for additional match criteria, when it's available
>  - pass such an id, or NULL, to probe()
>
> Differences from your current patch:  {hot,cold}plugging would work
> > Powerpc needs the ability to map from committee specified names into
> > Linux kernel names. Currently this is handled with a permanently
> > loaded table containing the mappings for all i2c/ALSA drivers used by
> > powerpc Linux. This is table is always growing as new devices are
> > added. A global table like this is a bad idea because any new driver
> > you want to use has to be added to the table - no external i2c modules
> > without modifying the kernel.
>
> That mechanism isn't what I was pushing back on.  The problem I see
> in what you've done is to *require* such mappings even on systems
> that demonstrably don't need them.  Best to minimize driver churn
> in such cases.

i2c has been rolling it own driver system for a long time. By
requiring this change of the few new style drivers (less than 15) it
would bring another part of i2c into alignment with the rest of the
drivers in the kernel. I didn't want to perpetuate the
driver_name/name scheme from the old driver system into the new style
system when there is a standardized alternative available.

Of course if we don't want to fix i2c in general I can make all of
this only compile in on the powerpc.

-- 
Jon Smirl
jonsmirl at gmail.com



More information about the i2c mailing list