Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 188517
b: refs/heads/master
c: 7f4f69f
h: refs/heads/master
i:
  188515: 4953eea
v: v3
  • Loading branch information
Joachim Eastwood authored and Mike Frysinger committed Mar 9, 2010
1 parent 2c2ebe6 commit f6405c9
Show file tree
Hide file tree
Showing 3 changed files with 20 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: f8e6dbffa7a6cb3da3bcaf1fde3039896e1ac764
refs/heads/master: 7f4f69f991146fa976cbc914a50285b2afc0ad93
17 changes: 13 additions & 4 deletions trunk/arch/blackfin/include/asm/gpio.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@

#ifndef __ASSEMBLY__

#include <linux/compiler.h>

/***********************************************************
*
* FUNCTIONS: Blackfin General Purpose Ports Access Functions
Expand Down Expand Up @@ -223,6 +225,9 @@ int bfin_gpio_direction_output(unsigned gpio, int value);
int bfin_gpio_get_value(unsigned gpio);
void bfin_gpio_set_value(unsigned gpio, int value);

#include <asm/irq.h>
#include <asm/errno.h>

#ifdef CONFIG_GPIOLIB
#include <asm-generic/gpio.h> /* cansleep wrappers */

Expand All @@ -247,6 +252,11 @@ static inline int gpio_cansleep(unsigned int gpio)
return __gpio_cansleep(gpio);
}

static inline int gpio_to_irq(unsigned gpio)
{
return __gpio_to_irq(gpio);
}

#else /* !CONFIG_GPIOLIB */

static inline int gpio_request(unsigned gpio, const char *label)
Expand Down Expand Up @@ -279,10 +289,6 @@ static inline void gpio_set_value(unsigned gpio, int value)
return bfin_gpio_set_value(gpio, value);
}

#include <asm-generic/gpio.h> /* cansleep wrappers */
#endif /* !CONFIG_GPIOLIB */
#include <asm/irq.h>

static inline int gpio_to_irq(unsigned gpio)
{
if (likely(gpio < MAX_BLACKFIN_GPIOS))
Expand All @@ -291,6 +297,9 @@ static inline int gpio_to_irq(unsigned gpio)
return -EINVAL;
}

#include <asm-generic/gpio.h> /* cansleep wrappers */
#endif /* !CONFIG_GPIOLIB */

static inline int irq_to_gpio(unsigned irq)
{
return (irq - GPIO_IRQ_BASE);
Expand Down
6 changes: 6 additions & 0 deletions trunk/arch/blackfin/kernel/bfin_gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -1319,6 +1319,11 @@ void bfin_gpiolib_gpio_free(struct gpio_chip *chip, unsigned gpio)
return bfin_gpio_free(gpio);
}

int bfin_gpiolib_gpio_to_irq(struct gpio_chip *chip, unsigned gpio)
{
return gpio + GPIO_IRQ_BASE;
}

static struct gpio_chip bfin_chip = {
.label = "BFIN-GPIO",
.direction_input = bfin_gpiolib_direction_input,
Expand All @@ -1327,6 +1332,7 @@ static struct gpio_chip bfin_chip = {
.set = bfin_gpiolib_set_value,
.request = bfin_gpiolib_gpio_request,
.free = bfin_gpiolib_gpio_free,
.to_irq = bfin_gpiolib_gpio_to_irq,
.base = 0,
.ngpio = MAX_BLACKFIN_GPIOS,
};
Expand Down

0 comments on commit f6405c9

Please sign in to comment.