summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-orion5x/lsmini-setup.c
diff options
context:
space:
mode:
authorAlexey Kopytko <alexey@kopytko.ru>2008-09-26 11:13:39 +0900
committerNicolas Pitre <nico@cam.org>2008-09-25 23:54:19 -0400
commit92a5de80e5c53c56d098ea3cb6266138efd892f6 (patch)
tree10a4afa36780f3c568dff622c3457865e986cac9 /arch/arm/mach-orion5x/lsmini-setup.c
parent7b0a26f2ca0001a13473b874d52b3d557e3d7289 (diff)
downloadlinux-92a5de80e5c53c56d098ea3cb6266138efd892f6.tar.gz
linux-92a5de80e5c53c56d098ea3cb6266138efd892f6.tar.bz2
linux-92a5de80e5c53c56d098ea3cb6266138efd892f6.zip
[ARM] Orion: Add Buffalo Linkstation Mini power-off method
This patch adds specific power-off method for Buffalo Linkstation Mini board. The board has a hardware switch which should be monitored from userspace. When the switch is in OFF position the board should be rebooted and U-Boot will start in an idle mode and wait for the user to move the power switch back to ON position. Signed-off-by: Alexey Kopytko <alexey@kopytko.ru> Signed-off-by: Nicolas Pitre <nico@marvell.com>
Diffstat (limited to 'arch/arm/mach-orion5x/lsmini-setup.c')
-rw-r--r--arch/arm/mach-orion5x/lsmini-setup.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/arch/arm/mach-orion5x/lsmini-setup.c b/arch/arm/mach-orion5x/lsmini-setup.c
index 4311dafd7e26..e0c43b8beb72 100644
--- a/arch/arm/mach-orion5x/lsmini-setup.c
+++ b/arch/arm/mach-orion5x/lsmini-setup.c
@@ -174,6 +174,23 @@ static struct mv_sata_platform_data lsmini_sata_data = {
/*****************************************************************************
+ * Linkstation Mini specific power off method: reboot
+ ****************************************************************************/
+/*
+ * On the Linkstation Mini, the shutdown process is following:
+ * - Userland monitors key events until the power switch goes to off position
+ * - The board reboots
+ * - U-boot starts and goes into an idle mode waiting for the user
+ * to move the switch to ON position
+ */
+
+static void lsmini_power_off(void)
+{
+ arch_reset(0);
+}
+
+
+/*****************************************************************************
* General Setup
****************************************************************************/
@@ -241,6 +258,9 @@ static void __init lsmini_init(void)
/* enable USB power */
gpio_set_value(LSMINI_GPIO_USB_POWER, 1);
+ /* register power-off method */
+ pm_power_off = lsmini_power_off;
+
pr_info("%s: finished\n", __func__);
}