Home | History | Annotate | Download | only in i2c
History log of /src/sys/dev/i2c/i2c_exec.c
RevisionDateAuthorComments
 1.21  23-Sep-2025  thorpej Move iic_{acquire,release}_bus_lock() into i2c_exec.c from i2c_subr.c
to deal with MODULARization / attribute entanglements.

Fixes e.g. alpha INSTALL kernel build issue after recent i2c work.
 1.20  21-Sep-2025  thorpej Tidy up the i2c subsystem ABI:
- Remove unused structures and deprecated fields (ia_prop, ia_cookie,
ia_cookietype).
- Normalize the "compatible" list; we get it as a strlist, don't bother
converting to an array when we can use the strlist as-is. (This is
invisible to drivers using the API correctly, but it does change
the i2c_attach_args).
- Add a "channel" field to i2c_tag_t, for use by controllers with
built-in i2c muxes or discrete i2c muxes.

Bienvenido, NetBSD 11.99.3.
 1.19  20-Sep-2025  thorpej Put the "acquire i2c bus lock" logic (sleep vs try) into a helper function
so it can shared.
 1.18  24-Oct-2022  riastradh i2c(9): Nix smbus intr API.

It was introduced in 2007 for some Xbox thing which was removed in
2011. The API and the threads it spawned have been sitting around
idly for over a decade serving no purpose -- sometimes causing kernel
lock spinouts in the event of panic.

Add ic_tag_private to obviate need for future ABI changes. Not
currently used, but we can privately allocate memory in iic_tag_init
for the purpose later if need be without changing ABI.

XXX kernel revbump -- changes struct i2c_controller
 1.17  12-Oct-2021  andvar fix various typos, mainly in comments.
 1.16  19-Apr-2020  thorpej In iic_acquire_bus(), unlock the bus lock if the back-end returns an
error from its acquire-bus function.
 1.15  02-Jan-2020  thorpej branches: 1.15.6;
Also force I2C_F_POLL if shutting_down.
 1.14  23-Dec-2019  thorpej Disable the not-in-interrupt assertions for now; more work needs to be
done in several i2c client drivers.
 1.13  22-Dec-2019  thorpej Cleanup i2c bus acquire / release, centralizing all of the logic into
iic_acquire_bus() / iic_release_bus(). "acquire" and "release" hooks
no longer need to be provided by back-end controller drivers (only if
they need special handling, e.g. powering on the i2c controller).
This results in the removal of a bunch of rendundant code from each
back-end controller driver.

Assert that we are not in hard interrupt context in iic_acquire_bus(),
iic_exec(), and iic_release_bus().
 1.12  25-Jul-2019  thorpej If cold, automagically set I2C_F_POLL.
 1.11  10-Dec-2018  thorpej Make i2c_acquire_bus() / i2c_release_bus() real symbols.
 1.10  07-Mar-2015  jmcneill branches: 1.10.16; 1.10.18;
i2c devices don't actually have a dependency on "iic" (the bus driver)
but on "i2cexec". Create an i2cexec module (i2c_exec.c) to mirror the
dependencies in files.i2c and switch device drivers to depend on "i2cexec"
module instead.

A kernel with a USB stack and no I2C controller / bus attachment would spit
out a bunch of "WARNING: module error: can't find builtin dependency `iic'"
messages at boot. This change solves that problem.
 1.9  12-Sep-2013  martin branches: 1.9.4; 1.9.6;
Fix evil "sizeof(void*)" botch
 1.8  22-Apr-2012  pgoyette branches: 1.8.2; 1.8.4;
Identify SMBus block-mode operations.

XXX Nothing in the kernel issues block-mode commands, and each i2c bus
XXX driver needs its own support for the block-mode operations.
 1.7  03-Feb-2009  pgoyette branches: 1.7.14; 1.7.18;
Handle i2c quick_read/quick_write bus protocol in the generic i2c_exec()
routine, since we have already have the iic_smbus_* interfaces.

NOTE: i2c controllers that provide their own i2c_exec() routine also need
to be modified. I'll be committing most of these shortly.
 1.6  11-Dec-2007  lukem branches: 1.6.12; 1.6.20;
use __KERNEL_RCSID()
 1.5  27-Mar-2006  jmcneill branches: 1.5.34; 1.5.44; 1.5.46; 1.5.48;
Implement a handful of missing smbus protocol functions. Proposed on
tech-kern: http://mail-index.netbsd.org/tech-kern/2006/03/16/0029.html
 1.4  11-Dec-2005  christos branches: 1.4.4; 1.4.6; 1.4.8; 1.4.10; 1.4.12;
