Skip to contentSkip to conversation

ASoC: rt1019: remove registers to sync with rt1019 datasheet

PATCH In review Jack Yu 2 participants 2 messages Apr 9, 2021

Subsystems (3)
lore
Share & tools
lore

Jack Yu

author
#0 lore raw

PATCH 1/1 ASoC: rt1019: remove registers to sync with rt1019 datasheet

Remove some registers to synchronize with the latest rt1019 datasheet.

---
 sound/soc/codecs/rt1019.c | 334 +-------------------------------------
 sound/soc/codecs/rt1019.h | 162 ------------------
 2 files changed, 1 insertion(+), 495 deletions(-)
sound/soc/codecs/rt1019.c +1 -333
index f64bb7302720..10656a5927f1 100644
@@ -32,210 +32,40 @@
 
 static const struct reg_default rt1019_reg[] = {
 	{ 0x0000, 0x00 },
-	{ 0x0002, 0x55 },
-	{ 0x0003, 0x55 },
-	{ 0x0005, 0x54 },
-	{ 0x0006, 0x05 },
-	{ 0x0007, 0x01 },
-	{ 0x0008, 0x70 },
-	{ 0x0009, 0x28 },
-	{ 0x000a, 0x7f },
 	{ 0x0011, 0x04 },
 	{ 0x0013, 0x00 },
-	{ 0x0015, 0x00 },
-	{ 0x0017, 0x00 },
 	{ 0x0019, 0x30 },
 	{ 0x001b, 0x01 },
-	{ 0x001d, 0x18 },
-	{ 0x001f, 0x29 },
-	{ 0x0021, 0x09 },
-	{ 0x0023, 0x02 },
-	{ 0x0025, 0x00 },
-	{ 0x0026, 0x00 },
-	{ 0x0028, 0x03 },
-	{ 0x0053, 0x00 },
-	{ 0x0055, 0x00 },
-	{ 0x0056, 0x00 },
-	{ 0x0057, 0x00 },
-	{ 0x0058, 0x00 },
-	{ 0x005a, 0x00 },
 	{ 0x005c, 0x00 },
-	{ 0x005d, 0x00 },
 	{ 0x005e, 0x10 },
 	{ 0x005f, 0xec },
 	{ 0x0061, 0x10 },
 	{ 0x0062, 0x19 },
-	{ 0x0064, 0x00 },
 	{ 0x0066, 0x08 },
-	{ 0x0068, 0x00 },
-	{ 0x006a, 0x00 },
-	{ 0x006c, 0x00 },
-	{ 0x006e, 0x00 },
 	{ 0x0100, 0x80 },
 	{ 0x0100, 0x51 },
 	{ 0x0102, 0x23 },
-	{ 0x0102, 0x0f },
-	{ 0x0104, 0x6c },
-	{ 0x0105, 0xec },
-	{ 0x0106, 0x00 },
-	{ 0x0107, 0x00 },
-	{ 0x0108, 0x00 },
-	{ 0x0200, 0x40 },
-	{ 0x0201, 0x00 },
-	{ 0x0202, 0x00 },
-	{ 0x0203, 0x00 },
-	{ 0x0301, 0x02 },
-	{ 0x0302, 0xaa },
-	{ 0x0303, 0x2a },
-	{ 0x0304, 0x6a },
-	{ 0x0306, 0xb0 },
-	{ 0x0308, 0x48 },
-	{ 0x030a, 0x0a },
-	{ 0x030b, 0x4b },
-	{ 0x030d, 0x7d },
-	{ 0x030e, 0xef },
-	{ 0x030f, 0x5a },
 	{ 0x0311, 0x00 },
 	{ 0x0312, 0x3e },
 	{ 0x0313, 0x86 },
-	{ 0x0315, 0xa8 },
-	{ 0x0318, 0x1b },
-	{ 0x031a, 0x3d },
-	{ 0x031c, 0x40 },
-	{ 0x031d, 0x40 },
-	{ 0x031e, 0x30 },
-	{ 0x031f, 0xbb },
-	{ 0x0320, 0xa5 },
-	{ 0x0321, 0xa5 },
-	{ 0x0323, 0x5a },
-	{ 0x0324, 0xaa },
-	{ 0x0325, 0x80 },
-	{ 0x0326, 0xaa },
-	{ 0x0327, 0x66 },
-	{ 0x0328, 0x94 },
-	{ 0x0329, 0x00 },
-	{ 0x0330, 0x00 },
-	{ 0x0331, 0x30 },
-	{ 0x0332, 0x05 },
 	{ 0x0400, 0x03 },
 	{ 0x0401, 0x02 },
 	{ 0x0402, 0x01 },
-	{ 0x0403, 0x23 },
-	{ 0x0404, 0x45 },
-	{ 0x0405, 0x67 },
-	{ 0x0500, 0x80 },
-	{ 0x0501, 0x00 },
-	{ 0x0502, 0x00 },
-	{ 0x0503, 0x00 },
 	{ 0x0504, 0xff },
 	{ 0x0505, 0x24 },
-	{ 0x0600, 0x75 },
-	{ 0x0601, 0x41 },
-	{ 0x0602, 0x60 },
-	{ 0x0603, 0x7f },
-	{ 0x0604, 0x65 },
-	{ 0x0605, 0x43 },
-	{ 0x0606, 0x00 },
-	{ 0x0607, 0x00 },
-	{ 0x0608, 0x00 },
-	{ 0x0609, 0x00 },
-	{ 0x060a, 0x00 },
-	{ 0x060b, 0x00 },
-	{ 0x060c, 0x00 },
-	{ 0x060d, 0x00 },
-	{ 0x060e, 0x00 },
-	{ 0x060f, 0x00 },
-	{ 0x0700, 0x15 },
-	{ 0x0701, 0xc8 },
-	{ 0x0704, 0x02 },
-	{ 0x0705, 0x00 },
-	{ 0x0706, 0x00 },
-	{ 0x0707, 0x80 },
-	{ 0x0708, 0x08 },
-	{ 0x0709, 0x00 },
-	{ 0x0800, 0x00 },
-	{ 0x0801, 0x00 },
-	{ 0x0802, 0x09 },
-	{ 0x0803, 0x00 },
-	{ 0x0900, 0x87 },
-	{ 0x0a01, 0x99 },
-	{ 0x0a02, 0x40 },
-	{ 0x0a03, 0x10 },
 	{ 0x0b00, 0x50 },
 	{ 0x0b01, 0xc3 },
-	{ 0x0c00, 0x84 },
-	{ 0x0c01, 0x00 },
-	{ 0x0c02, 0xbb },
-	{ 0x0c03, 0x80 },
-	{ 0x0c04, 0x10 },
-	{ 0x0c05, 0x30 },
-	{ 0x0c06, 0x00 },
-	{ 0x0d00, 0x80 },
-	{ 0x0d01, 0xbb },
-	{ 0x0d02, 0x80 },
-	{ 0x0d03, 0x00 },
-	{ 0x0d04, 0x00 },
-	{ 0x0d05, 0x00 },
-	{ 0x0e00, 0x80 },
-	{ 0x0e01, 0xbb },
-	{ 0x0e02, 0x80 },
-	{ 0x0e03, 0x00 },
-	{ 0x0e04, 0x10 },
-	{ 0x0e05, 0x30 },
-	{ 0x0f00, 0x80 },
-	{ 0x0f01, 0xbb },
-	{ 0x0f02, 0x80 },
-	{ 0x0f03, 0x00 },
-	{ 0x0f04, 0x10 },
-	{ 0x0f05, 0x30 },
-	{ 0x0f06, 0x88 },
-	{ 0x0f07, 0x88 },
-	{ 0x0f08, 0x00 },
-	{ 0x0f09, 0x00 },
 };
 
 static bool rt1019_volatile_register(struct device *dev, unsigned int reg)
 {
 	switch (reg) {
-	case RT1019_PWR_STRP_1:
 	case RT1019_PWR_STRP_2:
-	case RT1019_SIL_DET_GAT:
-	case RT1019_PHASE_SYNC:
-	case RT1019_STAT_MACH_2:
-	case RT1019_FS_DET_1:
-	case RT1019_FS_DET_2:
-	case RT1019_FS_DET_3:
-	case RT1019_FS_DET_4:
-	case RT1019_FS_DET_5:
-	case RT1019_FS_DET_6:
-	case RT1019_FS_DET_7:
-	case RT1019_ANA_READ:
 	case RT1019_VER_ID:
-	case RT1019_CUSTOM_ID:
 	case RT1019_VEND_ID_1:
 	case RT1019_VEND_ID_2:
 	case RT1019_DEV_ID_1:
 	case RT1019_DEV_ID_2:
-	case RT1019_CAL_TOP_3:
-	case RT1019_CAL_TOP_7:
-	case RT1019_CAL_TOP_17:
-	case RT1019_CAL_TOP_18:
-	case RT1019_CAL_TOP_19:
-	case RT1019_CAL_TOP_20:
-	case RT1019_CAL_TOP_21:
-	case RT1019_CAL_TOP_22:
-	case RT1019_MDRE_CTRL_2:
-	case RT1019_MDRE_CTRL_3:
-	case RT1019_MDRE_CTRL_4:
-	case RT1019_SIL_DET_2:
-	case RT1019_PWM_DC_DET_1:
-	case RT1019_PMC_8:
-	case RT1019_PMC_9:
-	case RT1019_SPKDRC_7:
-	case RT1019_HALF_FREQ_7:
-	case RT1019_CUR_CTRL_11:
-	case RT1019_CUR_CTRL_12:
-	case RT1019_CUR_CTRL_13:
 		return true;
 
 	default:
@@ -247,191 +77,29 @@ static bool rt1019_readable_register(struct device *dev, unsigned int reg)
 {
 	switch (reg) {
 	case RT1019_RESET:
-	case RT1019_PAD_DRV_1:
-	case RT1019_PAD_DRV_2:
-	case RT1019_PAD_PULL_1:
-	case RT1019_PAD_PULL_2:
-	case RT1019_PAD_PULL_3:
-	case RT1019_I2C_CTRL_1:
-	case RT1019_I2C_CTRL_2:
-	case RT1019_I2C_CTRL_3:
 	case RT1019_IDS_CTRL:
 	case RT1019_ASEL_CTRL:
-	case RT1019_PLL_RESET:
-	case RT1019_PWR_STRP_1:
 	case RT1019_PWR_STRP_2:
 	case RT1019_BEEP_TONE:
-	case RT1019_SIL_DET_GAT:
-	case RT1019_CLASSD_TIME:
-	case RT1019_CLASSD_OCP:
-	case RT1019_PHASE_SYNC:
-	case RT1019_STAT_MACH_1:
-	case RT1019_STAT_MACH_2:
-	case RT1019_EFF_CTRL:
-	case RT1019_FS_DET_1:
-	case RT1019_FS_DET_2:
-	case RT1019_FS_DET_3:
-	case RT1019_FS_DET_4:
-	case RT1019_FS_DET_5:
-	case RT1019_FS_DET_6:
-	case RT1019_FS_DET_7:
-	case RT1019_ANA_CTRL:
-	case RT1019_DUMMY_A:
-	case RT1019_DUMMY_B:
-	case RT1019_DUMMY_C:
-	case RT1019_DUMMY_D:
-	case RT1019_ANA_READ:
 	case RT1019_VER_ID:
-	case RT1019_CUSTOM_ID:
 	case RT1019_VEND_ID_1:
 	case RT1019_VEND_ID_2:
 	case RT1019_DEV_ID_1:
 	case RT1019_DEV_ID_2:
-	case RT1019_TEST_PAD:
 	case RT1019_SDB_CTRL:
-	case RT1019_TEST_CTRL_1:
-	case RT1019_TEST_CTRL_2:
-	case RT1019_TEST_CTRL_3:
-	case RT1019_SCAN_MODE:
 	case RT1019_CLK_TREE_1:
 	case RT1019_CLK_TREE_2:
 	case RT1019_CLK_TREE_3:
-	case RT1019_CLK_TREE_4:
-	case RT1019_CLK_TREE_5:
-	case RT1019_CLK_TREE_6:
-	case RT1019_CLK_TREE_7:
-	case RT1019_CLK_TREE_8:
-	case RT1019_CLK_TREE_9:
-	case RT1019_ASRC_1:
-	case RT1019_ASRC_2:
-	case RT1019_ASRC_3:
-	case RT1019_ASRC_4:
-	case RT1019_SYS_CLK:
-	case RT1019_BIAS_CUR_1:
-	case RT1019_BIAS_CUR_2:
-	case RT1019_BIAS_CUR_3:
-	case RT1019_BIAS_CUR_4:
-	case RT1019_CHOP_CLK_DAC:
-	case RT1019_CHOP_CLK_ADC:
-	case RT1019_LDO_CTRL_1:
-	case RT1019_LDO_CTRL_2:
-	case RT1019_PM_ANA_1:
-	case RT1019_PM_ANA_2:
-	case RT1019_PM_ANA_3:
 	case RT1019_PLL_1:
 	case RT1019_PLL_2:
 	case RT1019_PLL_3:
-	case RT1019_PLL_INT_1:
-	case RT1019_PLL_INT_3:
-	case RT1019_MIXER:
-	case RT1019_CLD_OUT_1:
-	case RT1019_CLD_OUT_2:
-	case RT1019_CLD_OUT_3:
-	case RT1019_CLD_OUT_4:
-	case RT1019_CLD_OUT_5:
-	case RT1019_CLD_OUT_6:
-	case RT1019_CLS_INT_REG_1:
-	case RT1019_CLS_INT_REG_2:
-	case RT1019_CLS_INT_REG_3:
-	case RT1019_CLS_INT_REG_4:
-	case RT1019_CLS_INT_REG_5:
-	case RT1019_CLS_INT_REG_6:
-	case RT1019_CLS_INT_REG_7:
-	case RT1019_CLS_INT_REG_8:
-	case RT1019_CLS_INT_REG_9:
-	case RT1019_CLS_INT_REG_10:
 	case RT1019_TDM_1:
 	case RT1019_TDM_2:
 	case RT1019_TDM_3:
-	case RT1019_TDM_4:
-	case RT1019_TDM_5:
-	case RT1019_TDM_6:
-	case RT1019_DVOL_1:
-	case RT1019_DVOL_2:
-	case RT1019_DVOL_3:
-	case RT1019_DVOL_4:
 	case RT1019_DMIX_MONO_1:
 	case RT1019_DMIX_MONO_2:
-	case RT1019_CAL_TOP_1:
-	case RT1019_CAL_TOP_2:
-	case RT1019_CAL_TOP_3:
-	case RT1019_CAL_TOP_4:
-	case RT1019_CAL_TOP_5:
-	case RT1019_CAL_TOP_6:
-	case RT1019_CAL_TOP_7:
-	case RT1019_CAL_TOP_8:
-	case RT1019_CAL_TOP_9:
-	case RT1019_CAL_TOP_10:
-	case RT1019_CAL_TOP_11:
-	case RT1019_CAL_TOP_12:
-	case RT1019_CAL_TOP_13:
-	case RT1019_CAL_TOP_14:
-	case RT1019_CAL_TOP_15:
-	case RT1019_CAL_TOP_16:
-	case RT1019_CAL_TOP_17:
-	case RT1019_CAL_TOP_18:
-	case RT1019_CAL_TOP_19:
-	case RT1019_CAL_TOP_20:
-	case RT1019_CAL_TOP_21:
-	case RT1019_CAL_TOP_22:
-	case RT1019_MDRE_CTRL_1:
-	case RT1019_MDRE_CTRL_2:
-	case RT1019_MDRE_CTRL_3:
-	case RT1019_MDRE_CTRL_4:
-	case RT1019_MDRE_CTRL_5:
-	case RT1019_MDRE_CTRL_6:
-	case RT1019_MDRE_CTRL_7:
-	case RT1019_MDRE_CTRL_8:
-	case RT1019_MDRE_CTRL_9:
-	case RT1019_MDRE_CTRL_10:
-	case RT1019_SCC_CTRL_1:
-	case RT1019_SCC_CTRL_2:
-	case RT1019_SCC_CTRL_3:
-	case RT1019_SCC_DUMMY:
-	case RT1019_SIL_DET_1:
-	case RT1019_SIL_DET_2:
-	case RT1019_PWM_DC_DET_1:
-	case RT1019_PWM_DC_DET_2:
-	case RT1019_PWM_DC_DET_3:
-	case RT1019_PWM_DC_DET_4:
 	case RT1019_BEEP_1:
 	case RT1019_BEEP_2:
-	case RT1019_PMC_1:
-	case RT1019_PMC_2:
-	case RT1019_PMC_3:
-	case RT1019_PMC_4:
-	case RT1019_PMC_5:
-	case RT1019_PMC_6:
-	case RT1019_PMC_7:
-	case RT1019_PMC_8:
-	case RT1019_PMC_9:
-	case RT1019_SPKDRC_1:
-	case RT1019_SPKDRC_2:
-	case RT1019_SPKDRC_3:
-	case RT1019_SPKDRC_4:
-	case RT1019_SPKDRC_5:
-	case RT1019_SPKDRC_6:
-	case RT1019_SPKDRC_7:
-	case RT1019_HALF_FREQ_1:
-	case RT1019_HALF_FREQ_2:
-	case RT1019_HALF_FREQ_3:
-	case RT1019_HALF_FREQ_4:
-	case RT1019_HALF_FREQ_5:
-	case RT1019_HALF_FREQ_6:
-	case RT1019_HALF_FREQ_7:
-	case RT1019_CUR_CTRL_1:
-	case RT1019_CUR_CTRL_2:
-	case RT1019_CUR_CTRL_3:
-	case RT1019_CUR_CTRL_4:
-	case RT1019_CUR_CTRL_5:
-	case RT1019_CUR_CTRL_6:
-	case RT1019_CUR_CTRL_7:
-	case RT1019_CUR_CTRL_8:
-	case RT1019_CUR_CTRL_9:
-	case RT1019_CUR_CTRL_10:
-	case RT1019_CUR_CTRL_11:
-	case RT1019_CUR_CTRL_12:
-	case RT1019_CUR_CTRL_13:
 		return true;
 	default:
 		return false;
@@ -861,7 +529,7 @@ static const struct regmap_config rt1019_regmap = {
 	.val_bits = 8,
 	.use_single_read = true,
 	.use_single_write = true,
-	.max_register = RT1019_CUR_CTRL_13,
+	.max_register = RT1019_BEEP_2,
 	.volatile_reg = rt1019_volatile_register,
 	.readable_reg = rt1019_readable_register,
 	.cache_type = REGCACHE_RBTREE,
sound/soc/codecs/rt1019.h +0 -162

191 lines not on this page · raw message

Signature · 1 line
2.29.0
maintainer
#1 lore raw
Quoted 1 line · Jack Yu

Remove some registers to synchronize with the latest rt1019 datasheet.

Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/1] ASoC: rt1019: remove registers to sync with rt1019 datasheet

      commit: 4f3b0f8e364029f2674875396f0e65a98ef84498

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark