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

Details

Provenance
avgAuthored on Thu, Jun 27, 7:40 AM
Parents
rGcde6642431bb: nuageinit: check for both user_data and user-data
Branches
Unknown
Tags
Unknown