No need to use I2C_F_POLL here.
This commit is contained in:
parent
7e6d53fd74
commit
ad09c384ba
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: sy8106a.c,v 1.4 2018/06/26 06:03:57 thorpej Exp $ */
|
||||
/* $NetBSD: sy8106a.c,v 1.5 2019/12/23 19:35:07 thorpej Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2017 Jared McNeill <jmcneill@invisible.ca>
|
||||
|
@ -27,7 +27,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: sy8106a.c,v 1.4 2018/06/26 06:03:57 thorpej Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: sy8106a.c,v 1.5 2019/12/23 19:35:07 thorpej Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
|
@ -93,10 +93,10 @@ sy8106a_write(struct sy8106a_softc *sc, uint8_t reg, uint8_t val, int flags)
|
|||
aprint_error_dev(sc->sc_dev, "error writing reg %#x: %d\n", reg, error);
|
||||
}
|
||||
|
||||
#define I2C_READ(sc, reg) sy8106a_read((sc), (reg), I2C_F_POLL)
|
||||
#define I2C_WRITE(sc, reg, val) sy8106a_write((sc), (reg), (val), I2C_F_POLL)
|
||||
#define I2C_LOCK(sc) iic_acquire_bus((sc)->sc_i2c, I2C_F_POLL)
|
||||
#define I2C_UNLOCK(sc) iic_release_bus((sc)->sc_i2c, I2C_F_POLL)
|
||||
#define I2C_READ(sc, reg) sy8106a_read((sc), (reg), 0)
|
||||
#define I2C_WRITE(sc, reg, val) sy8106a_write((sc), (reg), (val), 0)
|
||||
#define I2C_LOCK(sc) iic_acquire_bus((sc)->sc_i2c, 0)
|
||||
#define I2C_UNLOCK(sc) iic_release_bus((sc)->sc_i2c, 0)
|
||||
|
||||
static int
|
||||
sy8106a_acquire(device_t dev)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: tcagpio.c,v 1.4 2018/06/26 06:03:57 thorpej Exp $ */
|
||||
/* $NetBSD: tcagpio.c,v 1.5 2019/12/23 19:38:58 thorpej Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2017 Jared McNeill <jmcneill@invisible.ca>
|
||||
|
@ -27,7 +27,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: tcagpio.c,v 1.4 2018/06/26 06:03:57 thorpej Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: tcagpio.c,v 1.5 2019/12/23 19:38:58 thorpej Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
|
@ -102,10 +102,10 @@ tcagpio_write(struct tcagpio_softc *sc, uint8_t reg, uint8_t val, int flags)
|
|||
aprint_error_dev(sc->sc_dev, "error writing reg %#x: %d\n", reg, error);
|
||||
}
|
||||
|
||||
#define I2C_READ(sc, reg) tcagpio_read((sc), (reg), I2C_F_POLL)
|
||||
#define I2C_WRITE(sc, reg, val) tcagpio_write((sc), (reg), (val), I2C_F_POLL)
|
||||
#define I2C_LOCK(sc) iic_acquire_bus((sc)->sc_i2c, I2C_F_POLL)
|
||||
#define I2C_UNLOCK(sc) iic_release_bus((sc)->sc_i2c, I2C_F_POLL)
|
||||
#define I2C_READ(sc, reg) tcagpio_read((sc), (reg), 0)
|
||||
#define I2C_WRITE(sc, reg, val) tcagpio_write((sc), (reg), (val), 0)
|
||||
#define I2C_LOCK(sc) iic_acquire_bus((sc)->sc_i2c, 0)
|
||||
#define I2C_UNLOCK(sc) iic_release_bus((sc)->sc_i2c, 0)
|
||||
|
||||
static int
|
||||
tcagpio_gpio_config(struct tcagpio_softc *sc, int pin, int flags)
|
||||
|
|
Loading…
Reference in New Issue