include/linux/pinctrl/consumer.h
Source file repositories/reference/linux-study-clean/include/linux/pinctrl/consumer.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/pinctrl/consumer.h- Extension
.h- Size
- 5313 bytes
- Lines
- 240
- Domain
- Core OS
- Bucket
- Core Kernel Interface
- Inferred role
- Core OS: implementation source
- Status
- source implementation candidate
Why This File Exists
Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/err.hlinux/types.hlinux/pinctrl/pinctrl-state.h
Detected Declarations
struct devicestruct gpio_chipstruct pinctrlstruct pinctrl_statefunction pinctrl_pm_select_default_statefunction pinctrl_pm_select_init_statefunction pinctrl_pm_select_sleep_statefunction pinctrl_pm_select_idle_statefunction pinctrl_gpio_can_use_linefunction pinctrl_gpio_requestfunction pinctrl_gpio_freefunction pinctrl_gpio_direction_outputfunction pinctrl_gpio_get_configfunction pinctrl_gpio_set_configfunction pinctrl_getfunction pinctrl_putfunction pinctrl_select_statefunction devm_pinctrl_getfunction devm_pinctrl_putfunction pinctrl_pm_select_default_statefunction pinctrl_pm_select_init_statefunction pinctrl_pm_select_sleep_statefunction pinctrl_pm_select_idle_statefunction pinctrl_get_selectfunction pinctrl_get_select_defaultfunction devm_pinctrl_get_selectfunction devm_pinctrl_get_select_default
Annotated Snippet
#ifndef __LINUX_PINCTRL_CONSUMER_H
#define __LINUX_PINCTRL_CONSUMER_H
#include <linux/err.h>
#include <linux/types.h>
#include <linux/pinctrl/pinctrl-state.h>
struct device;
struct gpio_chip;
/* This struct is private to the core and should be regarded as a cookie */
struct pinctrl;
struct pinctrl_state;
#ifdef CONFIG_PINCTRL
/* External interface to pin control */
bool pinctrl_gpio_can_use_line(struct gpio_chip *gc, unsigned int offset);
int pinctrl_gpio_request(struct gpio_chip *gc, unsigned int offset);
void pinctrl_gpio_free(struct gpio_chip *gc, unsigned int offset);
int pinctrl_gpio_direction_input(struct gpio_chip *gc,
unsigned int offset);
int pinctrl_gpio_direction_output(struct gpio_chip *gc,
unsigned int offset);
int pinctrl_gpio_set_config(struct gpio_chip *gc, unsigned int offset,
unsigned long config);
int pinctrl_gpio_get_config(struct gpio_chip *gc, unsigned int offset,
unsigned long *config);
struct pinctrl * __must_check pinctrl_get(struct device *dev);
void pinctrl_put(struct pinctrl *p);
struct pinctrl_state * __must_check pinctrl_lookup_state(struct pinctrl *p,
const char *name);
int pinctrl_select_state(struct pinctrl *p, struct pinctrl_state *s);
struct pinctrl * __must_check devm_pinctrl_get(struct device *dev);
void devm_pinctrl_put(struct pinctrl *p);
int pinctrl_select_default_state(struct device *dev);
#ifdef CONFIG_PM
int pinctrl_pm_select_default_state(struct device *dev);
int pinctrl_pm_select_init_state(struct device *dev);
int pinctrl_pm_select_sleep_state(struct device *dev);
int pinctrl_pm_select_idle_state(struct device *dev);
#else
static inline int pinctrl_pm_select_default_state(struct device *dev)
{
return 0;
}
static inline int pinctrl_pm_select_init_state(struct device *dev)
{
return 0;
}
static inline int pinctrl_pm_select_sleep_state(struct device *dev)
{
return 0;
}
static inline int pinctrl_pm_select_idle_state(struct device *dev)
{
return 0;
}
#endif
#else /* !CONFIG_PINCTRL */
static inline bool
pinctrl_gpio_can_use_line(struct gpio_chip *gc, unsigned int offset)
{
return true;
}
static inline int
pinctrl_gpio_request(struct gpio_chip *gc, unsigned int offset)
{
return 0;
}
static inline void
pinctrl_gpio_free(struct gpio_chip *gc, unsigned int offset)
{
}
static inline int
pinctrl_gpio_direction_input(struct gpio_chip *gc, unsigned int offset)
{
return 0;
}
static inline int
Annotation
- Immediate include surface: `linux/err.h`, `linux/types.h`, `linux/pinctrl/pinctrl-state.h`.
- Detected declarations: `struct device`, `struct gpio_chip`, `struct pinctrl`, `struct pinctrl_state`, `function pinctrl_pm_select_default_state`, `function pinctrl_pm_select_init_state`, `function pinctrl_pm_select_sleep_state`, `function pinctrl_pm_select_idle_state`, `function pinctrl_gpio_can_use_line`, `function pinctrl_gpio_request`.
- Atlas domain: Core OS / Core Kernel Interface.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.