/* SPDX-License-Identifier: GPL-2.0 */
/*
* rt1308.h -- RT1308 ALSA SoC amplifier component driver
*
* Copyright 2019 Realtek Semiconductor Corp.
* Author: Derek Fang <derek.fang@realtek.com>
*
*/
#ifndef _RT1308_H_
#define _RT1308_H_
#define RT1308_DEVICE_ID_NUM 0 x10ec1300
#define RT1308_RESET 0 x00
#define RT1308_RESET_N 0 x01
#define RT1308_CLK_GATING 0 x02
#define RT1308_PLL_1 0 x03
#define RT1308_PLL_2 0 x04
#define RT1308_PLL_INT 0 x05
#define RT1308_CLK_1 0 x06
#define RT1308_DATA_PATH 0 x07
#define RT1308_CLK_2 0 x08
#define RT1308_SIL_DET 0 x09
#define RT1308_CLK_DET 0 x0a
#define RT1308_DC_DET 0 x0b
#define RT1308_DC_DET_THRES 0 x0c
#define RT1308_DAC_SET 0 x10
#define RT1308_SRC_SET 0 x11
#define RT1308_DAC_BUF 0 x12
#define RT1308_ADC_SET 0 x13
#define RT1308_ADC_SET_INT 0 x14
#define RT1308_I2S_SET_1 0 x15
#define RT1308_I2S_SET_2 0 x16
#define RT1308_I2C_I2S_SDW_SET 0 x17
#define RT1308_SDW_REG_RW 0 x18
#define RT1308_SDW_REG_RDATA 0 x19
#define RT1308_IV_SENSE 0 x1a
#define RT1308_I2S_TX_DAC_SET 0 x1b
#define RT1308_AD_FILTER_SET 0 x1c
#define RT1308_DC_CAL_1 0 x20
#define RT1308_DC_CAL_2 0 x21
#define RT1308_DC_CAL_L_OFFSET 0 x22
#define RT1308_DC_CAL_R_OFFSET 0 x23
#define RT1308_PVDD_OFFSET_CTL 0 x24
#define RT1308_PVDD_OFFSET_L 0 x25
#define RT1308_PVDD_OFFSET_R 0 x26
#define RT1308_PVDD_OFFSET_PBTL 0 x27
#define RT1308_PVDD_OFFSET_PVDD 0 x28
#define RT1308_CAL_OFFSET_DAC_PBTL 0 x29
#define RT1308_CAL_OFFSET_DAC_L 0 x2a
#define RT1308_CAL_OFFSET_DAC_R 0 x2b
#define RT1308_CAL_OFFSET_PWM_L 0 x2c
#define RT1308_CAL_OFFSET_PWM_R 0 x2d
#define RT1308_CAL_PWM_VOS_ADC_L 0 x2e
#define RT1308_CAL_PWM_VOS_ADC_R 0 x2f
#define RT1308_CLASS_D_SET_1 0 x30
#define RT1308_CLASS_D_SET_2 0 x31
#define RT1308_POWER 0 x32
#define RT1308_LDO 0 x33
#define RT1308_VREF 0 x34
#define RT1308_MBIAS 0 x35
#define RT1308_POWER_STATUS 0 x36
#define RT1308_POWER_INT 0 x37
#define RT1308_SINE_TONE_GEN_1 0 x50
#define RT1308_SINE_TONE_GEN_2 0 x51
#define RT1308_BQ_SET 0 x54
#define RT1308_BQ_PARA_UPDATE 0 x55
#define RT1308_BQ_PRE_VOL_L 0 x56
#define RT1308_BQ_PRE_VOL_R 0 x57
#define RT1308_BQ_POST_VOL_L 0 x58
#define RT1308_BQ_POST_VOL_R 0 x59
#define RT1308_BQ1_L_H0 0 x5b
#define RT1308_BQ1_L_B1 0 x5c
#define RT1308_BQ1_L_B2 0 x5d
#define RT1308_BQ1_L_A1 0 x5e
#define RT1308_BQ1_L_A2 0 x5f
#define RT1308_BQ1_R_H0 0 x60
#define RT1308_BQ1_R_B1 0 x61
#define RT1308_BQ1_R_B2 0 x62
#define RT1308_BQ1_R_A1 0 x63
#define RT1308_BQ1_R_A2 0 x64
#define RT1308_BQ2_L_H0 0 x65
#define RT1308_BQ2_L_B1 0 x66
#define RT1308_BQ2_L_B2 0 x67
#define RT1308_BQ2_L_A1 0 x68
#define RT1308_BQ2_L_A2 0 x69
#define RT1308_BQ2_R_H0 0 x6a
#define RT1308_BQ2_R_B1 0 x6b
#define RT1308_BQ2_R_B2 0 x6c
#define RT1308_BQ2_R_A1 0 x6d
#define RT1308_BQ2_R_A2 0 x6e
#define RT1308_VEN_DEV_ID 0 x70
#define RT1308_VERSION_ID 0 x71
#define RT1308_SPK_BOUND 0 x72
#define RT1308_BQ1_EQ_L_1 0 x73
#define RT1308_BQ1_EQ_L_2 0 x74
#define RT1308_BQ1_EQ_L_3 0 x75
#define RT1308_BQ1_EQ_R_1 0 x76
#define RT1308_BQ1_EQ_R_2 0 x77
#define RT1308_BQ1_EQ_R_3 0 x78
#define RT1308_BQ2_EQ_L_1 0 x79
#define RT1308_BQ2_EQ_L_2 0 x7a
#define RT1308_BQ2_EQ_L_3 0 x7b
#define RT1308_BQ2_EQ_R_1 0 x7c
#define RT1308_BQ2_EQ_R_2 0 x7d
#define RT1308_BQ2_EQ_R_3 0 x7e
#define RT1308_EFUSE_1 0 x7f
#define RT1308_EFUSE_2 0 x80
#define RT1308_EFUSE_PROG_PVDD_L 0 x81
#define RT1308_EFUSE_PROG_PVDD_R 0 x82
#define RT1308_EFUSE_PROG_R0_L 0 x83
#define RT1308_EFUSE_PROG_R0_R 0 x84
#define RT1308_EFUSE_PROG_DEV 0 x85
#define RT1308_EFUSE_READ_PVDD_L 0 x86
#define RT1308_EFUSE_READ_PVDD_R 0 x87
#define RT1308_EFUSE_READ_PVDD_PTBL 0 x88
#define RT1308_EFUSE_READ_DEV 0 x89
#define RT1308_EFUSE_READ_R0 0 x8a
#define RT1308_EFUSE_READ_ADC_L 0 x8b
#define RT1308_EFUSE_READ_ADC_R 0 x8c
#define RT1308_EFUSE_READ_ADC_PBTL 0 x8d
#define RT1308_EFUSE_RESERVE 0 x8e
#define RT1308_PADS_1 0 x90
#define RT1308_PADS_2 0 x91
#define RT1308_TEST_MODE 0 xa0
#define RT1308_TEST_1 0 xa1
#define RT1308_TEST_2 0 xa2
#define RT1308_TEST_3 0 xa3
#define RT1308_TEST_4 0 xa4
#define RT1308_EFUSE_DATA_0_MSB 0 xb0
#define RT1308_EFUSE_DATA_0_LSB 0 xb1
#define RT1308_EFUSE_DATA_1_MSB 0 xb2
#define RT1308_EFUSE_DATA_1_LSB 0 xb3
#define RT1308_EFUSE_DATA_2_MSB 0 xb4
#define RT1308_EFUSE_DATA_2_LSB 0 xb5
#define RT1308_EFUSE_DATA_3_MSB 0 xb6
#define RT1308_EFUSE_DATA_3_LSB 0 xb7
#define RT1308_EFUSE_DATA_TEST_MSB 0 xb8
#define RT1308_EFUSE_DATA_TEST_LSB 0 xb9
#define RT1308_EFUSE_STATUS_1 0 xba
#define RT1308_EFUSE_STATUS_2 0 xbb
#define RT1308_TCON_1 0 xc0
#define RT1308_TCON_2 0 xc1
#define RT1308_DUMMY_REG 0 xf0
#define RT1308_MAX_REG 0 xff
/* PLL1 M/N/K Code-1 (0x03) */
#define RT1308_PLL1_K_SFT 24
#define RT1308_PLL1_K_MASK (0 x1f << 24 )
#define RT1308_PLL1_M_BYPASS_MASK (0 x1 << 23 )
#define RT1308_PLL1_M_BYPASS_SFT 23
#define RT1308_PLL1_M_BYPASS (0 x1 << 23 )
#define RT1308_PLL1_M_MASK (0 x3f << 16 )
#define RT1308_PLL1_M_SFT 16
#define RT1308_PLL1_N_MASK (0 x7f << 8 )
#define RT1308_PLL1_N_SFT 8
/* CLOCK-1 (0x06) */
#define RT1308_DIV_FS_SYS_MASK (0 xf << 28 )
#define RT1308_DIV_FS_SYS_SFT 28
#define RT1308_SEL_FS_SYS_MASK (0 x7 << 24 )
#define RT1308_SEL_FS_SYS_SFT 24
#define RT1308_SEL_FS_SYS_SRC_MCLK (0 x0 << 24 )
#define RT1308_SEL_FS_SYS_SRC_BCLK (0 x1 << 24 )
#define RT1308_SEL_FS_SYS_SRC_PLL (0 x2 << 24 )
#define RT1308_SEL_FS_SYS_SRC_RCCLK (0 x4 << 24 )
/* CLOCK-2 (0x08) */
#define RT1308_DIV_PRE_PLL_MASK (0 xf << 28 )
#define RT1308_DIV_PRE_PLL_SFT 28
#define RT1308_SEL_PLL_SRC_MASK (0 x7 << 24 )
#define RT1308_SEL_PLL_SRC_SFT 24
#define RT1308_SEL_PLL_SRC_MCLK (0 x0 << 24 )
#define RT1308_SEL_PLL_SRC_BCLK (0 x1 << 24 )
#define RT1308_SEL_PLL_SRC_RCCLK (0 x4 << 24 )
/* Clock Detect (0x0a) */
#define RT1308_MCLK_DET_EN_MASK (0 x1 << 25 )
#define RT1308_MCLK_DET_EN_SFT 25
#define RT1308_MCLK_DET_EN (0 x1 << 25 )
#define RT1308_BCLK_DET_EN_MASK (0 x1 << 24 )
#define RT1308_BCLK_DET_EN_SFT 24
#define RT1308_BCLK_DET_EN (0 x1 << 24 )
/* DAC Setting (0x10) */
#define RT1308_DVOL_MUTE_R_EN_SFT 7
#define RT1308_DVOL_MUTE_L_EN_SFT 6
/* I2S Setting-1 (0x15) */
#define RT1308_I2S_DF_SEL_MASK (0 x3 << 12 )
#define RT1308_I2S_DF_SEL_SFT 12
#define RT1308_I2S_DF_SEL_I2S (0 x0 << 12 )
#define RT1308_I2S_DF_SEL_LEFT (0 x1 << 12 )
#define RT1308_I2S_DF_SEL_PCM_A (0 x2 << 12 )
#define RT1308_I2S_DF_SEL_PCM_B (0 x3 << 12 )
#define RT1308_I2S_DL_RX_SEL_MASK (0 x7 << 4 )
#define RT1308_I2S_DL_RX_SEL_SFT 4
#define RT1308_I2S_DL_RX_SEL_16B (0 x0 << 4 )
#define RT1308_I2S_DL_RX_SEL_20B (0 x1 << 4 )
#define RT1308_I2S_DL_RX_SEL_24B (0 x2 << 4 )
#define RT1308_I2S_DL_RX_SEL_32B (0 x3 << 4 )
#define RT1308_I2S_DL_RX_SEL_8B (0 x4 << 4 )
#define RT1308_I2S_DL_TX_SEL_MASK (0 x7 << 0 )
#define RT1308_I2S_DL_TX_SEL_SFT 0
#define RT1308_I2S_DL_TX_SEL_16B (0 x0 << 0 )
#define RT1308_I2S_DL_TX_SEL_20B (0 x1 << 0 )
#define RT1308_I2S_DL_TX_SEL_24B (0 x2 << 0 )
#define RT1308_I2S_DL_TX_SEL_32B (0 x3 << 0 )
#define RT1308_I2S_DL_TX_SEL_8B (0 x4 << 0 )
/* I2S Setting-2 (0x16) */
#define RT1308_I2S_DL_SEL_MASK (0 x7 << 24 )
#define RT1308_I2S_DL_SEL_SFT 24
#define RT1308_I2S_DL_SEL_16B (0 x0 << 24 )
#define RT1308_I2S_DL_SEL_20B (0 x1 << 24 )
#define RT1308_I2S_DL_SEL_24B (0 x2 << 24 )
#define RT1308_I2S_DL_SEL_32B (0 x3 << 24 )
#define RT1308_I2S_DL_SEL_8B (0 x4 << 24 )
#define RT1308_I2S_BCLK_MASK (0 x1 << 14 )
#define RT1308_I2S_BCLK_SFT 14
#define RT1308_I2S_BCLK_NORMAL (0 x0 << 14 )
#define RT1308_I2S_BCLK_INV (0 x1 << 14 )
/* Power Control-1 (0x32) */
#define RT1308_POW_MBIAS20U (0 x1 << 31 )
#define RT1308_POW_MBIAS20U_BIT 31
#define RT1308_POW_ALDO (0 x1 << 30 )
#define RT1308_POW_ALDO_BIT 30
#define RT1308_POW_DBG (0 x1 << 29 )
#define RT1308_POW_DBG_BIT 29
#define RT1308_POW_DACL (0 x1 << 28 )
#define RT1308_POW_DACL_BIT 28
#define RT1308_POW_DAC1 (0 x1 << 27 )
#define RT1308_POW_DAC1_BIT 27
#define RT1308_POW_CLK25M (0 x1 << 26 )
#define RT1308_POW_CLK25M_BIT 26
#define RT1308_POW_ADC_R (0 x1 << 25 )
#define RT1308_POW_ADC_R_BIT 25
#define RT1308_POW_ADC_L (0 x1 << 24 )
#define RT1308_POW_ADC_L_BIT 24
#define RT1308_POW_DLDO (0 x1 << 21 )
#define RT1308_POW_DLDO_BIT 21
#define RT1308_POW_VREF (0 x1 << 20 )
#define RT1308_POW_VREF_BIT 20
#define RT1308_POW_MIXER_R (0 x1 << 18 )
#define RT1308_POW_MIXER_R_BIT 18
#define RT1308_POW_MIXER_L (0 x1 << 17 )
#define RT1308_POW_MIXER_L_BIT 17
#define RT1308_POW_MBIAS4U (0 x1 << 16 )
#define RT1308_POW_MBIAS4U_BIT 16
#define RT1308_POW_PLL2_LDO_EN (0 x1 << 12 )
#define RT1308_POW_PLL2_LDO_EN_BIT 12
#define RT1308_POW_PLL2B_EN (0 x1 << 11 )
#define RT1308_POW_PLL2B_EN_BIT 11
#define RT1308_POW_PLL2F_EN (0 x1 << 10 )
#define RT1308_POW_PLL2F_EN_BIT 10
#define RT1308_POW_PLL2F2_EN (0 x1 << 9 )
#define RT1308_POW_PLL2F2_EN_BIT 9
#define RT1308_POW_PLL2B2_EN (0 x1 << 8 )
#define RT1308_POW_PLL2B2_EN_BIT 8
/* Power Control-2 (0x36) */
#define RT1308_POW_PDB_SRC_BIT (0 x1 << 27 )
#define RT1308_POW_PDB_MN_BIT (0 x1 << 25 )
#define RT1308_POW_PDB_REG_BIT (0 x1 << 24 )
/* System Clock Source */
enum {
RT1308_FS_SYS_S_MCLK,
RT1308_FS_SYS_S_BCLK,
RT1308_FS_SYS_S_PLL,
RT1308_FS_SYS_S_RCCLK, /* 25.0 MHz */
};
/* PLL Source */
enum {
RT1308_PLL_S_MCLK,
RT1308_PLL_S_BCLK,
RT1308_PLL_S_RCCLK,
};
enum {
RT1308_AIF1,
RT1308_AIFS
};
enum rt1308_hw_ver {
RT1308_VER_C = 2 ,
RT1308_VER_D
};
#endif /* end of _RT1308_H_ */
Messung V0.5 in Prozent C=94 H=95 G=94
¤ Dauer der Verarbeitung: 0.9 Sekunden
(vorverarbeitet am 2026-06-07)
¤
*© Formatika GbR, Deutschland