Embest SBC8140 User Manual Page 61

  • Download
  • Add to my manuals
  • Print
  • Page
    / 144
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 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);
}
Page view 60
1 2 ... 56 57 58 59 60 61 62 63 64 65 66 ... 143 144

Comments to this Manuals

No comments