Module Name: src Committed By: thorpej Date: Sat Jul 27 16:02:27 UTC 2019
Modified Files: src/sys/dev/i2c: ac100.c act8846.c as3722.c axp809.c axppmic.c em3027.c Log Message: No need to check cold to add I2C_F_POLL; the i2c API does it for us now. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/dev/i2c/ac100.c cvs rdiff -u -r1.5 -r1.6 src/sys/dev/i2c/act8846.c cvs rdiff -u -r1.15 -r1.16 src/sys/dev/i2c/as3722.c cvs rdiff -u -r1.2 -r1.3 src/sys/dev/i2c/axp809.c src/sys/dev/i2c/em3027.c cvs rdiff -u -r1.24 -r1.25 src/sys/dev/i2c/axppmic.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/ac100.c diff -u src/sys/dev/i2c/ac100.c:1.3 src/sys/dev/i2c/ac100.c:1.4 --- src/sys/dev/i2c/ac100.c:1.3 Mon May 27 21:11:13 2019 +++ src/sys/dev/i2c/ac100.c Sat Jul 27 16:02:27 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: ac100.c,v 1.3 2019/05/27 21:11:13 jmcneill Exp $ */ +/* $NetBSD: ac100.c,v 1.4 2019/07/27 16:02:27 thorpej Exp $ */ /*- * Copyright (c) 2014 Jared D. McNeill <jmcne...@invisible.ca> @@ -29,7 +29,7 @@ #include "opt_fdt.h" #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ac100.c,v 1.3 2019/05/27 21:11:13 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ac100.c,v 1.4 2019/07/27 16:02:27 thorpej Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -165,15 +165,13 @@ ac100_attach(device_t parent, device_t s static int ac100_read(struct ac100_softc *sc, uint8_t reg, uint16_t *val) { - return iic_smbus_read_word(sc->sc_i2c, sc->sc_addr, reg, val, - cold ? I2C_F_POLL : 0); + return iic_smbus_read_word(sc->sc_i2c, sc->sc_addr, reg, val, 0); } static int ac100_write(struct ac100_softc *sc, uint8_t reg, uint16_t val) { - return iic_smbus_write_word(sc->sc_i2c, sc->sc_addr, reg, val, - cold ? I2C_F_POLL : 0); + return iic_smbus_write_word(sc->sc_i2c, sc->sc_addr, reg, val, 0); } static int Index: src/sys/dev/i2c/act8846.c diff -u src/sys/dev/i2c/act8846.c:1.5 src/sys/dev/i2c/act8846.c:1.6 --- src/sys/dev/i2c/act8846.c:1.5 Sat Jun 16 21:22:13 2018 +++ src/sys/dev/i2c/act8846.c Sat Jul 27 16:02:27 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: act8846.c,v 1.5 2018/06/16 21:22:13 thorpej Exp $ */ +/* $NetBSD: act8846.c,v 1.6 2019/07/27 16:02:27 thorpej Exp $ */ /*- * Copyright (c) 2015 Jared D. McNeill <jmcne...@invisible.ca> @@ -29,7 +29,7 @@ //#define ACT_DEBUG #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: act8846.c,v 1.5 2018/06/16 21:22:13 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: act8846.c,v 1.6 2019/07/27 16:02:27 thorpej Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -185,15 +185,13 @@ act8846_attach(device_t parent, device_t static int act8846_read(struct act8846_softc *sc, uint8_t reg, uint8_t *val) { - return iic_smbus_read_byte(sc->sc_i2c, sc->sc_addr, reg, val, - cold ? I2C_F_POLL : 0); + return iic_smbus_read_byte(sc->sc_i2c, sc->sc_addr, reg, val, 0); } static int act8846_write(struct act8846_softc *sc, uint8_t reg, uint8_t val) { - return iic_smbus_write_byte(sc->sc_i2c, sc->sc_addr, reg, val, - cold ? I2C_F_POLL : 0); + return iic_smbus_write_byte(sc->sc_i2c, sc->sc_addr, reg, val, 0); } static void Index: src/sys/dev/i2c/as3722.c diff -u src/sys/dev/i2c/as3722.c:1.15 src/sys/dev/i2c/as3722.c:1.16 --- src/sys/dev/i2c/as3722.c:1.15 Tue Jun 26 06:03:57 2018 +++ src/sys/dev/i2c/as3722.c Sat Jul 27 16:02:27 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: as3722.c,v 1.15 2018/06/26 06:03:57 thorpej Exp $ */ +/* $NetBSD: as3722.c,v 1.16 2019/07/27 16:02:27 thorpej Exp $ */ /*- * Copyright (c) 2015 Jared D. McNeill <jmcne...@invisible.ca> @@ -29,7 +29,7 @@ #include "opt_fdt.h" #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: as3722.c,v 1.15 2018/06/26 06:03:57 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: as3722.c,v 1.16 2019/07/27 16:02:27 thorpej Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -372,7 +372,7 @@ as3722_wdt_setmode(struct sysmon_wdog *s struct as3722_softc * const sc = smw->smw_cookie; int error; - const int flags = (cold ? I2C_F_POLL : 0); + const int flags = 0; if ((smw->smw_mode & WDOG_MODE_MASK) == WDOG_MODE_DISARMED) { iic_acquire_bus(sc->sc_i2c, flags); @@ -409,7 +409,7 @@ as3722_wdt_tickle(struct sysmon_wdog *sm struct as3722_softc * const sc = smw->smw_cookie; int error; - const int flags = (cold ? I2C_F_POLL : 0); + const int flags = 0; iic_acquire_bus(sc->sc_i2c, flags); error = as3722_set_clear(sc, AS3722_WATCHDOG_SIGNAL_REG, @@ -426,7 +426,7 @@ as3722_rtc_gettime(todr_chip_handle_t tc uint8_t buf[6]; int error = 0; - const int flags = (cold ? I2C_F_POLL : 0); + const int flags = 0; iic_acquire_bus(sc->sc_i2c, flags); error += as3722_read(sc, AS3722_RTC_SECOND_REG, &buf[0], flags); @@ -468,7 +468,7 @@ as3722_rtc_settime(todr_chip_handle_t tc buf[4] = bintobcd(dt->dt_mon + 1) & 0x1f; buf[5] = bintobcd(dt->dt_year - AS3722_START_YEAR) & 0x7f; - const int flags = (cold ? I2C_F_POLL : 0); + const int flags = 0; iic_acquire_bus(sc->sc_i2c, flags); error += as3722_write(sc, AS3722_RTC_SECOND_REG, buf[0], flags); @@ -489,7 +489,7 @@ as3722_regulator_attach(struct as3722_so struct as3722reg_attach_args raa; int phandle, child; int error; - const int flags = (cold ? I2C_F_POLL : 0); + const int flags = 0; uint8_t tmp; iic_acquire_bus(sc->sc_i2c, flags); @@ -572,7 +572,7 @@ as3722reg_enable(device_t dev, bool enab struct as3722reg_softc *sc = device_private(dev); struct as3722_softc *asc = device_private(device_parent(dev)); const struct as3722regdef *regdef = sc->sc_regdef; - const int flags = (cold ? I2C_F_POLL : 0); + const int flags = 0; int error; if (!regdef->enable_mask) @@ -596,7 +596,7 @@ as3722reg_set_voltage_ldo(device_t dev, struct as3722reg_softc *sc = device_private(dev); struct as3722_softc *asc = device_private(device_parent(dev)); const struct as3722regdef *regdef = sc->sc_regdef; - const int flags = (cold ? I2C_F_POLL : 0); + const int flags = 0; uint8_t set_v = 0x00; u_int uvol; int error; @@ -633,7 +633,7 @@ as3722reg_get_voltage_ldo(device_t dev, struct as3722reg_softc *sc = device_private(dev); struct as3722_softc *asc = device_private(device_parent(dev)); const struct as3722regdef *regdef = sc->sc_regdef; - const int flags = (cold ? I2C_F_POLL : 0); + const int flags = 0; uint8_t v; int error; @@ -663,7 +663,7 @@ as3722reg_set_voltage_sd0(device_t dev, struct as3722reg_softc *sc = device_private(dev); struct as3722_softc *asc = device_private(device_parent(dev)); const struct as3722regdef *regdef = sc->sc_regdef; - const int flags = (cold ? I2C_F_POLL : 0); + const int flags = 0; uint8_t set_v = 0x00; u_int uvol; int error; @@ -703,7 +703,7 @@ as3722reg_get_voltage_sd0(device_t dev, struct as3722reg_softc *sc = device_private(dev); struct as3722_softc *asc = device_private(device_parent(dev)); const struct as3722regdef *regdef = sc->sc_regdef; - const int flags = (cold ? I2C_F_POLL : 0); + const int flags = 0; uint8_t v; int error; @@ -740,7 +740,7 @@ as3722reg_set_voltage_sd4(device_t dev, struct as3722reg_softc *sc = device_private(dev); struct as3722_softc *asc = device_private(device_parent(dev)); const struct as3722regdef *regdef = sc->sc_regdef; - const int flags = (cold ? I2C_F_POLL : 0); + const int flags = 0; uint8_t set_v = 0x00; u_int uvol; int error; @@ -785,7 +785,7 @@ as3722reg_get_voltage_sd4(device_t dev, struct as3722reg_softc *sc = device_private(dev); struct as3722_softc *asc = device_private(device_parent(dev)); const struct as3722regdef *regdef = sc->sc_regdef; - const int flags = (cold ? I2C_F_POLL : 0); + const int flags = 0; uint8_t v; int error; Index: src/sys/dev/i2c/axp809.c diff -u src/sys/dev/i2c/axp809.c:1.2 src/sys/dev/i2c/axp809.c:1.3 --- src/sys/dev/i2c/axp809.c:1.2 Sat Jun 16 21:22:13 2018 +++ src/sys/dev/i2c/axp809.c Sat Jul 27 16:02:27 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: axp809.c,v 1.2 2018/06/16 21:22:13 thorpej Exp $ */ +/* $NetBSD: axp809.c,v 1.3 2019/07/27 16:02:27 thorpej Exp $ */ /*- * Copyright (c) 2014 Jared D. McNeill <jmcne...@invisible.ca> @@ -29,7 +29,7 @@ #define AXP_DEBUG #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: axp809.c,v 1.2 2018/06/16 21:22:13 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: axp809.c,v 1.3 2019/07/27 16:02:27 thorpej Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -147,15 +147,13 @@ axp809_attach(device_t parent, device_t static int axp809_read(struct axp809_softc *sc, uint8_t reg, uint8_t *val) { - return iic_smbus_read_byte(sc->sc_i2c, sc->sc_addr, reg, val, - cold ? I2C_F_POLL : 0); + return iic_smbus_read_byte(sc->sc_i2c, sc->sc_addr, reg, val, 0); } static int axp809_write(struct axp809_softc *sc, uint8_t reg, uint8_t val) { - return iic_smbus_write_byte(sc->sc_i2c, sc->sc_addr, reg, val, - cold ? I2C_F_POLL : 0); + return iic_smbus_write_byte(sc->sc_i2c, sc->sc_addr, reg, val, 0); } static void Index: src/sys/dev/i2c/em3027.c diff -u src/sys/dev/i2c/em3027.c:1.2 src/sys/dev/i2c/em3027.c:1.3 --- src/sys/dev/i2c/em3027.c:1.2 Sat Jun 16 21:22:13 2018 +++ src/sys/dev/i2c/em3027.c Sat Jul 27 16:02:27 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: em3027.c,v 1.2 2018/06/16 21:22:13 thorpej Exp $ */ +/* $NetBSD: em3027.c,v 1.3 2019/07/27 16:02:27 thorpej Exp $ */ /* * Copyright (c) 2018 Valery Ushakov * All rights reserved. @@ -28,7 +28,7 @@ * EM Microelectronic EM3027 RTC */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: em3027.c,v 1.2 2018/06/16 21:22:13 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: em3027.c,v 1.3 2019/07/27 16:02:27 thorpej Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -320,7 +320,7 @@ static int em3027rtc_iic_exec(struct em3027rtc_softc *sc, i2c_op_t op, uint8_t reg, void *buf, size_t len) { - const int flags = cold ? 0 : I2C_F_POLL; + const int flags = 0; int error; error = iic_acquire_bus(sc->sc_tag, flags); Index: src/sys/dev/i2c/axppmic.c diff -u src/sys/dev/i2c/axppmic.c:1.24 src/sys/dev/i2c/axppmic.c:1.25 --- src/sys/dev/i2c/axppmic.c:1.24 Tue May 28 20:22:18 2019 +++ src/sys/dev/i2c/axppmic.c Sat Jul 27 16:02:27 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: axppmic.c,v 1.24 2019/05/28 20:22:18 jmcneill Exp $ */ +/* $NetBSD: axppmic.c,v 1.25 2019/07/27 16:02:27 thorpej Exp $ */ /*- * Copyright (c) 2014-2018 Jared McNeill <jmcne...@invisible.ca> @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: axppmic.c,v 1.24 2019/05/28 20:22:18 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: axppmic.c,v 1.25 2019/07/27 16:02:27 thorpej Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -481,7 +481,7 @@ axppmic_write(i2c_tag_t tag, i2c_addr_t static int axppmic_set_voltage(i2c_tag_t tag, i2c_addr_t addr, const struct axppmic_ctrl *c, u_int min, u_int max) { - const int flags = (cold ? I2C_F_POLL : 0); + const int flags = 0; u_int vol, reg_val; int nstep, error; uint8_t val; @@ -526,7 +526,7 @@ axppmic_set_voltage(i2c_tag_t tag, i2c_a static int axppmic_get_voltage(i2c_tag_t tag, i2c_addr_t addr, const struct axppmic_ctrl *c, u_int *pvol) { - const int flags = (cold ? I2C_F_POLL : 0); + const int flags = 0; int reg_val, error; uint8_t val; @@ -1015,7 +1015,7 @@ axpreg_enable(device_t dev, bool enable) { struct axpreg_softc *sc = device_private(dev); const struct axppmic_ctrl *c = sc->sc_ctrl; - const int flags = (cold ? I2C_F_POLL : 0); + const int flags = 0; uint8_t val; int error;