Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 77518
b: refs/heads/master
c: b11e9e0
h: refs/heads/master
v: v3
  • Loading branch information
Herbert Valerio Riedel authored and Russell King committed Jan 26, 2008
1 parent 1f15b25 commit ad26d19
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 01af72e4e36fba66cd7cfc2a628efee866c346d1
refs/heads/master: b11e9e020c8c6cdd7e7cc6d5178cce2ad0ac0784
19 changes: 19 additions & 0 deletions trunk/arch/arm/mach-orion/gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ int gpio_direction_output(unsigned pin, int value)
gpio_label[pin] = "?";

mask = 1 << pin;
orion_clrbits(GPIO_BLINK_EN, mask);
if (value)
orion_setbits(GPIO_OUT, mask);
else
Expand Down Expand Up @@ -107,6 +108,7 @@ void gpio_set_value(unsigned pin, int value)

spin_lock_irqsave(&gpio_lock, flags);

orion_clrbits(GPIO_BLINK_EN, mask);
if (value)
orion_setbits(GPIO_OUT, mask);
else
Expand All @@ -116,6 +118,23 @@ void gpio_set_value(unsigned pin, int value)
}
EXPORT_SYMBOL(gpio_set_value);

void orion_gpio_set_blink(unsigned pin, int blink)
{
unsigned long flags;
int mask = 1 << pin;

spin_lock_irqsave(&gpio_lock, flags);

orion_clrbits(GPIO_OUT, mask);
if (blink)
orion_setbits(GPIO_BLINK_EN, mask);
else
orion_clrbits(GPIO_BLINK_EN, mask);

spin_unlock_irqrestore(&gpio_lock, flags);
}
EXPORT_SYMBOL(orion_gpio_set_blink);

int gpio_request(unsigned pin, const char *label)
{
int ret = 0;
Expand Down
1 change: 1 addition & 0 deletions trunk/include/asm-arm/arch-orion/gpio.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ extern int gpio_direction_input(unsigned pin);
extern int gpio_direction_output(unsigned pin, int value);
extern int gpio_get_value(unsigned pin);
extern void gpio_set_value(unsigned pin, int value);
extern void orion_gpio_set_blink(unsigned pin, int blink);
extern void gpio_display(void); /* debug */

static inline int gpio_to_irq(int pin)
Expand Down

0 comments on commit ad26d19

Please sign in to comment.