162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */
262306a36Sopenharmony_ci/*
362306a36Sopenharmony_ci * cs35l35.h -- CS35L35 ALSA SoC audio driver
462306a36Sopenharmony_ci *
562306a36Sopenharmony_ci * Copyright 2016 Cirrus Logic, Inc.
662306a36Sopenharmony_ci *
762306a36Sopenharmony_ci * Author: Brian Austin <brian.austin@cirrus.com>
862306a36Sopenharmony_ci */
962306a36Sopenharmony_ci
1062306a36Sopenharmony_ci#ifndef __CS35L35_H__
1162306a36Sopenharmony_ci#define __CS35L35_H__
1262306a36Sopenharmony_ci
1362306a36Sopenharmony_ci#define CS35L35_FIRSTREG		0x01
1462306a36Sopenharmony_ci#define CS35L35_LASTREG			0x7E
1562306a36Sopenharmony_ci#define CS35L35_CHIP_ID			0x00035A35
1662306a36Sopenharmony_ci#define CS35L35_DEVID_AB		0x01	/* Device ID A & B [RO] */
1762306a36Sopenharmony_ci#define CS35L35_DEVID_CD		0x02    /* Device ID C & D [RO] */
1862306a36Sopenharmony_ci#define CS35L35_DEVID_E			0x03    /* Device ID E [RO] */
1962306a36Sopenharmony_ci#define CS35L35_FAB_ID			0x04	/* Fab ID [RO] */
2062306a36Sopenharmony_ci#define CS35L35_REV_ID			0x05	/* Revision ID [RO] */
2162306a36Sopenharmony_ci#define CS35L35_PWRCTL1			0x06    /* Power Ctl 1 */
2262306a36Sopenharmony_ci#define CS35L35_PWRCTL2			0x07    /* Power Ctl 2 */
2362306a36Sopenharmony_ci#define CS35L35_PWRCTL3			0x08	/* Power Ctl 3 */
2462306a36Sopenharmony_ci#define CS35L35_CLK_CTL1		0x0A	/* Clocking Ctl 1 */
2562306a36Sopenharmony_ci#define CS35L35_CLK_CTL2		0x0B	/* Clocking Ctl 2 */
2662306a36Sopenharmony_ci#define CS35L35_CLK_CTL3		0x0C	/* Clocking Ctl 3 */
2762306a36Sopenharmony_ci#define CS35L35_SP_FMT_CTL1		0x0D	/* Serial Port Format CTL1 */
2862306a36Sopenharmony_ci#define CS35L35_SP_FMT_CTL2		0x0E	/* Serial Port Format CTL2 */
2962306a36Sopenharmony_ci#define CS35L35_SP_FMT_CTL3		0x0F	/* Serial Port Format CTL3 */
3062306a36Sopenharmony_ci#define CS35L35_MAG_COMP_CTL		0x13	/* Magnitude Comp CTL */
3162306a36Sopenharmony_ci#define CS35L35_AMP_INP_DRV_CTL		0x14	/* Amp Input Drive Ctl */
3262306a36Sopenharmony_ci#define CS35L35_AMP_DIG_VOL_CTL		0x15	/* Amplifier Dig Volume Ctl */
3362306a36Sopenharmony_ci#define CS35L35_AMP_DIG_VOL		0x16	/* Amplifier Dig Volume */
3462306a36Sopenharmony_ci#define CS35L35_ADV_DIG_VOL		0x17	/* Advisory Digital Volume */
3562306a36Sopenharmony_ci#define CS35L35_PROTECT_CTL		0x18	/* Amp Gain - Prot Ctl Param */
3662306a36Sopenharmony_ci#define CS35L35_AMP_GAIN_AUD_CTL	0x19	/* Amp Serial Port Gain Ctl */
3762306a36Sopenharmony_ci#define CS35L35_AMP_GAIN_PDM_CTL	0x1A	/* Amplifier Gain PDM Ctl */
3862306a36Sopenharmony_ci#define CS35L35_AMP_GAIN_ADV_CTL	0x1B	/* Amplifier Gain Ctl */
3962306a36Sopenharmony_ci#define CS35L35_GPI_CTL			0x1C	/* GPI Ctl */
4062306a36Sopenharmony_ci#define CS35L35_BST_CVTR_V_CTL		0x1D	/* Boost Conv Voltage Ctl */
4162306a36Sopenharmony_ci#define CS35L35_BST_PEAK_I		0x1E	/* Boost Conv Peak Current */
4262306a36Sopenharmony_ci#define CS35L35_BST_RAMP_CTL		0x20	/* Boost Conv Soft Ramp Ctl */
4362306a36Sopenharmony_ci#define CS35L35_BST_CONV_COEF_1		0x21	/* Boost Conv Coefficients 1 */
4462306a36Sopenharmony_ci#define CS35L35_BST_CONV_COEF_2		0x22	/* Boost Conv Coefficients 2 */
4562306a36Sopenharmony_ci#define CS35L35_BST_CONV_SLOPE_COMP	0x23	/* Boost Conv Slope Comp */
4662306a36Sopenharmony_ci#define CS35L35_BST_CONV_SW_FREQ	0x24	/* Boost Conv L BST SW Freq */
4762306a36Sopenharmony_ci#define CS35L35_CLASS_H_CTL		0x30	/* CLS H Control */
4862306a36Sopenharmony_ci#define CS35L35_CLASS_H_HEADRM_CTL	0x31	/* CLS H Headroom Ctl */
4962306a36Sopenharmony_ci#define CS35L35_CLASS_H_RELEASE_RATE	0x32	/* CLS H Release Rate */
5062306a36Sopenharmony_ci#define CS35L35_CLASS_H_FET_DRIVE_CTL	0x33	/* CLS H Weak FET Drive Ctl */
5162306a36Sopenharmony_ci#define CS35L35_CLASS_H_VP_CTL		0x34	/* CLS H VP Ctl */
5262306a36Sopenharmony_ci#define CS35L35_CLASS_H_STATUS		0x38	/* CLS H Status */
5362306a36Sopenharmony_ci#define CS35L35_VPBR_CTL		0x3A	/* VPBR Ctl */
5462306a36Sopenharmony_ci#define CS35L35_VPBR_VOL_CTL		0x3B	/* VPBR Volume Ctl */
5562306a36Sopenharmony_ci#define CS35L35_VPBR_TIMING_CTL		0x3C	/* VPBR Timing Ctl */
5662306a36Sopenharmony_ci#define CS35L35_VPBR_MODE_VOL_CTL	0x3D	/* VPBR Mode/Attack Vol Ctl */
5762306a36Sopenharmony_ci#define CS35L35_VPBR_ATTEN_STATUS	0x4B	/* VPBR Attenuation Status */
5862306a36Sopenharmony_ci#define CS35L35_SPKR_MON_CTL		0x4E	/* Speaker Monitoring Ctl */
5962306a36Sopenharmony_ci#define CS35L35_IMON_SCALE_CTL		0x51	/* IMON Scale Ctl */
6062306a36Sopenharmony_ci#define CS35L35_AUDIN_RXLOC_CTL		0x52	/* Audio Input RX Loc Ctl */
6162306a36Sopenharmony_ci#define CS35L35_ADVIN_RXLOC_CTL		0x53	/* Advisory Input RX Loc Ctl */
6262306a36Sopenharmony_ci#define CS35L35_VMON_TXLOC_CTL		0x54	/* VMON TX Loc Ctl */
6362306a36Sopenharmony_ci#define CS35L35_IMON_TXLOC_CTL		0x55	/* IMON TX Loc Ctl */
6462306a36Sopenharmony_ci#define CS35L35_VPMON_TXLOC_CTL		0x56	/* VPMON TX Loc Ctl */
6562306a36Sopenharmony_ci#define CS35L35_VBSTMON_TXLOC_CTL	0x57	/* VBSTMON TX Loc Ctl */
6662306a36Sopenharmony_ci#define CS35L35_VPBR_STATUS_TXLOC_CTL	0x58	/* VPBR Status TX Loc Ctl */
6762306a36Sopenharmony_ci#define CS35L35_ZERO_FILL_LOC_CTL	0x59	/* Zero Fill Loc Ctl */
6862306a36Sopenharmony_ci#define CS35L35_AUDIN_DEPTH_CTL		0x5A	/* Audio Input Depth Ctl */
6962306a36Sopenharmony_ci#define CS35L35_SPKMON_DEPTH_CTL	0x5B	/* SPK Mon Output Depth Ctl */
7062306a36Sopenharmony_ci#define CS35L35_SUPMON_DEPTH_CTL	0x5C	/* Supply Mon Out Depth Ctl */
7162306a36Sopenharmony_ci#define CS35L35_ZEROFILL_DEPTH_CTL	0x5D	/* Zero Fill Mon Output Ctl */
7262306a36Sopenharmony_ci#define CS35L35_MULT_DEV_SYNCH1		0x62	/* Multidevice Synch */
7362306a36Sopenharmony_ci#define CS35L35_MULT_DEV_SYNCH2		0x63	/* Multidevice Synch 2 */
7462306a36Sopenharmony_ci#define CS35L35_PROT_RELEASE_CTL	0x64	/* Protection Release Ctl */
7562306a36Sopenharmony_ci#define CS35L35_DIAG_MODE_REG_LOCK	0x68	/* Diagnostic Mode Reg Lock */
7662306a36Sopenharmony_ci#define CS35L35_DIAG_MODE_CTL_1		0x69	/* Diagnostic Mode Ctl 1 */
7762306a36Sopenharmony_ci#define CS35L35_DIAG_MODE_CTL_2		0x6A	/* Diagnostic Mode Ctl 2 */
7862306a36Sopenharmony_ci#define CS35L35_INT_MASK_1		0x70	/* Interrupt Mask 1 */
7962306a36Sopenharmony_ci#define CS35L35_INT_MASK_2		0x71	/* Interrupt Mask 2 */
8062306a36Sopenharmony_ci#define CS35L35_INT_MASK_3		0x72	/* Interrupt Mask 3 */
8162306a36Sopenharmony_ci#define CS35L35_INT_MASK_4		0x73	/* Interrupt Mask 4 */
8262306a36Sopenharmony_ci#define CS35L35_INT_STATUS_1		0x74	/* Interrupt Status 1 */
8362306a36Sopenharmony_ci#define CS35L35_INT_STATUS_2		0x75	/* Interrupt Status 2 */
8462306a36Sopenharmony_ci#define CS35L35_INT_STATUS_3		0x76	/* Interrupt Status 3 */
8562306a36Sopenharmony_ci#define CS35L35_INT_STATUS_4		0x77	/* Interrupt Status 4 */
8662306a36Sopenharmony_ci#define CS35L35_PLL_STATUS		0x78	/* PLL Status */
8762306a36Sopenharmony_ci#define CS35L35_OTP_TRIM_STATUS		0x7E	/* OTP Trim Status */
8862306a36Sopenharmony_ci
8962306a36Sopenharmony_ci#define CS35L35_MAX_REGISTER		0x7F
9062306a36Sopenharmony_ci
9162306a36Sopenharmony_ci/* CS35L35_PWRCTL1 */
9262306a36Sopenharmony_ci#define CS35L35_SFT_RST			0x80
9362306a36Sopenharmony_ci#define CS35L35_DISCHG_FLT		0x02
9462306a36Sopenharmony_ci#define CS35L35_PDN_ALL			0x01
9562306a36Sopenharmony_ci
9662306a36Sopenharmony_ci/* CS35L35_PWRCTL2 */
9762306a36Sopenharmony_ci#define CS35L35_PDN_VMON		0x80
9862306a36Sopenharmony_ci#define CS35L35_PDN_IMON		0x40
9962306a36Sopenharmony_ci#define CS35L35_PDN_CLASSH		0x20
10062306a36Sopenharmony_ci#define CS35L35_PDN_VPBR		0x10
10162306a36Sopenharmony_ci#define CS35L35_PDN_BST			0x04
10262306a36Sopenharmony_ci#define CS35L35_PDN_AMP			0x01
10362306a36Sopenharmony_ci
10462306a36Sopenharmony_ci/* CS35L35_PWRCTL3 */
10562306a36Sopenharmony_ci#define CS35L35_PDN_VBSTMON_OUT		0x10
10662306a36Sopenharmony_ci#define CS35L35_PDN_VMON_OUT		0x08
10762306a36Sopenharmony_ci
10862306a36Sopenharmony_ci#define CS35L35_AUDIN_DEPTH_MASK	0x03
10962306a36Sopenharmony_ci#define CS35L35_AUDIN_DEPTH_SHIFT	0
11062306a36Sopenharmony_ci#define CS35L35_ADVIN_DEPTH_MASK	0x0C
11162306a36Sopenharmony_ci#define CS35L35_ADVIN_DEPTH_SHIFT	2
11262306a36Sopenharmony_ci#define CS35L35_SDIN_DEPTH_8		0x01
11362306a36Sopenharmony_ci#define CS35L35_SDIN_DEPTH_16		0x02
11462306a36Sopenharmony_ci#define CS35L35_SDIN_DEPTH_24		0x03
11562306a36Sopenharmony_ci
11662306a36Sopenharmony_ci#define CS35L35_SDOUT_DEPTH_8		0x01
11762306a36Sopenharmony_ci#define CS35L35_SDOUT_DEPTH_12		0x02
11862306a36Sopenharmony_ci#define CS35L35_SDOUT_DEPTH_16		0x03
11962306a36Sopenharmony_ci
12062306a36Sopenharmony_ci#define CS35L35_AUD_IN_LR_MASK		0x80
12162306a36Sopenharmony_ci#define CS35L35_AUD_IN_LR_SHIFT		7
12262306a36Sopenharmony_ci#define CS35L35_ADV_IN_LR_MASK		0x80
12362306a36Sopenharmony_ci#define CS35L35_ADV_IN_LR_SHIFT		7
12462306a36Sopenharmony_ci#define CS35L35_AUD_IN_LOC_MASK		0x0F
12562306a36Sopenharmony_ci#define CS35L35_AUD_IN_LOC_SHIFT	0
12662306a36Sopenharmony_ci#define CS35L35_ADV_IN_LOC_MASK		0x0F
12762306a36Sopenharmony_ci#define CS35L35_ADV_IN_LOC_SHIFT	0
12862306a36Sopenharmony_ci
12962306a36Sopenharmony_ci#define CS35L35_IMON_DEPTH_MASK		0x03
13062306a36Sopenharmony_ci#define CS35L35_IMON_DEPTH_SHIFT	0
13162306a36Sopenharmony_ci#define CS35L35_VMON_DEPTH_MASK		0x0C
13262306a36Sopenharmony_ci#define CS35L35_VMON_DEPTH_SHIFT	2
13362306a36Sopenharmony_ci#define CS35L35_VBSTMON_DEPTH_MASK	0x03
13462306a36Sopenharmony_ci#define CS35L35_VBSTMON_DEPTH_SHIFT	0
13562306a36Sopenharmony_ci#define CS35L35_VPMON_DEPTH_MASK	0x0C
13662306a36Sopenharmony_ci#define CS35L35_VPMON_DEPTH_SHIFT	2
13762306a36Sopenharmony_ci#define CS35L35_VPBRSTAT_DEPTH_MASK	0x30
13862306a36Sopenharmony_ci#define CS35L35_VPBRSTAT_DEPTH_SHIFT	4
13962306a36Sopenharmony_ci#define CS35L35_ZEROFILL_DEPTH_MASK	0x03
14062306a36Sopenharmony_ci#define CS35L35_ZEROFILL_DEPTH_SHIFT	0x00
14162306a36Sopenharmony_ci
14262306a36Sopenharmony_ci#define CS35L35_MON_TXLOC_MASK		0x3F
14362306a36Sopenharmony_ci#define CS35L35_MON_TXLOC_SHIFT		0
14462306a36Sopenharmony_ci#define CS35L35_MON_FRM_MASK		0x80
14562306a36Sopenharmony_ci#define CS35L35_MON_FRM_SHIFT		7
14662306a36Sopenharmony_ci
14762306a36Sopenharmony_ci#define CS35L35_IMON_SCALE_MASK		0xF8
14862306a36Sopenharmony_ci#define CS35L35_IMON_SCALE_SHIFT	3
14962306a36Sopenharmony_ci
15062306a36Sopenharmony_ci#define CS35L35_MS_MASK			0x80
15162306a36Sopenharmony_ci#define CS35L35_MS_SHIFT		7
15262306a36Sopenharmony_ci#define CS35L35_SPMODE_MASK		0x40
15362306a36Sopenharmony_ci#define CS35L35_SP_DRV_MASK		0x10
15462306a36Sopenharmony_ci#define CS35L35_SP_DRV_SHIFT		4
15562306a36Sopenharmony_ci#define CS35L35_CLK_CTL2_MASK		0xFF
15662306a36Sopenharmony_ci#define CS35L35_PDM_MODE_MASK		0x40
15762306a36Sopenharmony_ci#define CS35L35_PDM_MODE_SHIFT		6
15862306a36Sopenharmony_ci#define CS35L35_CLK_SOURCE_MASK		0x03
15962306a36Sopenharmony_ci#define CS35L35_CLK_SOURCE_SHIFT	0
16062306a36Sopenharmony_ci#define CS35L35_CLK_SOURCE_MCLK		0
16162306a36Sopenharmony_ci#define CS35L35_CLK_SOURCE_SCLK		1
16262306a36Sopenharmony_ci#define CS35L35_CLK_SOURCE_PDM		2
16362306a36Sopenharmony_ci
16462306a36Sopenharmony_ci#define CS35L35_SP_SCLKS_MASK		0x0F
16562306a36Sopenharmony_ci#define CS35L35_SP_SCLKS_SHIFT		0x00
16662306a36Sopenharmony_ci#define CS35L35_SP_SCLKS_16FS		0x03
16762306a36Sopenharmony_ci#define CS35L35_SP_SCLKS_32FS		0x07
16862306a36Sopenharmony_ci#define CS35L35_SP_SCLKS_48FS		0x0B
16962306a36Sopenharmony_ci#define CS35L35_SP_SCLKS_64FS		0x0F
17062306a36Sopenharmony_ci#define CS35L35_SP_RATE_MASK		0xC0
17162306a36Sopenharmony_ci#define CS35L35_SP_RATE_SHIFT		6
17262306a36Sopenharmony_ci
17362306a36Sopenharmony_ci#define CS35L35_PDN_BST_MASK		0x06
17462306a36Sopenharmony_ci#define CS35L35_PDN_BST_FETON_SHIFT	1
17562306a36Sopenharmony_ci#define CS35L35_PDN_BST_FETOFF_SHIFT	2
17662306a36Sopenharmony_ci#define CS35L35_PWR2_PDN_MASK		0xE0
17762306a36Sopenharmony_ci#define CS35L35_PWR3_PDN_MASK		0x1E
17862306a36Sopenharmony_ci#define CS35L35_PDN_ALL_MASK		0x01
17962306a36Sopenharmony_ci#define CS35L35_DISCHG_FILT_MASK	0x02
18062306a36Sopenharmony_ci#define CS35L35_DISCHG_FILT_SHIFT	1
18162306a36Sopenharmony_ci#define CS35L35_MCLK_DIS_MASK		0x04
18262306a36Sopenharmony_ci#define CS35L35_MCLK_DIS_SHIFT		2
18362306a36Sopenharmony_ci
18462306a36Sopenharmony_ci#define CS35L35_BST_CTL_MASK		0x7F
18562306a36Sopenharmony_ci#define CS35L35_BST_CTL_SHIFT		0
18662306a36Sopenharmony_ci#define CS35L35_BST_IPK_MASK		0x1F
18762306a36Sopenharmony_ci#define CS35L35_BST_IPK_SHIFT		0
18862306a36Sopenharmony_ci#define CS35L35_AMP_MUTE_MASK		0x20
18962306a36Sopenharmony_ci#define CS35L35_AMP_MUTE_SHIFT		5
19062306a36Sopenharmony_ci#define CS35L35_AMP_GAIN_ZC_MASK	0x10
19162306a36Sopenharmony_ci#define CS35L35_AMP_GAIN_ZC_SHIFT	4
19262306a36Sopenharmony_ci
19362306a36Sopenharmony_ci#define CS35L35_AMP_DIGSFT_MASK		0x02
19462306a36Sopenharmony_ci#define CS35L35_AMP_DIGSFT_SHIFT	1
19562306a36Sopenharmony_ci
19662306a36Sopenharmony_ci/* CS35L35_SP_FMT_CTL3 */
19762306a36Sopenharmony_ci#define CS35L35_SP_I2S_DRV_MASK		0x03
19862306a36Sopenharmony_ci#define CS35L35_SP_I2S_DRV_SHIFT	0
19962306a36Sopenharmony_ci
20062306a36Sopenharmony_ci/* Boost Converter Config */
20162306a36Sopenharmony_ci#define CS35L35_BST_CONV_COEFF_MASK	0xFF
20262306a36Sopenharmony_ci#define CS35L35_BST_CONV_SLOPE_MASK	0xFF
20362306a36Sopenharmony_ci#define CS35L35_BST_CONV_LBST_MASK	0x03
20462306a36Sopenharmony_ci#define CS35L35_BST_CONV_SWFREQ_MASK	0xF0
20562306a36Sopenharmony_ci
20662306a36Sopenharmony_ci/* Class H Algorithm Control */
20762306a36Sopenharmony_ci#define CS35L35_CH_STEREO_MASK		0x40
20862306a36Sopenharmony_ci#define CS35L35_CH_STEREO_SHIFT		6
20962306a36Sopenharmony_ci#define CS35L35_CH_BST_OVR_MASK		0x04
21062306a36Sopenharmony_ci#define CS35L35_CH_BST_OVR_SHIFT	2
21162306a36Sopenharmony_ci#define CS35L35_CH_BST_LIM_MASK		0x08
21262306a36Sopenharmony_ci#define CS35L35_CH_BST_LIM_SHIFT	3
21362306a36Sopenharmony_ci#define CS35L35_CH_MEM_DEPTH_MASK	0x01
21462306a36Sopenharmony_ci#define CS35L35_CH_MEM_DEPTH_SHIFT	0
21562306a36Sopenharmony_ci#define CS35L35_CH_HDRM_CTL_MASK	0x3F
21662306a36Sopenharmony_ci#define CS35L35_CH_HDRM_CTL_SHIFT	0
21762306a36Sopenharmony_ci#define CS35L35_CH_REL_RATE_MASK	0xFF
21862306a36Sopenharmony_ci#define CS35L35_CH_REL_RATE_SHIFT	0
21962306a36Sopenharmony_ci#define CS35L35_CH_WKFET_DIS_MASK	0x80
22062306a36Sopenharmony_ci#define CS35L35_CH_WKFET_DIS_SHIFT	7
22162306a36Sopenharmony_ci#define CS35L35_CH_WKFET_DEL_MASK	0x70
22262306a36Sopenharmony_ci#define CS35L35_CH_WKFET_DEL_SHIFT	4
22362306a36Sopenharmony_ci#define CS35L35_CH_WKFET_THLD_MASK	0x0F
22462306a36Sopenharmony_ci#define CS35L35_CH_WKFET_THLD_SHIFT	0
22562306a36Sopenharmony_ci#define CS35L35_CH_VP_AUTO_MASK		0x80
22662306a36Sopenharmony_ci#define CS35L35_CH_VP_AUTO_SHIFT	7
22762306a36Sopenharmony_ci#define CS35L35_CH_VP_RATE_MASK		0x60
22862306a36Sopenharmony_ci#define CS35L35_CH_VP_RATE_SHIFT	5
22962306a36Sopenharmony_ci#define CS35L35_CH_VP_MAN_MASK		0x1F
23062306a36Sopenharmony_ci#define CS35L35_CH_VP_MAN_SHIFT		0
23162306a36Sopenharmony_ci
23262306a36Sopenharmony_ci/* CS35L35_PROT_RELEASE_CTL */
23362306a36Sopenharmony_ci#define CS35L35_CAL_ERR_RLS		0x80
23462306a36Sopenharmony_ci#define CS35L35_SHORT_RLS		0x04
23562306a36Sopenharmony_ci#define CS35L35_OTW_RLS			0x02
23662306a36Sopenharmony_ci#define CS35L35_OTE_RLS			0x01
23762306a36Sopenharmony_ci
23862306a36Sopenharmony_ci/* INT Mask Registers */
23962306a36Sopenharmony_ci#define CS35L35_INT1_CRIT_MASK		0x38
24062306a36Sopenharmony_ci#define CS35L35_INT2_CRIT_MASK		0xEF
24162306a36Sopenharmony_ci#define CS35L35_INT3_CRIT_MASK		0xEE
24262306a36Sopenharmony_ci#define CS35L35_INT4_CRIT_MASK		0xFF
24362306a36Sopenharmony_ci
24462306a36Sopenharmony_ci/* PDN DONE Masks */
24562306a36Sopenharmony_ci#define CS35L35_M_PDN_DONE_SHIFT	4
24662306a36Sopenharmony_ci#define CS35L35_M_PDN_DONE_MASK		0x10
24762306a36Sopenharmony_ci
24862306a36Sopenharmony_ci/* CS35L35_INT_1 */
24962306a36Sopenharmony_ci#define CS35L35_CAL_ERR			0x80
25062306a36Sopenharmony_ci#define CS35L35_OTP_ERR			0x40
25162306a36Sopenharmony_ci#define CS35L35_LRCLK_ERR		0x20
25262306a36Sopenharmony_ci#define CS35L35_SPCLK_ERR		0x10
25362306a36Sopenharmony_ci#define CS35L35_MCLK_ERR		0x08
25462306a36Sopenharmony_ci#define CS35L35_AMP_SHORT		0x04
25562306a36Sopenharmony_ci#define CS35L35_OTW			0x02
25662306a36Sopenharmony_ci#define CS35L35_OTE			0x01
25762306a36Sopenharmony_ci
25862306a36Sopenharmony_ci/* CS35L35_INT_2 */
25962306a36Sopenharmony_ci#define CS35L35_PDN_DONE		0x10
26062306a36Sopenharmony_ci#define CS35L35_VPBR_ERR		0x02
26162306a36Sopenharmony_ci#define CS35L35_VPBR_CLR		0x01
26262306a36Sopenharmony_ci
26362306a36Sopenharmony_ci/* CS35L35_INT_3 */
26462306a36Sopenharmony_ci#define CS35L35_BST_HIGH		0x10
26562306a36Sopenharmony_ci#define CS35L35_BST_HIGH_FLAG		0x08
26662306a36Sopenharmony_ci#define CS35L35_BST_IPK_FLAG		0x04
26762306a36Sopenharmony_ci#define CS35L35_LBST_SHORT		0x01
26862306a36Sopenharmony_ci
26962306a36Sopenharmony_ci/* CS35L35_INT_4 */
27062306a36Sopenharmony_ci#define CS35L35_VMON_OVFL		0x08
27162306a36Sopenharmony_ci#define CS35L35_IMON_OVFL		0x04
27262306a36Sopenharmony_ci
27362306a36Sopenharmony_ci#define CS35L35_FORMATS (SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE | \
27462306a36Sopenharmony_ci			SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE)
27562306a36Sopenharmony_ci
27662306a36Sopenharmony_cistruct  cs35l35_private {
27762306a36Sopenharmony_ci	struct device *dev;
27862306a36Sopenharmony_ci	struct cs35l35_platform_data pdata;
27962306a36Sopenharmony_ci	struct regmap *regmap;
28062306a36Sopenharmony_ci	struct regulator_bulk_data supplies[2];
28162306a36Sopenharmony_ci	int num_supplies;
28262306a36Sopenharmony_ci	int sysclk;
28362306a36Sopenharmony_ci	int sclk;
28462306a36Sopenharmony_ci	bool pdm_mode;
28562306a36Sopenharmony_ci	bool i2s_mode;
28662306a36Sopenharmony_ci	bool clock_consumer;
28762306a36Sopenharmony_ci	/* GPIO for /RST */
28862306a36Sopenharmony_ci	struct gpio_desc *reset_gpio;
28962306a36Sopenharmony_ci	struct completion pdn_done;
29062306a36Sopenharmony_ci};
29162306a36Sopenharmony_ci
29262306a36Sopenharmony_cistatic const char * const cs35l35_supplies[] = {
29362306a36Sopenharmony_ci	"VA",
29462306a36Sopenharmony_ci	"VP",
29562306a36Sopenharmony_ci};
29662306a36Sopenharmony_ci
29762306a36Sopenharmony_ci#endif
298