[i2c] Kernel 2.6 reference implementation?

Roger Venable roger38 at mdve.net
Mon Dec 11 20:59:21 CET 2006


Hello!  I need drivers for a few I2C sensor chips I'm using, and I can't
seem to find anything written for them yet, so I'm writing them.

I'm reading the archives of this list, "Linux Device Drivers v3", articles
from Linux Journal, the actual datasheets of the chips, and the source
code of similar chip drivers.  I'm confused about some of the changes from
the 2.4 to 2.6 kernel, /proc versus /sys , where chip registers actually
can be found in /sys, that type of thing.

I have a question for all who are kind enough to respond...

What is the current best example or reference implementation of a modern
Linux kernel 2.6 driver I can use as a skeleton template for my own
drivers?

My first choice would have been the DS1307 RTC, but apparently it has some
trouble lately.  Is there one (that comes to your memory) that got put
into the source tree, didn't really need a lot of argument to tweak, works
now, and never really seemed to have any significant problems?  "The best"
certainly invites argument, but I'm just interested in a few knowledgeable
opinions, not a contest or feud.

I've got a programming background, and I know Linux well enough (usually
compile my own custom kernels) but I've never had much luck writing the
kernel drivers.  The chips I'm interfacing are MEMS sensory inputs (mostly
read with a few control registers) and one of them causes a hardware
interrupt.  I think they could also be controlled just in userspace, but I
do want to learn how an interrupt should be handled.

I'll be happy to share what I write if it's worth the photons needed to
store it.  No answer too simple, please toss in your penny (2 cents is too
expensive for this question).  Thanks in advance for your kind
thoughtfulness and reply.

--Roger
Ann Arbor, Michigan, USA





More information about the i2c mailing list