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 --- a/arch/x86/Kconfig
28 +++ b/arch/x86/Kconfig
29 @@ -2133,6 +2133,13 @@ config ALIX
31 Note: You have to set alix.force=1 for boards with Award BIOS.
34 + bool "Traverse Technologies GEOS System Support (LEDS, GPIO, etc)"
38 + This option enables system support for the Traverse Technologies GEOS.
43 --- a/arch/x86/platform/geode/Makefile
44 +++ b/arch/x86/platform/geode/Makefile
46 obj-$(CONFIG_ALIX) += alix.o
47 +obj-$(CONFIG_GEOS) += geos.o
49 +++ b/arch/x86/platform/geode/geos.c
52 + * System Specific setup for Traverse Technologies GEOS.
53 + * At the moment this means setup of GPIO control of LEDs.
55 + * Copyright (C) 2008 Constantin Baranov <const@mimas.ru>
56 + * Copyright (C) 2011 Ed Wildgoose <kernel@wildgooses.com>
57 + * and Philip Prindeville <philipp@redfish-solutions.com>
59 + * TODO: There are large similarities with leds-net5501.c
60 + * by Alessandro Zummo <a.zummo@towertech.it>
61 + * In the future leds-net5501.c should be migrated over to platform
63 + * This program is free software; you can redistribute it and/or modify
64 + * it under the terms of the GNU General Public License version 2
65 + * as published by the Free Software Foundation.
68 +#include <linux/kernel.h>
69 +#include <linux/init.h>
70 +#include <linux/io.h>
71 +#include <linux/string.h>
72 +#include <linux/module.h>
73 +#include <linux/leds.h>
74 +#include <linux/platform_device.h>
75 +#include <linux/gpio.h>
76 +#include <linux/input.h>
77 +#include <linux/gpio_keys.h>
78 +#include <linux/dmi.h>
80 +#include <asm/geode.h>
82 +static struct gpio_keys_button geos_gpio_buttons[] = {
84 + .code = KEY_RESTART,
87 + .desc = "Reset button",
90 + .debounce_interval = 100,
94 +static struct gpio_keys_platform_data geos_buttons_data = {
95 + .buttons = geos_gpio_buttons,
96 + .nbuttons = ARRAY_SIZE(geos_gpio_buttons),
97 + .poll_interval = 20,
100 +static struct platform_device geos_buttons_dev = {
101 + .name = "gpio-keys-polled",
104 + .platform_data = &geos_buttons_data,
108 +static struct gpio_led geos_leds[] = {
112 + .default_trigger = "default-on",
118 + .default_trigger = "default-off",
124 + .default_trigger = "default-off",
129 +static struct gpio_led_platform_data geos_leds_data = {
130 + .num_leds = ARRAY_SIZE(geos_leds),
134 +static struct platform_device geos_leds_dev = {
135 + .name = "leds-gpio",
137 + .dev.platform_data = &geos_leds_data,
140 +static struct __initdata platform_device *geos_devs[] = {
145 +static void __init register_geos(void)
147 + /* Setup LED control through leds-gpio driver */
148 + platform_add_devices(geos_devs, ARRAY_SIZE(geos_devs));
151 +static int __init geos_init(void)
153 + const char *vendor, *product;
158 + vendor = dmi_get_system_info(DMI_SYS_VENDOR);
159 + if (!vendor || strcmp(vendor, "Traverse Technologies"))
162 + product = dmi_get_system_info(DMI_PRODUCT_NAME);
163 + if (!product || strcmp(product, "Geos"))
166 + printk(KERN_INFO "%s: system is recognized as \"%s %s\"\n",
167 + KBUILD_MODNAME, vendor, product);
174 +module_init(geos_init);
176 +MODULE_AUTHOR("Philip Prindeville <philipp@redfish-solutions.com>");
177 +MODULE_DESCRIPTION("Traverse Technologies Geos System Setup");
178 +MODULE_LICENSE("GPL");