https://github.com/torvalds/linux
Revision 907135aaa0cc120a347222c8f274ecc5ca0db641 authored by David Brownell on 15 November 2007, 18:24:01 UTC, committed by Jean Delvare on 15 November 2007, 18:24:01 UTC
This adds some "how does this work" comments to the i2c-dev driver,
plus separators between the three main components:

  - The parallel list of i2c_adapters ("i2c_dev_list"), each of which
    gets a "struct i2c_dev" and a /dev/i2c-X character special file.

  - An i2cdev_driver gets adapter add/remove notifications, which are
    used to maintain that list of adapters.

  - Special file operations, which let userspace talk either directly to
    the adapter (for i2c_msg operations) or through cached addressing info
    using an anonymous i2c_client (never registered anywhere).

Plus there's the usual module load/unload record keeping.

After making sense of this code, I think that the anonymous i2c_client
is pretty shady.  But since it's never registered, using this code with
a system set up for "new style" I2C drivers is no more complicated than
always using the I2C_SLAVE_FORCE ioctl (instead of I2C_SLAVE).

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
1 parent 99fee6d
History
Tip revision: 907135aaa0cc120a347222c8f274ecc5ca0db641 authored by David Brownell on 15 November 2007, 18:24:01 UTC
i2c-dev: "how does it work" comments
Tip revision: 907135a
File Mode Size
Documentation
arch
block
crypto
drivers
fs
include
init
ipc
kernel
lib
mm
net
samples
scripts
security
sound
usr
.gitignore -rw-r--r-- 628 bytes
.mailmap -rw-r--r-- 3.6 KB
COPYING -rw-r--r-- 18.3 KB
CREDITS -rw-r--r-- 90.1 KB
Kbuild -rw-r--r-- 1.6 KB
MAINTAINERS -rw-r--r-- 93.2 KB
Makefile -rw-r--r-- 52.2 KB
README -rw-r--r-- 16.7 KB
REPORTING-BUGS -rw-r--r-- 3.0 KB

README

back to top