drivers/gpu/drm/amd/display/dc/gpio/gpio_base.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/amd/display/dc/gpio/gpio_base.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/amd/display/dc/gpio/gpio_base.c- Extension
.c- Size
- 7748 bytes
- Lines
- 353
- Domain
- Driver Families
- Bucket
- drivers/gpu
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
dm_services.hinclude/gpio_interface.hinclude/gpio_service_interface.hhw_gpio.hhw_translate.hhw_factory.hgpio_service.h
Detected Declarations
function filesfunction dal_gpio_open_exfunction dal_gpio_get_valuefunction dal_gpio_set_valuefunction dal_gpio_get_modefunction dal_gpio_lock_pinfunction dal_gpio_unlock_pinfunction dal_gpio_change_modefunction dal_gpio_get_idfunction dal_gpio_get_enumfunction dal_gpio_set_configfunction dal_gpio_get_pin_infofunction dal_gpio_get_sync_sourcefunction dal_gpio_get_output_statefunction dal_gpio_closefunction dal_gpio_destroy
Annotated Snippet
switch (gpio->en) {
case GPIO_GENERIC_A:
return SYNC_SOURCE_IO_GENERIC_A;
case GPIO_GENERIC_B:
return SYNC_SOURCE_IO_GENERIC_B;
case GPIO_GENERIC_C:
return SYNC_SOURCE_IO_GENERIC_C;
case GPIO_GENERIC_D:
return SYNC_SOURCE_IO_GENERIC_D;
case GPIO_GENERIC_E:
return SYNC_SOURCE_IO_GENERIC_E;
case GPIO_GENERIC_F:
return SYNC_SOURCE_IO_GENERIC_F;
default:
return SYNC_SOURCE_NONE;
}
break;
case GPIO_ID_SYNC:
switch (gpio->en) {
case GPIO_SYNC_HSYNC_A:
return SYNC_SOURCE_IO_HSYNC_A;
case GPIO_SYNC_VSYNC_A:
return SYNC_SOURCE_IO_VSYNC_A;
case GPIO_SYNC_HSYNC_B:
return SYNC_SOURCE_IO_HSYNC_B;
case GPIO_SYNC_VSYNC_B:
return SYNC_SOURCE_IO_VSYNC_B;
default:
return SYNC_SOURCE_NONE;
}
break;
case GPIO_ID_HPD:
switch (gpio->en) {
case GPIO_HPD_1:
return SYNC_SOURCE_IO_HPD1;
case GPIO_HPD_2:
return SYNC_SOURCE_IO_HPD2;
default:
return SYNC_SOURCE_NONE;
}
break;
case GPIO_ID_GSL:
switch (gpio->en) {
case GPIO_GSL_GENLOCK_CLOCK:
return SYNC_SOURCE_GSL_IO_GENLOCK_CLOCK;
case GPIO_GSL_GENLOCK_VSYNC:
return SYNC_SOURCE_GSL_IO_GENLOCK_VSYNC;
case GPIO_GSL_SWAPLOCK_A:
return SYNC_SOURCE_GSL_IO_SWAPLOCK_A;
case GPIO_GSL_SWAPLOCK_B:
return SYNC_SOURCE_GSL_IO_SWAPLOCK_B;
default:
return SYNC_SOURCE_NONE;
}
break;
default:
return SYNC_SOURCE_NONE;
}
}
enum gpio_pin_output_state dal_gpio_get_output_state(
const struct gpio *gpio)
{
return gpio->output_state;
}
struct hw_ddc *dal_gpio_get_ddc(struct gpio *gpio)
{
return gpio->hw_container.ddc;
}
struct hw_hpd *dal_gpio_get_hpd(struct gpio *gpio)
{
return gpio->hw_container.hpd;
}
struct hw_generic *dal_gpio_get_generic(struct gpio *gpio)
{
return gpio->hw_container.generic;
}
void dal_gpio_close(
struct gpio *gpio)
{
if (!gpio)
return;
dal_gpio_service_close(gpio->service, &gpio->pin);
gpio->mode = GPIO_MODE_UNKNOWN;
Annotation
- Immediate include surface: `dm_services.h`, `include/gpio_interface.h`, `include/gpio_service_interface.h`, `hw_gpio.h`, `hw_translate.h`, `hw_factory.h`, `gpio_service.h`.
- Detected declarations: `function files`, `function dal_gpio_open_ex`, `function dal_gpio_get_value`, `function dal_gpio_set_value`, `function dal_gpio_get_mode`, `function dal_gpio_lock_pin`, `function dal_gpio_unlock_pin`, `function dal_gpio_change_mode`, `function dal_gpio_get_id`, `function dal_gpio_get_enum`.
- Atlas domain: Driver Families / drivers/gpu.
- 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.