cregit-Linux how code gets into the kernel

Release 4.7 include/linux/pinctrl/consumer.h

/*
 * Consumer interface the pin control subsystem
 *
 * Copyright (C) 2012 ST-Ericsson SA
 * Written on behalf of Linaro for ST-Ericsson
 * Based on bits of regulator core, gpio core and clk core
 *
 * Author: Linus Walleij <linus.walleij@linaro.org>
 *
 * License terms: GNU General Public License (GPL) version 2
 */
#ifndef __LINUX_PINCTRL_CONSUMER_H

#define __LINUX_PINCTRL_CONSUMER_H

#include <linux/err.h>
#include <linux/list.h>
#include <linux/seq_file.h>
#include <linux/pinctrl/pinctrl-state.h>

/* This struct is private to the core and should be regarded as a cookie */
struct pinctrl;
struct pinctrl_state;
struct device;

#ifdef CONFIG_PINCTRL

/* External interface to pin control */
extern int pinctrl_request_gpio(unsigned gpio);
extern void pinctrl_free_gpio(unsigned gpio);
extern int pinctrl_gpio_direction_input(unsigned gpio);
extern int pinctrl_gpio_direction_output(unsigned gpio);

extern struct pinctrl * __must_check pinctrl_get(struct device *dev);
extern void pinctrl_put(struct pinctrl *p);
extern struct pinctrl_state * __must_check pinctrl_lookup_state(
							struct pinctrl *p,
							const char *name);
extern int pinctrl_select_state(struct pinctrl *p, struct pinctrl_state *s);

extern struct pinctrl * __must_check devm_pinctrl_get(struct device *dev);
extern void devm_pinctrl_put(struct pinctrl *p);

#ifdef CONFIG_PM
extern int pinctrl_pm_select_default_state(struct device *dev);
extern int pinctrl_pm_select_sleep_state(struct device *dev);
extern int pinctrl_pm_select_idle_state(struct device *dev);
#else

static inline int pinctrl_pm_select_default_state(struct device *dev) { return 0; }

Contributors

PersonTokensPropCommitsCommitProp
linus walleijlinus walleij15100.00%1100.00%
Total15100.00%1100.00%


static inline int pinctrl_pm_select_sleep_state(struct device *dev) { return 0; }

Contributors

PersonTokensPropCommitsCommitProp
linus walleijlinus walleij15100.00%1100.00%
Total15100.00%1100.00%


static inline int pinctrl_pm_select_idle_state(struct device *dev) { return 0; }

Contributors

PersonTokensPropCommitsCommitProp
linus walleijlinus walleij15100.00%1100.00%
Total15100.00%1100.00%

#endif #else /* !CONFIG_PINCTRL */
static inline int pinctrl_request_gpio(unsigned gpio) { return 0; }

Contributors

PersonTokensPropCommitsCommitProp
linus walleijlinus walleij13100.00%2100.00%
Total13100.00%2100.00%


static inline void pinctrl_free_gpio(unsigned gpio) { }

Contributors

PersonTokensPropCommitsCommitProp
linus walleijlinus walleij9100.00%2100.00%
Total9100.00%2100.00%


static inline int pinctrl_gpio_direction_input(unsigned gpio) { return 0; }

Contributors

PersonTokensPropCommitsCommitProp
linus walleijlinus walleij13100.00%2100.00%
Total13100.00%2100.00%


static inline int pinctrl_gpio_direction_output(unsigned gpio) { return 0; }

Contributors

PersonTokensPropCommitsCommitProp
linus walleijlinus walleij13100.00%2100.00%
Total13100.00%2100.00%


static inline struct pinctrl * __must_check pinctrl_get(struct device *dev) { return NULL; }

Contributors

PersonTokensPropCommitsCommitProp
linus walleijlinus walleij18100.00%3100.00%
Total18100.00%3100.00%


static inline void pinctrl_put(struct pinctrl *p) { }

Contributors

PersonTokensPropCommitsCommitProp
linus walleijlinus walleij11100.00%2100.00%
Total11100.00%2100.00%


static inline struct pinctrl_state * __must_check pinctrl_lookup_state( struct pinctrl *p, const char *name) { return NULL; }

Contributors

