sound/aoa/core/gpio-pmf.c
Source file repositories/reference/linux-study-clean/sound/aoa/core/gpio-pmf.c
File Facts
- System
- Linux kernel
- Corpus path
sound/aoa/core/gpio-pmf.c- Extension
.c- Size
- 6105 bytes
- Lines
- 244
- Domain
- Driver Families
- Bucket
- sound/aoa
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- 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
linux/slab.hasm/pmac_feature.hasm/pmac_pfunc.h../aoa.h
Detected Declarations
function pmf_gpio_set_hw_resetfunction pmf_gpio_all_amps_offfunction pmf_gpio_all_amps_restorefunction pmf_handle_notifyfunction pmf_gpio_initfunction pmf_gpio_exitfunction pmf_handle_notify_irqfunction pmf_set_notifyfunction pmf_get_detectexport pmf_gpio_methods
Annotated Snippet
if (err) {
printk(KERN_ERR "snd-aoa: gpio layer failed to"
" register %s irq (%d)\n", name, err);
kfree(irq_client);
return err;
}
notif->gpio_private = irq_client;
}
notif->notify = notify;
notif->data = data;
return 0;
}
static int pmf_get_detect(struct gpio_runtime *rt,
enum notify_type type)
{
char *name;
int err = -EBUSY, ret;
struct pmf_args args = { .count = 1, .u[0].p = &ret };
switch (type) {
case AOA_NOTIFY_HEADPHONE:
name = "headphone-detect";
break;
case AOA_NOTIFY_LINE_IN:
name = "linein-detect";
break;
case AOA_NOTIFY_LINE_OUT:
name = "lineout-detect";
break;
default:
return -EINVAL;
}
err = pmf_call_function(rt->node, name, &args);
if (err)
return err;
return ret;
}
static struct gpio_methods methods = {
.init = pmf_gpio_init,
.exit = pmf_gpio_exit,
.all_amps_off = pmf_gpio_all_amps_off,
.all_amps_restore = pmf_gpio_all_amps_restore,
.set_headphone = pmf_gpio_set_headphone,
.set_speakers = pmf_gpio_set_amp,
.set_lineout = pmf_gpio_set_lineout,
.set_hw_reset = pmf_gpio_set_hw_reset,
.get_headphone = pmf_gpio_get_headphone,
.get_speakers = pmf_gpio_get_amp,
.get_lineout = pmf_gpio_get_lineout,
.set_notify = pmf_set_notify,
.get_detect = pmf_get_detect,
};
struct gpio_methods *pmf_gpio_methods = &methods;
EXPORT_SYMBOL_GPL(pmf_gpio_methods);
Annotation
- Immediate include surface: `linux/slab.h`, `asm/pmac_feature.h`, `asm/pmac_pfunc.h`, `../aoa.h`.
- Detected declarations: `function pmf_gpio_set_hw_reset`, `function pmf_gpio_all_amps_off`, `function pmf_gpio_all_amps_restore`, `function pmf_handle_notify`, `function pmf_gpio_init`, `function pmf_gpio_exit`, `function pmf_handle_notify_irq`, `function pmf_set_notify`, `function pmf_get_detect`, `export pmf_gpio_methods`.
- Atlas domain: Driver Families / sound/aoa.
- Implementation status: integration 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.