No need to use I2C_F_POLL here.

This commit is contained in:
thorpej 2019-12-23 14:55:22 +00:00
parent 57968d4c6d
commit 7c3bc3baec
1 changed files with 10 additions and 10 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: spdmem_i2c.c,v 1.17 2018/10/20 03:23:05 macallan Exp $ */
/* $NetBSD: spdmem_i2c.c,v 1.18 2019/12/23 14:55:22 thorpej Exp $ */
/*
* Copyright (c) 2007 Nicolas Joly
@ -40,7 +40,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: spdmem_i2c.c,v 1.17 2018/10/20 03:23:05 macallan Exp $");
__KERNEL_RCSID(0, "$NetBSD: spdmem_i2c.c,v 1.18 2019/12/23 14:55:22 thorpej Exp $");
#include <sys/param.h>
#include <sys/device.h>
@ -114,9 +114,9 @@ spdmem_reset_page(struct spdmem_i2c_softc *sc)
* doesn't exist at the address.
*/
rv = iic_exec(sc->sc_tag, I2C_OP_READ_WITH_STOP, sc->sc_addr, &reg, 1,
&byte0, 1, I2C_F_POLL);
&byte0, 1, 0);
rv |= iic_exec(sc->sc_tag, I2C_OP_READ_WITH_STOP, sc->sc_addr, &reg, 1,
&byte2, 1, I2C_F_POLL);
&byte2, 1, 0);
if (rv != 0)
goto error;
@ -143,7 +143,7 @@ spdmem_reset_page(struct spdmem_i2c_softc *sc)
* I don't know whether our icc_exec()'s API is good or not.
*/
rv = iic_exec(sc->sc_tag, I2C_OP_READ_WITH_STOP, sc->sc_page0,
&reg, 1, &dummy, 1, I2C_F_POLL);
&reg, 1, &dummy, 1, 0);
if (rv != 0) {
/*
* The possibilities are:
@ -153,7 +153,7 @@ spdmem_reset_page(struct spdmem_i2c_softc *sc)
* Is there no way to distinguish them now?
*/
rv = iic_exec(sc->sc_tag, I2C_OP_WRITE_WITH_STOP,
sc->sc_page0, &reg, 1, &dummy, 1, I2C_F_POLL);
sc->sc_page0, &reg, 1, &dummy, 1, 0);
if (rv == 0) {
aprint_debug("Page 1 was selected. Page 0 is "
"selected now.\n");
@ -269,14 +269,14 @@ spdmem_i2c_read(struct spdmem_softc *softc, uint16_t addr, uint8_t *val)
if (addr & 0x100) {
rv = iic_exec(sc->sc_tag, I2C_OP_WRITE_WITH_STOP, sc->sc_page1,
&dummy, 1, &dummy, 1, I2C_F_POLL);
&dummy, 1, &dummy, 1, 0);
rv |= iic_exec(sc->sc_tag, I2C_OP_READ_WITH_STOP, sc->sc_addr,
&reg, 1, val, 1, I2C_F_POLL);
&reg, 1, val, 1, 0);
rv |= iic_exec(sc->sc_tag, I2C_OP_WRITE_WITH_STOP,
sc->sc_page0, &dummy, 1, &dummy, 1, I2C_F_POLL);
sc->sc_page0, &dummy, 1, &dummy, 1, 0);
} else {
rv = iic_exec(sc->sc_tag, I2C_OP_READ_WITH_STOP, sc->sc_addr,
&reg, 1, val, 1, I2C_F_POLL);
&reg, 1, val, 1, 0);
}
iic_release_bus(sc->sc_tag, 0);