static irqreturn_t at91_cf_irq(int irq, void *_cf, struct pt_regs *r) { struct at91_cf_socket *cf = (struct at91_cf_socket *) _cf; if (irq == cf->board->det_pin) { unsigned present = at91_cf_present(cf); /* kick pccard as needed */ if (present != cf->present) { cf->present = present; pr_debug("%s: card %s\n", driver_name, present ? "present" : "gone"); pcmcia_parse_events(&cf->socket, SS_DETECT); } } return IRQ_HANDLED; }
static irqreturn_t at91_cf_irq(int irq, void *_cf) { struct at91_cf_socket *cf = _cf; if (irq == gpio_to_irq(cf->board->det_pin)) { unsigned present = at91_cf_present(cf); /* kick pccard as needed */ if (present != cf->present) { cf->present = present; dev_dbg(&cf->pdev->dev, "card %s\n", present ? "present" : "gone"); pcmcia_parse_events(&cf->socket, SS_DETECT); } } return IRQ_HANDLED; }
static irqreturn_t at91_cf_irq(int irq, void *_cf) { struct at91_cf_socket *cf = _cf; if (irq == gpio_to_irq(cf->board->det_pin)) { unsigned present = at91_cf_present(cf); /* */ if (present != cf->present) { cf->present = present; pr_debug("%s: card %s\n", driver_name, present ? "present" : "gone"); pcmcia_parse_events(&cf->socket, SS_DETECT); } } return IRQ_HANDLED; }
static int at91_cf_get_status(struct pcmcia_socket *s, u_int *sp) { struct at91_cf_socket *cf; if (!sp) return -EINVAL; cf = container_of(s, struct at91_cf_socket, socket); /* NOTE: CF is always 3VCARD */ if (at91_cf_present(cf)) { int rdy = gpio_is_valid(cf->board->irq_pin); /* RDY/nIRQ */ int vcc = gpio_is_valid(cf->board->vcc_pin); *sp = SS_DETECT | SS_3VCARD; if (!rdy || gpio_get_value(cf->board->irq_pin)) *sp |= SS_READY; if (!vcc || gpio_get_value(cf->board->vcc_pin)) *sp |= SS_POWERON; } else *sp = 0; return 0; }