freebsd-dev/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
ad7418.c
adm1030.c
ads111x.c Revert "Define PNP info after defining driver modules" 2021-01-23 10:59:41 -05:00
adt746x.c
ds13rtc.c
ds1307.c ds1307: allow configuration via hints on FDT-based systems 2021-11-13 11:23:10 +02:00
ds1307reg.h
ds1631.c
ds1672.c
ds1775.c
ds3231.c
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_recover_bus.c
iic_recover_bus.h
iic.c
iic.h
iicbb_if.m
iicbb.c move defintion of hw.i2c sysctl node from iicbb to iicbus 2020-09-03 08:02:19 +00:00
iicbus_if.m
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
iichid.c iichid(4): Perform bus_teardown_intr/bus_setup_intr to disable interrupts 2021-07-09 22:32:59 +03:00
iicoc_fdt.c iicoc: support building as a module 2021-11-01 12:33:39 +08:00
iicoc_pci.c
iicoc.c iicoc: fix repeated start 2021-11-01 12:29:29 +08:00
iicoc.h
iiconf.c
iiconf.h
iicsmb.c iicsmb: Request the bus recursively in bread() 2021-02-23 20:06:16 +00:00
isl12xx.c
lm75.c
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
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
s35390a.c
sy8106a.c
syr827.c