Path: blob/master/arch/arm/mach-gemini/board-nas4220b.c
10817 views
/*1* Support for Raidsonic NAS-4220-B2*3* Copyright (C) 2009 Janos Laube <[email protected]>4*5* based on rut1xx.c6* Copyright (C) 2008 Paulius Zaleckas <[email protected]>7*8* This program is free software; you can redistribute it and/or modify9* it under the terms of the GNU General Public License as published by10* the Free Software Foundation; either version 2 of the License, or11* (at your option) any later version.12*/1314#include <linux/kernel.h>15#include <linux/init.h>16#include <linux/platform_device.h>17#include <linux/leds.h>18#include <linux/input.h>19#include <linux/gpio_keys.h>20#include <linux/mdio-gpio.h>21#include <linux/io.h>2223#include <asm/setup.h>24#include <asm/mach-types.h>25#include <asm/mach/arch.h>26#include <asm/mach/time.h>2728#include <mach/hardware.h>29#include <mach/global_reg.h>3031#include "common.h"3233static struct sys_timer ib4220b_timer = {34.init = gemini_timer_init,35};3637static struct gpio_led ib4220b_leds[] = {38{39.name = "nas4220b:orange:hdd",40.default_trigger = "none",41.gpio = 60,42},43{44.name = "nas4220b:green:os",45.default_trigger = "heartbeat",46.gpio = 62,47},48};4950static struct gpio_led_platform_data ib4220b_leds_data = {51.num_leds = ARRAY_SIZE(ib4220b_leds),52.leds = ib4220b_leds,53};5455static struct platform_device ib4220b_led_device = {56.name = "leds-gpio",57.id = -1,58.dev = {59.platform_data = &ib4220b_leds_data,60},61};6263static struct gpio_keys_button ib4220b_keys[] = {64{65.code = KEY_SETUP,66.gpio = 61,67.active_low = 1,68.desc = "Backup Button",69.type = EV_KEY,70},71{72.code = KEY_RESTART,73.gpio = 63,74.active_low = 1,75.desc = "Softreset Button",76.type = EV_KEY,77},78};7980static struct gpio_keys_platform_data ib4220b_keys_data = {81.buttons = ib4220b_keys,82.nbuttons = ARRAY_SIZE(ib4220b_keys),83};8485static struct platform_device ib4220b_key_device = {86.name = "gpio-keys",87.id = -1,88.dev = {89.platform_data = &ib4220b_keys_data,90},91};9293static void __init ib4220b_init(void)94{95gemini_gpio_init();96platform_register_uart();97platform_register_pflash(SZ_16M, NULL, 0);98platform_device_register(&ib4220b_led_device);99platform_device_register(&ib4220b_key_device);100platform_register_rtc();101}102103MACHINE_START(NAS4220B, "Raidsonic NAS IB-4220-B")104.boot_params = 0x100,105.map_io = gemini_map_io,106.init_irq = gemini_init_irq,107.timer = &ib4220b_timer,108.init_machine = ib4220b_init,109MACHINE_END110111112