cregit-Linux how code gets into the kernel

Release 4.7 include/linux/gpio.h

Directory: include/linux
#ifndef __LINUX_GPIO_H

#define __LINUX_GPIO_H

#include <linux/errno.h>

/* see Documentation/gpio/gpio-legacy.txt */

/* make these flag values available regardless of GPIO kconfig options */

#define GPIOF_DIR_OUT	(0 << 0)

#define GPIOF_DIR_IN	(1 << 0)


#define GPIOF_INIT_LOW	(0 << 1)

#define GPIOF_INIT_HIGH	(1 << 1)


#define GPIOF_IN		(GPIOF_DIR_IN)

#define GPIOF_OUT_INIT_LOW	(GPIOF_DIR_OUT | GPIOF_INIT_LOW)

#define GPIOF_OUT_INIT_HIGH	(GPIOF_DIR_OUT | GPIOF_INIT_HIGH)

/* Gpio pin is active-low */

#define GPIOF_ACTIVE_LOW        (1 << 2)

/* Gpio pin is open drain */

#define GPIOF_OPEN_DRAIN	(1 << 3)

/* Gpio pin is open source */

#define GPIOF_OPEN_SOURCE	(1 << 4)


#define GPIOF_EXPORT		(1 << 5)

#define GPIOF_EXPORT_CHANGEABLE	(1 << 6)

#define GPIOF_EXPORT_DIR_FIXED	(GPIOF_EXPORT)

#define GPIOF_EXPORT_DIR_CHANGEABLE (GPIOF_EXPORT | GPIOF_EXPORT_CHANGEABLE)

/**
 * struct gpio - a structure describing a GPIO with configuration
 * @gpio:       the GPIO number
 * @flags:      GPIO configuration as specified by GPIOF_*
 * @label:      a literal description string of this GPIO
 */

struct gpio {
	
unsigned	gpio;
	
unsigned long	flags;
	
const char	*label;
};

#ifdef CONFIG_GPIOLIB

#ifdef CONFIG_ARCH_HAVE_CUSTOM_GPIO_H
#include <asm/gpio.h>
#else

#include <asm-generic/gpio.h>


static inline int gpio_get_value(unsigned int gpio) { return __gpio_get_value(gpio); }

Contributors

PersonTokensPropCommitsCommitProp
mark brownmark brown17100.00%1100.00%
Total17100.00%1100.00%


static inline void gpio_set_value(unsigned int gpio, int value) { __gpio_set_value(gpio, value); }

Contributors

PersonTokensPropCommitsCommitProp
mark brownmark brown21100.00%1100.00%
Total21100.00%1100.00%


static inline int gpio_cansleep(unsigned int gpio) { return __gpio_cansleep(gpio); }

Contributors

PersonTokensPropCommitsCommitProp
mark brownmark brown17100.00%1100.00%
Total17100.00%1100.00%


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

Contributors

PersonTokensPropCommitsCommitProp
mark brownmark brown17100.00%1100.00%
Total17100.00%1100.00%


static inline int irq_to_gpio(unsigned int irq) { return -EINVAL; }

Contributors

PersonTokensPropCommitsCommitProp
mark brownmark brown15100.00%1100.00%
Total15100.00%1100.00%

#endif /* ! CONFIG_ARCH_HAVE_CUSTOM_GPIO_H */ /* CONFIG_GPIOLIB: bindings for managed devices that want to request gpios */ struct device; int devm_gpio_request(struct device *dev, unsigned gpio, const char *label); int devm_gpio_request_one(struct device *dev, unsigned gpio, unsigned long flags, const char *label); void devm_gpio_free(struct device *dev, unsigned int gpio); #else /* ! CONFIG_GPIOLIB */ #include <linux/kernel.h> #include <linux/types.h> #include <linux/bug.h> #include <linux/pinctrl/pinctrl.h> struct device; struct gpio_chip;
static inline bool gpio_is_valid(int number) { return false; }

Contributors

PersonTokensPropCommitsCommitProp
david brownelldavid brownell1184.62%150.00%
joe perchesjoe perches215.38%150.00%
Total13100.00%2100.00%


static inline int gpio_request(unsigned gpio, const char *label) { return -ENOSYS; }

Contributors

PersonTokensPropCommitsCommitProp
david brownelldavid brownell19100.00%1100.00%
Total19100.00%1100.00%


