sound/sparc/dbri.c
Source file repositories/reference/linux-study-clean/sound/sparc/dbri.c
File Facts
- System
- Linux kernel
- Corpus path
sound/sparc/dbri.c- Extension
.c- Size
- 79375 bytes
- Lines
- 2677
- Domain
- Driver Families
- Bucket
- sound/sparc
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/interrupt.hlinux/delay.hlinux/irq.hlinux/io.hlinux/dma-mapping.hlinux/gfp.hlinux/string.hsound/core.hsound/pcm.hsound/pcm_params.hsound/info.hsound/control.hsound/initval.hlinux/of.hlinux/platform_device.hlinux/atomic.hlinux/module.h
Detected Declarations
struct cs4215struct dbri_memstruct dbri_dmastruct dbri_pipestruct dbri_streaminfostruct snd_dbrienum in_or_outenum master_or_slavefunction reverse_bytesfunction dbri_cmdwaitfunction dbri_cmdsendfunction dbri_resetfunction dbri_initializefunction scoped_guardfunction scoped_guardfunction pipe_activefunction reset_pipefunction setup_pipefunction link_time_slotfunction unlink_time_slotfunction changesfunction scoped_guardfunction recv_fixedfunction setup_descsfunction reset_chifunction cs4215_setup_pipesfunction cs4215_init_datafunction cs4215_setdatafunction cs4215_openfunction usfunction informationfunction Slotfunction scoped_guardfunction cs4215_preparefunction cs4215_initfunction dbri_process_one_interruptfunction pipefunction reception_complete_intrfunction dbri_process_one_interruptfunction wordfunction snd_dbri_interruptfunction snd_hw_rule_formatfunction snd_hw_rule_channelsfunction snd_dbri_openfunction scoped_guardfunction snd_dbri_closefunction snd_dbri_hw_paramsfunction snd_dbri_hw_free
Annotated Snippet
struct cs4215 {
__u8 data[4]; /* Data mode: Time slots 5-8 */
__u8 ctrl[4]; /* Ctrl mode: Time slots 1-4 */
__u8 onboard;
__u8 offset; /* Bit offset from frame sync to time slot 1 */
volatile __u32 status;
volatile __u32 version;
__u8 precision; /* In bits, either 8 or 16 */
__u8 channels; /* 1 or 2 */
};
/*
* Control mode first
*/
/* Time Slot 1, Status register */
#define CS4215_CLB (1<<2) /* Control Latch Bit */
#define CS4215_OLB (1<<3) /* 1: line: 2.0V, speaker 4V */
/* 0: line: 2.8V, speaker 8V */
#define CS4215_MLB (1<<4) /* 1: Microphone: 20dB gain disabled */
#define CS4215_RSRVD_1 (1<<5)
/* Time Slot 2, Data Format Register */
#define CS4215_DFR_LINEAR16 0
#define CS4215_DFR_ULAW 1
#define CS4215_DFR_ALAW 2
#define CS4215_DFR_LINEAR8 3
#define CS4215_DFR_STEREO (1<<2)
static struct {
unsigned short freq;
unsigned char xtal;
unsigned char csval;
} CS4215_FREQ[] = {
{ 8000, (1 << 4), (0 << 3) },
{ 16000, (1 << 4), (1 << 3) },
{ 27429, (1 << 4), (2 << 3) }, /* Actually 24428.57 */
{ 32000, (1 << 4), (3 << 3) },
/* { NA, (1 << 4), (4 << 3) }, */
/* { NA, (1 << 4), (5 << 3) }, */
{ 48000, (1 << 4), (6 << 3) },
{ 9600, (1 << 4), (7 << 3) },
{ 5512, (2 << 4), (0 << 3) }, /* Actually 5512.5 */
{ 11025, (2 << 4), (1 << 3) },
{ 18900, (2 << 4), (2 << 3) },
{ 22050, (2 << 4), (3 << 3) },
{ 37800, (2 << 4), (4 << 3) },
{ 44100, (2 << 4), (5 << 3) },
{ 33075, (2 << 4), (6 << 3) },
{ 6615, (2 << 4), (7 << 3) },
{ 0, 0, 0}
};
#define CS4215_HPF (1<<7) /* High Pass Filter, 1: Enabled */
#define CS4215_12_MASK 0xfcbf /* Mask off reserved bits in slot 1 & 2 */
/* Time Slot 3, Serial Port Control register */
#define CS4215_XEN (1<<0) /* 0: Enable serial output */
#define CS4215_XCLK (1<<1) /* 1: Master mode: Generate SCLK */
#define CS4215_BSEL_64 (0<<2) /* Bitrate: 64 bits per frame */
#define CS4215_BSEL_128 (1<<2)
#define CS4215_BSEL_256 (2<<2)
#define CS4215_MCK_MAST (0<<4) /* Master clock */
#define CS4215_MCK_XTL1 (1<<4) /* 24.576 MHz clock source */
#define CS4215_MCK_XTL2 (2<<4) /* 16.9344 MHz clock source */
#define CS4215_MCK_CLK1 (3<<4) /* Clockin, 256 x Fs */
#define CS4215_MCK_CLK2 (4<<4) /* Clockin, see DFR */
/* Time Slot 4, Test Register */
#define CS4215_DAD (1<<0) /* 0:Digital-Dig loop, 1:Dig-Analog-Dig loop */
#define CS4215_ENL (1<<1) /* Enable Loopback Testing */
/* Time Slot 5, Parallel Port Register */
/* Read only here and the same as the in data mode */
/* Time Slot 6, Reserved */
/* Time Slot 7, Version Register */
#define CS4215_VERSION_MASK 0xf /* Known versions 0/C, 1/D, 2/E */
/* Time Slot 8, Reserved */
/*
* Data mode
*/
/* Time Slot 1-2: Left Channel Data, 2-3: Right Channel Data */
/* Time Slot 5, Output Setting */
#define CS4215_LO(v) v /* Left Output Attenuation 0x3f: -94.5 dB */
#define CS4215_LE (1<<6) /* Line Out Enable */
Annotation
- Immediate include surface: `linux/interrupt.h`, `linux/delay.h`, `linux/irq.h`, `linux/io.h`, `linux/dma-mapping.h`, `linux/gfp.h`, `linux/string.h`, `sound/core.h`.
- Detected declarations: `struct cs4215`, `struct dbri_mem`, `struct dbri_dma`, `struct dbri_pipe`, `struct dbri_streaminfo`, `struct snd_dbri`, `enum in_or_out`, `enum master_or_slave`, `function reverse_bytes`, `function dbri_cmdwait`.
- Atlas domain: Driver Families / sound/sparc.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.