Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 336365
b: refs/heads/master
c: 50309a9
h: refs/heads/master
i:
  336363: dd8dd7d
v: v3
  • Loading branch information
Linus Walleij committed Nov 11, 2012
1 parent f7ceba9 commit 682700a
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 26 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: 1e63d7b9363f0c57d00991f9f2e0af374dfc591a
refs/heads/master: 50309a9c2e576ac4ad29e30f5854acb87bdc2ac4
56 changes: 35 additions & 21 deletions trunk/include/asm-generic/gpio.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,27 +48,6 @@ struct seq_file;
struct module;
struct device_node;

#ifdef CONFIG_PINCTRL

/**
* struct gpio_pin_range - pin range controlled by a gpio chip
* @head: list for maintaining set of pin ranges, used internally
* @pctldev: pinctrl device which handles corresponding pins
* @range: actual range of pins controlled by a gpio controller
*/

struct gpio_pin_range {
struct list_head node;
struct pinctrl_dev *pctldev;
struct pinctrl_gpio_range range;
};

int gpiochip_add_pin_range(struct gpio_chip *chip, const char *pinctl_name,
unsigned int pin_base, unsigned int npins);
void gpiochip_remove_pin_ranges(struct gpio_chip *chip);

#endif

/**
* struct gpio_chip - abstract a GPIO controller
* @label: for diagnostics
Expand Down Expand Up @@ -288,4 +267,39 @@ static inline void gpio_unexport(unsigned gpio)
}
#endif /* CONFIG_GPIO_SYSFS */

#ifdef CONFIG_PINCTRL

/**
* struct gpio_pin_range - pin range controlled by a gpio chip
* @head: list for maintaining set of pin ranges, used internally
* @pctldev: pinctrl device which handles corresponding pins
* @range: actual range of pins controlled by a gpio controller
*/

struct gpio_pin_range {
struct list_head node;
struct pinctrl_dev *pctldev;
struct pinctrl_gpio_range range;
};

int gpiochip_add_pin_range(struct gpio_chip *chip, const char *pinctl_name,
unsigned int pin_base, unsigned int npins);
void gpiochip_remove_pin_ranges(struct gpio_chip *chip);

#else

static inline int
gpiochip_add_pin_range(struct gpio_chip *chip, const char *pinctl_name,
unsigned int pin_base, unsigned int npins)
{
return 0;
}

static inline void
gpiochip_remove_pin_ranges(struct gpio_chip *chip)
{
}

#endif /* CONFIG_PINCTRL */

#endif /* _ASM_GENERIC_GPIO_H */
7 changes: 3 additions & 4 deletions trunk/include/linux/gpio.h
Original file line number Diff line number Diff line change
Expand Up @@ -231,21 +231,20 @@ static inline int irq_to_gpio(unsigned irq)
return -EINVAL;
}

#ifdef CONFIG_PINCTRL

static inline int
gpiochip_add_pin_range(struct gpio_chip *chip, const char *pinctl_name,
unsigned int pin_base, unsigned int npins)
{
WARN_ON(1);
return -EINVAL;
}

static inline void
gpiochip_remove_pin_ranges(struct gpio_chip *chip)
{
WARN_ON(1);
}

#endif /* CONFIG_PINCTRL */

#endif /* ! CONFIG_GENERIC_GPIO */

#endif /* __LINUX_GPIO_H */

0 comments on commit 682700a

Please sign in to comment.