aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/microblaze/kernel/reset.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/arch/microblaze/kernel/reset.c b/arch/microblaze/kernel/reset.c
index 789af930d72c..a1721a33042e 100644
--- a/arch/microblaze/kernel/reset.c
+++ b/arch/microblaze/kernel/reset.c
@@ -17,6 +17,7 @@
17#include <linux/of_gpio.h> 17#include <linux/of_gpio.h>
18 18
19static int handle; /* reset pin handle */ 19static int handle; /* reset pin handle */
20static unsigned int reset_val;
20 21
21static int of_reset_gpio_handle(void) 22static int of_reset_gpio_handle(void)
22{ 23{
@@ -75,9 +76,9 @@ void of_platform_reset_gpio_probe(void)
75 } 76 }
76 77
77 /* get current setup value */ 78 /* get current setup value */
78 ret = gpio_get_value(handle); 79 reset_val = gpio_get_value(handle);
79 /* FIXME maybe worth to perform any action */ 80 /* FIXME maybe worth to perform any action */
80 pr_debug("Reset: Gpio output state: 0x%x\n", ret); 81 pr_debug("Reset: Gpio output state: 0x%x\n", reset_val);
81 82
82 /* Setup GPIO as output */ 83 /* Setup GPIO as output */
83 ret = gpio_direction_output(handle, 0); 84 ret = gpio_direction_output(handle, 0);
@@ -87,7 +88,8 @@ void of_platform_reset_gpio_probe(void)
87 /* Setup output direction */ 88 /* Setup output direction */
88 gpio_set_value(handle, 0); 89 gpio_set_value(handle, 0);
89 90
90 printk(KERN_INFO "RESET: Registered gpio device: %d\n", handle); 91 printk(KERN_INFO "RESET: Registered gpio device: %d, current val: %d\n",
92 handle, reset_val);
91 return; 93 return;
92err: 94err:
93 gpio_free(handle); 95 gpio_free(handle);
@@ -97,7 +99,7 @@ err:
97 99
98static void gpio_system_reset(void) 100static void gpio_system_reset(void)
99{ 101{
100 gpio_set_value(handle, 1); 102 gpio_set_value(handle, 1 - reset_val);
101} 103}
102#else 104#else
103#define gpio_system_reset() do {} while (0) 105#define gpio_system_reset() do {} while (0)