sound/i2c/other/ak4113.c

Source file repositories/reference/linux-study-clean/sound/i2c/other/ak4113.c

File Facts

System
Linux kernel
Corpus path
sound/i2c/other/ak4113.c
Extension
.c
Size
17648 bytes
Lines
637
Domain
Driver Families
Bucket
sound/i2c
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.

Dependency Surface

Detected Declarations

Annotated Snippet

if (snd_pcm_running(ak4113->substream)) {
			snd_pcm_stop(ak4113->substream,
					SNDRV_PCM_STATE_DRAINING);
			wake_up(&runtime->sleep);
			res = 1;
		}
		snd_pcm_stream_unlock_irqrestore(ak4113->substream, _flags);
	}
	return res;
}
EXPORT_SYMBOL_GPL(snd_ak4113_check_rate_and_errors);

static void ak4113_stats(struct work_struct *work)
{
	struct ak4113 *chip = container_of(work, struct ak4113, work.work);

	if (atomic_inc_return(&chip->wq_processing) == 1)
		snd_ak4113_check_rate_and_errors(chip, chip->check_flags);

	if (atomic_dec_and_test(&chip->wq_processing))
		schedule_delayed_work(&chip->work, HZ / 10);
}

#ifdef CONFIG_PM
void snd_ak4113_suspend(struct ak4113 *chip)
{
	atomic_inc(&chip->wq_processing); /* don't schedule new work */
	cancel_delayed_work_sync(&chip->work);
}
EXPORT_SYMBOL(snd_ak4113_suspend);

void snd_ak4113_resume(struct ak4113 *chip)
{
	atomic_dec(&chip->wq_processing);
	snd_ak4113_reinit(chip);
}
EXPORT_SYMBOL(snd_ak4113_resume);
#endif

Annotation

Implementation Notes