[adm5120] add missing buttons device for RB-1xx boards, thanks to Christophe Lucas
[openwrt-10.03/.git] / target / linux / adm5120 / files / arch / mips / adm5120 / boards / mikrotik.c
index 48a7272afd7efd4fd55407d66abd740fb6de4331..54fb8c03b7917dabeaac18f4b78056f852e3d856 100644 (file)
@@ -3,8 +3,8 @@
  *
  *  Mikrotik RouterBOARD 1xx series
  *
- *  Copyright (C) 2007 OpenWrt.org
- *  Copyright (C) 2007 Gabor Juhos <juhosg at openwrt.org>
+ *  Copyright (C) 2007-2008 OpenWrt.org
+ *  Copyright (C) 2007-2008 Gabor Juhos <juhosg at openwrt.org>
  *
  *  NAND initialization code was based on a driver for Linux 2.6.19+ which
  *  was derived from the driver for Linux 2.4.xx published by Mikrotik for
@@ -86,6 +86,7 @@ static struct mtd_partition rb1xx_nand_parts[] = {
 static struct platform_device *rb1xx_devices[] __initdata = {
        &adm5120_flash0_device,
        &adm5120_nand_device,
+       &adm5120_buttons_device,
 };
 
 /*
@@ -132,6 +133,7 @@ static struct platform_device rb153_cf_device = {
 static struct platform_device *rb153_devices[] __initdata = {
        &adm5120_flash0_device,
        &adm5120_nand_device,
+       &adm5120_buttons_device,
        &rb153_cf_device,
 };
 
@@ -248,6 +250,10 @@ static void __init rb1xx_setup(void)
        adm5120_nand_set_spn(1);
        adm5120_nand_set_wpn(0);
 
+       adm5120_buttons_data.nbuttons = 1;
+       adm5120_buttons[0].desc = "reset button";
+       adm5120_buttons[0].gpio = ADM5120_GPIO_PIN7;
+
        rb1xx_flash_setup();
        rb1xx_mac_setup();
 }
@@ -269,6 +275,10 @@ static void __init rb150_setup(void)
        adm5120_nand_data.ctrl.cmd_ctrl = rb150_nand_cmd_ctrl;
        adm5120_nand_data.ctrl.dev_ready = rb150_nand_ready;
 
+       adm5120_buttons_data.nbuttons = 1;
+       adm5120_buttons[0].desc = "reset button";
+       adm5120_buttons[0].gpio = ADM5120_GPIO_PIN1; /* FIXME: valid? */
+
        adm5120_flash0_data.window_size = 512*1024;
 
        rb1xx_flash_setup();