static inline int gpio_request_one(unsigned gpio, unsigned long flags, const char *label) { return -ENOSYS; }

Contributors

PersonTokensPropCommitsCommitProp
wolfram sangwolfram sang23100.00%1100.00%
Total23100.00%1100.00%


static inline int gpio_request_array(const struct gpio *array, size_t num) { return -ENOSYS; }

Contributors

PersonTokensPropCommitsCommitProp
wolfram sangwolfram sang1995.00%150.00%
lars-peter clausenlars-peter clausen15.00%150.00%
Total20100.00%2100.00%


static inline void gpio_free(unsigned gpio) { might_sleep(); /* GPIO can never have been requested */ WARN_ON(1); }

Contributors

PersonTokensPropCommitsCommitProp
david brownelldavid brownell1684.21%150.00%
uwe kleine-koeniguwe kleine-koenig315.79%150.00%
Total19100.00%2100.00%


static inline void gpio_free_array(const struct gpio *array, size_t num) { might_sleep(); /* GPIO can never have been requested */ WARN_ON(1); }

Contributors

PersonTokensPropCommitsCommitProp
wolfram sangwolfram sang2496.00%150.00%
lars-peter clausenlars-peter clausen14.00%150.00%
Total25100.00%2100.00%


static inline int gpio_direction_input(unsigned gpio) { return -ENOSYS; }

Contributors

PersonTokensPropCommitsCommitProp
david brownelldavid brownell14100.00%1100.00%
Total14100.00%1100.00%


static inline int gpio_direction_output(unsigned gpio, int value) { return -ENOSYS; }

Contributors

PersonTokensPropCommitsCommitProp
david brownelldavid brownell17100.00%1100.00%
Total17100.00%1100.00%


static inline int gpio_set_debounce(unsigned gpio, unsigned debounce) { return -ENOSYS; }

Contributors

PersonTokensPropCommitsCommitProp
felipe balbifelipe balbi17100.00%1100.00%
Total17100.00%1100.00%


static inline int gpio_get_value(unsigned gpio) { /* GPIO can never have been requested or set as {in,out}put */ WARN_ON(1); return 0; }

Contributors

PersonTokensPropCommitsCommitProp
david brownelldavid brownell19100.00%1100.00%
Total19100.00%1100.00%


static inline void gpio_set_value(unsigned gpio, int value) { /* GPIO can never have been requested or set as output */ WARN_ON(1); }

Contributors

PersonTokensPropCommitsCommitProp
david brownelldavid brownell19100.00%1100.00%
Total19100.00%1100.00%


static inline int gpio_cansleep(unsigned gpio) { /* GPIO can never have been requested or set as {in,out}put */ WARN_ON(1); return 0; }

Contributors

PersonTokensPropCommitsCommitProp
david brownelldavid brownell19100.00%1100.00%
Total19100.00%1100.00%


static inline int gpio_get_value_cansleep(unsigned gpio) { /* GPIO can never have been requested or set as {in,out}put */ WARN_ON(1); return 0; }

Contributors

PersonTokensPropCommitsCommitProp
david brownelldavid brownell19100.00%1100.00%
Total19100.00%1100.00%


static inline void gpio_set_value_cansleep(unsigned gpio, int value) { /* GPIO can never have been requested or set as output */ WARN_ON(1); }

Contributors

PersonTokensPropCommitsCommitProp
david brownelldavid brownell19100.00%1100.00%
Total19100.00%1100.00%


static inline int gpio_export(unsigned gpio, bool direction_may_change) { /* GPIO can never have been requested or set as {in,out}put */ WARN_ON(1); return -EINVAL; }

Contributors

PersonTokensPropCommitsCommitProp
david brownelldavid brownell23100.00%1100.00%
Total23100.00%1100.00%


static inline int gpio_export_link(struct device *dev, const char *name, unsigned gpio) { /* GPIO can never have been exported */ WARN_ON(1); return -EINVAL; }

Contributors

PersonTokensPropCommitsCommitProp
jani nikulajani nikula30100.00%1100.00%
Total30100.00%1100.00%


static inline void gpio_unexport(unsigned gpio) { /* GPIO can never have been exported */ WARN_ON(1); }

Contributors

PersonTokensPropCommitsCommitProp
david brownelldavid brownell16100.00%1100.00%
Total16100.00%1100.00%


