]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Fix nxprtc(4) on systems that support i2c repeat-start correctly.
authorian <ian@FreeBSD.org>
Mon, 15 Jul 2019 21:40:58 +0000 (21:40 +0000)
committerian <ian@FreeBSD.org>
Mon, 15 Jul 2019 21:40:58 +0000 (21:40 +0000)
commit264fbd07fe040c5e58bcfb7d0a0a5e117dd8dd27
tree3c3180aa860bd75525a8713b105c3254dc07109e
parent64ee41ff5541fbc455e908af4b4fed3cb9da5aef
Fix nxprtc(4) on systems that support i2c repeat-start correctly.

An obscure footnote in the datasheets for the PCx2127, PCx2129, and
PCF8523 rtc chips states that the chips do not support i2c repeat-start
operations.  When the driver was originally written and tested, the i2c
bus on that system also didn't support repeat-start and just quietly
turned repeat-start operations into a stop-then-start, making it appear
that the nxprtc driver was working properly.

The repeat-start situation only comes up on reads, so instead of using
the standard iicdev_readfrom(), use a local nxprtc_readfrom(), which is
just a cut-and-pasted copy of iicdev_readfrom(), modified to send two
separate start-data-stop sequences instead of using repeat-start.
sys/dev/iicbus/nxprtc.c