MCPcopy Create free account
hub / github.com/F-Stack/f-stack / as3722_write_buf

Function as3722_write_buf

freebsd/arm/nvidia/as3722.c:149–170  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

147}
148
149int as3722_write_buf(struct as3722_softc *sc, uint8_t reg, uint8_t *buf,
150 size_t size)
151{
152 uint8_t data[1];
153 int rv;
154 struct iic_msg msgs[2] = {
155 {0, IIC_M_WR, 1, data},
156 {0, IIC_M_WR | IIC_M_NOSTART, size, buf},
157 };
158
159 msgs[0].slave = sc->bus_addr;
160 msgs[1].slave = sc->bus_addr;
161 data[0] = reg;
162
163 rv = iicbus_transfer(sc->dev, msgs, 2);
164 if (rv != 0) {
165 device_printf(sc->dev,
166 "Error when writing reg 0x%02X, rv: %d\n", reg, rv);
167 return (EIO);
168 }
169 return (0);
170}
171
172int
173as3722_modify(struct as3722_softc *sc, uint8_t reg, uint8_t clear, uint8_t set)

Callers 1

as3722_rtc_settimeFunction · 0.85

Calls 1

device_printfFunction · 0.85

Tested by

no test coverage detected