History log of /freebsd-10-stable/sys/dev/iicbus/iiconf.h
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 294673 24-Jan-2016 ian

MFC r289726:

Add iicbus_transfer_excl(), a helper routine to do an i2c bus transaction
while holding exclusive ownership of the bus. This is the routine most
slave drivers should use unless they have a need to acquire and hold the
bus across a series of related operations that involves multiple transfers.


# 289666 20-Oct-2015 ian

MFC r281828, r289083, r289084, r289091, r289093, r289095, r289097, r289098,
r289104, r289105, r289118: various i2c fixes...

Fix numerous issues in iic(4) and iicbus(4):
--Allow multiple open iic fds by storing addressing state in cdevpriv
--Fix, as much as possible, the baked-in race conditions in the iic
ioctl interface by requesting bus ownership on I2CSTART, releasing it on
I2CSTOP/I2CRSTCARD, and requiring bus ownership by the current cdevpriv
to use the I/O ioctls
--Reduce internal iic buffer size and remove 1K read/write limit by
iteratively calling iicbus_read/iicbus_write
--Eliminate dynamic allocation in I2CWRITE/I2CREAD
--Move handling of I2CRDWR to separate function and improve error handling
--Add new I2CSADDR ioctl to store address in current cdevpriv so that
I2CSTART is not needed for read(2)/write(2) to work
--Redesign iicbus_request_bus() and iicbus_release_bus():
--iicbus_request_bus() no longer falls through if the bus is already
owned by the requesting device. Multiple threads on the same device may
want exclusive access. Also, iicbus_release_bus() was never
device-recursive anyway.
--Previously, if IICBUS_CALLBACK failed in iicbus_release_bus(), but
the following iicbus_poll() call succeeded, IICBUS_CALLBACK would not be
issued again
--Do not hold iicbus mtx during IICBUS_CALLBACK call. There are
several drivers that may sleep in IICBUS_CALLBACK, if IIC_WAIT is passed.
--Do not loop in iicbus_request_bus if IICBUS_CALLBACK returns
EWOULDBLOCK; instead pass that to the caller so that it can retry if so
desired.

Bugfix: Exit the transfer loop if any read or write operation fails. Also,
perform a stop operation on the bus if there was an error, otherwise the
bus will remain hung forever. Consistantly use 'if (error != 0)' style in
the function.

Mostly rewrite the imx i2c driver. This started out as an attempt to fix
one specific problem: the driver didn't check for ACK/NAK after writing a
slave address byte to the bus, and some slaves signal that they are busy
(such as when completing an internal write to flash memory) by sending a
NAK in response to being addressed.

Use IIC_EBUSBSY and IIC_BUSERR status values consistantly across all drivers.
Make it clearer what each one means in the comments that define them.

Add iic2errno(), a helper function to translate IIC_Exxxxx status values to
errno values that are at least vaguely equivelent. Also add a new status
value, IIC_ERESOURCE, to indicate a failure to acquire memory or other
required resources to complete a transaction.

Return only IIC_Exxxx status values from iicbus-layer functions. Most of
these functions are thin wrappers around calling the hardware-layer driver,
but some of them do sanity checks and return an error.

Add a short name, IIC_INTRWAIT, for the common case (IIC_INTR | IIC_WAIT).

Replace a local sx lock that allowed only one client at a time to access
an eeprom device with iicbus_request/release_bus(), which achieves the
same effect and also keeps other i2c slave drivers from clashing on the bus.


# 256281 10-Oct-2013 gjb

Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

# 164901 05-Dec-2006 imp

const poison

submitted by: john wehle


# 164704 27-Nov-2006 imp

Remove unused leftovers.


# 160372 14-Jul-2006 imp

Allow iic bridges to support a generalized transfer, rather than
forcing all transfers to do the start read/write stop by hand. Some
smart bridges prefer this sort of operation, and this allows us to
support their features more easily. When bridges don't support it, we
fall back to using the old-style opertaions. Expand the ioctl
interface to expose this function. Unlike the old-style interface,
this interface is thread safe, even on old bridges.


# 116559 19-Jun-2003 jmg

make iicbb_devclass and iicbb_driver globally visible. This will let
drivers that implemnt the i2c bit banging bus interface not have to
recompile iicbb in order to add an attachment for it.

This will mean the bktr and other definitions can go back to their
respective drivers.


# 93023 23-Mar-2002 nsouch

Major rework of the iicbus/smbus framework:

- VIA chipset SMBus controllers added
- alpm driver updated
- Support for dynamic modules added
- bktr FreeBSD smbus updated but not tested
- cleanup


# 50477 27-Aug-1999 peter

$Id$ -> $FreeBSD$


# 43346 28-Jan-1999 roger

Submitted by: Nicolas Souchu <nsouch@freebsd.org>

Updated to support bt848 driver MSP34xx audio chip.
This adds changes made in 1.3.2.1 and 1.3.2.2 from RELENG_3


# 43301 27-Jan-1999 dillon

Fix warnings in preparation for adding -Wall -Wcast-qual to the
kernel compile


# 42442 09-Jan-1999 nsouch

Change /dev/smb and /dev/iic interface to allow user programs to interact with
devices dynamically. That means,

+ only one /dev/iic or /dev/smb device for each smb/iic bus to access
+ I2C/SMB device address must be given to any ioctl
+ new devices may be plugged and accessed after boot, which was
impossible previously (device addresses were hardcoded into
the kernel)


# 40782 31-Oct-1998 nsouch

iicbb is generic support for I2C bit-banging.

Other files: timeout management added to the I2C framework.


# 38775 03-Sep-1998 nsouch

This commit was generated by cvs2svn to compensate for changes in r38774,
which included commits to RCS files with non-trunk default branches.


# 38774 03-Sep-1998 nsouch

Submitted by: nsouch
Philips I2C bus generic support other new bus architecture.