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
[] = {
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",
36 static struct platform_device csb701_gpio_keys
= {
39 .dev
.platform_data
= &csb701_gpio_keys_data
,
42 static struct gpio_led_platform_data csb701_leds_gpio_data
= {
44 .num_leds
= ARRAY_SIZE(csb701_leds
),
47 static struct platform_device csb701_leds_gpio
= {
50 .dev
.platform_data
= &csb701_leds_gpio_data
,
53 static struct platform_device
*devices
[] __initdata
= {
58 static int __init
csb701_init(void)
60 if (!machine_is_csb726())
63 return platform_add_devices(devices
, ARRAY_SIZE(devices
));
66 module_init(csb701_init
);