sound/soc/codecs/sma1303.c
Source file repositories/reference/linux-study-clean/sound/soc/codecs/sma1303.c
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/codecs/sma1303.c- Extension
.c- Size
- 47468 bytes
- Lines
- 1812
- 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/mod_devicetable.hlinux/module.hlinux/moduleparam.hlinux/kernel.hlinux/init.hlinux/delay.hlinux/pm.hlinux/i2c.hlinux/regmap.hsound/core.hsound/pcm.hsound/pcm_params.hsound/soc.hsound/initval.hsound/tlv.hlinux/slab.hasm/div64.hsma1303.h
Detected Declarations
struct sma1303_pll_matchstruct sma1303_privenum sma1303_typefunction sma1303_readable_registerfunction sma1303_writeable_registerfunction sma1303_volatile_registerfunction sma1303_regmap_writefunction sma1303_regmap_update_bitsfunction sma1303_regmap_readfunction sma1303_force_mute_getfunction sma1303_force_mute_putfunction sma1303_postscaler_getfunction sma1303_postscaler_putfunction sma1303_tdm_slot_rx_getfunction sma1303_tdm_slot_rx_putfunction sma1303_tdm_slot_tx_getfunction sma1303_tdm_slot_tx_putfunction sma1303_startupfunction sma1303_shutdownfunction sma1303_aif_in_eventfunction sma1303_aif_out_eventfunction sma1303_sdo_eventfunction sma1303_post_scaler_eventfunction sma1303_power_eventfunction sma1303_setup_pllfunction sma1303_dai_hw_params_ampfunction sma1303_dai_set_sysclk_ampfunction sma1303_dai_mutefunction sma1303_dai_set_fmt_ampfunction sma1303_dai_set_tdm_slotfunction sma1303_check_fault_workerfunction sma1303_removefunction check_fault_period_showfunction check_fault_period_storefunction check_fault_status_showfunction check_fault_status_storefunction sma1303_i2c_probefunction sma1303_i2c_remove
Annotated Snippet
struct sma1303_pll_match {
char *input_clk_name;
char *output_clk_name;
unsigned int input_clk;
unsigned int post_n;
unsigned int n;
unsigned int vco;
unsigned int p_cp;
};
struct sma1303_priv {
enum sma1303_type devtype;
struct attribute_group *attr_grp;
struct delayed_work check_fault_work;
struct device *dev;
struct kobject *kobj;
struct regmap *regmap;
struct sma1303_pll_match *pll_matches;
bool amp_power_status;
bool force_mute_status;
int num_of_pll_matches;
int retry_cnt;
unsigned int amp_mode;
unsigned int cur_vol;
unsigned int format;
unsigned int frame_size;
unsigned int init_vol;
unsigned int last_bclk;
unsigned int last_ocp_val;
unsigned int last_over_temp;
unsigned int rev_num;
unsigned int sys_clk_id;
unsigned int tdm_slot_rx;
unsigned int tdm_slot_tx;
unsigned int tsdw_cnt;
long check_fault_period;
long check_fault_status;
};
static struct sma1303_pll_match sma1303_pll_matches[] = {
PLL_MATCH("1.411MHz", "24.595MHz", 1411200, 0x07, 0xF4, 0x8B, 0x03),
PLL_MATCH("1.536MHz", "24.576MHz", 1536000, 0x07, 0xE0, 0x8B, 0x03),
PLL_MATCH("3.072MHz", "24.576MHz", 3072000, 0x07, 0x70, 0x8B, 0x03),
PLL_MATCH("6.144MHz", "24.576MHz", 6144000, 0x07, 0x70, 0x8B, 0x07),
PLL_MATCH("12.288MHz", "24.576MHz", 12288000, 0x07, 0x70, 0x8B, 0x0B),
PLL_MATCH("19.2MHz", "24.343MHz", 19200000, 0x07, 0x47, 0x8B, 0x0A),
PLL_MATCH("24.576MHz", "24.576MHz", 24576000, 0x07, 0x70, 0x8B, 0x0F),
};
static int sma1303_startup(struct snd_soc_component *);
static int sma1303_shutdown(struct snd_soc_component *);
static const struct reg_default sma1303_reg_def[] = {
{ 0x00, 0x80 },
{ 0x01, 0x00 },
{ 0x02, 0x00 },
{ 0x03, 0x11 },
{ 0x04, 0x17 },
{ 0x09, 0x00 },
{ 0x0A, 0x31 },
{ 0x0B, 0x98 },
{ 0x0C, 0x84 },
{ 0x0D, 0x07 },
{ 0x0E, 0x3F },
{ 0x10, 0x00 },
{ 0x11, 0x00 },
{ 0x12, 0x00 },
{ 0x14, 0x5C },
{ 0x15, 0x01 },
{ 0x16, 0x0F },
{ 0x17, 0x0F },
{ 0x18, 0x0F },
{ 0x19, 0x00 },
{ 0x1A, 0x00 },
{ 0x1B, 0x00 },
{ 0x23, 0x19 },
{ 0x24, 0x00 },
{ 0x25, 0x00 },
{ 0x26, 0x04 },
{ 0x33, 0x00 },
{ 0x36, 0x92 },
{ 0x37, 0x27 },
{ 0x3B, 0x5A },
{ 0x3C, 0x20 },
{ 0x3D, 0x00 },
{ 0x3E, 0x03 },
{ 0x3F, 0x0C },
{ 0x8B, 0x07 },
{ 0x8C, 0x70 },
{ 0x8D, 0x8B },
Annotation
- Immediate include surface: `linux/mod_devicetable.h`, `linux/module.h`, `linux/moduleparam.h`, `linux/kernel.h`, `linux/init.h`, `linux/delay.h`, `linux/pm.h`, `linux/i2c.h`.
- Detected declarations: `struct sma1303_pll_match`, `struct sma1303_priv`, `enum sma1303_type`, `function sma1303_readable_register`, `function sma1303_writeable_register`, `function sma1303_volatile_register`, `function sma1303_regmap_write`, `function sma1303_regmap_update_bits`, `function sma1303_regmap_read`, `function sma1303_force_mute_get`.
- 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.