Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 176119
b: refs/heads/master
c: 67bf876
h: refs/heads/master
i:
  176117: 112887a
  176115: e09db57
  176111: 7394440
v: v3
  • Loading branch information
Michal Simek committed Dec 14, 2009
1 parent 2ff4edd commit 7544bf7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 753758304019fc7c2ef3af674f52a193b1606d15
refs/heads/master: 67bf87665466c4ea93e2c54d66dfd4cdac011a4b
10 changes: 6 additions & 4 deletions trunk/arch/microblaze/kernel/reset.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include <linux/of_gpio.h>

static int handle; /* reset pin handle */
static unsigned int reset_val;

static int of_reset_gpio_handle(void)
{
Expand Down Expand Up @@ -75,9 +76,9 @@ void of_platform_reset_gpio_probe(void)
}

/* get current setup value */
ret = gpio_get_value(handle);
reset_val = gpio_get_value(handle);
/* FIXME maybe worth to perform any action */
pr_debug("Reset: Gpio output state: 0x%x\n", ret);
pr_debug("Reset: Gpio output state: 0x%x\n", reset_val);

/* Setup GPIO as output */
ret = gpio_direction_output(handle, 0);
Expand All @@ -87,7 +88,8 @@ void of_platform_reset_gpio_probe(void)
/* Setup output direction */
gpio_set_value(handle, 0);

printk(KERN_INFO "RESET: Registered gpio device: %d\n", handle);
printk(KERN_INFO "RESET: Registered gpio device: %d, current val: %d\n",
handle, reset_val);
return;
err:
gpio_free(handle);
Expand All @@ -97,7 +99,7 @@ void of_platform_reset_gpio_probe(void)

static void gpio_system_reset(void)
{
gpio_set_value(handle, 1);
gpio_set_value(handle, 1 - reset_val);
}
#else
#define gpio_system_reset() do {} while (0)
Expand Down

0 comments on commit 7544bf7

Please sign in to comment.