Page | 55
" direction for GPIO %d, error %d\n",
button->gpio, error);
goto fail3;
}
irq = gpio_to_irq(button->gpio);
if (irq < 0) {
error = irq;
dev_err(dev, "Unable to get irq number for GPIO
%d, error %d\n",
button->gpio, error);
goto fail3;
}
error = request_irq(irq, gpio_keys_isr,
IRQF_SHARED |
IRQF_TRIGGER_RISING
|
IRQF_TRIGGER_FALLING,
desc, bdata);
if (error) {
dev_err(dev, "Unable to claim irq %d; error %d\n",
irq, error);
goto fail3;
}
return 0;
fail3:
gpio_free(button->gpio);
fail2:
return error;
}
Interrupt processing; an interrupt is generated when pressing a button,
and then a key value will be returned;
static irqreturn_t gpio_keys_isr(int irq, void *dev_id)
{
…
schedule_work(&bdata->work);
…
}
Summary of Contents for SBC8140
Page 1: ...SBC8140 Single Board Computer User Manual Version 1 1 22nd Jan 2014...
Page 12: ...Page 6 1 4 Interfaces on the SBC8140 Figure 4 SBC8140 Interfaces...
Page 13: ...Page 7 1 5 System Block Diagram Figure 5 SBC8140 system block diagram...
Page 15: ...Page 9 1 6 2 Expansion Board Figure 8 Expansion board dimensions...
Page 128: ...Page 122...
Page 131: ...Page 125...
Page 139: ...Page 133 Appendix 5 FAQ Please visit http www elinux org SBC8600_FAQ...