sound/soc/codecs/aw88261.c
Source file repositories/reference/linux-study-clean/sound/soc/codecs/aw88261.c
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/codecs/aw88261.c- Extension
.c- Size
- 35411 bytes
- Lines
- 1362
- 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/i2c.hlinux/firmware.hlinux/bitops.hlinux/regmap.hlinux/regulator/consumer.hsound/soc.hsound/pcm_params.hsound/tlv.haw88261.haw88395/aw88395_data_type.haw88395/aw88395_device.h
Detected Declarations
function aw88261_dev_set_volumefunction aw88261_dev_i2s_tx_enablefunction aw88261_dev_pwdfunction aw88261_dev_amppdfunction aw88261_dev_mutefunction aw88261_dev_clear_int_statusfunction aw88261_dev_get_iis_statusfunction aw88261_dev_check_pllfunction aw88261_dev_configure_syspllfunction aw88261_dev_check_sysstfunction aw88261_dev_uls_hmutefunction aw88261_reg_force_setfunction aw88261_dev_get_icalkfunction aw88261_dev_get_vcalkfunction aw88261_dev_set_vcalbfunction aw88261_dev_reg_updatefunction aw88261_dev_get_prof_namefunction aw88261_dev_get_prof_datafunction aw88261_dev_fw_updatefunction aw88261_dev_startfunction aw88261_dev_stopfunction aw88261_reg_updatefunction aw88261_start_pafunction aw88261_startfunction aw88261_set_fmtfunction aw88261_hw_paramsfunction aw88261_set_tdm_slotfunction aw88261_dev_set_profile_indexfunction aw88261_profile_infofunction aw88261_profile_getfunction aw88261_profile_setfunction aw88261_volume_getfunction aw88261_volume_setfunction aw88261_playback_eventfunction aw88261_frcset_checkfunction aw88261_dev_initfunction aw88261_request_firmware_filefunction aw88261_codec_probefunction aw88261_parse_channel_dtfunction aw88261_initfunction aw88261_i2c_probe
Annotated Snippet
if (ret) {
dev_dbg(aw_dev->dev, "mode1 iis signal check error");
usleep_range(AW88261_2000_US, AW88261_2000_US + 10);
} else {
return ret;
}
}
return -EPERM;
}
static int aw88261_dev_configure_syspll(struct aw88261 *aw88261)
{
struct aw_device *aw_dev = aw88261->aw_pa;
int ret;
/* Configure TDM slots (I2S is represented as no slots) */
ret = regmap_update_bits(aw_dev->regmap, AW88261_I2SCTRL2_REG,
~AW88261_SLOT_NUM_MASK, aw88261->slot_num_value);
if (ret)
return ret;
ret = regmap_update_bits(aw_dev->regmap, AW88261_I2SCTRL2_REG,
~AW88261_I2S_TX_SLOTVLD_MASK,
aw88261->tx_slotvld_mask);
if (ret)
return ret;
ret = regmap_update_bits(aw_dev->regmap, AW88261_I2SCTRL2_REG,
~AW88261_I2S_RXL_SLOTVLD_MASK,
aw88261->rxl_slotvld_mask);
if (ret)
return ret;
ret = regmap_update_bits(aw_dev->regmap, AW88261_I2SCTRL2_REG,
~AW88261_I2S_RXR_SLOTVLD_MASK,
aw88261->rxr_slotvld_mask);
if (ret)
return ret;
/* PLL divider must be used for 8/16/32 kHz modes */
ret = regmap_update_bits(aw_dev->regmap, AW88261_PLLCTRL1_REG,
~AW88261_CCO_MUX_MASK, aw88261->cco_mux_value);
if (ret)
return ret;
/* The word clock (WCK) defines the beginning of a frame */
ret = regmap_update_bits(aw_dev->regmap, AW88261_I2SCTRL1_REG,
~AW88261_I2SSR_MASK, aw88261->sr_value);
if (ret)
return ret;
/* The bit clock (BCK) defines the length of a frame */
ret = regmap_update_bits(aw_dev->regmap, AW88261_I2SCTRL1_REG,
~AW88261_I2SBCK_MASK,
(aw88261->tdm_bck_value != AW88261_TDM_BCK_UNSET)
? aw88261->tdm_bck_value : aw88261->bck_value);
if (ret)
return ret;
/* The logical frame size is the width of data for 1 slot */
ret = regmap_update_bits(aw_dev->regmap, AW88261_I2SCTRL1_REG,
~AW88261_I2SFS_MASK, aw88261->fs_value);
if (ret)
return ret;
/* The I2S interface mode (Philips standard, LSB/MSB justified) */
ret = regmap_update_bits(aw_dev->regmap, AW88261_I2SCTRL1_REG,
~AW88261_I2SMD_MASK, aw88261->md_value);
if (ret)
return ret;
/* The polarity of the bit clock (BCK) */
ret = regmap_update_bits(aw_dev->regmap, AW88261_SYSCTRL_REG,
~AW88261_BCKINV_MASK, aw88261->bck_inv_value);
if (ret)
return ret;
return aw88261_dev_check_pll(aw_dev);
}
static int aw88261_dev_check_sysst(struct aw_device *aw_dev)
{
unsigned int check_val;
unsigned int reg_val;
int ret, i;
for (i = 0; i < AW88261_DEV_SYSST_CHECK_MAX; i++) {
ret = regmap_read(aw_dev->regmap, AW88261_SYSST_REG, ®_val);
if (ret)
Annotation
- Immediate include surface: `linux/i2c.h`, `linux/firmware.h`, `linux/bitops.h`, `linux/regmap.h`, `linux/regulator/consumer.h`, `sound/soc.h`, `sound/pcm_params.h`, `sound/tlv.h`.
- Detected declarations: `function aw88261_dev_set_volume`, `function aw88261_dev_i2s_tx_enable`, `function aw88261_dev_pwd`, `function aw88261_dev_amppd`, `function aw88261_dev_mute`, `function aw88261_dev_clear_int_status`, `function aw88261_dev_get_iis_status`, `function aw88261_dev_check_pll`, `function aw88261_dev_configure_syspll`, `function aw88261_dev_check_sysst`.
- 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.