i2c_probe: Use a quick write transfer instead of writing a zero
This matches the method implemented in i2cdetect(8) when using its -q
option.

With this change an rx8130 RTC is detectable using i2c_probe. This
failed before because this chip acks the first byte (containing its
address and the R/̅W bit) but nacks the following 0 (representing the
target address to write nothing to) which makes i2c_write_reg() return
with an error and so the chip is not listed as available.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
1 parent d4c88b9 commit 1b6253ab991d272adf8c84b0a6063b4076253d61
@Uwe Kleine-König Uwe Kleine-König authored on 25 Jan 2019
Sascha Hauer committed on 28 Jan 2019
Showing 1 changed file
View
commands/i2c.c