<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/drivers/i2c/i2c-dev.c, branch linux-2.6.26.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.</subtitle>
<id>https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-2.6.26.y</id>
<link rel='self' href='https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-2.6.26.y'/>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/'/>
<updated>2008-10-09T03:22:48Z</updated>
<entry>
<title>i2c-dev: Return correct error code on class_create() failure</title>
<updated>2008-10-09T03:22:48Z</updated>
<author>
<name>Sven Wegener</name>
<email>sven.wegener@stealer.net</email>
</author>
<published>2008-09-28T12:14:21Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=75678e311ea588ef8f0134ba534482d91fc1e0cb'/>
<id>urn:sha1:75678e311ea588ef8f0134ba534482d91fc1e0cb</id>
<content type='text'>
In Linus' tree:
http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commit;h=e74783ec3cb981211689bd2cfd3248f8dc48ec01

We need to convert the error pointer from class_create(), else we'll return the
successful return code from register_chrdev() on failure.

Signed-off-by: Sven Wegener &lt;sven.wegener@stealer.net&gt;
Signed-off-by: Jean Delvare &lt;khali@linux-fr.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>i2c-dev: Split i2cdev_ioctl</title>
<updated>2008-04-22T20:16:47Z</updated>
<author>
<name>Jean Delvare</name>
<email>khali@linux-fr.org</email>
</author>
<published>2008-04-22T20:16:47Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=dba7997a87cd12b815c0d58b2a0522a8bb0cf5ec'/>
<id>urn:sha1:dba7997a87cd12b815c0d58b2a0522a8bb0cf5ec</id>
<content type='text'>
Split the handling of the I2C_RDWR and I2C_SMBUS ioctls to their own
functions. This limits the stack usage, saves one level of indentation
and makes the code more readable.

Signed-off-by: Jean Delvare &lt;khali@linux-fr.org&gt;
</content>
</entry>
<entry>
<title>i2c: Stop using the redundant client list</title>
<updated>2008-01-27T17:14:51Z</updated>
<author>
<name>David Brownell</name>
<email>david-b@pacbell.net</email>
</author>
<published>2008-01-27T17:14:51Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=9b766b814d6a5f31ca1e9da1ebc08164b9352941'/>
<id>urn:sha1:9b766b814d6a5f31ca1e9da1ebc08164b9352941</id>
<content type='text'>
The i2c_adapter.clients list of i2c_client nodes duplicates driver
model state.  This patch starts removing that list, letting us remove
most existing users of those i2c-core lists.

 * The core I2C code now iterates over the driver model's list instead
   of the i2c-internal one in some places where it's safe:
      - Passing a command/ioctl to each client, a mechanims
        used almost exclusively by DVB adapters;
      - Device address checking, in both i2c-core and i2c-dev.

 * Provide i2c_verify_client() to use with driver model iterators.

 * Flag the relevant i2c_adapter and i2c_client fields as deprecated,
   to help prevent new users from appearing.

For the moment the list needs to stick around, since some issues show
up when deleting devices created by legacy I2C drivers.  (They don't
follow standard driver model rules.  Removing those devices can cause
self-deadlocks.)

Signed-off-by: David Brownell &lt;dbrownell@users.sourceforge.net&gt;
Signed-off-by: Jean Delvare &lt;khali@linux-fr.org&gt;
</content>
</entry>
<entry>
<title>i2c: Spelling fixes</title>
<updated>2008-01-14T20:53:30Z</updated>
<author>
<name>Joe Perches</name>
<email>joe@perches.com</email>
</author>
<published>2008-01-14T20:53:30Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=96acafe05fad2c9429ca2c39af47efc5db2d8042'/>
<id>urn:sha1:96acafe05fad2c9429ca2c39af47efc5db2d8042</id>
<content type='text'>
[JD: One more fix in i2c-dev.]

Signed-off-by: Joe Perches &lt;joe@perches.com&gt;
Signed-off-by: Jean Delvare &lt;khali@linux-fr.org&gt;
</content>
</entry>
<entry>
<title>i2c-dev: Unbound new-style i2c clients aren't busy</title>
<updated>2007-11-15T18:24:01Z</updated>
<author>
<name>Jean Delvare</name>
<email>khali@linux-fr.org</email>
</author>
<published>2007-11-15T18:24:01Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=bd4217d8c6ef48425c8d6b28d2e089a83e01af04'/>
<id>urn:sha1:bd4217d8c6ef48425c8d6b28d2e089a83e01af04</id>
<content type='text'>
Let i2c-dev deal properly with new-style i2c clients. Instead of
considering them always busy, it needs to check wether a driver is
bound to them or not.

This is still not completely correct, as the client could become
busy later, but the same problem already existed before new-style
clients were introduced. We'll want to fix it someday.

