Subject: MI I^2C drivers
To: None <>
From: Ben Harris <>
List: tech-kern
Date: 07/26/2000 18:01:05
[ Prompted by pk's TOD clock interface, and the fact the clock Acorn
  systems use attaches to an I^2C bus, so I want an MI I^2C infrastructure
  for it. ]

Currently, there seem to be at least three sets of infrastructure in the
kernel for handling Philips' I^2C bus.  There's the MI stuff in
sys/dev/i2c, and MD stuff in sys/arch/arm26/ioc/{iic,rtc}.c and
sys/arch/arm32/dev/{iic,rtc}.c.  This is clearly silly.

The reason I didn't use the MI stuff for arm26 is that it doesn't present
a real bus -- instead, it provides an attribute to attach to a
device.  This seems fine if it's being used within one device, but it's
less than optimal if we want to have devices (from the NetBSD point of
view) attached to an I^2C bus, which I would.

On the other hand, a real bus is likely to be awkward if you _do_ want to
treat it as part of a device, since you don't want your I^2C EEPROM being
a device in its own right (do you?).

Any thoughts from the rest of the world on this kind of thing?  If not,
I'll start hacking and see what I come up with.

Ben Harris                                                   <>
Portmaster, NetBSD/arm26               <URL:>