Merge tag 'sched-urgent-2020-12-27' of git://git.kernel.org/pub/scm/linux/kernel...
[linux/fpc-iii.git] / arch / arm / mach-pxa / csb701.c
blob527c9fdf979539b0c0752e61f3b241d42ec7ae0e
1 // SPDX-License-Identifier: GPL-2.0
2 #include <linux/kernel.h>
3 #include <linux/module.h>
4 #include <linux/platform_device.h>
5 #include <linux/gpio_keys.h>
6 #include <linux/input.h>
7 #include <linux/leds.h>
9 #include <asm/mach-types.h>
11 static struct gpio_keys_button csb701_buttons[] = {
13 .code = 0x7,
14 .gpio = 1,
15 .active_low = 1,
16 .desc = "SW2",
17 .type = EV_SW,
18 .wakeup = 1,
22 static struct gpio_keys_platform_data csb701_gpio_keys_data = {
23 .buttons = csb701_buttons,
24 .nbuttons = ARRAY_SIZE(csb701_buttons),
27 static struct gpio_led csb701_leds[] = {
29 .name = "csb701:yellow:heartbeat",
30 .default_trigger = "heartbeat",
31 .gpio = 11,
32 .active_low = 1,
36 static struct platform_device csb701_gpio_keys = {
37 .name = "gpio-keys",
38 .id = -1,
39 .dev.platform_data = &csb701_gpio_keys_data,
42 static struct gpio_led_platform_data csb701_leds_gpio_data = {
43 .leds = csb701_leds,
44 .num_leds = ARRAY_SIZE(csb701_leds),
47 static struct platform_device csb701_leds_gpio = {
48 .name = "leds-gpio",
49 .id = -1,
50 .dev.platform_data = &csb701_leds_gpio_data,
53 static struct platform_device *devices[] __initdata = {
54 &csb701_gpio_keys,
55 &csb701_leds_gpio,
58 static int __init csb701_init(void)
60 if (!machine_is_csb726())
61 return -ENODEV;
63 return platform_add_devices(devices, ARRAY_SIZE(devices));
66 module_init(csb701_init);