PM / Domains: Check device PM QoS flags in pm_genpd_poweroff()
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / arch / arm / mach-kirkwood / board-ib62x0.c
blobcfc47f80e73436e20b19e2b7c7a43cba472b7dce
1 /*
2 * Copyright 2012 (C), Simon Baatz <gmbnomis@gmail.com>
4 * arch/arm/mach-kirkwood/board-ib62x0.c
6 * RaidSonic ICY BOX IB-NAS6210 & IB-NAS6220 init for drivers not
7 * converted to flattened device tree yet.
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
14 #include <linux/kernel.h>
15 #include <linux/init.h>
16 #include <linux/platform_device.h>
17 #include <linux/mtd/partitions.h>
18 #include <linux/ata_platform.h>
19 #include <linux/mv643xx_eth.h>
20 #include <linux/gpio.h>
21 #include <linux/input.h>
22 #include <asm/mach-types.h>
23 #include <asm/mach/arch.h>
24 #include <mach/kirkwood.h>
25 #include "common.h"
26 #include "mpp.h"
28 #define IB62X0_GPIO_POWER_OFF 24
30 static struct mv643xx_eth_platform_data ib62x0_ge00_data = {
31 .phy_addr = MV643XX_ETH_PHY_ADDR(8),
34 static unsigned int ib62x0_mpp_config[] __initdata = {
35 MPP0_NF_IO2,
36 MPP1_NF_IO3,
37 MPP2_NF_IO4,
38 MPP3_NF_IO5,
39 MPP4_NF_IO6,
40 MPP5_NF_IO7,
41 MPP18_NF_IO0,
42 MPP19_NF_IO1,
43 MPP22_GPIO, /* OS LED red */
44 MPP24_GPIO, /* Power off device */
45 MPP25_GPIO, /* OS LED green */
46 MPP27_GPIO, /* USB transfer LED */
47 MPP28_GPIO, /* Reset button */
48 MPP29_GPIO, /* USB Copy button */
52 static void ib62x0_power_off(void)
54 gpio_set_value(IB62X0_GPIO_POWER_OFF, 1);
57 void __init ib62x0_init(void)
60 * Basic setup. Needs to be called early.
62 kirkwood_mpp_conf(ib62x0_mpp_config);
64 kirkwood_ehci_init();
65 kirkwood_ge00_init(&ib62x0_ge00_data);
66 if (gpio_request(IB62X0_GPIO_POWER_OFF, "ib62x0:power:off") == 0 &&
67 gpio_direction_output(IB62X0_GPIO_POWER_OFF, 0) == 0)
68 pm_power_off = ib62x0_power_off;
69 else
70 pr_err("board-ib62x0: failed to configure power-off GPIO\n");