Signed-off-by: Jean Delvare &lt;khali@linux-fr.org&gt;
Acked-by: David Brownell &lt;dbrownell@users.sourceforge.net&gt;
</content>
</entry>
<entry>
<title>i2c-dev: "how does it work" comments</title>
<updated>2007-11-15T18:24:01Z</updated>
<author>
<name>David Brownell</name>
<email>david-b@pacbell.net</email>
</author>
<published>2007-11-15T18:24:01Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=907135aaa0cc120a347222c8f274ecc5ca0db641'/>
<id>urn:sha1:907135aaa0cc120a347222c8f274ecc5ca0db641</id>
<content type='text'>
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 &lt;dbrownell@users.sourceforge.net&gt;
Signed-off-by: Jean Delvare &lt;khali@linux-fr.org&gt;
</content>
</entry>
<entry>
<title>i2c: Remove i2c_algorithm.algo_control()</title>
<updated>2007-10-13T21:56:32Z</updated>
<author>
<name>David Brownell</name>
<email>david-b@pacbell.net</email>
</author>
<published>2007-10-13T21:56:32Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=53be79593452e568a856f8393985131848d59b72'/>
<id>urn:sha1:53be79593452e568a856f8393985131848d59b72</id>
<content type='text'>
This removes:

 - An effectively unused hook:  i2c_algorithm.algo_control.

 - The i2c_control() call, used only by i2c-dev to call that
   unused hook or set two barely supported adapter params.

   (That param setting moves into i2c-dev.c ... still iffy
   due to lack of locking, but no other changes.)

As shown by diffstat, this is a net code shrink.  It also reduces the
complexity of the I2C adapter and /dev interfaces.

Signed-off-by: David Brownell &lt;dbrownell@users.sourceforge.net&gt;
Signed-off-by: Jean Delvare &lt;khali@linux-fr.org&gt;
</content>
</entry>
<entry>
<title>i2c-dev: Reject I2C_M_RECV_LEN</title>
<updated>2007-10-13T21:56:31Z</updated>
<author>
<name>David Brownell</name>
<email>david-b@pacbell.net</email>
</author>
<published>2007-10-13T21:56:31Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=e265cfa19c1220938de5f0291ed8d549a523de3c'/>
<id>urn:sha1:e265cfa19c1220938de5f0291ed8d549a523de3c</id>
<content type='text'>
The I2C_M_RECV_LEN calling convention for i2c_mesg.flags involves
playing games with reported buffer lengths.  (They start out less
than their actual size, and the length is then modified to reflect
how many bytes were delivered ... which one hopes is less than the
presumed actual size.)  Refuse to play such error prone games across
the boundary between userspace and kernel.

Signed-off-by: David Brownell &lt;dbrownell@users.sourceforge.net&gt;
Signed-off-by: Jean Delvare &lt;khali@linux-fr.org&gt;
</content>
</entry>
<entry>
<title>i2c: Fix the i2c_smbus_read_i2c_block_data() prototype</title>
<updated>2007-07-12T12:12:29Z</updated>
<author>
<name>Jean Delvare</name>
<email>khali@linux-fr.org</email>
</author>
<published>2007-07-12T12:12:29Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=4b2643d7d9bdcd776749e17f73c168ddf02e93cb'/>
<id>urn:sha1:4b2643d7d9bdcd776749e17f73c168ddf02e93cb</id>
<content type='text'>
Let the drivers specify how many bytes they want to read with
i2c_smbus_read_i2c_block_data(). So far, the block count was
hard-coded to I2C_SMBUS_BLOCK_MAX (32), which did not make much sense.
Many driver authors complained about this before, and I believe it's
about time to fix it. Right now, authors have to do technically stupid
things, such as individual byte reads or full-fledged I2C messaging,
to work around the problem. We do not want to encourage that.

I even found that some bus drivers (e.g. i2c-amd8111) already
implemented I2C block read the "right" way, that is, they didn't
follow the old, broken standard. The fact that it was never noticed
before just shows how little i2c_smbus_read_i2c_block_data() was used,
which isn't that surprising given how broken its prototype was so far.

There are some obvious compatiblity considerations:
* This changes the i2c_smbus_read_i2c_block_data() prototype. Users
  outside the kernel tree will notice at compilation time, and will
  have to update their code.
* User-space has access to i2c_smbus_xfer() directly using i2c-dev, so
  the changed expectations would affect tools such as i2cdump. In order
  to preserve binary compatibility, we give I2C_SMBUS_I2C_BLOCK_DATA
  a new numeric value, and define I2C_SMBUS_I2C_BLOCK_BROKEN with the
  old numeric value. When i2c-dev receives a transaction with the
  old value, it can convert it to the new format on the fly.

Signed-off-by: Jean Delvare &lt;khali@linux-fr.org&gt;
</content>
</entry>
<entry>
<title>header cleaning: don't include smp_lock.h when not used</title>
<updated>2007-05-08T18:15:07Z</updated>
<author>
<name>Randy Dunlap</name>
<email>randy.dunlap@oracle.com</email>
</author>
<published>2007-05-08T07:28:08Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=e63340ae6b6205fef26b40a75673d1c9c0c8bb90'/>
<id>urn:sha1:e63340ae6b6205fef26b40a75673d1c9c0c8bb90</id>
<content type='text'>
Remove includes of &lt;linux/smp_lock.h&gt; where it is not used/needed.
Suggested by Al Viro.

Builds cleanly on x86_64, i386, alpha, ia64, powerpc, sparc,
sparc64, and arm (all 59 defconfigs).

Signed-off-by: Randy Dunlap &lt;randy.dunlap@oracle.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
</feed>
