Lines Matching +full:wait +full:- +full:pin

1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
56 * Polling mode for master operations wait for a new
65 while (counter--) { in pcf_wait_byte()
66 if ((pcf_get_S1(sc) & PIN) == 0) in pcf_wait_byte()
91 if (sc->pcf_started) { in pcf_stop_locked()
93 pcf_set_S1(sc, PIN|ESO|ENI|STO|ACK); in pcf_stop_locked()
95 sc->pcf_started = 0; in pcf_stop_locked()
110 DELAY(10); /* XXX wait 10 us */ in pcf_noack()
111 } while (k--); in pcf_noack()
134 /* wait for address sent, polling */ in pcf_repeated_start()
179 pcf_set_S1(sc, PIN|ESO|STA|ACK); in pcf_start()
181 sc->pcf_started = 1; in pcf_start()
183 /* wait for address sent, polling */ in pcf_start()
230 if (status & PIN) { in pcf_intr()
242 iicbus_intr(sc->iicbus, INTR_ERROR, &error); in pcf_intr()
250 switch(sc->pcf_slave_mode) { in pcf_intr()
257 sc->pcf_slave_mode = SLAVE_RECEIVER; in pcf_intr()
259 iicbus_intr(sc->iicbus, INTR_NOACK, NULL); in pcf_intr()
264 iicbus_intr(sc->iicbus, INTR_TRANSMIT, &data); in pcf_intr()
274 iicbus_intr(sc->iicbus, INTR_GENERAL, &addr); in pcf_intr()
276 iicbus_intr(sc->iicbus, INTR_START, &addr); in pcf_intr()
279 sc->pcf_slave_mode = SLAVE_TRANSMITTER; in pcf_intr()
282 iicbus_intr(sc->iicbus, INTR_TRANSMIT, &data); in pcf_intr()
297 iicbus_intr(sc->iicbus, INTR_STOP, NULL); in pcf_intr()
304 iicbus_intr(sc->iicbus, INTR_RECEIVE, &data); in pcf_intr()
310 sc->pcf_slave_mode); in pcf_intr()
313 } while ((pcf_get_S1(sc) & PIN) == 0); in pcf_intr()
320 pcf_set_S1(sc, PIN|ESO|ENI|ACK); in pcf_intr()
322 sc->pcf_slave_mode = SLAVE_RECEIVER; in pcf_intr()
335 *oldaddr = sc->pcf_addr; in pcf_rst_card()
339 sc->pcf_addr = PCF_DEFAULT_ADDR; in pcf_rst_card()
341 sc->pcf_addr = addr; in pcf_rst_card()
343 pcf_set_S1(sc, PIN); /* initialize S1 */ in pcf_rst_card()
346 pcf_set_S0(sc, sc->pcf_addr >> 1); in pcf_rst_card()
349 pcf_set_S1(sc, PIN|ES1); in pcf_rst_card()
369 pcf_set_S1(sc, PIN|ESO|ENI|ACK); in pcf_rst_card()
371 sc->pcf_slave_mode = SLAVE_RECEIVER; in pcf_rst_card()
393 /* wait for the byte to be send */ in pcf_write()
403 len --; in pcf_write()
444 /* wait for trigged byte */ in pcf_read()
462 len --; in pcf_read()