sound/pci/ice1712/delta.c
Source file repositories/reference/linux-study-clean/sound/pci/ice1712/delta.c
File Facts
- System
- Linux kernel
- Corpus path
sound/pci/ice1712/delta.c- Extension
.c- Size
- 25583 bytes
- Lines
- 914
- Domain
- Driver Families
- Bucket
- sound/pci
- 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/delay.hlinux/interrupt.hlinux/init.hlinux/slab.hlinux/mutex.hsound/core.hsound/cs8427.hsound/asoundef.hice1712.hdelta.hsound/cs8403.h
Detected Declarations
function ICE1712function ap_cs8427_read_bytefunction ap_cs8427_codec_selectfunction ap_cs8427_codec_deassertfunction ap_cs8427_sendbytesfunction ap_cs8427_readbytesfunction ap_cs8427_probeaddrfunction snd_ice1712_delta_cs8403_spdif_writefunction delta_spdif_default_getfunction delta_spdif_default_putfunction delta_spdif_stream_getfunction delta_spdif_stream_putfunction delta_ak4524_lockfunction delta1010lt_ak4524_lockfunction delta66e_ak4524_lockfunction vx442_ak4524_lockfunction delta_1010_set_rate_valfunction delta_ak4524_set_rate_valfunction vx442_ak4524_set_rate_valfunction snd_akm4xxx_getfunction delta_open_spdiffunction delta_setup_spdiffunction scoped_guardfunction snd_ice1712_delta1010lt_wordclock_status_getfunction snd_ice1712_delta_resumefunction snd_ice1712_delta_suspendfunction snd_ice1712_delta_initfunction snd_ice1712_delta_add_controls
Annotated Snippet
snd_akm4xxx_get(ak, 1, 0x02) != val) {
snd_akm4xxx_reset(ak, 1);
snd_akm4xxx_write(ak, 0, 0x02, val);
snd_akm4xxx_write(ak, 1, 0x02, val);
snd_akm4xxx_reset(ak, 0);
}
}
/*
* SPDIF ops for Delta 1010, Dio, 66
*/
/* open callback */
static void delta_open_spdif(struct snd_ice1712 *ice, struct snd_pcm_substream *substream)
{
ice->spdif.cs8403_stream_bits = ice->spdif.cs8403_bits;
}
/* set up */
static void delta_setup_spdif(struct snd_ice1712 *ice, int rate)
{
unsigned int tmp;
int change;
scoped_guard(spinlock_irqsave, &ice->reg_lock) {
tmp = ice->spdif.cs8403_stream_bits;
if (tmp & 0x01) /* consumer */
tmp &= (tmp & 0x01) ? ~0x06 : ~0x18;
switch (rate) {
case 32000: tmp |= (tmp & 0x01) ? 0x04 : 0x00; break;
case 44100: tmp |= (tmp & 0x01) ? 0x00 : 0x10; break;
case 48000: tmp |= (tmp & 0x01) ? 0x02 : 0x08; break;
default: tmp |= (tmp & 0x01) ? 0x00 : 0x18; break;
}
change = ice->spdif.cs8403_stream_bits != tmp;
ice->spdif.cs8403_stream_bits = tmp;
}
if (change)
snd_ctl_notify(ice->card, SNDRV_CTL_EVENT_MASK_VALUE, &ice->spdif.stream_ctl->id);
snd_ice1712_delta_cs8403_spdif_write(ice, tmp);
}
#define snd_ice1712_delta1010lt_wordclock_status_info \
snd_ctl_boolean_mono_info
static int snd_ice1712_delta1010lt_wordclock_status_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
char reg = 0x10; /* CS8427 receiver error register */
struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
if (snd_i2c_sendbytes(ice->cs8427, ®, 1) != 1)
dev_err(ice->card->dev,
"unable to send register 0x%x byte to CS8427\n", reg);
snd_i2c_readbytes(ice->cs8427, ®, 1);
ucontrol->value.integer.value[0] = (reg & CS8427_UNLOCK) ? 1 : 0;
return 0;
}
static const struct snd_kcontrol_new snd_ice1712_delta1010lt_wordclock_status =
{
.access = (SNDRV_CTL_ELEM_ACCESS_READ),
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "Word Clock Status",
.info = snd_ice1712_delta1010lt_wordclock_status_info,
.get = snd_ice1712_delta1010lt_wordclock_status_get,
};
/*
* initialize the chips on M-Audio cards
*/
static const struct snd_akm4xxx akm_audiophile = {
.type = SND_AK4528,
.num_adcs = 2,
.num_dacs = 2,
.ops = {
.set_rate_val = delta_ak4524_set_rate_val
}
};
static const struct snd_ak4xxx_private akm_audiophile_priv = {
.caddr = 2,
.cif = 0,
.data_mask = ICE1712_DELTA_AP_DOUT,
.clk_mask = ICE1712_DELTA_AP_CCLK,
.cs_mask = ICE1712_DELTA_AP_CS_CODEC,
.cs_addr = ICE1712_DELTA_AP_CS_CODEC,
.cs_none = 0,
Annotation
- Immediate include surface: `linux/delay.h`, `linux/interrupt.h`, `linux/init.h`, `linux/slab.h`, `linux/mutex.h`, `sound/core.h`, `sound/cs8427.h`, `sound/asoundef.h`.
- Detected declarations: `function ICE1712`, `function ap_cs8427_read_byte`, `function ap_cs8427_codec_select`, `function ap_cs8427_codec_deassert`, `function ap_cs8427_sendbytes`, `function ap_cs8427_readbytes`, `function ap_cs8427_probeaddr`, `function snd_ice1712_delta_cs8403_spdif_write`, `function delta_spdif_default_get`, `function delta_spdif_default_put`.
- Atlas domain: Driver Families / sound/pci.
- 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.