summaryrefslogtreecommitdiffstats
path: root/sys/dev/iicbus/iicbus.h
Commit message (Collapse)AuthorAgeFilesLines
* Handle IRQ resources on iicbus and ofw_iicbus.loos2015-05-091-0/+1
| | | | Based on a patch submitted by Michal Meloun <meloun@miracle.cz>.
* Allow i2c bus speed to be configured via hints, FDT data, and sysctl.ian2014-11-181-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current support for controlling i2c bus speed is an inconsistant mess. There are 4 symbolic speed values defined, UNKNOWN, SLOW, FAST, FASTEST. It seems to be universally assumed that SLOW means the standard 100KHz rate from the original spec. Nothing ever calls iicbus_reset() with a speed of FAST, although some drivers would treat it as the 400KHz standard speed. Mostly iicbus_reset() is called with the speed set to UNKNOWN or FASTEST, and there's really no telling what any individual driver will do with those. The speed of an i2c bus is limited by the speed of the slowest device on the bus. This means that generally the bus speed needs to be configured based on the board/system and the components within it. Historically for i2c we've configured with device hints. Newer systems use FDT data and it documents a clock-frequency property for i2c busses. Hobbyists and developers are likely to want on the fly changes. These changes provide all 3 methods, but do not require any existing drivers to change to use the new facilities. This adds an iicbus method, iicbus_get_frequency(dev, speed) that gets the frequency for the requested symbolic speed. If the symbolic speed is SLOW or if there is no speed configured for the bus, the returned value is 100KHz, always. Otherwise, if bus speed is configured by hints, fdt, tunable, or sysctl, that speed is returned. It also adds a helper function, iicbus_init_frequency() that any bus driver subclassed from iicbus can initialize the frequency from some other source of info. Initial driver implementations are provided for Freescale and TI. Differential Revision: https://reviews.freebsd.org/D1174 PR: 195009
* Add a method to iicbus to request IIC_M_NOSTOP behaviour for multibytekib2014-10-271-1/+4
| | | | | | | | | transfers to be default. It simplifies porting code which assumes such settings. Discussed with: avg, llos, nwhitehorn Sponsored by: The FreeBSD Foundation MFC after: 1 week
* Allow the i2c node requirements to be slightly relaxed.adrian2011-12-041-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | These realtek switch PHYs speak a variant of i2c with some slightly modified handling. From the submitter, slightly modified now that some further digging has been done: The I2C framework makes a assumption that the read/not-write bit of the first byte (the address) indicates whether reads or writes are to follow. The RTL8366 family uses the bus: after sending the address+read/not-write byte, two register address bytes are sent, then the 16-bit register value is sent or received. While the register write access can be performed as a 4-byte write, the read access requires the read bit to be set, but the first two bytes for the register address then need to be transmitted. This patch maintains the i2c protocol behaviour but allows it to be relaxed (for these kinds of switch PHYs, and whatever else Realtek may do with this almost-but-not-quite i2c bus) - by setting the "strict" hint to 0. The "strict" hint defaults to 1. Submitted by: Stefan Bethke <stb@lassitu.de>
* Add locking to the core iicbus(4) drivers:jhb2008-08-041-6/+9
| | | | | | | | | | | | | | | | | | - Add an sx lock to the iic(4) driver to serialize open(), close(), read(), and write and to protect sc_addr and sc_count in the softc. - Use cdev->si_drv1 instead of using the minor number of the cdev to lookup the softc via newbus in iic(4). - Store the device_t in the softc to avoid a similar detour via minor numbers in iic(4). - Only add at most one instance of iic(4) and iicsmb(4) to each iicbus(4) instance, and do it in the child driver. - Add a mutex to the iicbus(4) softc to synchronize the request/release bus stuff. - Use __BUS_ACCESSOR() for IICBUS_ACCESSOR() instead of rolling our own. - Add a mutex to the iicsmb(4) softc to protect softc state updated in the interrupt handler. - Remove Giant from all the smbus methods in iicsmb(4) now that all the iicbus(4) backend is locked.
* MFp4: Create an ivar for each iic device on the iicbus. This ivarimp2007-03-231-1/+24
| | | | holds the device's address.
* Allow iic bridges to support a generalized transfer, rather thanimp2006-07-141-0/+3
| | | | | | | | | 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.
* Remove public declarations of variables that were forgotten when they wereobrien2005-08-101-2/+0
| | | | made static.
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Change /dev/smb and /dev/iic interface to allow user programs to interact withnsouch1999-01-091-1/+3
| | | | | | | | | | 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)
* iicbb is generic support for I2C bit-banging.nsouch1998-10-311-2/+1
| | | | Other files: timeout management added to the I2C framework.
* Submitted by: nsouchnsouch1998-09-031-0/+42
Philips I2C bus generic support other new bus architecture.
OpenPOWER on IntegriCloud