162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */
262306a36Sopenharmony_ci/*
362306a36Sopenharmony_ci * Copyright (C) 2011 LAPIS Semiconductor Co., Ltd.
462306a36Sopenharmony_ci */
562306a36Sopenharmony_ci
662306a36Sopenharmony_ci#ifndef ML26124_H
762306a36Sopenharmony_ci#define ML26124_H
862306a36Sopenharmony_ci
962306a36Sopenharmony_ci/* Clock Control Register */
1062306a36Sopenharmony_ci#define ML26124_SMPLING_RATE		0x00
1162306a36Sopenharmony_ci#define ML26124_PLLNL			0x02
1262306a36Sopenharmony_ci#define ML26124_PLLNH			0x04
1362306a36Sopenharmony_ci#define ML26124_PLLML			0x06
1462306a36Sopenharmony_ci#define ML26124_PLLMH			0x08
1562306a36Sopenharmony_ci#define ML26124_PLLDIV			0x0a
1662306a36Sopenharmony_ci#define ML26124_CLK_EN			0x0c
1762306a36Sopenharmony_ci#define ML26124_CLK_CTL			0x0e
1862306a36Sopenharmony_ci
1962306a36Sopenharmony_ci/* System Control Register */
2062306a36Sopenharmony_ci#define ML26124_SW_RST			0x10
2162306a36Sopenharmony_ci#define ML26124_REC_PLYBAK_RUN		0x12
2262306a36Sopenharmony_ci#define ML26124_MIC_TIM			0x14
2362306a36Sopenharmony_ci
2462306a36Sopenharmony_ci/* Power Mnagement Register */
2562306a36Sopenharmony_ci#define ML26124_PW_REF_PW_MNG		0x20
2662306a36Sopenharmony_ci#define ML26124_PW_IN_PW_MNG		0x22
2762306a36Sopenharmony_ci#define ML26124_PW_DAC_PW_MNG		0x24
2862306a36Sopenharmony_ci#define ML26124_PW_SPAMP_PW_MNG		0x26
2962306a36Sopenharmony_ci#define ML26124_PW_LOUT_PW_MNG		0x28
3062306a36Sopenharmony_ci#define ML26124_PW_VOUT_PW_MNG		0x2a
3162306a36Sopenharmony_ci#define ML26124_PW_ZCCMP_PW_MNG		0x2e
3262306a36Sopenharmony_ci
3362306a36Sopenharmony_ci/* Analog Reference Control Register */
3462306a36Sopenharmony_ci#define ML26124_PW_MICBIAS_VOL		0x30
3562306a36Sopenharmony_ci
3662306a36Sopenharmony_ci/* Input/Output Amplifier Control Register */
3762306a36Sopenharmony_ci#define ML26124_PW_MIC_IN_VOL		0x32
3862306a36Sopenharmony_ci#define ML26124_PW_MIC_BOST_VOL		0x38
3962306a36Sopenharmony_ci#define ML26124_PW_SPK_AMP_VOL		0x3a
4062306a36Sopenharmony_ci#define ML26124_PW_AMP_VOL_FUNC		0x48
4162306a36Sopenharmony_ci#define ML26124_PW_AMP_VOL_FADE		0x4a
4262306a36Sopenharmony_ci
4362306a36Sopenharmony_ci/* Analog Path Control Register */
4462306a36Sopenharmony_ci#define ML26124_SPK_AMP_OUT		0x54
4562306a36Sopenharmony_ci#define ML26124_MIC_IF_CTL		0x5a
4662306a36Sopenharmony_ci#define ML26124_MIC_SELECT		0xe8
4762306a36Sopenharmony_ci
4862306a36Sopenharmony_ci/* Audio Interface Control Register */
4962306a36Sopenharmony_ci#define ML26124_SAI_TRANS_CTL		0x60
5062306a36Sopenharmony_ci#define ML26124_SAI_RCV_CTL		0x62
5162306a36Sopenharmony_ci#define ML26124_SAI_MODE_SEL		0x64
5262306a36Sopenharmony_ci
5362306a36Sopenharmony_ci/* DSP Control Register */
5462306a36Sopenharmony_ci#define ML26124_FILTER_EN		0x66
5562306a36Sopenharmony_ci#define ML26124_DVOL_CTL		0x68
5662306a36Sopenharmony_ci#define ML26124_MIXER_VOL_CTL		0x6a
5762306a36Sopenharmony_ci#define ML26124_RECORD_DIG_VOL		0x6c
5862306a36Sopenharmony_ci#define ML26124_PLBAK_DIG_VOL		0x70
5962306a36Sopenharmony_ci#define ML26124_DIGI_BOOST_VOL		0x72
6062306a36Sopenharmony_ci#define ML26124_EQ_GAIN_BRAND0		0x74
6162306a36Sopenharmony_ci#define ML26124_EQ_GAIN_BRAND1		0x76
6262306a36Sopenharmony_ci#define ML26124_EQ_GAIN_BRAND2		0x78
6362306a36Sopenharmony_ci#define ML26124_EQ_GAIN_BRAND3		0x7a
6462306a36Sopenharmony_ci#define ML26124_EQ_GAIN_BRAND4		0x7c
6562306a36Sopenharmony_ci#define ML26124_HPF2_CUTOFF		0x7e
6662306a36Sopenharmony_ci#define ML26124_EQBRAND0_F0L		0x80
6762306a36Sopenharmony_ci#define ML26124_EQBRAND0_F0H		0x82
6862306a36Sopenharmony_ci#define ML26124_EQBRAND0_F1L		0x84
6962306a36Sopenharmony_ci#define ML26124_EQBRAND0_F1H		0x86
7062306a36Sopenharmony_ci#define ML26124_EQBRAND1_F0L		0x88
7162306a36Sopenharmony_ci#define ML26124_EQBRAND1_F0H		0x8a
7262306a36Sopenharmony_ci#define ML26124_EQBRAND1_F1L		0x8c
7362306a36Sopenharmony_ci#define ML26124_EQBRAND1_F1H		0x8e
7462306a36Sopenharmony_ci#define ML26124_EQBRAND2_F0L		0x90
7562306a36Sopenharmony_ci#define ML26124_EQBRAND2_F0H		0x92
7662306a36Sopenharmony_ci#define ML26124_EQBRAND2_F1L		0x94
7762306a36Sopenharmony_ci#define ML26124_EQBRAND2_F1H		0x96
7862306a36Sopenharmony_ci#define ML26124_EQBRAND3_F0L		0x98
7962306a36Sopenharmony_ci#define ML26124_EQBRAND3_F0H		0x9a
8062306a36Sopenharmony_ci#define ML26124_EQBRAND3_F1L		0x9c
8162306a36Sopenharmony_ci#define ML26124_EQBRAND3_F1H		0x9e
8262306a36Sopenharmony_ci#define ML26124_EQBRAND4_F0L		0xa0
8362306a36Sopenharmony_ci#define ML26124_EQBRAND4_F0H		0xa2
8462306a36Sopenharmony_ci#define ML26124_EQBRAND4_F1L		0xa4
8562306a36Sopenharmony_ci#define ML26124_EQBRAND4_F1H		0xa6
8662306a36Sopenharmony_ci
8762306a36Sopenharmony_ci/* ALC Control Register */
8862306a36Sopenharmony_ci#define ML26124_ALC_MODE		0xb0
8962306a36Sopenharmony_ci#define ML26124_ALC_ATTACK_TIM		0xb2
9062306a36Sopenharmony_ci#define ML26124_ALC_DECAY_TIM		0xb4
9162306a36Sopenharmony_ci#define ML26124_ALC_HOLD_TIM		0xb6
9262306a36Sopenharmony_ci#define ML26124_ALC_TARGET_LEV		0xb8
9362306a36Sopenharmony_ci#define ML26124_ALC_MAXMIN_GAIN		0xba
9462306a36Sopenharmony_ci#define ML26124_NOIS_GATE_THRSH		0xbc
9562306a36Sopenharmony_ci#define ML26124_ALC_ZERO_TIMOUT		0xbe
9662306a36Sopenharmony_ci
9762306a36Sopenharmony_ci/* Playback Limiter Control Register */
9862306a36Sopenharmony_ci#define ML26124_PL_ATTACKTIME		0xc0
9962306a36Sopenharmony_ci#define ML26124_PL_DECAYTIME		0xc2
10062306a36Sopenharmony_ci#define ML26124_PL_TARGETTIME		0xc4
10162306a36Sopenharmony_ci#define ML26124_PL_MAXMIN_GAIN		0xc6
10262306a36Sopenharmony_ci#define ML26124_PLYBAK_BOST_VOL		0xc8
10362306a36Sopenharmony_ci#define ML26124_PL_0CROSS_TIMOUT	0xca
10462306a36Sopenharmony_ci
10562306a36Sopenharmony_ci/* Video Amplifer Control Register */
10662306a36Sopenharmony_ci#define ML26124_VIDEO_AMP_GAIN_CTL	0xd0
10762306a36Sopenharmony_ci#define ML26124_VIDEO_AMP_SETUP1	0xd2
10862306a36Sopenharmony_ci#define ML26124_VIDEO_AMP_CTL2		0xd4
10962306a36Sopenharmony_ci
11062306a36Sopenharmony_ci/* Clock select for machine driver */
11162306a36Sopenharmony_ci#define ML26124_USE_PLL			0
11262306a36Sopenharmony_ci#define ML26124_USE_MCLKI_256FS		1
11362306a36Sopenharmony_ci#define ML26124_USE_MCLKI_512FS		2
11462306a36Sopenharmony_ci#define ML26124_USE_MCLKI_1024FS	3
11562306a36Sopenharmony_ci
11662306a36Sopenharmony_ci/* Register Mask */
11762306a36Sopenharmony_ci#define ML26124_R0_MASK	0xf
11862306a36Sopenharmony_ci#define ML26124_R2_MASK	0xff
11962306a36Sopenharmony_ci#define ML26124_R4_MASK	0x1
12062306a36Sopenharmony_ci#define ML26124_R6_MASK	0xf
12162306a36Sopenharmony_ci#define ML26124_R8_MASK	0x3f
12262306a36Sopenharmony_ci#define ML26124_Ra_MASK	0x1f
12362306a36Sopenharmony_ci#define ML26124_Rc_MASK	0x1f
12462306a36Sopenharmony_ci#define ML26124_Re_MASK	0x7
12562306a36Sopenharmony_ci#define ML26124_R10_MASK	0x1
12662306a36Sopenharmony_ci#define ML26124_R12_MASK	0x17
12762306a36Sopenharmony_ci#define ML26124_R14_MASK	0x3f
12862306a36Sopenharmony_ci#define ML26124_R20_MASK	0x47
12962306a36Sopenharmony_ci#define ML26124_R22_MASK	0xa
13062306a36Sopenharmony_ci#define ML26124_R24_MASK	0x2
13162306a36Sopenharmony_ci#define ML26124_R26_MASK	0x1f
13262306a36Sopenharmony_ci#define ML26124_R28_MASK	0x2
13362306a36Sopenharmony_ci#define ML26124_R2a_MASK	0x2
13462306a36Sopenharmony_ci#define ML26124_R2e_MASK	0x2
13562306a36Sopenharmony_ci#define ML26124_R30_MASK	0x7
13662306a36Sopenharmony_ci#define ML26124_R32_MASK	0x3f
13762306a36Sopenharmony_ci#define ML26124_R38_MASK	0x38
13862306a36Sopenharmony_ci#define ML26124_R3a_MASK	0x3f
13962306a36Sopenharmony_ci#define ML26124_R48_MASK	0x3
14062306a36Sopenharmony_ci#define ML26124_R4a_MASK	0x7
14162306a36Sopenharmony_ci#define ML26124_R54_MASK	0x2a
14262306a36Sopenharmony_ci#define ML26124_R5a_MASK	0x3
14362306a36Sopenharmony_ci#define ML26124_Re8_MASK	0x3
14462306a36Sopenharmony_ci#define ML26124_R60_MASK	0xff
14562306a36Sopenharmony_ci#define ML26124_R62_MASK	0xff
14662306a36Sopenharmony_ci#define ML26124_R64_MASK	0x1
14762306a36Sopenharmony_ci#define ML26124_R66_MASK	0xff
14862306a36Sopenharmony_ci#define ML26124_R68_MASK	0x3b
14962306a36Sopenharmony_ci#define ML26124_R6a_MASK	0xf3
15062306a36Sopenharmony_ci#define ML26124_R6c_MASK	0xff
15162306a36Sopenharmony_ci#define ML26124_R70_MASK	0xff
15262306a36Sopenharmony_ci
15362306a36Sopenharmony_ci#define ML26124_MCLKEN		BIT(0)
15462306a36Sopenharmony_ci#define ML26124_PLLEN		BIT(1)
15562306a36Sopenharmony_ci#define ML26124_PLLOE		BIT(2)
15662306a36Sopenharmony_ci#define ML26124_MCLKOE		BIT(3)
15762306a36Sopenharmony_ci
15862306a36Sopenharmony_ci#define ML26124_BLT_ALL_ON	0x1f
15962306a36Sopenharmony_ci#define ML26124_BLT_PREAMP_ON	0x13
16062306a36Sopenharmony_ci
16162306a36Sopenharmony_ci#define ML26124_MICBEN_ON	BIT(2)
16262306a36Sopenharmony_ci
16362306a36Sopenharmony_cienum ml26124_regs {
16462306a36Sopenharmony_ci	ML26124_MCLK = 0,
16562306a36Sopenharmony_ci};
16662306a36Sopenharmony_ci
16762306a36Sopenharmony_cienum ml26124_clk_in {
16862306a36Sopenharmony_ci	ML26124_USE_PLLOUT = 0,
16962306a36Sopenharmony_ci	ML26124_USE_MCLKI,
17062306a36Sopenharmony_ci};
17162306a36Sopenharmony_ci
17262306a36Sopenharmony_ci#endif
173