2 * Hauppauge/PCTV Broadway Support
4 * Copyright (C) 2012 Devin Heitmueller <dheitmueller@kernellabs.com>
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 as published
8 * by the Free Software Foundation.
11 #include <linux/init.h>
12 #include <linux/platform_device.h>
14 #include <asm/mach-ralink/machine.h>
15 #include <asm/mach-ralink/dev-gpio-buttons.h>
16 #include <asm/mach-ralink/dev-gpio-leds.h>
17 #include <asm/mach-ralink/rt305x.h>
18 #include <asm/mach-ralink/rt305x_regs.h>
22 #define BROADWAY_GPIO_LED_DISKMOUNT 9
23 #define BROADWAY_GPIO_LED_WPS 14
25 #define BROADWAY_GPIO_BUTTON_WPS 0
26 #define BROADWAY_GPIO_BUTTON_FACTORYRESET 13
28 #define BROADWAY_KEYS_POLL_INTERVAL 20
29 #define BROADWAY_KEYS_DEBOUNCE_INTERVAL (3 * BROADWAY_KEYS_POLL_INTERVAL)
31 static struct gpio_led broadway_leds_gpio[] __initdata = {
33 .name = "red:diskmounted",
34 .gpio = BROADWAY_GPIO_LED_DISKMOUNT,
38 .name = "red:wps_active",
39 .gpio = BROADWAY_GPIO_LED_WPS,
44 static struct gpio_keys_button broadway_gpio_buttons[] __initdata = {
46 .desc = "Factory Reset button",
49 .debounce_interval = BROADWAY_KEYS_DEBOUNCE_INTERVAL,
50 .gpio = BROADWAY_GPIO_BUTTON_FACTORYRESET,
53 #ifdef DJH_WPS_BUTTON_NOT_WIRED_TO_GPIO
57 .code = KEY_WPS_BUTTON,
58 .debounce_interval = BROADWAY_KEYS_DEBOUNCE_INTERVAL,
59 .gpio = BROADWAY_GPIO_BUTTON_WPS,
65 static void __init broadway_init(void)
67 rt305x_gpio_init((RT305X_GPIO_MODE_GPIO <<
68 RT305X_GPIO_MODE_UART0_SHIFT));
70 rt305x_register_flash(0);
72 rt305x_esw_data.vlan_config = RT305X_ESW_VLAN_CONFIG_WLLLL;
73 rt305x_register_ethernet();
75 ramips_register_gpio_leds(-1, ARRAY_SIZE(broadway_leds_gpio),
77 ramips_register_gpio_buttons(-1, BROADWAY_KEYS_POLL_INTERVAL,
78 ARRAY_SIZE(broadway_gpio_buttons),
79 broadway_gpio_buttons);
81 rt305x_register_wifi();
82 rt305x_register_wdt();
83 rt305x_register_usb();
86 MIPS_MACHINE(RAMIPS_MACH_BROADWAY, "BROADWAY", "Hauppauge Broadway",