sound/soc/codecs/aw88081.c
Source file repositories/reference/linux-study-clean/sound/soc/codecs/aw88081.c
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/codecs/aw88081.c- Extension
.c- Size
- 32781 bytes
- Lines
- 1321
- 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/firmware.hlinux/i2c.hlinux/regmap.hsound/soc.haw88081.haw88395/aw88395_device.h
Detected Declarations
struct aw88081enum aw8808x_typefunction aw88081_dev_get_iis_statusfunction aw88081_dev_check_mode1_pllfunction aw88081_dev_check_mode2_pllfunction aw88081_dev_check_syspllfunction aw88081_dev_check_sysstfunction aw88081_dev_i2s_tx_enablefunction aw88081_dev_pwdfunction aw88081_dev_amppdfunction aw88083_i2c_wenfunction aw88083_dev_amppdfunction aw88083_dev_pllpdfunction aw88081_dev_clear_int_statusfunction aw88081_dev_set_volumefunction aw88081_dev_fade_infunction aw88081_dev_fade_outfunction aw88081_dev_mutefunction aw88081_dev_uls_hmutefunction aw88081_dev_reg_value_checkfunction aw88083_dev_reg_value_checkfunction aw88081_reg_value_checkfunction aw88081_dev_reg_updatefunction aw88081_dev_get_prof_namefunction aw88081_dev_get_prof_datafunction aw88081_dev_fw_updatefunction aw88081_dev_startfunction aw88083_dev_startfunction aw88081_device_startfunction aw88081_dev_stopfunction aw88083_dev_stopfunction aw88081_stopfunction aw88081_reg_updatefunction aw88081_start_pafunction aw88081_startup_workfunction aw88081_startfunction aw88081_get_fade_in_timefunction aw88081_set_fade_in_timefunction aw88081_get_fade_out_timefunction aw88081_set_fade_out_timefunction aw88081_dev_set_profile_indexfunction aw88081_profile_infofunction aw88081_profile_getfunction aw88081_profile_setfunction aw88081_volume_getfunction aw88081_volume_setfunction aw88081_get_fade_stepfunction aw88081_set_fade_step
Annotated Snippet
struct aw88081 {
struct aw_device *aw_pa;
struct mutex lock;
struct delayed_work start_work;
struct regmap *regmap;
struct aw_container *aw_cfg;
enum aw8808x_type devtype;
bool phase_sync;
};
static const struct regmap_config aw88081_regmap_config = {
.val_bits = 16,
.reg_bits = 8,
.max_register = AW88081_REG_MAX,
.reg_format_endian = REGMAP_ENDIAN_LITTLE,
.val_format_endian = REGMAP_ENDIAN_BIG,
};
static const struct regmap_config aw88083_regmap_config = {
.val_bits = 16,
.reg_bits = 8,
.max_register = AW88083_REG_MAX,
.reg_format_endian = REGMAP_ENDIAN_LITTLE,
.val_format_endian = REGMAP_ENDIAN_BIG,
};
static int aw88081_dev_get_iis_status(struct aw_device *aw_dev)
{
unsigned int reg_val;
int ret;
ret = regmap_read(aw_dev->regmap, AW88081_SYSST_REG, ®_val);
if (ret)
return ret;
if ((reg_val & AW88081_BIT_PLL_CHECK) != AW88081_BIT_PLL_CHECK) {
dev_err(aw_dev->dev, "check pll lock fail,reg_val:0x%04x", reg_val);
return -EINVAL;
}
return 0;
}
static int aw88081_dev_check_mode1_pll(struct aw_device *aw_dev)
{
int ret, i;
for (i = 0; i < AW88081_DEV_SYSST_CHECK_MAX; i++) {
ret = aw88081_dev_get_iis_status(aw_dev);
if (ret) {
dev_err(aw_dev->dev, "mode1 iis signal check error");
usleep_range(AW88081_2000_US, AW88081_2000_US + 10);
} else {
return 0;
}
}
return -EPERM;
}
static int aw88081_dev_check_mode2_pll(struct aw_device *aw_dev)
{
unsigned int reg_val;
int ret, i;
ret = regmap_read(aw_dev->regmap, AW88081_PLLCTRL1_REG, ®_val);
if (ret)
return ret;
reg_val &= (~AW88081_CCO_MUX_MASK);
if (reg_val == AW88081_CCO_MUX_DIVIDED_VALUE) {
dev_dbg(aw_dev->dev, "CCO_MUX is already divider");
return -EPERM;
}
/* change mode2 */
ret = regmap_update_bits(aw_dev->regmap, AW88081_PLLCTRL1_REG,
~AW88081_CCO_MUX_MASK, AW88081_CCO_MUX_DIVIDED_VALUE);
if (ret)
return ret;
for (i = 0; i < AW88081_DEV_SYSST_CHECK_MAX; i++) {
ret = aw88081_dev_get_iis_status(aw_dev);
if (ret) {
dev_err(aw_dev->dev, "mode2 iis check error");
usleep_range(AW88081_2000_US, AW88081_2000_US + 10);
} else {
break;
}
}
Annotation
- Immediate include surface: `linux/firmware.h`, `linux/i2c.h`, `linux/regmap.h`, `sound/soc.h`, `aw88081.h`, `aw88395/aw88395_device.h`.
- Detected declarations: `struct aw88081`, `enum aw8808x_type`, `function aw88081_dev_get_iis_status`, `function aw88081_dev_check_mode1_pll`, `function aw88081_dev_check_mode2_pll`, `function aw88081_dev_check_syspll`, `function aw88081_dev_check_sysst`, `function aw88081_dev_i2s_tx_enable`, `function aw88081_dev_pwd`, `function aw88081_dev_amppd`.
- 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.