sound/soc/codecs/lpass-tx-macro.c
Source file repositories/reference/linux-study-clean/sound/soc/codecs/lpass-tx-macro.c
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/codecs/lpass-tx-macro.c- Extension
.c- Size
- 85577 bytes
- Lines
- 2544
- 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/module.hlinux/init.hlinux/clk.hlinux/io.hlinux/platform_device.hlinux/pm_runtime.hlinux/regmap.hsound/soc.hsound/soc-dapm.hsound/tlv.hlinux/of_clk.hlinux/clk-provider.hlpass-macro-common.h
Detected Declarations
struct tx_mute_workstruct hpf_workstruct tx_macro_datastruct tx_macrofunction tx_is_volatile_registerfunction tx_is_rw_registerfunction tx_macro_mclk_enablefunction is_amic_enabledfunction tx_macro_tx_hpf_corner_freq_callbackfunction tx_macro_mute_update_callbackfunction tx_macro_mclk_eventfunction tx_macro_update_smic_sel_v9function tx_macro_update_smic_sel_v9_2function tx_macro_put_dec_enumfunction tx_macro_tx_mixer_getfunction tx_macro_tx_mixer_putfunction tx_macro_enable_decfunction tx_macro_dec_mode_getfunction tx_macro_dec_mode_putfunction tx_macro_get_bcsfunction tx_macro_set_bcsfunction tx_macro_hw_paramsfunction tx_macro_get_channel_mapfunction tx_macro_digital_mutefunction tx_macro_component_extendfunction tx_macro_component_probefunction swclk_gate_enablefunction swclk_gate_disablefunction swclk_gate_is_enabledfunction swclk_recalc_ratefunction tx_macro_register_mclk_outputfunction tx_macro_probefunction tx_macro_removefunction tx_macro_runtime_suspendfunction tx_macro_runtime_resume
Annotated Snippet
struct tx_mute_work {
struct tx_macro *tx;
u8 decimator;
struct delayed_work dwork;
};
struct hpf_work {
struct tx_macro *tx;
u8 decimator;
u8 hpf_cut_off_freq;
struct delayed_work dwork;
};
struct tx_macro_data {
unsigned int flags;
unsigned int ver;
const struct snd_soc_dapm_widget *extra_widgets;
size_t extra_widgets_num;
const struct snd_soc_dapm_route *extra_routes;
size_t extra_routes_num;
};
struct tx_macro {
struct device *dev;
const struct tx_macro_data *data;
struct snd_soc_component *component;
struct hpf_work tx_hpf_work[NUM_DECIMATORS];
struct tx_mute_work tx_mute_dwork[NUM_DECIMATORS];
unsigned long active_ch_mask[TX_MACRO_MAX_DAIS];
unsigned long active_ch_cnt[TX_MACRO_MAX_DAIS];
int active_decimator[TX_MACRO_MAX_DAIS];
struct regmap *regmap;
struct clk *mclk;
struct clk *npl;
struct clk *macro;
struct clk *dcodec;
struct clk *fsgen;
struct clk_hw hw;
bool dec_active[NUM_DECIMATORS];
int tx_mclk_users;
bool bcs_enable;
int dec_mode[NUM_DECIMATORS];
struct lpass_macro *pds;
bool bcs_clk_en;
};
#define to_tx_macro(_hw) container_of(_hw, struct tx_macro, hw)
static const DECLARE_TLV_DB_SCALE(digital_gain, -8400, 100, -8400);
static struct reg_default tx_defaults[] = {
/* TX Macro */
{ CDC_TX_CLK_RST_CTRL_MCLK_CONTROL, 0x00 },
{ CDC_TX_CLK_RST_CTRL_FS_CNT_CONTROL, 0x00 },
{ CDC_TX_CLK_RST_CTRL_SWR_CONTROL, 0x00},
{ CDC_TX_TOP_CSR_TOP_CFG0, 0x00},
{ CDC_TX_TOP_CSR_ANC_CFG, 0x00},
{ CDC_TX_TOP_CSR_SWR_CTRL, 0x00},
{ CDC_TX_TOP_CSR_FREQ_MCLK, 0x00},
{ CDC_TX_TOP_CSR_DEBUG_BUS, 0x00},
{ CDC_TX_TOP_CSR_DEBUG_EN, 0x00},
{ CDC_TX_TOP_CSR_TX_I2S_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ation
- Immediate include surface: `linux/module.h`, `linux/init.h`, `linux/clk.h`, `linux/io.h`, `linux/platform_device.h`, `linux/pm_runtime.h`, `linux/regmap.h`, `sound/soc.h`.
- Detected declarations: `struct tx_mute_work`, `struct hpf_work`, `struct tx_macro_data`, `struct tx_macro`, `function tx_is_volatile_register`, `function tx_is_rw_register`, `function tx_macro_mclk_enable`, `function is_amic_enabled`, `function tx_macro_tx_hpf_corner_freq_callback`, `function tx_macro_mute_update_callback`.
- 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.