Page | 44
MODULE_DESCRIPTION("Keyboard driver for GPIOs");
MODULE_ALIAS("platform:gpio-keys");
Call input_register_device to register input driver
static int __devinit gpio_keys_probe(struct platform_device *pdev)
{
…
input = input_allocate_device();
…
for (i = 0; i < pdata->nbuttons; i++) {
struct gpio_keys_button *button = &pdata->buttons[i];
struct gpio_button_data *bdata = &ddata->data[i];
unsigned int type = button->type ?: EV_KEY;
bdata->input = input;
bdata->button = button;
error = gpio_keys_setup_key(pdev, bdata, button);
if (error)
goto fail2;
if (button->wakeup)
wakeup = 1;
input_set_capability(input, type, button->code);
}
error = sysfs_create_group(&pdev->dev.kobj, &gpio_keys_attr_group);
if (error) {
dev_err(dev, "Unable to export keys/switches, error: %d\n",
error);
goto fail2;
}
error = input_register_device(input);
if (error) {
dev_err(dev, "Unable to register input device, error: %d\n",
error);
goto fail3;
}
Apply for GPIO and define the GPIO as input, and register GPIO
interrupt.
static int __devinit gpio_keys_setup_key(struct platform_device *pdev,
struct gpio_button_data *bdata,
Summary of Contents for SBC8600B
Page 1: ...SBC8600B Single Board Computer Quick Start Guide Version 1 1 23rd Jan 2014...
Page 9: ...Page 2 1 3 Board Interfaces Figure 1 SBC8600B Interfaces...
Page 10: ...Page 3 1 4 System Block Diagram Figure 2 SBC8600B System Block Diagram...
Page 11: ...Page 4 1 5 Physical Dimensions Figure 3 MINI8600B Physical Dimensions...
Page 12: ...Page 5 Figure 4 SBC8600B Physical Dimensions...
Page 114: ...Page 107...