sound/pcmcia/pdaudiocf/pdaudiocf.c
Source file repositories/reference/linux-study-clean/sound/pcmcia/pdaudiocf/pdaudiocf.c
File Facts
- System
- Linux kernel
- Corpus path
sound/pcmcia/pdaudiocf/pdaudiocf.c- Extension
.c- Size
- 6319 bytes
- Lines
- 288
- Domain
- Driver Families
- Bucket
- sound/pcmcia
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
sound/core.hlinux/slab.hlinux/module.hpcmcia/ciscode.hpcmcia/cisreg.hpdaudiocf.hsound/initval.hlinux/init.h
Detected Declarations
function pdacf_releasefunction snd_pdacf_freefunction snd_pdacf_dev_freefunction snd_pdacf_probefunction snd_pdacf_assign_resourcesfunction snd_pdacf_detachfunction pdacf_configfunction pdacf_suspendfunction pdacf_resume
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-or-later
/*
* Driver for Sound Core PDAudioCF soundcard
*
* Copyright (c) 2003 by Jaroslav Kysela <perex@perex.cz>
*/
#include <sound/core.h>
#include <linux/slab.h>
#include <linux/module.h>
#include <pcmcia/ciscode.h>
#include <pcmcia/cisreg.h>
#include "pdaudiocf.h"
#include <sound/initval.h>
#include <linux/init.h>
/*
*/
#define CARD_NAME "PDAudio-CF"
MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>");
MODULE_DESCRIPTION("Sound Core " CARD_NAME);
MODULE_LICENSE("GPL");
static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable switches */
module_param_array(index, int, NULL, 0444);
MODULE_PARM_DESC(index, "Index value for " CARD_NAME " soundcard.");
module_param_array(id, charp, NULL, 0444);
MODULE_PARM_DESC(id, "ID string for " CARD_NAME " soundcard.");
module_param_array(enable, bool, NULL, 0444);
MODULE_PARM_DESC(enable, "Enable " CARD_NAME " soundcard.");
/*
*/
static struct snd_card *card_list[SNDRV_CARDS];
/*
* prototypes
*/
static int pdacf_config(struct pcmcia_device *link);
static void snd_pdacf_detach(struct pcmcia_device *p_dev);
static void pdacf_release(struct pcmcia_device *link)
{
free_irq(link->irq, link->priv);
pcmcia_disable_device(link);
}
/*
* destructor
*/
static int snd_pdacf_free(struct snd_pdacf *pdacf)
{
struct pcmcia_device *link = pdacf->p_dev;
pdacf_release(link);
card_list[pdacf->index] = NULL;
pdacf->card = NULL;
kfree(pdacf);
return 0;
}
static int snd_pdacf_dev_free(struct snd_device *device)
{
struct snd_pdacf *chip = device->device_data;
return snd_pdacf_free(chip);
}
/*
* snd_pdacf_attach - attach callback for cs
*/
static int snd_pdacf_probe(struct pcmcia_device *link)
{
int i, err;
struct snd_pdacf *pdacf;
struct snd_card *card;
static const struct snd_device_ops ops = {
.dev_free = snd_pdacf_dev_free,
};
/* find an empty slot from the card list */
for (i = 0; i < SNDRV_CARDS; i++) {
if (! card_list[i])
Annotation
- Immediate include surface: `sound/core.h`, `linux/slab.h`, `linux/module.h`, `pcmcia/ciscode.h`, `pcmcia/cisreg.h`, `pdaudiocf.h`, `sound/initval.h`, `linux/init.h`.
- Detected declarations: `function pdacf_release`, `function snd_pdacf_free`, `function snd_pdacf_dev_free`, `function snd_pdacf_probe`, `function snd_pdacf_assign_resources`, `function snd_pdacf_detach`, `function pdacf_config`, `function pdacf_suspend`, `function pdacf_resume`.
- Atlas domain: Driver Families / sound/pcmcia.
- 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.