Lines Matching defs:sc
72 struct sypwr_softc *sc = (struct sypwr_softc *)self;
77 sc->sc_tag = ia->ia_tag;
78 sc->sc_addr = ia->ia_addr;
80 sc->sc_fixed_microvolt =
90 reg = sypwr_read(sc, SY8106A_VOUT1_SEL);
91 if (reg & SY8106A_VOUT1_SEL_I2C || sc->sc_fixed_microvolt != 0) {
94 voltage = sypwr_get_voltage(sc);
98 sc->sc_rd.rd_node = node;
99 sc->sc_rd.rd_cookie = sc;
100 sc->sc_rd.rd_get_voltage = sypwr_get_voltage;
101 sc->sc_rd.rd_set_voltage = sypwr_set_voltage;
102 regulator_register(&sc->sc_rd);
111 struct sypwr_softc *sc = (struct sypwr_softc *)self;
120 if (sc->sc_fixed_microvolt != 0) {
121 reg = sypwr_read(sc, SY8106A_VOUT1_SEL);
123 sypwr_write(sc, SY8106A_VOUT1_SEL, reg);
132 sypwr_read(struct sypwr_softc *sc, int reg)
138 iic_acquire_bus(sc->sc_tag, I2C_F_POLL);
139 error = iic_exec(sc->sc_tag, I2C_OP_READ_WITH_STOP, sc->sc_addr,
141 iic_release_bus(sc->sc_tag, I2C_F_POLL);
146 sc->sc_dev.dv_xname, reg);
154 sypwr_write(struct sypwr_softc *sc, int reg, uint8_t val)
159 iic_acquire_bus(sc->sc_tag, I2C_F_POLL);
160 error = iic_exec(sc->sc_tag, I2C_OP_WRITE_WITH_STOP, sc->sc_addr,
162 iic_release_bus(sc->sc_tag, I2C_F_POLL);
166 sc->sc_dev.dv_xname, reg);
173 struct sypwr_softc *sc = cookie;
176 value = sypwr_read(sc, SY8106A_VOUT1_SEL);
180 return sc->sc_fixed_microvolt;
186 struct sypwr_softc *sc = cookie;
193 sypwr_write(sc, SY8106A_VOUT1_SEL, value | SY8106A_VOUT1_SEL_I2C);