Page | 45
struct gpio_keys_button *button)
{
const char *desc = button->desc ? button->desc : "gpio_keys";
struct device *dev = &pdev->dev;
unsigned long irqflags;
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"
" direction for GPIO %d, error %d\n",
button->gpio, error);
goto fail3;
}
if (button->debounce_interval) {
error = gpio_set_debounce(button->gpio,
button->debounce_interval * 1000);
/* use timer if gpiolib doesn't provide debounce */
if (error < 0)
bdata->timer_debounce = button->debounce_interval;
}
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;
}
irqflags = IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING;
/*
* If platform has specified that the button can be disabled,
* we don't want it to share the interrupt line.
Содержание SBC8600B
Страница 1: ...SBC8600B Single Board Computer Quick Start Guide Version 1 1 23rd Jan 2014...
Страница 9: ...Page 2 1 3 Board Interfaces Figure 1 SBC8600B Interfaces...
Страница 10: ...Page 3 1 4 System Block Diagram Figure 2 SBC8600B System Block Diagram...
Страница 11: ...Page 4 1 5 Physical Dimensions Figure 3 MINI8600B Physical Dimensions...
Страница 12: ...Page 5 Figure 4 SBC8600B Physical Dimensions...
Страница 113: ...Page 106 3 When the following appears select Continue 4 Please wait until the installation is completed...
Страница 114: ...Page 107...