drivers/gpu/drm/amd/display/dc/gpio/gpio_service.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/amd/display/dc/gpio/gpio_service.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/amd/display/dc/gpio/gpio_service.c- Extension
.c- Size
- 13371 bytes
- Lines
- 679
- 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_translate.hhw_factory.hgpio_service.hhw_gpio.h
Detected Declarations
function filesfunction dal_gpio_destroy_generic_muxfunction dal_gpio_get_generic_pin_infofunction dal_gpio_service_destroyfunction dal_mux_setup_configfunction is_pin_busyfunction set_pin_busyfunction set_pin_freefunction dal_gpio_service_lockfunction dal_gpio_service_unlockfunction dal_gpio_service_openfunction dal_gpio_service_closefunction dal_irq_get_sourcefunction dal_irq_get_rx_sourcefunction dal_irq_get_read_requestfunction dal_irq_setup_hpd_filterfunction dal_gpio_destroy_irqfunction dal_gpio_destroy_ddcfunction dal_ddc_openfunction dal_ddc_change_modefunction dal_ddc_get_linefunction dal_ddc_set_configfunction dal_ddc_close
Annotated Snippet
if (number_of_bits) {
service->busyness[index_of_id] =
kcalloc(number_of_bits, sizeof(char),
GFP_KERNEL);
if (!service->busyness[index_of_id]) {
BREAK_TO_DEBUGGER();
goto failure_2;
}
do {
service->busyness[index_of_id][i] = 0;
++i;
} while (i < number_of_bits);
} else {
service->busyness[index_of_id] = NULL;
}
++index_of_id;
} while (index_of_id < GPIO_ID_COUNT);
}
return service;
failure_2:
while (index_of_id > 0) {
--index_of_id;
kfree(service->busyness[index_of_id]);
}
failure_1:
kfree(service);
return NULL;
}
struct gpio *dal_gpio_service_create_irq(
struct gpio_service *service,
uint32_t offset,
uint32_t mask)
{
enum gpio_id id = 0;
uint32_t en;
if (!service->translate.funcs->offset_to_id(offset, mask, &id, &en)) {
ASSERT_CRITICAL(false);
return NULL;
}
return dal_gpio_create_irq(service, id, en);
}
struct gpio *dal_gpio_service_create_generic_mux(
struct gpio_service *service,
uint32_t offset,
uint32_t mask)
{
enum gpio_id id = 0;
uint32_t en;
struct gpio *generic;
if (!service->translate.funcs->offset_to_id(offset, mask, &id, &en)) {
ASSERT_CRITICAL(false);
return NULL;
}
generic = dal_gpio_create(
service, id, en, GPIO_PIN_OUTPUT_STATE_DEFAULT);
return generic;
}
void dal_gpio_destroy_generic_mux(
struct gpio **mux)
{
if (!mux || !*mux) {
ASSERT_CRITICAL(false);
return;
}
dal_gpio_destroy(mux);
kfree(*mux);
*mux = NULL;
}
struct gpio_pin_info dal_gpio_get_generic_pin_info(
struct gpio_service *service,
enum gpio_id id,
uint32_t en)
Annotation
- Immediate include surface: `dm_services.h`, `include/gpio_interface.h`, `include/gpio_service_interface.h`, `hw_translate.h`, `hw_factory.h`, `gpio_service.h`, `hw_gpio.h`.
- Detected declarations: `function files`, `function dal_gpio_destroy_generic_mux`, `function dal_gpio_get_generic_pin_info`, `function dal_gpio_service_destroy`, `function dal_mux_setup_config`, `function is_pin_busy`, `function set_pin_busy`, `function set_pin_free`, `function dal_gpio_service_lock`, `function dal_gpio_service_unlock`.
- 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.