Module Name: src
Committed By: thorpej
Date: Thu Jan 2 16:53:05 UTC 2020
Modified Files:
src/sys/dev/i2c: pcf8583.c
Log Message:
No need to use I2C_F_POLL here.
To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/dev/i2c/pcf8583.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/i2c/pcf8583.c
diff -u src/sys/dev/i2c/pcf8583.c:1.18 src/sys/dev/i2c/pcf8583.c:1.19
--- src/sys/dev/i2c/pcf8583.c:1.18 Sat Jun 16 21:22:13 2018
+++ src/sys/dev/i2c/pcf8583.c Thu Jan 2 16:53:05 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: pcf8583.c,v 1.18 2018/06/16 21:22:13 thorpej Exp $ */
+/* $NetBSD: pcf8583.c,v 1.19 2020/01/02 16:53:05 thorpej Exp $ */
/*
* Copyright (c) 2003 Wasabi Systems, Inc.
@@ -43,7 +43,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pcf8583.c,v 1.18 2018/06/16 21:22:13 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pcf8583.c,v 1.19 2020/01/02 16:53:05 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -327,7 +327,7 @@ pcfrtc_clock_read(struct pcfrtc_softc *s
u_int8_t bcd[10], cmdbuf[1];
int i, err;
- if ((err = iic_acquire_bus(sc->sc_tag, I2C_F_POLL))) {
+ if ((err = iic_acquire_bus(sc->sc_tag, 0))) {
aprint_error_dev(sc->sc_dev,
"pcfrtc_clock_read: failed to acquire I2C bus\n");
return err;
@@ -339,8 +339,8 @@ pcfrtc_clock_read(struct pcfrtc_softc *s
if ((err = iic_exec(sc->sc_tag, I2C_OP_READ_WITH_STOP,
sc->sc_address, cmdbuf, 1,
- &bcd[i], 1, I2C_F_POLL))) {
- iic_release_bus(sc->sc_tag, I2C_F_POLL);
+ &bcd[i], 1, 0))) {
+ iic_release_bus(sc->sc_tag, 0);
aprint_error_dev(sc->sc_dev,
"pcfrtc_clock_read: failed to read rtc "
"at 0x%x\n",
@@ -350,7 +350,7 @@ pcfrtc_clock_read(struct pcfrtc_softc *s
}
/* Done with I2C */
- iic_release_bus(sc->sc_tag, I2C_F_POLL);
+ iic_release_bus(sc->sc_tag, 0);
/*
* Convert the PCF8583's register values into something useable
@@ -405,7 +405,7 @@ pcfrtc_clock_write(struct pcfrtc_softc *
bcd[8] = dt->dt_year % 100;
bcd[9] = dt->dt_year / 100;
- if ((err = iic_acquire_bus(sc->sc_tag, I2C_F_POLL))) {
+ if ((err = iic_acquire_bus(sc->sc_tag, 0))) {
aprint_error_dev(sc->sc_dev,
"pcfrtc_clock_write: failed to acquire I2C bus\n");
return err;
@@ -416,8 +416,8 @@ pcfrtc_clock_write(struct pcfrtc_softc *
if ((err = iic_exec(sc->sc_tag,
i != 9 ? I2C_OP_WRITE : I2C_OP_WRITE_WITH_STOP,
sc->sc_address, cmdbuf, 1,
- &bcd[i], 1, I2C_F_POLL))) {
- iic_release_bus(sc->sc_tag, I2C_F_POLL);
+ &bcd[i], 1, 0))) {
+ iic_release_bus(sc->sc_tag, 0);
aprint_error_dev(sc->sc_dev,
"pcfrtc_clock_write: failed to write rtc "
" at 0x%x\n",
@@ -426,7 +426,7 @@ pcfrtc_clock_write(struct pcfrtc_softc *
}
}
- iic_release_bus(sc->sc_tag, I2C_F_POLL);
+ iic_release_bus(sc->sc_tag, 0);
return 0;
}
@@ -445,15 +445,15 @@ pcfrtc_bootstrap_read(i2c_tag_t tag, int
if (len == 0)
return (0);
- if (iic_acquire_bus(tag, I2C_F_POLL) != 0)
+ if (iic_acquire_bus(tag, 0) != 0)
return (-1);
while (len) {
/* Read a single byte. */
cmdbuf[0] = offset;
if (iic_exec(tag, I2C_OP_READ_WITH_STOP, i2caddr,
- cmdbuf, 1, rvp, 1, I2C_F_POLL)) {
- iic_release_bus(tag, I2C_F_POLL);
+ cmdbuf, 1, rvp, 1, 0)) {
+ iic_release_bus(tag, 0);
return (-1);
}
@@ -462,7 +462,7 @@ pcfrtc_bootstrap_read(i2c_tag_t tag, int
offset++;
}
- iic_release_bus(tag, I2C_F_POLL);
+ iic_release_bus(tag, 0);
return (0);
}
@@ -480,15 +480,15 @@ pcfrtc_bootstrap_write(i2c_tag_t tag, in
if (len == 0)
return (0);
- if (iic_acquire_bus(tag, I2C_F_POLL) != 0)
+ if (iic_acquire_bus(tag, 0) != 0)
return (-1);
while (len) {
/* Write a single byte. */
cmdbuf[0] = offset;
if (iic_exec(tag, I2C_OP_WRITE_WITH_STOP, i2caddr,
- cmdbuf, 1, rvp, 1, I2C_F_POLL)) {
- iic_release_bus(tag, I2C_F_POLL);
+ cmdbuf, 1, rvp, 1, 0)) {
+ iic_release_bus(tag, 0);
return (-1);
}
@@ -497,6 +497,6 @@ pcfrtc_bootstrap_write(i2c_tag_t tag, in
offset++;
}
- iic_release_bus(tag, I2C_F_POLL);
+ iic_release_bus(tag, 0);
return (0);
}