1d2912cb1SThomas Gleixner // SPDX-License-Identifier: GPL-2.0-only
23197059aSPhilip A. Prindeville /*
33197059aSPhilip A. Prindeville * System Specific setup for Traverse Technologies GEOS.
43197059aSPhilip A. Prindeville * At the moment this means setup of GPIO control of LEDs.
53197059aSPhilip A. Prindeville *
63197059aSPhilip A. Prindeville * Copyright (C) 2008 Constantin Baranov <const@mimas.ru>
73197059aSPhilip A. Prindeville * Copyright (C) 2011 Ed Wildgoose <kernel@wildgooses.com>
83197059aSPhilip A. Prindeville * and Philip Prindeville <philipp@redfish-solutions.com>
93197059aSPhilip A. Prindeville *
103197059aSPhilip A. Prindeville * TODO: There are large similarities with leds-net5501.c
113197059aSPhilip A. Prindeville * by Alessandro Zummo <a.zummo@towertech.it>
123197059aSPhilip A. Prindeville * In the future leds-net5501.c should be migrated over to platform
133197059aSPhilip A. Prindeville */
143197059aSPhilip A. Prindeville
153197059aSPhilip A. Prindeville #include <linux/kernel.h>
163197059aSPhilip A. Prindeville #include <linux/init.h>
173197059aSPhilip A. Prindeville #include <linux/io.h>
183197059aSPhilip A. Prindeville #include <linux/string.h>
193197059aSPhilip A. Prindeville #include <linux/dmi.h>
203197059aSPhilip A. Prindeville
213197059aSPhilip A. Prindeville #include <asm/geode.h>
223197059aSPhilip A. Prindeville
23*298c9babSDmitry Torokhov #include "geode-common.h"
243197059aSPhilip A. Prindeville
25*298c9babSDmitry Torokhov static const struct geode_led geos_leds[] __initconst = {
26*298c9babSDmitry Torokhov { 6, true },
27*298c9babSDmitry Torokhov { 25, false },
28*298c9babSDmitry Torokhov { 27, false },
293197059aSPhilip A. Prindeville };
303197059aSPhilip A. Prindeville
register_geos(void)313197059aSPhilip A. Prindeville static void __init register_geos(void)
323197059aSPhilip A. Prindeville {
33*298c9babSDmitry Torokhov geode_create_restart_key(3);
34*298c9babSDmitry Torokhov geode_create_leds("geos", geos_leds, ARRAY_SIZE(geos_leds));
353197059aSPhilip A. Prindeville }
363197059aSPhilip A. Prindeville
geos_init(void)373197059aSPhilip A. Prindeville static int __init geos_init(void)
383197059aSPhilip A. Prindeville {
393197059aSPhilip A. Prindeville const char *vendor, *product;
403197059aSPhilip A. Prindeville
413197059aSPhilip A. Prindeville if (!is_geode())
423197059aSPhilip A. Prindeville return 0;
433197059aSPhilip A. Prindeville
443197059aSPhilip A. Prindeville vendor = dmi_get_system_info(DMI_SYS_VENDOR);
453197059aSPhilip A. Prindeville if (!vendor || strcmp(vendor, "Traverse Technologies"))
463197059aSPhilip A. Prindeville return 0;
473197059aSPhilip A. Prindeville
483197059aSPhilip A. Prindeville product = dmi_get_system_info(DMI_PRODUCT_NAME);
493197059aSPhilip A. Prindeville if (!product || strcmp(product, "Geos"))
503197059aSPhilip A. Prindeville return 0;
513197059aSPhilip A. Prindeville
523197059aSPhilip A. Prindeville printk(KERN_INFO "%s: system is recognized as \"%s %s\"\n",
533197059aSPhilip A. Prindeville KBUILD_MODNAME, vendor, product);
543197059aSPhilip A. Prindeville
553197059aSPhilip A. Prindeville register_geos();
563197059aSPhilip A. Prindeville
573197059aSPhilip A. Prindeville return 0;
583197059aSPhilip A. Prindeville }
59eb61aee7SPaul Gortmaker device_initcall(geos_init);
60