diff options
author | Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> | 2007-10-01 06:45:05 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2007-10-11 18:46:12 -0400 |
commit | e86169fffedc2f461be6f70817ae5ab201c12fd5 (patch) | |
tree | 62a42062dbdddb79c759736122a0af161d2e3668 /arch/mips/cobalt/led.c | |
parent | f4fae8267c152d6c319a7bfaf92ed1c2c9a2c4e8 (diff) |
[MIPS] Cobalt: Add Cobalt Raq LED platform register and power off trigger
Signed-off-by: Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/cobalt/led.c')
-rw-r--r-- | arch/mips/cobalt/led.c | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/arch/mips/cobalt/led.c b/arch/mips/cobalt/led.c new file mode 100644 index 000000000000..8150af3abb8e --- /dev/null +++ b/arch/mips/cobalt/led.c | |||
@@ -0,0 +1,56 @@ | |||
1 | /* | ||
2 | * Registration of Cobalt LED platform device. | ||
3 | * | ||
4 | * Copyright (C) 2007 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License | ||
17 | * along with this program; if not, write to the Free Software | ||
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
19 | */ | ||
20 | #include <linux/errno.h> | ||
21 | #include <linux/init.h> | ||
22 | #include <linux/ioport.h> | ||
23 | #include <linux/platform_device.h> | ||
24 | |||
25 | static struct resource cobalt_led_resource __initdata = { | ||
26 | .start = 0x1c000000, | ||
27 | .end = 0x1c000000, | ||
28 | .flags = IORESOURCE_MEM, | ||
29 | }; | ||
30 | |||
31 | static __init int cobalt_led_add(void) | ||
32 | { | ||
33 | struct platform_device *pdev; | ||
34 | int retval; | ||
35 | |||
36 | pdev = platform_device_alloc("cobalt-raq-leds", -1); | ||
37 | |||
38 | if (!pdev) | ||
39 | return -ENOMEM; | ||
40 | |||
41 | retval = platform_device_add_resources(pdev, &cobalt_led_resource, 1); | ||
42 | if (retval) | ||
43 | goto err_free_device; | ||
44 | |||
45 | retval = platform_device_add(pdev); | ||
46 | if (retval) | ||
47 | goto err_free_device; | ||
48 | |||
49 | return 0; | ||
50 | |||
51 | err_free_device: | ||
52 | platform_device_put(pdev); | ||
53 | |||
54 | return retval; | ||
55 | } | ||
56 | device_initcall(cobalt_led_add); | ||