sound/soc/ux500/ux500_msp_dai.c
Source file repositories/reference/linux-study-clean/sound/soc/ux500/ux500_msp_dai.c
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/ux500/ux500_msp_dai.c- Extension
.c- Size
- 21691 bytes
- Lines
- 825
- Domain
- Driver Families
- Bucket
- sound/soc
- 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
linux/module.hlinux/slab.hlinux/bitops.hlinux/platform_device.hlinux/clk.hlinux/of.hlinux/regulator/consumer.hlinux/mfd/dbx500-prcmu.hsound/soc.hsound/soc-dai.hsound/dmaengine_pcm.hux500_msp_i2s.hux500_msp_dai.hux500_pcm.h
Detected Declarations
function Copyrightfunction setup_frameperfunction setup_pcm_framingfunction setup_clockingfunction setup_pcm_protdescfunction setup_i2s_protdescfunction setup_msp_configfunction ux500_msp_dai_startupfunction ux500_msp_dai_shutdownfunction ux500_msp_dai_preparefunction ux500_msp_dai_hw_paramsfunction ux500_msp_dai_set_dai_fmtfunction ux500_msp_dai_set_tdm_slotfunction ux500_msp_dai_set_dai_sysclkfunction ux500_msp_dai_triggerfunction ux500_msp_dai_of_probefunction ux500_msp_drv_probefunction ux500_msp_drv_remove
Annotated Snippet
switch (rate) {
case 8000:
prot_desc->frame_period =
FRAME_PER_SINGLE_SLOT_8_KHZ;
break;
case 16000:
prot_desc->frame_period =
FRAME_PER_SINGLE_SLOT_16_KHZ;
break;
case 44100:
prot_desc->frame_period =
FRAME_PER_SINGLE_SLOT_44_1_KHZ;
break;
case 48000:
prot_desc->frame_period =
FRAME_PER_SINGLE_SLOT_48_KHZ;
break;
default:
dev_err(dai->dev,
"%s: Error: Unsupported sample-rate (freq = %d)!\n",
__func__, rate);
return -EINVAL;
}
break;
case 2:
prot_desc->frame_period = FRAME_PER_2_SLOTS;
break;
case 8:
prot_desc->frame_period = FRAME_PER_8_SLOTS;
break;
case 16:
prot_desc->frame_period = FRAME_PER_16_SLOTS;
break;
default:
dev_err(dai->dev,
"%s: Error: Unsupported slot-count (slots = %d)!\n",
__func__, drvdata->slots);
return -EINVAL;
}
prot_desc->clocks_per_frame =
prot_desc->frame_period+1;
dev_dbg(dai->dev, "%s: Clocks per frame: %u\n",
__func__,
prot_desc->clocks_per_frame);
return 0;
}
static int setup_pcm_framing(struct snd_soc_dai *dai, unsigned int rate,
struct msp_protdesc *prot_desc)
{
struct ux500_msp_i2s_drvdata *drvdata = dev_get_drvdata(dai->dev);
u32 frame_length = MSP_FRAME_LEN_1;
prot_desc->frame_width = 0;
switch (drvdata->slots) {
case 1:
frame_length = MSP_FRAME_LEN_1;
break;
case 2:
frame_length = MSP_FRAME_LEN_2;
break;
case 8:
frame_length = MSP_FRAME_LEN_8;
break;
case 16:
frame_length = MSP_FRAME_LEN_16;
break;
default:
dev_err(dai->dev,
"%s: Error: Unsupported slot-count (slots = %d)!\n",
__func__, drvdata->slots);
return -EINVAL;
}
prot_desc->tx_frame_len_1 = frame_length;
Annotation
- Immediate include surface: `linux/module.h`, `linux/slab.h`, `linux/bitops.h`, `linux/platform_device.h`, `linux/clk.h`, `linux/of.h`, `linux/regulator/consumer.h`, `linux/mfd/dbx500-prcmu.h`.
- Detected declarations: `function Copyright`, `function setup_frameper`, `function setup_pcm_framing`, `function setup_clocking`, `function setup_pcm_protdesc`, `function setup_i2s_protdesc`, `function setup_msp_config`, `function ux500_msp_dai_startup`, `function ux500_msp_dai_shutdown`, `function ux500_msp_dai_prepare`.
- Atlas domain: Driver Families / sound/soc.
- 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.