1 From 31bc84d45320dad2392384381ad4d818ab21087a Mon Sep 17 00:00:00 2001
2 From: "Philip A. Prindeville" <philipp@redfish-solutions.com>
3 Date: Wed, 18 Jan 2012 11:15:33 -0700
4 Subject: [PATCH 1/1] geos: Platform driver for Geos and Geos2 single-board
7 Trivial platform driver for Traverse Technologies Geos and Geos2
8 single-board computers. Uses SMBIOS to identify platform.
9 Based on progressive revisions of the leds-net5501 driver that
10 was rewritten by Ed Wildgoose as a platform driver.
12 Supports GPIO-based LEDs (3) and 1 polled button which is
13 typically used for a soft reset.
15 Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
16 Reviewed-by: Ed Wildgoose <ed@wildgooses.com>
17 Acked-by: Andres Salomon <dilinger@queued.net>
18 Cc: Richard Purdie <rpurdie@rpsys.net>
19 Cc: Andrew Morton <akpm@linux-foundation.org>
21 arch/x86/Kconfig | 7 ++
22 arch/x86/platform/geode/Makefile | 1 +
23 arch/x86/platform/geode/geos.c | 128 ++++++++++++++++++++++++++++++++++++++
24 3 files changed, 136 insertions(+), 0 deletions(-)
25 create mode 100644 arch/x86/platform/geode/geos.c
27 diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
28 index 07c3f15..4ee921b 100644
29 --- a/arch/x86/Kconfig
30 +++ b/arch/x86/Kconfig
31 @@ -2168,6 +2168,13 @@ config ALIX
33 Note: You have to set alix.force=1 for boards with Award BIOS.
36 + bool "Traverse Technologies GEOS System Support (LEDS, GPIO, etc)"
40 + This option enables system support for the Traverse Technologies GEOS.
45 diff --git a/arch/x86/platform/geode/Makefile b/arch/x86/platform/geode/Makefile
46 index 07c9cd0..d8ba564 100644
47 --- a/arch/x86/platform/geode/Makefile
48 +++ b/arch/x86/platform/geode/Makefile
50 obj-$(CONFIG_ALIX) += alix.o
51 +obj-$(CONFIG_GEOS) += geos.o
52 diff --git a/arch/x86/platform/geode/geos.c b/arch/x86/platform/geode/geos.c
54 index 0000000..c2e6d53
56 +++ b/arch/x86/platform/geode/geos.c
59 + * System Specific setup for Traverse Technologies GEOS.
60 + * At the moment this means setup of GPIO control of LEDs.
62 + * Copyright (C) 2008 Constantin Baranov <const@mimas.ru>
63 + * Copyright (C) 2011 Ed Wildgoose <kernel@wildgooses.com>
64 + * and Philip Prindeville <philipp@redfish-solutions.com>
66 + * TODO: There are large similarities with leds-net5501.c
67 + * by Alessandro Zummo <a.zummo@towertech.it>
68 + * In the future leds-net5501.c should be migrated over to platform
70 + * This program is free software; you can redistribute it and/or modify
71 + * it under the terms of the GNU General Public License version 2
72 + * as published by the Free Software Foundation.
75 +#include <linux/kernel.h>
76 +#include <linux/init.h>
77 +#include <linux/io.h>
78 +#include <linux/string.h>
79 +#include <linux/module.h>
80 +#include <linux/leds.h>
81 +#include <linux/platform_device.h>
82 +#include <linux/gpio.h>
83 +#include <linux/input.h>
84 +#include <linux/gpio_keys.h>
85 +#include <linux/dmi.h>
87 +#include <asm/geode.h>
89 +static struct gpio_keys_button geos_gpio_buttons[] = {
91 + .code = KEY_RESTART,
94 + .desc = "Reset button",
97 + .debounce_interval = 100,
101 +static struct gpio_keys_platform_data geos_buttons_data = {
102 + .buttons = geos_gpio_buttons,
103 + .nbuttons = ARRAY_SIZE(geos_gpio_buttons),
104 + .poll_interval = 20,
107 +static struct platform_device geos_buttons_dev = {
108 + .name = "gpio-keys-polled",
111 + .platform_data = &geos_buttons_data,
115 +static struct gpio_led geos_leds[] = {
119 + .default_trigger = "default-on",
125 + .default_trigger = "default-off",
131 + .default_trigger = "default-off",
136 +static struct gpio_led_platform_data geos_leds_data = {
137 + .num_leds = ARRAY_SIZE(geos_leds),
141 +static struct platform_device geos_leds_dev = {
142 + .name = "leds-gpio",
144 + .dev.platform_data = &geos_leds_data,
147 +static struct __initdata platform_device *geos_devs[] = {
152 +static void __init register_geos(void)
154 + /* Setup LED control through leds-gpio driver */
155 + platform_add_devices(geos_devs, ARRAY_SIZE(geos_devs));
158 +static int __init geos_init(void)
160 + const char *vendor, *product;
165 + vendor = dmi_get_system_info(DMI_SYS_VENDOR);
166 + if (!vendor || strcmp(vendor, "Traverse Technologies"))
169 + product = dmi_get_system_info(DMI_PRODUCT_NAME);
170 + if (!product || strcmp(product, "Geos"))
173 + printk(KERN_INFO "%s: system is recognized as \"%s %s\"\n",
174 + KBUILD_MODNAME, vendor, product);
181 +module_init(geos_init);
183 +MODULE_AUTHOR("Philip Prindeville <philipp@redfish-solutions.com>");
184 +MODULE_DESCRIPTION("Traverse Technologies Geos System Setup");
185 +MODULE_LICENSE("GPL");