sound/soc/codecs/fs210x.c
Source file repositories/reference/linux-study-clean/sound/soc/codecs/fs210x.c
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/codecs/fs210x.c- Extension
.c- Size
- 37769 bytes
- Lines
- 1587
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- 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/clk.hlinux/delay.hlinux/i2c.hlinux/gpio/consumer.hlinux/module.hlinux/mutex.hlinux/of.hlinux/regmap.hlinux/regulator/consumer.hlinux/workqueue.hsound/soc.hsound/tlv.hfs210x.hfs-amp-lib.h
Detected Declarations
struct fs210x_platform_datastruct fs210x_privfunction fs210x_bclk_setfunction fs210x_reg_writefunction fs210x_reg_readfunction fs210x_reg_update_bitsfunction fs210x_reg_bulk_writefunction fs210x_write_reg_valfunction fs210x_write_reg_bitsfunction fs210x_set_cmd_pkgfunction fs210x_reg_write_tablefunction fs210x_dev_playfunction fs210x_dev_stopfunction fs210x_set_reg_tablefunction fs210x_set_woofer_tablefunction fs210x_set_effect_tablefunction fs210x_access_dsp_ramfunction fs210x_write_dsp_effectfunction fs210x_check_scenefunction fs210x_set_scenefunction fs210x_init_chipfunction scenefunction fs210x_set_i2s_paramsfunction fs210x_get_pll_divfunction fs210x_set_hw_paramsfunction fs210x_dai_startupfunction fs210x_dai_set_fmtfunction fs210x_dai_hw_paramsfunction fs210x_dai_mutefunction fs210x_dai_triggerfunction fs210x_start_workfunction fs210x_fault_check_workfunction fs210x_get_drvdata_from_kctrlfunction fs210x_effect_scene_infofunction fs210x_effect_scene_getfunction fs210x_effect_scene_putfunction fs210x_playback_eventfunction fs210x_add_mixer_controlsfunction fs210x_probefunction fs210x_removefunction fs210x_suspendfunction fs210x_resumefunction fs210x_volatile_registersfunction fs210x_detect_devicefunction fs210x_parse_dtsfunction fs210x_deinitfunction fs210x_initfunction fs210x_register_snd_component
Annotated Snippet
struct fs210x_platform_data {
const char *fwm_name;
};
struct fs210x_priv {
struct i2c_client *i2c;
struct device *dev;
struct regmap *regmap;
struct fs210x_platform_data pdata;
struct regulator_bulk_data supplies[FS210X_NUM_SUPPLIES];
struct gpio_desc *gpio_sdz;
struct delayed_work start_work;
struct delayed_work fault_check_work;
struct fs_amp_lib amp_lib;
const struct fs_amp_scene *cur_scene;
struct clk *clk_bclk;
/*
* @lock: Mutex ensuring exclusive access for critical device operations
*
* This lock serializes access between the following actions:
* - Device initialization procedures(probe)
* - Enable/disable device(DAPM event)
* - Suspend/resume device(PM)
* - Runtime scene switching(control)
* - Scheduling/execution of delayed works items(delayed works)
*/
struct mutex lock;
unsigned int check_interval_ms;
unsigned int bclk;
unsigned int srate;
int scene_id;
u16 devid;
bool is_inited;
bool is_suspended;
bool is_bclk_on;
bool is_playing;
};
static const unsigned int fs2105s_rates[] = {
32000, 44100, 48000, 88200, 96000
};
static const struct snd_pcm_hw_constraint_list fs2105s_constraints = {
.count = ARRAY_SIZE(fs2105s_rates),
.list = fs2105s_rates,
};
static const unsigned int fs210x_rates[] = {
16000, 32000, 44100, 48000, 88200, 96000
};
static const struct snd_pcm_hw_constraint_list fs210x_constraints = {
.count = ARRAY_SIZE(fs210x_rates),
.list = fs210x_rates,
};
static const struct fs_pll_div fs210x_pll_div[] = {
/* bclk, pll1, pll2, pll3 */
{ 512000, 0x006C, 0x0120, 0x0001 },
{ 768000, 0x016C, 0x00C0, 0x0001 },
{ 1024000, 0x016C, 0x0090, 0x0001 },
{ 1536000, 0x016C, 0x0060, 0x0001 },
{ 2048000, 0x016C, 0x0090, 0x0002 },
{ 2304000, 0x016C, 0x0080, 0x0002 },
{ 3072000, 0x016C, 0x0090, 0x0003 },
{ 4096000, 0x016C, 0x0090, 0x0004 },
{ 4608000, 0x016C, 0x0080, 0x0004 },
{ 6144000, 0x016C, 0x0090, 0x0006 },
{ 8192000, 0x016C, 0x0090, 0x0008 },
{ 9216000, 0x016C, 0x0090, 0x0009 },
{ 12288000, 0x016C, 0x0090, 0x000C },
{ 16384000, 0x016C, 0x0090, 0x0010 },
{ 18432000, 0x016C, 0x0090, 0x0012 },
{ 24576000, 0x016C, 0x0090, 0x0018 },
{ 1411200, 0x016C, 0x0060, 0x0001 },
{ 2116800, 0x016C, 0x0080, 0x0002 },
{ 2822400, 0x016C, 0x0090, 0x0003 },
{ 4233600, 0x016C, 0x0080, 0x0004 },
{ 5644800, 0x016C, 0x0090, 0x0006 },
{ 8467200, 0x016C, 0x0090, 0x0009 },
{ 11289600, 0x016C, 0x0090, 0x000C },
{ 16934400, 0x016C, 0x0090, 0x0012 },
{ 22579200, 0x016C, 0x0090, 0x0018 },
{ 2000000, 0x017C, 0x0093, 0x0002 },
};
static int fs210x_bclk_set(struct fs210x_priv *fs210x, bool on)
{
int ret = 0;
Annotation
- Immediate include surface: `linux/clk.h`, `linux/delay.h`, `linux/i2c.h`, `linux/gpio/consumer.h`, `linux/module.h`, `linux/mutex.h`, `linux/of.h`, `linux/regmap.h`.
- Detected declarations: `struct fs210x_platform_data`, `struct fs210x_priv`, `function fs210x_bclk_set`, `function fs210x_reg_write`, `function fs210x_reg_read`, `function fs210x_reg_update_bits`, `function fs210x_reg_bulk_write`, `function fs210x_write_reg_val`, `function fs210x_write_reg_bits`, `function fs210x_set_cmd_pkg`.
- Atlas domain: Driver Families / sound/soc.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.