summaryrefslogtreecommitdiff
path: root/sys/dev/i2c
AgeCommit message (Collapse)Author
2023-05-10ims(4): Use config_detach_children.riastradh
2023-01-24Don't panic with invalid user data, just return an error.mlelstv
2023-01-23fix typos in comments.andvar
2022-12-03Split the BMP280 / BME280 driver into common code and create I2C andbrad
SPI attachments.
2022-12-01Use a better choice for the print format string.brad
2022-12-01Correct the humidity conversion for the BME280brad
2022-11-24Mention where in the datasheet the compensation algorithms came from.brad
2022-11-23Use kpause() instead of delay() in the measurement cycle. Try andbrad
derive the proper wait delay for the measurement based upon the over sampling setting and allow the wait factor multiplier to be adjusted.
2022-11-22Read the datasheet more closely and put in some delays. The chip willbrad
just return junk if the wait is not long enough to allow a measurement to start.
2022-11-21A driver for the Bosch BMP280 / BME280 temperature, humidity andbrad
atmospheric pressure sensor. This is an inexpensive to moderately expensive chip available from a large number of places. The driver supports all aspects of the two chips, except for the repeating read mode which would allow for sub-second queries, such as fall detection or perhaps even as an altimeter. This driver also only supports the I2C interface and not the SPI interface. The BME280, the one with humidity, is not fully tested at this point, awaiting upon a breakout board and may not show proper humidity.
2022-11-17A driver for the Aosong AHT20 temperature and humidity sensor. Whilebrad
slow for an I2C sensor it is inexpensive and should work well enough in most indoor conditions. All features of the chip are supported.
2022-10-30Add GPIO support.jmcneill
PR# kern/57030
2022-10-24iic(4): Use config_detach_children to simplify.riastradh
2022-10-24i2c(9): Nix smbus intr API.riastradh
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
2022-09-25s/inerrupt/interrupt/ and s/intrrupt/interrupt/ in comments.andvar
2022-07-23If there is a compat string list, parenthetically print the first onethorpej
in iic_print_direct(). (From thorpej-i2c-spi-conf2 branch.)
2022-07-22Normalize how motoi2c controllers are attached.thorpej
2022-07-20Improve error reporting.thorpej
2022-07-20drm: Use CPPFLAGS.drmkms in all local drm drivers too.riastradh
This way we don't pollute the NetBSD kernel namespace with all the Linux compat shim definitions needed to build drm, except for the local drm drivers that need the API.
2022-07-02s/tempurature/temperature/andvar
2022-06-29Bump max transaction size from 32 Bytes to 4kB.mlelstv
2022-06-29Allocate data buffer instead of using the stack.mlelstv
2022-05-28fix various typos in comments.andvar
2022-05-28fix various typos, mainly in comments.andvar
2022-05-24fix various typos in comments, docs and log messages.andvar
2022-05-22fix various small typos, mainly in comments.andvar
2022-04-27After testing with a couple of more samples of the SHT3x sensor chipbrad
it was found that the datasheet does not appear to provide enough information to make use of the alarm and interrupt function work. So actually remove the dead code that was an attempt at making that all work. Adjust the man page to mention that this.
2022-04-01Split i2c_subr.c into a separate module rather than including it inpgoyette
the iic module. There are valid configurations where i2c_subr code can be both built-in and part of a loaded module (eg, piixpm is in the kernel, but the iic module is loaded later). This causes the in-kernel linker to detect a duplicate symbol.
2022-03-31For device modules that provide both auto-config and /dev/xxxpgoyette
interfaces, make sure that initialization and destruction follow the proper sequence. This is triggered by the recent changes to the devsw stuff; per riastradh@ the required call sequence is: devsw_attach() config_init_component() or config_cf*_attach() ... config_fini_component() or config_cf*_detach() devsw_detach() While here, add a few missing calls to some of the detach routines. Testing of these changes has been limited to: 1. compile without build break 2. no related test failures from atf 3. modload/modunload work as well as before. No functional device testing done, since I don't have any of these devices. Let me know of any damage I might cause here! XXX Some of the modules affected by this commit are already XXX broken; see kern/56772. This commit does not break any additional modules (as far as I know).
2022-03-30These modules need to depend on iic, not just on i2cexec. (They willpgoyette
still recursively get i2cexec since the iic depends on it.) Partial fix for kern/56772
2022-03-28driver(9): devsw_detach never fails. Make it return void.riastradh
Prune a whole lotta dead branches as a result of this. (Some logic calling this is also wrong for other reasons; devsw_detach is final -- you should never have any reason to decide to roll it back. To be cleaned up in subsequent commits...) XXX kernel ABI change to devsw_detach signature requires bump
2022-02-12sys: Fix various abuse of struct device internals.riastradh
Will help to make struct device opaque later.
2022-01-24remove double "with" in comments and usage text. Also fix one typo.andvar
2022-01-22Change the devhandle_from_*() functions to also take a "super handle",thorpej
from which the newly created handle will inherit it's implementation. The root implementation for a new handle type is used if an invalid "super handle" is passed.
2022-01-21Replace devhandle_invalidate(), which invalidates a devhandle, withthorpej
devhandle_invalid(), which returns an invalid devhandle.
2022-01-17G/C mcpgpio_softc::sc_phandle; nothing is using it.thorpej
2022-01-17Minimal hack to pass child devices a devhandle created from the OFthorpej
or ACPI "cookie". Temporary measure until the i2c autoconfiguration overhaul is merged (which fixes this in a more generic way).
2022-01-17Re-factor and overhaul the "mcp23s17gpio" driver as "mcpgpio", andthorpej
add support for 8-bit and I2C variants of the chip: - MCP23008 / MCP23S08: 8-bit (I2C / SPI) - MCP23017 / MCP23S17: 16-bit (I2C / SPI) - MCP23018 / MCP23S18: 16-bit (I2C / SPI), open-drain outputs The MCP23x17 and MCP23x18 are essentially identical, software-wise; we merely report different GPIO pin capabilities (no push-pull output for MCP23x18). Also, remove the tri-state capability that was previously advertised by the old version of this driver; these chips have no way to put the pin into a HI-Z mode. All 3 I2C versions are supported, but the SPI front-end still only supports the MCP23S17 for now (SPI autoconfiguration needs an overhaul). mcp23s17gpio(4) remains present as a link to the new mcpgpio(4) man page. XXX Still to-do: FDT integration, interrupt suppoort.
2022-01-15Trailing whitespaceskrll
2022-01-14ihidev(4): Prohibit closing an unopened ihidev.riastradh
2022-01-14ihidev(4): Avoid reference count overflow.riastradh
2022-01-14ims(4): Sprinkle KERNEL_LOCKED_P assertions.riastradh
Access to the softc and hidms state is currently kernel-locked.
2022-01-14ihidev(4): Take the lock for ihidev_open, ihidev_close.riastradh
Need this to serialize access to sc_state, sc_refcnt. XXX Should harmonize this with uhidev(4) and tighten assertions.
2022-01-14ihidev(4): Check kmem_alloc(..., KM_NOSLEEP) for failure.riastradh
2022-01-14ihidev(4): Allocate report buffer with KM_SLEEP.riastradh
Limited to 64k and only happens on attach anyway. Let's not leave a rake to trip on here.
2022-01-14ihidev(4): Fix locking and interrupt handler.riastradh
- Can't run iic_exec in softint because it does cv_wait, at least on some i2c controllers -- defer to workqueue instead. - Fix violations of locking rules: . Do not take a lock at higher IPL than it is defined at! . Do not sleep under a lock! . Definitely do not sleep under a spin lock! In this case, sc_intr_lock was defined at IPL_VM but used at IPL_TTY, and i2c transactions -- possibly causing sleep for cv_wait -- were issued under it. But in this case, the interrupt handler needs only a single bit to mark whether the work is pending, so just use atomic_swap for that. - Use an adaptive lock (IPL_NONE) for i2c transactions. - Detach children, and do so before freeing anything.
2022-01-14ihidev(4): Add missing includes and header guard.riastradh
Mark the sections that are conventionally separate files for hardware interface (*reg.h) versus software state (*var.h).
2021-12-27fix few typos in comments.andvar
2021-12-19drm: Fix tda19988 drm build.riastradh
2021-12-19Sort includes.riastradh