Home | History | Annotate | Download | only in at91

Lines Matching defs:ph

139 	struct at91cf_handle *ph;
177 ph = kmem_zalloc(sizeof(*ph), KM_SLEEP);
178 sc->sc_ph = ph;
179 ph->ph_sc = sc;
180 ph->ph_space[IO].base = sa->sa_addr + IO_BASE;
181 ph->ph_space[IO].size = IO_SIZE;
182 ph->ph_space[COMMON].base = sa->sa_addr + COMMON_BASE;
183 ph->ph_space[COMMON].size = COMMON_SIZE;
184 ph->ph_space[ATTRIBUTE].base = sa->sa_addr + MEMORY_BASE;
185 ph->ph_space[ATTRIBUTE].size = MEMORY_SIZE;
186 at91cf_attach_socket(ph);
194 at91cf_attach_socket(struct at91cf_handle *ph)
196 struct at91cf_softc *sc = ph->ph_sc;
200 ph->ph_width = 16;
201 ph->ph_vcc = 3;
202 ph->ph_event_thread = NULL;
203 ph->ph_run = 0;
204 ph->ph_ih_func = NULL;
205 ph->ph_ih_arg = NULL;
207 ph->ph_status = (*cscf->card_detect)(sc);
216 at91cf_config_socket(struct at91cf_handle *ph)
218 struct at91cf_softc *sc = ph->ph_sc;
225 paa.pch = (pcmcia_chipset_handle_t)ph;
226 ph->ph_card = config_found(sc->sc_dev, &paa, at91cf_print, CFARGS_NONE);
228 (*cscf->intr_establish)(sc, CD_IRQ, IPL_BIO, at91cf_intr_carddetect, ph);
232 kthread_create(PRI_NONE, 0, NULL, at91cf_create_event_thread, ph,
233 &ph->ph_event_thread, "%s", device_xname(sc->sc_dev));
245 struct at91cf_handle *ph = arg;
246 struct at91cf_softc *sc = ph->ph_sc;
249 ph->ph_status = (*cscf->card_detect)(sc);
251 DPRINTFN(1, ("at91cf_create_event_thread: status=%d\n", ph->ph_status));
253 if (ph->ph_status)
254 pcmcia_card_attach(ph->ph_card);
256 ph->ph_run = 1;
257 kthread_create(PRI_NONE, 0, NULL, at91cf_event_thread, ph,
258 &ph->ph_event_thread, "%s", device_xname(sc->sc_dev));
264 struct at91cf_handle *ph = arg;
268 status = ph->ph_status;
269 tsleep(ph, PWAIT, "CSC wait", 0);
270 if (!ph->ph_run)
273 DPRINTFN(1, ("at91cf_event_thread: old status=%d, new status=%d\n", status, ph->ph_status));
275 if (!status && ph->ph_status)
276 pcmcia_card_attach(ph->ph_card);
277 else if (status && !ph->ph_status)
278 pcmcia_card_detach(ph->ph_card, DETACH_FORCE);
281 DPRINTFN(1, ("at91cf_event_thread: run=%d\n",ph->ph_run));
282 ph->ph_event_thread = NULL;
289 struct at91cf_handle *ph = arg;
292 ph->ph_run = 0;
293 wakeup(ph);
299 struct at91cf_handle *ph = arg;
300 struct at91cf_softc *sc = ph->ph_sc;
306 DPRINTFN(1, ("at91cf_intr: nstatus=%#x, ostatus=%#x\n", nstatus, ph->ph_status));
308 if (nstatus != ph->ph_status) {
309 ph->ph_status = nstatus;
310 wakeup(ph);
320 struct at91cf_handle *ph = (struct at91cf_handle *)pch;
321 struct at91cf_softc *sc = ph->ph_sc;
340 struct at91cf_handle *ph = (struct at91cf_handle *)pch;
341 struct at91cf_softc *sc = ph->ph_sc;
352 ph->ph_width = 8;
354 ph->ph_width = 16;
357 pa += ph->ph_space[ATTRIBUTE].base;
360 pa += ph->ph_space[COMMON].base;
376 struct at91cf_handle *ph = (struct at91cf_handle *)pch;
377 struct at91cf_softc *sc = ph->ph_sc;
388 struct at91cf_handle *ph = (struct at91cf_handle *)pch;
389 struct at91cf_softc *sc = ph->ph_sc;
397 pa = pih->addr + ph->ph_space[IO].base;
404 struct at91cf_handle *ph = (struct at91cf_handle *)pch;
405 struct at91cf_softc *sc = ph->ph_sc;
416 struct at91cf_handle *ph = (struct at91cf_handle *)pch;
423 ph->ph_width = 8;
428 ph->ph_width = 16;
448 struct at91cf_handle *ph = (struct at91cf_handle *)pch;
449 struct at91cf_softc *sc = ph->ph_sc;
454 if (ph->ph_ih_func)
457 ph->ph_ih_func = ih_func;
458 ph->ph_ih_arg = ih_arg;
460 return (*cscf->intr_establish)(sc, CF_IRQ, ipl, at91cf_intr_socket, ph);
467 struct at91cf_handle *ph = (struct at91cf_handle *)pch;
468 struct at91cf_softc *sc = ph->ph_sc;
473 ph->ph_ih_func = NULL;
474 ph->ph_ih_arg = NULL;
482 struct at91cf_handle *ph = arg;
483 struct at91cf_softc *sc = ph->ph_sc;
487 if (ph->ph_ih_func) {
489 if (ph->ph_type == PCMCIA_IFTYPE_IO)
492 err = (*ph->ph_ih_func)(ph->ph_ih_arg);
503 struct at91cf_handle *ph = (struct at91cf_handle *)pch;
504 struct at91cf_softc *sc = ph->ph_sc;
517 struct at91cf_handle *ph = (struct at91cf_handle *)pch;
518 struct at91cf_softc *sc = ph->ph_sc;
531 struct at91cf_handle *ph = (struct at91cf_handle *)pch;
535 ph->ph_type = type;
552 at91cf_get_voltage(struct at91cf_handle *ph)
554 struct at91cf_softc *sc = ph->ph_sc;
559 if (eppio_read(sc->sc_pio, ph->ph_port, ph->ph_vs[0])) {
572 DPRINTFN(1, ("at91cf_get_voltage: vs1=%d, vs2=%d (%dV)\n",eppio_read_bit(sc->sc_pio, ph->ph_port, ph->ph_vs[0]),eppio_read_bit(sc->sc_pio, ph->ph_port, ph->ph_vs[1]),vcc));