Page | 59
platform_driver_unregister(&gpio_led_driver);
#endif
#ifdef CONFIG_LEDS_GPIO_OF
of_unregister_platform_driver(&of_gpio_leds_driver);
#endif
}
module_init(gpio_led_init);
module_exit(gpio_led_exit);
MODULE_AUTHOR("Raphael Assenat <[email protected]>, Trent Piepho
<[email protected]>");
MODULE_DESCRIPTION("GPIO LED driver");
MODULE_LICENSE("GPL");
Apply for GPIO, and call led_classdev_register to register led_classdev
driver;
static int __devinit gpio_led_probe(struct platform_device
*pdev)
{
…
leds_data = kzalloc(sizeof(struct gpio_led_data) *
pdata->num_leds,
GFP_KERNEL);
…
for (i = 0; i < pdata->num_leds; i++) {
ret
=
create_gpio_led(&pdata->leds[i],
&leds_data[i],
&pdev->dev,
pdata->gpio_blink_set);
if (ret < 0)
goto err;
}
…
}
static int __devinit create_gpio_led(const struct gpio_led
*template,
struct gpio_led_data *led_dat, struct device *parent,
int (*blink_set)(unsigned, unsigned long *, unsigned
long *))
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...