Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 112520
b: refs/heads/master
c: 69fc7ee
h: refs/heads/master
v: v3
  • Loading branch information
Dmitry Baryshkov authored and Russell King committed Oct 11, 2008
1 parent 708dfc8 commit 283617d
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 9 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: 6defd90433729c2d795865165cb34d938d8ff07c
refs/heads/master: 69fc7eed5f56bce15b239e5110de2575a6970df4
9 changes: 6 additions & 3 deletions trunk/arch/arm/mach-pxa/include/mach/reset.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,12 @@
extern unsigned int reset_status;
extern void clear_reset_status(unsigned int mask);

/*
* register GPIO as reset generator
/**
* init_gpio_reset() - register GPIO as reset generator
*
* @gpio - gpio nr
* @output - set gpio as out/low instead of input during normal work
*/
extern int init_gpio_reset(int gpio);
extern int init_gpio_reset(int gpio, int output);

#endif /* __ASM_ARCH_RESET_H */
9 changes: 6 additions & 3 deletions trunk/arch/arm/mach-pxa/reset.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ static void do_hw_reset(void);

static int reset_gpio = -1;

int init_gpio_reset(int gpio)
int init_gpio_reset(int gpio, int output)
{
int rc;

Expand All @@ -30,9 +30,12 @@ int init_gpio_reset(int gpio)
goto out;
}

rc = gpio_direction_input(gpio);
if (output)
rc = gpio_direction_output(gpio, 0);
else
rc = gpio_direction_input(gpio);
if (rc) {
printk(KERN_ERR "Can't configure reset_gpio for input\n");
printk(KERN_ERR "Can't configure reset_gpio\n");
gpio_free(gpio);
goto out;
}
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/arm/mach-pxa/spitz.c
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@ static void spitz_restart(char mode)

static void __init common_init(void)
{
init_gpio_reset(SPITZ_GPIO_ON_RESET);
init_gpio_reset(SPITZ_GPIO_ON_RESET, 1);
pm_power_off = spitz_poweroff;
arm_pm_restart = spitz_restart;

Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/arm/mach-pxa/tosa.c
Original file line number Diff line number Diff line change
Expand Up @@ -781,7 +781,7 @@ static void __init tosa_init(void)
gpio_set_wake(MFP_PIN_GPIO1, 1);
/* We can't pass to gpio-keys since it will drop the Reset altfunc */

init_gpio_reset(TOSA_GPIO_ON_RESET);
init_gpio_reset(TOSA_GPIO_ON_RESET, 0);

pm_power_off = tosa_poweroff;
arm_pm_restart = tosa_restart;
Expand Down

0 comments on commit 283617d

Please sign in to comment.