aboutsummaryrefslogtreecommitdiffstats
path: root/arch/microblaze
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-01-07 15:15:36 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-01-07 15:15:36 -0500
commitfbce1c234feedb5270468aa4b1770c1cab58a960 (patch)
tree7391d7bcce50eab43c750c4055b056ab1892d6b2 /arch/microblaze
parent7affca3537d74365128e477b40c529d6f2fe86c8 (diff)
parentd0ad5e89256c351ddd40167152c24a88efcb0f6d (diff)
Merge tag 'gpio-for-linus' of git://git.secretlab.ca/git/linux-2.6
Changes queued in gpio/next for the start of the 3.3 merge window * tag 'gpio-for-linus-20120104' of git://git.secretlab.ca/git/linux-2.6: gpio: Add decode of WM8994 GPIO configuration gpio: Convert GPIO drivers to module_platform_driver gpio: Fix typo in comment in Samsung driver gpio: Explicitly index samsung_gpio_cfgs gpio: Add Linus Walleij as gpio co-maintainer of: Add device tree selftests of: create of_phandle_args to simplify return of phandle parsing data gpio/powerpc: Eliminate duplication of of_get_named_gpio_flags() gpio/microblaze: Eliminate duplication of of_get_named_gpio_flags() gpiolib: output basic details and consolidate gpio device drivers pch_gpio: Change company name OKI SEMICONDUCTOR to LAPIS Semiconductor pch_gpio: Support new device LAPIS Semiconductor ML7831 IOH spi/pl022: make the chip deselect handling thread safe spi/pl022: add support for pm_runtime autosuspend spi/pl022: disable the PL022 block when unused spi/pl022: move device disable to workqueue thread spi/pl022: skip default configuration before suspending spi/pl022: fix build warnings spi/pl022: only enable RX interrupts when TX is complete
Diffstat (limited to 'arch/microblaze')
-rw-r--r--arch/microblaze/kernel/reset.c43
1 files changed, 2 insertions, 41 deletions
diff --git a/arch/microblaze/kernel/reset.c b/arch/microblaze/kernel/reset.c
index bd8ccab5ceff..88a01636f785 100644
--- a/arch/microblaze/kernel/reset.c
+++ b/arch/microblaze/kernel/reset.c
@@ -19,50 +19,11 @@
19static int handle; /* reset pin handle */ 19static int handle; /* reset pin handle */
20static unsigned int reset_val; 20static unsigned int reset_val;
21 21
22static int of_reset_gpio_handle(void)
23{
24 int ret; /* variable which stored handle reset gpio pin */
25 struct device_node *root; /* root node */
26 struct device_node *gpio; /* gpio node */
27 struct gpio_chip *gc;
28 u32 flags;
29 const void *gpio_spec;
30
31 /* find out root node */
32 root = of_find_node_by_path("/");
33
34 /* give me handle for gpio node to be possible allocate pin */
35 ret = of_parse_phandles_with_args(root, "hard-reset-gpios",
36 "#gpio-cells", 0, &gpio, &gpio_spec);
37 if (ret) {
38 pr_debug("%s: can't parse gpios property\n", __func__);
39 goto err0;
40 }
41
42 gc = of_node_to_gpiochip(gpio);
43 if (!gc) {
44 pr_debug("%s: gpio controller %s isn't registered\n",
45 root->full_name, gpio->full_name);
46 ret = -ENODEV;
47 goto err1;
48 }
49
50 ret = gc->of_xlate(gc, root, gpio_spec, &flags);
51 if (ret < 0)
52 goto err1;
53
54 ret += gc->base;
55err1:
56 of_node_put(gpio);
57err0:
58 pr_debug("%s exited with status %d\n", __func__, ret);
59 return ret;
60}
61
62void of_platform_reset_gpio_probe(void) 22void of_platform_reset_gpio_probe(void)
63{ 23{
64 int ret; 24 int ret;
65 handle = of_reset_gpio_handle(); 25 handle = of_get_named_gpio(of_find_node_by_path("/"),
26 "hard-reset-gpios", 0);
66 27
67 if (!gpio_is_valid(handle)) { 28 if (!gpio_is_valid(handle)) {
68 printk(KERN_INFO "Skipping unavailable RESET gpio %d (%s)\n", 29 printk(KERN_INFO "Skipping unavailable RESET gpio %d (%s)\n",