static inline int gpio_to_irq(unsigned gpio) { /* GPIO can never have been requested or set as input */ WARN_ON(1); return -EINVAL; }

Contributors

PersonTokensPropCommitsCommitProp
david brownelldavid brownell20100.00%1100.00%
Total20100.00%1100.00%


static inline int gpiochip_lock_as_irq(struct gpio_chip *chip, unsigned int offset) { WARN_ON(1); return -EINVAL; }

Contributors

PersonTokensPropCommitsCommitProp
linus walleijlinus walleij2496.00%150.00%
alexandre courbotalexandre courbot14.00%150.00%
Total25100.00%2100.00%


static inline void gpiochip_unlock_as_irq(struct gpio_chip *chip, unsigned int offset) { WARN_ON(1); }

Contributors

PersonTokensPropCommitsCommitProp
linus walleijlinus walleij2095.24%150.00%
alexandre courbotalexandre courbot14.76%150.00%
Total21100.00%2100.00%


static inline int irq_to_gpio(unsigned irq) { /* irq can never have been returned from gpio_to_irq() */ WARN_ON(1); return -EINVAL; }

Contributors

PersonTokensPropCommitsCommitProp
david brownelldavid brownell20100.00%1100.00%
Total20100.00%1100.00%


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

Contributors

PersonTokensPropCommitsCommitProp
linus walleijlinus walleij1950.00%583.33%
shiraz hashimshiraz hashim1950.00%116.67%
Total38100.00%6100.00%


static inline int gpiochip_add_pingroup_range(struct gpio_chip *chip, struct pinctrl_dev *pctldev, unsigned int gpio_offset, const char *pin_group) { WARN_ON(1); return -EINVAL; }

Contributors

PersonTokensPropCommitsCommitProp
christian ruppertchristian ruppert3394.29%150.00%
linus walleijlinus walleij25.71%150.00%
Total35100.00%2100.00%


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

Contributors

PersonTokensPropCommitsCommitProp
shiraz hashimshiraz hashim847.06%133.33%
linus walleijlinus walleij741.18%133.33%
christian ruppertchristian ruppert211.76%133.33%
Total17100.00%3100.00%


static inline int devm_gpio_request(struct device *dev, unsigned gpio, const char *label) { WARN_ON(1); return -EINVAL; }

Contributors

PersonTokensPropCommitsCommitProp
shawn guoshawn guo1655.17%150.00%
linus walleijlinus walleij1344.83%150.00%
Total29100.00%2100.00%


static inline int devm_gpio_request_one(struct device *dev, unsigned gpio, unsigned long flags, const char *label) { WARN_ON(1); return -EINVAL; }

Contributors

PersonTokensPropCommitsCommitProp
shawn guoshawn guo2060.61%150.00%
linus walleijlinus walleij1339.39%150.00%
Total33100.00%2100.00%


static inline void devm_gpio_free(struct device *dev, unsigned int gpio) { WARN_ON(1); }

Contributors

PersonTokensPropCommitsCommitProp
shawn guoshawn guo1257.14%150.00%
linus walleijlinus walleij942.86%150.00%
Total21100.00%2100.00%

#endif /* ! CONFIG_GPIOLIB */ #endif /* __LINUX_GPIO_H */

Overall Contributors

PersonTokensPropCommitsCommitProp
david brownelldavid brownell27231.48%39.68%
linus walleijlinus walleij16619.21%722.58%
mark brownmark brown11813.66%26.45%
wolfram sangwolfram sang809.26%26.45%
shawn guoshawn guo485.56%13.23%
christian ruppertchristian ruppert384.40%13.23%
jani nikulajani nikula333.82%13.23%
randy dunlaprandy dunlap293.36%13.23%
shiraz hashimshiraz hashim273.12%13.23%
felipe balbifelipe balbi171.97%13.23%
alexandre courbotalexandre courbot131.50%39.68%
laxman dewanganlaxman dewangan80.93%26.45%
uwe kleine-koeniguwe kleine-koenig60.69%13.23%
anton vorontsovanton vorontsov30.35%13.23%
joe perchesjoe perches20.23%13.23%
lars-peter clausenlars-peter clausen20.23%13.23%
paul gortmakerpaul gortmaker10.12%13.23%
richard genoudrichard genoud10.12%13.23%
Total864100.00%31100.00%
Directory: include/linux
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.
{% endraw %}