freebsd-dev/share
Andriy Gapon 448897d366 add iic interface to ig4 driver, move isl and cyapa to iicbus
Summary:
The hardware does not expose a classic SMBus interface.
Instead it has a lower level interface that can express a far richer
I2C protocol than what smbus offers.  However, the interface does not
provide a way to explicitly generate the I2C stop and start conditions.
It's only possible to request that the stop condition is generated
after transferring the next byte in either direction.  So, at least
one data byte must always be transferred.
Thus, some I2C sequences are impossible to generate, e.g., an equivalent
of smbus quick command (<start>-<slave addr>-<r/w bit>-<stop>).

At the same time isl(4) and cyapa(4) are moved to iicbus and now they use
iicbus_transfer for communication.  Previously they used smbus_trans()
interface that is not defined by the SMBus protocol and was implemented
only by ig4(4).  In fact, that interface was impossible to implement
for the typical SMBus controllers like intpm(4) or ichsmb(4) where
a type of the SMBus command must be programmed.

The plan is to remove smbus_trans() and all its uses.
As an aside, the smbus_trans() method deviates from the standard,
but perhaps backwards, FreeBSD convention of using 8-bit slave
addresses (shifted by 1 bit to the left).  The method expects
7-bit addresses.

There is a user facing consequence of this change.
A user must now provide device hints for isl and cyapa that specify an iicbus to use
and a slave address on it.
On Chromebook hardware where isl and cyapa devices are commonly found
it is also possible to use a new chromebook_platform(4) driver that
automatically configures isl and cyapa devices.  There is no need to
provide the device hints in that case,

Right now smbus(4) driver tries to discover all slaves on the bus.
That is very dangerous.  Fortunately, the probing code uses smbus_trans()
to do its job, so it is really enabled for ig4 only.
The plan is to remove that auto-probing code and smbus_trans().

Tested by:	grembo, Matthias Apitz <guru@unixarea.de> (w/o
		chromebook_platform)
Discussed with:	grembo, imp
Reviewed by:	wblock (docs)
MFC after:	1 month
Relnotes:	yes
Differential Revision: https://reviews.freebsd.org/D8172
2016-10-30 12:15:33 +00:00
..
colldef Add the forgotten "svn mv" from r302329 2016-07-03 19:31:21 +00:00
ctypedef Posixify the locales name for variants 2016-07-03 18:21:11 +00:00
dict Add META_MODE support. 2015-06-13 19:20:56 +00:00
doc Remove reference to RCS from PSD titles 2016-10-22 23:09:06 +00:00
dtrace Remove redefinitions of some kernel types from mbuf.d. 2016-09-03 20:43:59 +00:00
examples libifconfig: style(9) fixes 2016-09-04 20:55:27 +00:00
i18n Fix building on read-only source trees. 2016-08-22 22:50:58 +00:00
keys META MODE: Update dependencies with 'the-lot' and add missing directories. 2015-12-01 05:23:19 +00:00
man add iic interface to ig4 driver, move isl and cyapa to iicbus 2016-10-30 12:15:33 +00:00
me Add META_MODE support. 2015-06-13 19:20:56 +00:00
misc Import pci_vendors 2016.10.20 2016-10-22 19:36:12 +00:00
mk Revert r307823 (Use upstream suffixes for LLVM IR) for now. It causes a 2016-10-27 18:46:52 +00:00
monetdef Posixify the locales name for variants 2016-07-03 18:21:11 +00:00
msgdef Posixify the locales name for variants 2016-07-03 18:21:11 +00:00
numericdef Posixify the locales name for variants 2016-07-03 18:21:11 +00:00
security META MODE: These need object directories to handle staging. 2015-11-26 01:14:27 +00:00
sendmail Update share/examples/* to properly install /usr/share/examples. 2016-05-10 00:51:50 +00:00
skel Use more appropriate ${SHAREDIR} rather than /usr/share. 2015-10-27 23:35:02 +00:00
snmp Add META_MODE support. 2015-06-13 19:20:56 +00:00
syscons DIRDEPS_BUILD: Run the staged bootstrap-tools version of build-tools. 2016-05-09 22:21:09 +00:00
tabset Add META_MODE support. 2015-06-13 19:20:56 +00:00
termcap Replace ln -s calls with INSTALL_SYMLINK 2015-12-04 03:17:14 +00:00
tests Merge ^/user/ngie/release-pkg-fix-tests to unbreak how test files are installed 2016-05-04 23:20:53 +00:00
timedef Suffix short month names with "월" and replace %b with %_m for date formats. 2016-09-07 23:35:38 +00:00
vt Remove uudecode make rule for vt fonts 2016-02-29 18:35:16 +00:00
zoneinfo Reimplement r301944 using the correct install(1) invocation, which again 2016-06-16 13:34:20 +00:00
Makefile Posixify the locales name for variants 2016-07-03 18:21:11 +00:00
Makefile.inc