Page | 54
bdata->button = button;
error = gpio_keys_setup_key(dev, bdata, button);
if (error)
goto fail2;
if (button->wakeup)
wakeup = 1;
input_set_capability(input,
type,
button->code);
}
error = input_register_device(input);
…
Apply for GPIO, set GPIO as input, and register GPIO interrupt;
static int __devinit gpio_keys_setup_key(struct device *dev,
struct
gpio_button_data
*bdata,
struct
gpio_keys_button
*button)
{
char *desc = button->desc ? button->desc : "gpio_keys";
int irq, error;
setup_timer(&bdata->timer, gpio_keys_timer, (unsigned
long)bdata);
INIT_WORK(&bdata->work, gpio_keys_work_func);
error = gpio_request(button->gpio, desc);
if (error < 0) {
dev_err(dev, "failed to request GPIO %d, error
%d\n",
button->gpio, error);
goto fail2;
}
error = gpio_direction_input(button->gpio);
if (error < 0) {
dev_err(dev, "failed to configure"
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...