merge ktrace-lwp.
 1.3  29-Oct-2003  mycroft branches: 1.3.4; 1.3.18;
Remove bogus initializer, and instead fix an =/== typo.
 1.2  25-Oct-2003  christos Don't return random errors.
 1.1  30-Sep-2003  thorpej New generic I2C framework. Supports bit-bang and "intelligent" I2C
interface controllers (of varying intelligence levels).

Contributed by Wasabi Systems, Inc. Primarily written by Steve Woodford,
with some modification by me.
 1.3.18.2  21-Jan-2008  yamt sync with head
 1.3.18.1  21-Jun-2006  yamt sync with head.
 1.3.4.4  21-Sep-2004  skrll Fix the sync with head I botched.
 1.3.4.3  18-Sep-2004  skrll Sync with HEAD.
 1.3.4.2  03-Aug-2004  skrll Sync with HEAD
 1.3.4.1  29-Oct-2003  skrll file i2c_exec.c was added on branch ktrace-lwp on 2004-08-03 10:46:06 +0000
 1.4.12.1  28-Mar-2006  tron Merge 2006-03-28 NetBSD-current into the "peter-altq" branch.
 1.4.10.1  19-Apr-2006  elad sync with head.
 1.4.8.1  01-Apr-2006  yamt sync with head.
 1.4.6.1  22-Apr-2006  simonb Sync with head.
 1.4.4.1  09-Sep-2006  rpaulo sync with head
 1.5.48.1  13-Dec-2007  bouyer Sync with HEAD
 1.5.46.1  11-Dec-2007  yamt sync with head.
 1.5.44.1  26-Dec-2007  ad Sync with head.
 1.5.34.1  09-Jan-2008  matt sync with HEAD
 1.6.20.1  03-Mar-2009  skrll Sync with HEAD.
 1.6.12.1  04-May-2009  yamt sync with head.
 1.7.18.1  29-Apr-2012  mrg sync to latest -current.
 1.7.14.2  22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.7.14.1  23-May-2012  yamt sync with head.
 1.8.4.1  18-May-2014  rmind sync with head
 1.8.2.2  03-Dec-2017  jdolecek update from HEAD
 1.8.2.1  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.9.6.1  06-Apr-2015  skrll Sync with HEAD
 1.9.4.1  21-Mar-2015  snj Pull up following revision(s) (requested by jmcneill in ticket #634):
distrib/sets/lists/modules/md.amd64: revision 1.51
distrib/sets/lists/modules/md.evbppc.powerpc: revision 1.5
distrib/sets/lists/modules/md.i386: revision 1.55
distrib/sets/lists/modules/mi: revision 1.71
sys/dev/i2c/au8522.c: revision 1.7
sys/dev/i2c/cx24227.c: revision 1.7
sys/dev/i2c/dbcool.c: revision 1.42
sys/dev/i2c/hytp14.c: revision 1.3
sys/dev/i2c/i2c_exec.c: revision 1.10
sys/dev/i2c/lg3303.c: revision 1.9
sys/dev/i2c/mt2131.c: revision 1.5
sys/dev/i2c/nxt2k.c: revision 1.4
sys/dev/i2c/sdtemp.c: revision 1.24
sys/dev/i2c/spdmem_i2c.c: revision 1.10
sys/dev/i2c/tvpll.c: revision 1.6
sys/dev/i2c/xc3028.c: revision 1.7
sys/dev/i2c/xc5k.c: revision 1.6
sys/dev/i2c/zl10353.c: revision 1.4
sys/modules/Makefile: revision 1.143
sys/modules/i2cexec/Makefile: revision 1.1
i2c devices don't actually have a dependency on "iic" (the bus driver)
but on "i2cexec". Create an i2cexec module (i2c_exec.c) to mirror the
dependencies in files.i2c and switch device drivers to depend on "i2cexec"
module instead.
A kernel with a USB stack and no I2C controller / bus attachment would spit
out a bunch of "WARNING: module error: can't find builtin dependency `iic'"
messages at boot. This change solves that problem.
 1.10.18.3  21-Apr-2020  martin Sync with HEAD
 1.10.18.2  13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.10.18.1  10-Jun-2019  christos Sync with HEAD
 1.10.16.1  26-Dec-2018  pgoyette Sync with HEAD, resolve a few conflicts
 1.15.6.1  20-Apr-2020  bouyer Sync with HEAD

RSS XML Feed