1 // SPDX-License-Identifier: GPL-2.0-only
3 * System Specific setup for Traverse Technologies GEOS.
4 * At the moment this means setup of GPIO control of LEDs.
6 * Copyright (C) 2008 Constantin Baranov <const@mimas.ru>
7 * Copyright (C) 2011 Ed Wildgoose <kernel@wildgooses.com>
8 * and Philip Prindeville <philipp@redfish-solutions.com>
10 * TODO: There are large similarities with leds-net5501.c
11 * by Alessandro Zummo <a.zummo@towertech.it>
12 * In the future leds-net5501.c should be migrated over to platform
15 #include <linux/kernel.h>
16 #include <linux/init.h>
18 #include <linux/string.h>
19 #include <linux/leds.h>
20 #include <linux/platform_device.h>
21 #include <linux/input.h>
22 #include <linux/gpio_keys.h>
23 #include <linux/dmi.h>
25 #include <asm/geode.h>
27 static struct gpio_keys_button geos_gpio_buttons
[] = {
32 .desc
= "Reset button",
35 .debounce_interval
= 100,
39 static struct gpio_keys_platform_data geos_buttons_data
= {
40 .buttons
= geos_gpio_buttons
,
41 .nbuttons
= ARRAY_SIZE(geos_gpio_buttons
),
45 static struct platform_device geos_buttons_dev
= {
46 .name
= "gpio-keys-polled",
49 .platform_data
= &geos_buttons_data
,
53 static struct gpio_led geos_leds
[] = {
57 .default_trigger
= "default-on",
63 .default_trigger
= "default-off",
69 .default_trigger
= "default-off",
74 static struct gpio_led_platform_data geos_leds_data
= {
75 .num_leds
= ARRAY_SIZE(geos_leds
),
79 static struct platform_device geos_leds_dev
= {
82 .dev
.platform_data
= &geos_leds_data
,
85 static struct platform_device
*geos_devs
[] __initdata
= {
90 static void __init
register_geos(void)
92 /* Setup LED control through leds-gpio driver */
93 platform_add_devices(geos_devs
, ARRAY_SIZE(geos_devs
));
96 static int __init
geos_init(void)
98 const char *vendor
, *product
;
103 vendor
= dmi_get_system_info(DMI_SYS_VENDOR
);
104 if (!vendor
|| strcmp(vendor
, "Traverse Technologies"))
107 product
= dmi_get_system_info(DMI_PRODUCT_NAME
);
108 if (!product
|| strcmp(product
, "Geos"))
111 printk(KERN_INFO
"%s: system is recognized as \"%s %s\"\n",
112 KBUILD_MODNAME
, vendor
, product
);
118 device_initcall(geos_init
);