opnsense-src/sys/dev/iicbus
Andriy Gapon ff1e858180 twsi: support more message combinations in transfers
Most prominently, add support for a transfer where a write with no-stop
flag is followed by a write with no-start flag.  Logically, it's a
single larger write, but consumers may want to split it like that
because one part can be a register ID and the other part can be data to
be written to (or starting at) that register.

Such a transfer can be created by i2c tool and iic(4) driver, e.g., for
an EEPROM write at specific offset:
    i2c -m tr -a 0x50 -d w -w 16 -o 0 -c 8 -v < /dev/random

This should be fixed by new code that handles the end of data transfer
for both reads and writes.  It handles two existing conditions and one
new.  Namely:
- the last message has been completed -- end of transfer;
- a message has been completed and the next one requires the start
  condition;
- a message has been completed and the next one should be sent without
  the start condition.

In the last case we simply switch to the next message and start sending
its data.  Reads without the start condition are not supported yet,
though.  That's because we NACK the last byte of the previous message,
so the device stops sending data.  To fix this we will need to add a
look-ahead at the next message when handling the penultimate byte of the
current one.

This change also fixed a bug where msg_idx was not incremented after a
read message.  Apparently, typically a read message is a last message in
a transfer, so the bug did not cause much trouble.

PR:		258994
MFC after:	3 weeks
2021-11-26 16:20:27 +02:00
..
gpio TCA6408: Add driver for tca6408 gpio expander 2021-11-24 07:40:38 +01:00
mux pca954x: driver for PCA954x / TCA954x I2C switches 2021-11-13 11:27:41 +02:00
pmic pmic: rockchip: Rename the driver with _pmu as it was before 2021-11-14 20:26:33 +01:00
rtc Pcf85063: Add RTC driver 2021-11-24 07:40:38 +01:00
twsi twsi: support more message combinations in transfers 2021-11-26 16:20:27 +02:00
acpi_iicbus.c newbus: Move from bus_child_{pnpinfo,location}_src to bus_child_{pnpinfo,location} with sbuf 2021-06-22 20:52:06 -06:00
ad7417.c Drop 'All rights reserved' 2020-03-06 21:32:42 +00:00
ad7418.c Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many) 2020-02-26 14:26:36 +00:00
adm1030.c
ads111x.c Revert "Define PNP info after defining driver modules" 2021-01-23 10:59:41 -05:00
adt746x.c Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many) 2020-02-26 14:26:36 +00:00
ds13rtc.c Clean up some of my copyrights; add SPDX tag and remove All rights reserved. 2019-12-13 01:38:48 +00:00
ds1307.c ds1307: allow configuration via hints on FDT-based systems 2021-11-13 11:23:10 +02:00
ds1307reg.h DS1307: Add the mcp7941x enable bit 2017-11-08 01:28:20 +00:00
ds1631.c Drop 'All rights reserved' 2020-03-06 21:24:09 +00:00
ds1672.c Build the ds1672 driver as a module. Add a detach() to unregister the rtc. 2018-03-06 02:30:34 +00:00
ds1775.c Drop 'All rights reserved' 2020-03-06 21:26:35 +00:00
ds3231.c Switch to the new bcd_clocktime conversion routines, and add calls to the 2018-03-05 00:15:56 +00:00
ds3231reg.h The ds3231 RTC chip bitmask values for 12- versus 24-hour mode were reversed, 2020-07-19 18:53:19 +00:00
htu21.c htu21: don't needlessly bother hardware when measurements are not needed 2021-11-06 19:39:52 +02:00
icee.c icee: allow configuration via hints on FDT-based systems 2021-11-13 11:24:57 +02:00
if_ic.c routing: Allow using IPv6 next-hops for IPv4 routes (RFC 5549). 2021-08-22 22:56:08 +00:00
iic.c sys/dev: further adoption of SPDX licensing ID tags. 2017-11-27 14:52:40 +00:00
iic.h sys/dev: further adoption of SPDX licensing ID tags. 2017-11-27 14:52:40 +00:00
iic_recover_bus.c Clean up some of my copyrights; add SPDX tag and remove All rights reserved. 2019-12-13 01:38:48 +00:00
iic_recover_bus.h Clean up some of my copyrights; add SPDX tag and remove All rights reserved. 2019-12-13 01:38:48 +00:00
iicbb.c move defintion of hw.i2c sysctl node from iicbb to iicbus 2020-09-03 08:02:19 +00:00
iicbb_if.m Remove a couple of extra blank lines. 2016-05-22 04:09:05 +00:00
iicbus.c newbus: Move from bus_child_{pnpinfo,location}_src to bus_child_{pnpinfo,location} with sbuf 2021-06-22 20:52:06 -06:00
iicbus.h newbus: Move from bus_child_{pnpinfo,location}_src to bus_child_{pnpinfo,location} with sbuf 2021-06-22 20:52:06 -06:00
iicbus_if.m Add a default implementation that returns ENODEV for start, repeat_start, 2017-09-11 23:47:49 +00:00
iichid.c iichid(4): Perform bus_teardown_intr/bus_setup_intr to disable interrupts 2021-07-09 22:32:59 +03:00
iicoc.c iicoc: fix repeated start 2021-11-01 12:29:29 +08:00
iicoc.h iicoc: split up common core and PCI bus specifics 2019-12-20 03:40:46 +00:00
iicoc_fdt.c iicoc: support building as a module 2021-11-01 12:33:39 +08:00
iicoc_pci.c iicoc: fix the build on PCI machines 2019-12-20 05:15:03 +00:00
iiconf.c Add support for i2c bus mux hardware. 2020-01-02 17:51:49 +00:00
iiconf.h Add support for i2c bus mux hardware. 2020-01-02 17:51:49 +00:00
iicsmb.c iicsmb: Request the bus recursively in bread() 2021-02-23 20:06:16 +00:00
isl12xx.c Clean up some of my copyrights; add SPDX tag and remove All rights reserved. 2019-12-13 01:38:48 +00:00
lm75.c Fix the deciKelvin to Celsius conversion in kernel. 2016-05-22 13:58:32 +00:00
max6690.c Provide a slightly more-tolerant set of thermal parameters for PowerMac 2020-10-15 13:43:43 +00:00
max44009.c driver for MAX44009 I2C illuminance sensor 2021-11-06 19:19:04 +02:00
nxprtc.c Clean up some of my copyrights; add SPDX tag and remove All rights reserved. 2019-12-13 01:38:48 +00:00
ofw_iicbus.c newbus: Move from bus_child_{pnpinfo,location}_src to bus_child_{pnpinfo,location} with sbuf 2021-06-22 20:52:06 -06:00
pcf8591.c pcf8591: driver for adc/dac with i2c interface 2021-11-06 19:14:50 +02:00
rtc8583.c Clean up some of my copyrights; add SPDX tag and remove All rights reserved. 2019-12-13 01:38:48 +00:00
s35390a.c Switch to the new bcd_clocktime conversion routines, and add calls to the 2018-03-05 00:43:53 +00:00
sy8106a.c Remove "all rights reserved" from copyright for the file that Jared McNeill 2019-12-03 21:05:33 +00:00
syr827.c syr827: Switch to iicdev_{readfrom,writeto} 2019-10-01 18:32:27 +00:00