arch/m68k/include/asm/mcfgpio.h
Source file repositories/reference/linux-study-clean/arch/m68k/include/asm/mcfgpio.h
File Facts
- System
- Linux kernel
- Corpus path
arch/m68k/include/asm/mcfgpio.h- Extension
.h- Size
- 8136 bytes
- Lines
- 293
- Domain
- Architecture Layer
- Bucket
- arch/m68k
- Inferred role
- Architecture Layer: implementation source
- Status
- source implementation candidate
Why This File Exists
CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
Dependency Surface
linux/gpio.h
Detected Declarations
function __gpio_get_valuefunction __gpio_set_valuefunction __gpio_to_irqfunction gpio_direction_inputfunction gpio_direction_outputfunction gpio_requestfunction gpio_freefunction definedfunction __mcfgpio_podrfunction __mcfgpio_pddr
Annotated Snippet
#ifndef mcfgpio_h
#define mcfgpio_h
int __mcfgpio_get_value(unsigned gpio);
void __mcfgpio_set_value(unsigned gpio, int value);
int __mcfgpio_direction_input(unsigned gpio);
int __mcfgpio_direction_output(unsigned gpio, int value);
int __mcfgpio_request(unsigned gpio);
void __mcfgpio_free(unsigned gpio);
#ifdef CONFIG_GPIOLIB
#include <linux/gpio.h>
#else
/* our alternate 'gpiolib' functions */
static inline int __gpio_get_value(unsigned gpio)
{
if (gpio < MCFGPIO_PIN_MAX)
return __mcfgpio_get_value(gpio);
else
return -EINVAL;
}
static inline void __gpio_set_value(unsigned gpio, int value)
{
if (gpio < MCFGPIO_PIN_MAX)
__mcfgpio_set_value(gpio, value);
}
static inline int __gpio_to_irq(unsigned gpio)
{
return -EINVAL;
}
static inline int gpio_direction_input(unsigned gpio)
{
if (gpio < MCFGPIO_PIN_MAX)
return __mcfgpio_direction_input(gpio);
else
return -EINVAL;
}
static inline int gpio_direction_output(unsigned gpio, int value)
{
if (gpio < MCFGPIO_PIN_MAX)
return __mcfgpio_direction_output(gpio, value);
else
return -EINVAL;
}
static inline int gpio_request(unsigned gpio, const char *label)
{
if (gpio < MCFGPIO_PIN_MAX)
return __mcfgpio_request(gpio);
else
return -EINVAL;
}
static inline void gpio_free(unsigned gpio)
{
if (gpio < MCFGPIO_PIN_MAX)
__mcfgpio_free(gpio);
}
#endif /* CONFIG_GPIOLIB */
/*
* The Freescale Coldfire family is quite varied in how they implement GPIO.
* Some parts have 8 bit ports, some have 16bit and some have 32bit; some have
* only one port, others have multiple ports; some have a single data latch
* for both input and output, others have a separate pin data register to read
* input; some require a read-modify-write access to change an output, others
* have set and clear registers for some of the outputs; Some have all the
* GPIOs in a single control area, others have some GPIOs implemented in
* different modules.
*
* This implementation attempts accommodate the differences while presenting
* a generic interface that will optimize to as few instructions as possible.
*/
#if defined(CONFIG_M5206) || defined(CONFIG_M5206e) || \
defined(CONFIG_M520x) || defined(CONFIG_M523x) || \
defined(CONFIG_M527x) || defined(CONFIG_M528x) || \
defined(CONFIG_M53xx) || defined(CONFIG_M54xx) || \
defined(CONFIG_M5441x)
/* These parts have GPIO organized by 8 bit ports */
#define MCFGPIO_PORTTYPE u8
#define MCFGPIO_PORTSIZE 8
Annotation
- Immediate include surface: `linux/gpio.h`.
- Detected declarations: `function __gpio_get_value`, `function __gpio_set_value`, `function __gpio_to_irq`, `function gpio_direction_input`, `function gpio_direction_output`, `function gpio_request`, `function gpio_free`, `function defined`, `function __mcfgpio_podr`, `function __mcfgpio_pddr`.
- Atlas domain: Architecture Layer / arch/m68k.
- 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.