Embest SBC8140 Instrukcja Użytkownika Strona 61

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 144
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 60
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);
}
Przeglądanie stron 60
1 2 ... 56 57 58 59 60 61 62 63 64 65 66 ... 143 144

Komentarze do niniejszej Instrukcji

Brak uwag