Module Name:    src
Committed By:   thorpej
Date:           Mon Dec 23 02:35:18 UTC 2019

Modified Files:
        src/sys/dev/i2c: as3722.c

Log Message:
No need to do the poll-during-autoconfiguration dance; the i2c code
does the right thing for us.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/dev/i2c/as3722.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/as3722.c
diff -u src/sys/dev/i2c/as3722.c:1.16 src/sys/dev/i2c/as3722.c:1.17
--- src/sys/dev/i2c/as3722.c:1.16	Sat Jul 27 16:02:27 2019
+++ src/sys/dev/i2c/as3722.c	Mon Dec 23 02:35:18 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: as3722.c,v 1.16 2019/07/27 16:02:27 thorpej Exp $ */
+/* $NetBSD: as3722.c,v 1.17 2019/12/23 02:35:18 thorpej Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill <[email protected]>
@@ -29,7 +29,7 @@
 #include "opt_fdt.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: as3722.c,v 1.16 2019/07/27 16:02:27 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: as3722.c,v 1.17 2019/12/23 02:35:18 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -240,11 +240,11 @@ as3722_match(device_t parent, cfdata_t m
 	if (ia->ia_addr != AS3722_I2C_ADDR)
 		return 0;
 	
-	iic_acquire_bus(ia->ia_tag, I2C_F_POLL);
+	iic_acquire_bus(ia->ia_tag, 0);
 	reg = AS3722_ASIC_ID1_REG;
 	error = iic_exec(ia->ia_tag, I2C_OP_READ_WITH_STOP, ia->ia_addr,
-	    &reg, 1, &id1, 1, I2C_F_POLL);
-	iic_release_bus(ia->ia_tag, I2C_F_POLL);
+	    &reg, 1, &id1, 1, 0);
+	iic_release_bus(ia->ia_tag, 0);
 
 	if (error == 0 && id1 == 0x0c)
 		return I2C_MATCH_ADDRESS_AND_PROBE;
@@ -281,16 +281,16 @@ as3722_wdt_attach(struct as3722_softc *s
 {
 	int error;
 
-	iic_acquire_bus(sc->sc_i2c, I2C_F_POLL);
+	iic_acquire_bus(sc->sc_i2c, 0);
 	error = as3722_write(sc, AS3722_GPIO0_CTRL_REG,
 	    __SHIFTIN(AS3722_GPIO0_CTRL_IOSF_GPIO,
 		      AS3722_GPIO0_CTRL_IOSF) |
 	    __SHIFTIN(AS3722_GPIO0_CTRL_MODE_PULLDOWN,
 		      AS3722_GPIO0_CTRL_MODE),
-	    I2C_F_POLL);
+	    0);
 	error += as3722_set_clear(sc, AS3722_WATCHDOG_CTRL_REG,
-	    __SHIFTIN(1, AS3722_WATCHDOG_CTRL_MODE), 0, I2C_F_POLL);
-	iic_release_bus(sc->sc_i2c, I2C_F_POLL);
+	    __SHIFTIN(1, AS3722_WATCHDOG_CTRL_MODE), 0, 0);
+	iic_release_bus(sc->sc_i2c, 0);
 
 	if (error) {
 		aprint_error_dev(sc->sc_dev, "couldn't setup watchdog\n");
@@ -315,10 +315,10 @@ as3722_rtc_attach(struct as3722_softc *s
 {
 	int error;
 
-	iic_acquire_bus(sc->sc_i2c, I2C_F_POLL);
+	iic_acquire_bus(sc->sc_i2c, 0);
 	error = as3722_set_clear(sc, AS3722_RTC_CONTROL_REG,
-	    AS3722_RTC_CONTROL_RTC_ON, 0, I2C_F_POLL);
-	iic_release_bus(sc->sc_i2c, I2C_F_POLL);
+	    AS3722_RTC_CONTROL_RTC_ON, 0, 0);
+	iic_release_bus(sc->sc_i2c, 0);
 
 	if (error) {
 		aprint_error_dev(sc->sc_dev, "couldn't setup RTC\n");

Reply via email to