PersonTokensPropCommitsCommitProp
linus walleijlinus walleij1356.52%375.00%
stephen warrenstephen warren1043.48%125.00%
Total23100.00%4100.00%


static inline int pinctrl_select_state(struct pinctrl *p, struct pinctrl_state *s) { return 0; }

Contributors

PersonTokensPropCommitsCommitProp
stephen warrenstephen warren1260.00%133.33%
linus walleijlinus walleij840.00%266.67%
Total20100.00%3100.00%


static inline struct pinctrl * __must_check devm_pinctrl_get(struct device *dev) { return NULL; }

Contributors

PersonTokensPropCommitsCommitProp
stephen warrenstephen warren1794.44%150.00%
linus walleijlinus walleij15.56%150.00%
Total18100.00%2100.00%


static inline void devm_pinctrl_put(struct pinctrl *p) { }

Contributors

PersonTokensPropCommitsCommitProp
stephen warrenstephen warren11100.00%1100.00%
Total11100.00%1100.00%


static inline int pinctrl_pm_select_default_state(struct device *dev) { return 0; }

Contributors

PersonTokensPropCommitsCommitProp
linus walleijlinus walleij15100.00%1100.00%
Total15100.00%1100.00%


static inline int pinctrl_pm_select_sleep_state(struct device *dev) { return 0; }

Contributors

PersonTokensPropCommitsCommitProp
linus walleijlinus walleij15100.00%1100.00%
Total15100.00%1100.00%


static inline int pinctrl_pm_select_idle_state(struct device *dev) { return 0; }

Contributors

PersonTokensPropCommitsCommitProp
linus walleijlinus walleij15100.00%1100.00%
Total15100.00%1100.00%

#endif /* CONFIG_PINCTRL */
static inline struct pinctrl * __must_check pinctrl_get_select( struct device *dev, const char *name) { struct pinctrl *p; struct pinctrl_state *s; int ret; p = pinctrl_get(dev); if (IS_ERR(p)) return p; s = pinctrl_lookup_state(p, name); if (IS_ERR(s)) { pinctrl_put(p); return ERR_CAST(s); } ret = pinctrl_select_state(p, s); if (ret < 0) { pinctrl_put(p); return ERR_PTR(ret); } return p; }

Contributors

PersonTokensPropCommitsCommitProp
stephen warrenstephen warren10999.09%150.00%
fabian frederickfabian frederick10.91%150.00%
Total110100.00%2100.00%


static inline struct pinctrl * __must_check pinctrl_get_select_default( struct device *dev) { return pinctrl_get_select(dev, PINCTRL_STATE_DEFAULT); }

Contributors

PersonTokensPropCommitsCommitProp
stephen warrenstephen warren23100.00%1100.00%
Total23100.00%1100.00%


static inline struct pinctrl * __must_check devm_pinctrl_get_select( struct device *dev, const char *name) { struct pinctrl *p; struct pinctrl_state *s; int ret; p = devm_pinctrl_get(dev); if (IS_ERR(p)) return p; s = pinctrl_lookup_state(p, name); if (IS_ERR(s)) { devm_pinctrl_put(p); return ERR_CAST(s); } ret = pinctrl_select_state(p, s); if (ret < 0) { devm_pinctrl_put(p); return ERR_PTR(ret); } return p; }

Contributors

PersonTokensPropCommitsCommitProp
stephen warrenstephen warren10999.09%150.00%
uwe kleine-koeniguwe kleine-koenig10.91%150.00%
Total110100.00%2100.00%


static inline struct pinctrl * __must_check devm_pinctrl_get_select_default( struct device *dev) { return devm_pinctrl_get_select(dev, PINCTRL_STATE_DEFAULT); }

Contributors

PersonTokensPropCommitsCommitProp
stephen warrenstephen warren23100.00%1100.00%
Total23100.00%1100.00%

#endif /* __LINUX_PINCTRL_CONSUMER_H */

Overall Contributors

PersonTokensPropCommitsCommitProp
stephen warrenstephen warren36051.80%216.67%
linus walleijlinus walleij32947.34%650.00%
richard genoudrichard genoud30.43%18.33%
uwe kleine-koeniguwe kleine-koenig10.14%18.33%
david howellsdavid howells10.14%18.33%
fabian frederickfabian frederick10.14%18.33%
Total695100.00%12100.00%
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.
{% endraw %}