HomeFreeBSD

rk_i2c: emulate repeated start

Description

rk_i2c: emulate repeated start

rk_i2c_send_stop is modified so that it sends a stop condition, like it
always did, if there is no IIC_M_NOSTOP flag.
But if the flag is set then the function completely resets the control
register and sets the driver state to transfer completed.
Something like this was previously done for a write with IIC_M_NOSTOP.
Now it is done for a read with IIC_M_NOSTOP as well.

Linux code says that the hardware does not support the repeated start
condition and the documentation, indeed, does not mention it.
But according to the Linux driver clearing the control register and then
sending a start condition acts as if it were a repeated start.

While here, add braces around a single-line 'if' branch to balance it
with a multi-line 'else' branch.

Tested with max44009(4).

MFC after: 2 weeks

(cherry picked from commit 0deaf4be346f7f343bd2cf771bbf5d172d1c0d2a)

Details

Provenance
avgAuthored on Jun 27 2024, 7:40 AM
Parents
rG231985152cf7: ufs: change isrmdir type to bool or u_int as appropriate
Branches
Unknown
Tags
Unknown