| 215 | } |
| 216 | |
| 217 | static int |
| 218 | as3722_init(struct as3722_softc *sc) |
| 219 | { |
| 220 | uint32_t reg; |
| 221 | int rv; |
| 222 | |
| 223 | reg = 0; |
| 224 | if (sc->int_pullup) |
| 225 | reg |= AS3722_INT_PULL_UP; |
| 226 | if (sc->i2c_pullup) |
| 227 | reg |= AS3722_I2C_PULL_UP; |
| 228 | |
| 229 | rv = RM1(sc, AS3722_IO_VOLTAGE, |
| 230 | AS3722_INT_PULL_UP | AS3722_I2C_PULL_UP, reg); |
| 231 | if (rv != 0) |
| 232 | return (ENXIO); |
| 233 | |
| 234 | /* mask interrupts */ |
| 235 | rv = WR1(sc, AS3722_INTERRUPT_MASK1, 0); |
| 236 | if (rv != 0) |
| 237 | return (ENXIO); |
| 238 | rv = WR1(sc, AS3722_INTERRUPT_MASK2, 0); |
| 239 | if (rv != 0) |
| 240 | return (ENXIO); |
| 241 | rv = WR1(sc, AS3722_INTERRUPT_MASK3, 0); |
| 242 | if (rv != 0) |
| 243 | return (ENXIO); |
| 244 | rv = WR1(sc, AS3722_INTERRUPT_MASK4, 0); |
| 245 | if (rv != 0) |
| 246 | return (ENXIO); |
| 247 | return (0); |
| 248 | } |
| 249 | |
| 250 | static int |
| 251 | as3722_parse_fdt(struct as3722_softc *sc, phandle_t node) |