Lines Matching refs:iot
114 bus_space_tag_t iot = sc->sc_iot;
121 bus_space_write_4(iot, ioh, I2C_ICR, ICR_UR);
122 bus_space_write_4(iot, ioh, I2C_ISAR, sc->sc_isar);
123 bus_space_write_4(iot, ioh, I2C_ISR, ISR_ITE | ISR_IRF);
125 bus_space_write_4(iot, ioh, I2C_ICR, ICR_IUE | ICR_SCLE);
128 bus_space_write_4(iot, ioh, I2C_IDBR, (slave<<1) | 0x1);
129 rv = bus_space_read_4(iot, ioh, I2C_ICR);
130 bus_space_write_4(iot, ioh, I2C_ICR, rv | ICR_START);
131 rv = bus_space_read_4(iot, ioh, I2C_ICR);
132 bus_space_write_4(iot, ioh, I2C_ICR, rv & ~ICR_STOP);
133 rv = bus_space_read_4(iot, ioh, I2C_ICR);
134 bus_space_write_4(iot, ioh, I2C_ICR, rv | ICR_TB);
137 while ((bus_space_read_4(iot, ioh, I2C_ISR) & ISR_ITE) == 0) {
143 bus_space_write_4(iot, ioh, I2C_ISR, ISR_ITE);
145 rv = bus_space_read_4(iot, ioh, I2C_ICR);
146 bus_space_write_4(iot, ioh, I2C_ICR, rv & ~ICR_START);
149 rv = bus_space_read_4(iot, ioh, I2C_ICR);
150 bus_space_write_4(iot, ioh, I2C_ICR, rv |
152 rv = bus_space_read_4(iot, ioh, I2C_ICR);
153 bus_space_write_4(iot, ioh, I2C_ICR, rv | ICR_TB);
156 while ((bus_space_read_4(iot, ioh, I2C_ISR) & ISR_IRF) == 0) {
162 bus_space_write_4(iot, ioh, I2C_ISR, ISR_IRF);
164 rv = bus_space_read_4(iot, ioh, I2C_IDBR);
166 bus_space_write_4(iot, ioh, I2C_ICR, ICR_IUE | ICR_BEIE | ICR_SADIE);
174 bus_space_write_4(iot, ioh, I2C_ICR, ICR_UR);
175 bus_space_write_4(iot, ioh, I2C_ISAR, sc->sc_isar);
176 bus_space_write_4(iot, ioh, I2C_ISR, ISR_ITE | ISR_IRF);
177 bus_space_write_4(iot, ioh, I2C_ICR, ICR_IUE | ICR_BEIE | ICR_SADIE);
185 bus_space_tag_t iot = sc->sc_iot;
192 bus_space_write_4(iot, ioh, I2C_ICR, ICR_UR);
193 bus_space_write_4(iot, ioh, I2C_ISAR, sc->sc_isar);
194 bus_space_write_4(iot, ioh, I2C_ISR, ISR_ITE);
196 bus_space_write_4(iot, ioh, I2C_ICR, ICR_IUE | ICR_SCLE);
199 bus_space_write_4(iot, ioh, I2C_IDBR, (slave<<1));
200 rv = bus_space_read_4(iot, ioh, I2C_ICR);
201 bus_space_write_4(iot, ioh, I2C_ICR, rv | ICR_START);
202 rv = bus_space_read_4(iot, ioh, I2C_ICR);
203 bus_space_write_4(iot, ioh, I2C_ICR, rv & ~ICR_STOP);
204 rv = bus_space_read_4(iot, ioh, I2C_ICR);
205 bus_space_write_4(iot, ioh, I2C_ICR, rv | ICR_TB);
208 while ((bus_space_read_4(iot, ioh, I2C_ISR) & ISR_ITE) == 0) {
213 if ((bus_space_read_4(iot, ioh, I2C_ISR) & ISR_ACKNAK) != 0)
216 bus_space_write_4(iot, ioh, I2C_ISR, ISR_ITE);
219 rv = bus_space_read_4(iot, ioh, I2C_ICR);
220 bus_space_write_4(iot, ioh, I2C_ICR, rv & ~ICR_START);
221 rv = bus_space_read_4(iot, ioh, I2C_ICR);
222 bus_space_write_4(iot, ioh, I2C_ICR, rv | ICR_STOP);
223 bus_space_write_4(iot, ioh, I2C_IDBR, value);
224 rv = bus_space_read_4(iot, ioh, I2C_ICR);
225 bus_space_write_4(iot, ioh, I2C_ICR, rv | ICR_TB);
228 while ((bus_space_read_4(iot, ioh, I2C_ISR) & ISR_ITE) == 0) {
233 if ((bus_space_read_4(iot, ioh, I2C_ISR) & ISR_ACKNAK) != 0)
236 bus_space_write_4(iot, ioh, I2C_ISR, ISR_ITE);
238 bus_space_write_4(iot, ioh, I2C_ICR, ICR_IUE | ICR_BEIE | ICR_SADIE);
246 bus_space_write_4(iot, ioh, I2C_ICR, ICR_UR);
247 bus_space_write_4(iot, ioh, I2C_ISAR, sc->sc_isar);
248 bus_space_write_4(iot, ioh, I2C_ISR, ISR_ITE);
249 bus_space_write_4(iot, ioh, I2C_ICR, ICR_IUE | ICR_BEIE | ICR_SADIE);
260 bus_space_tag_t iot = sc->sc_iot;
267 bus_space_write_4(iot, ioh, I2C_ICR, ICR_UR);
268 bus_space_write_4(iot, ioh, I2C_ISAR, sc->sc_isar);
269 bus_space_write_4(iot, ioh, I2C_ISR, ISR_ITE);
271 bus_space_write_4(iot, ioh, I2C_ICR, ICR_IUE | ICR_SCLE);
274 bus_space_write_4(iot, ioh, I2C_IDBR, (slave<<1) | (rw & 1));
275 rv = bus_space_read_4(iot, ioh, I2C_ICR);
276 bus_space_write_4(iot, ioh, I2C_ICR, rv | ICR_START);
277 rv = bus_space_read_4(iot, ioh, I2C_ICR);
278 bus_space_write_4(iot, ioh, I2C_ICR, rv | ICR_STOP);
279 rv = bus_space_read_4(iot, ioh, I2C_ICR);
282 while ((bus_space_read_4(iot, ioh, I2C_ISR) & ISR_ITE) == 0) {
287 if ((bus_space_read_4(iot, ioh, I2C_ISR) & ISR_ACKNAK) != 0)
290 bus_space_write_4(iot, ioh, I2C_ISR, ISR_ITE);
292 bus_space_write_4(iot, ioh, I2C_ICR, ICR_IUE | ICR_BEIE | ICR_SADIE);
300 bus_space_write_4(iot, ioh, I2C_ICR, ICR_UR);
301 bus_space_write_4(iot, ioh, I2C_ISAR, sc->sc_isar);
302 bus_space_write_4(iot, ioh, I2C_ISR, ISR_ITE);
303 bus_space_write_4(iot, ioh, I2C_ICR, ICR_IUE | ICR_BEIE | ICR_SADIE);
311 bus_space_tag_t iot = sc->sc_iot;
318 bus_space_write_4(iot, ioh, I2C_ICR, ICR_UR);
319 bus_space_write_4(iot, ioh, I2C_ISAR, sc->sc_isar);
320 bus_space_write_4(iot, ioh, I2C_ISR, ISR_ITE);
322 bus_space_write_4(iot, ioh, I2C_ICR, ICR_IUE | ICR_SCLE);
325 bus_space_write_4(iot, ioh, I2C_IDBR, (slave<<1));
326 rv = bus_space_read_4(iot, ioh, I2C_ICR);
327 bus_space_write_4(iot, ioh, I2C_ICR, rv | ICR_START);
328 rv = bus_space_read_4(iot, ioh, I2C_ICR);
329 bus_space_write_4(iot, ioh, I2C_ICR, rv & ~ICR_STOP);
330 rv = bus_space_read_4(iot, ioh, I2C_ICR);
331 bus_space_write_4(iot, ioh, I2C_ICR, rv | ICR_TB);
334 while ((bus_space_read_4(iot, ioh, I2C_ISR) & ISR_ITE) == 0) {
339 if ((bus_space_read_4(iot, ioh, I2C_ISR) & ISR_ACKNAK) != 0)
342 bus_space_write_4(iot, ioh, I2C_ISR, ISR_ITE);
345 bus_space_write_4(iot, ioh, I2C_IDBR, (value >> 8) & 0xff);
346 rv = bus_space_read_4(iot, ioh, I2C_ICR);
347 bus_space_write_4(iot, ioh, I2C_ICR, rv & ~ICR_START);
348 rv = bus_space_read_4(iot, ioh, I2C_ICR);
349 bus_space_write_4(iot, ioh, I2C_ICR, rv & ~ICR_STOP);
350 rv = bus_space_read_4(iot, ioh, I2C_ICR);
351 bus_space_write_4(iot, ioh, I2C_ICR, rv | ICR_TB);
354 while ((bus_space_read_4(iot, ioh, I2C_ISR) & ISR_ITE) == 0) {
359 if ((bus_space_read_4(iot, ioh, I2C_ISR) & ISR_ACKNAK) != 0)
362 bus_space_write_4(iot, ioh, I2C_ISR, ISR_ITE);
365 bus_space_write_4(iot, ioh, I2C_IDBR, value & 0xff);
366 rv = bus_space_read_4(iot, ioh, I2C_ICR);
367 bus_space_write_4(iot, ioh, I2C_ICR, rv & ~ICR_START);
368 rv = bus_space_read_4(iot, ioh, I2C_ICR);
369 bus_space_write_4(iot, ioh, I2C_ICR, rv | ICR_STOP);
370 rv = bus_space_read_4(iot, ioh, I2C_ICR);
371 bus_space_write_4(iot, ioh, I2C_ICR, rv | ICR_TB);
374 while ((bus_space_read_4(iot, ioh, I2C_ISR) & ISR_ITE) == 0) {
379 if ((bus_space_read_4(iot, ioh, I2C_ISR) & ISR_ACKNAK) != 0)
382 bus_space_write_4(iot, ioh, I2C_ISR, ISR_ITE);
384 rv = bus_space_read_4(iot, ioh, I2C_ICR);
385 bus_space_write_4(iot, ioh, I2C_ICR, rv & ~ICR_STOP);
387 bus_space_write_4(iot, ioh, I2C_ICR, ICR_IUE | ICR_BEIE | ICR_SADIE);
395 bus_space_write_4(iot, ioh, I2C_ICR, ICR_UR);
396 bus_space_write_4(iot, ioh, I2C_ISAR, sc->sc_isar);
397 bus_space_write_4(iot, ioh, I2C_ISR, ISR_ITE);
398 bus_space_write_4(iot, ioh, I2C_ICR, ICR_IUE | ICR_BEIE | ICR_SADIE);
537 bus_space_tag_t iot = sc->sc_iot;
554 bus_space_write_4(iot, ioh, I2C_ISAR, sc->sc_isar);
555 bus_space_write_4(iot, ioh, I2C_ICR, ICR_IUE | ICR_SADIE);
560 rv = bus_space_read_4(iot, ioh, I2C_ISR);
567 bus_space_write_4(iot, ioh, I2C_ISR, ISR_SAD); /* Clear SAD */
569 rv = bus_space_read_4(iot, ioh, I2C_ISR);
577 bus_space_write_4(iot, ioh, I2C_IDBR, data[n]);
580 rv = bus_space_read_4(iot, ioh, I2C_ICR);
581 bus_space_write_4(iot, ioh, I2C_ICR, rv | ICR_TB | ICR_ITEIE);
586 rv = bus_space_read_4(iot, ioh, I2C_ISR);
594 bus_space_write_4(iot, ioh, I2C_ISR, ISR_ITE);
598 bus_space_write_4(iot, ioh, I2C_IDBR, data[n]);
600 rv = bus_space_read_4(iot, ioh, I2C_ICR);
601 bus_space_write_4(iot, ioh, I2C_ICR,
607 rv = bus_space_read_4(iot, ioh, I2C_ISR);
615 bus_space_write_4(iot, ioh, I2C_ISR, ISR_ITE);
623 rv = bus_space_read_4(iot, ioh, I2C_ICR);
624 bus_space_write_4(iot, ioh, I2C_ICR,
630 rv = bus_space_read_4(iot, ioh, I2C_ISR);
639 iot, ioh, I2C_IDBR);
641 bus_space_write_4(iot, ioh, I2C_ISR, ISR_IRF);
645 rv = bus_space_read_4(iot, ioh, I2C_ICR);
646 bus_space_write_4(iot, ioh, I2C_ICR, rv | ICR_TB);
651 rv = bus_space_read_4(iot, ioh, I2C_ISR);
659 bus_space_write_4(iot, ioh, I2C_ISR, ISR_SSD);
662 bus_space_write_4(iot, ioh, I2C_ICR, ICR_IUE | ICR_BEIE | ICR_SADIE);
671 bus_space_tag_t iot = sc->sc_iot;
676 isr = bus_space_read_4(iot, ioh, I2C_ISR);
677 bus_space_write_4(iot, ioh, I2C_ISR,
687 rv = bus_space_read_4(iot, ioh, I2C_ICR);
688 bus_space_write_4(iot, ioh, I2C_ICR,
694 *buf = bus_space_read_4(iot, ioh, I2C_IDBR);
698 rv = bus_space_read_4(iot, ioh, I2C_ICR);
699 bus_space_write_4(iot, ioh, I2C_ICR,
705 bus_space_write_4(iot, ioh, I2C_ICR,