123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162 |
- /* SPDX-License-Identifier: GPL-2.0 */
- /* Copyright (c) 2018, The Linux Foundation. All rights reserved.
- */
- #ifndef _AQT1000_INTERNAL_H
- #define _AQT1000_INTERNAL_H
- #include <linux/types.h>
- SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_48000 |\
- SNDRV_PCM_RATE_96000 | SNDRV_PCM_RATE_192000 |\
- SNDRV_PCM_RATE_384000)
- /* Fractional Rates */
- SNDRV_PCM_RATE_176400)
- SNDRV_PCM_FMTBIT_S24_LE)
- SNDRV_PCM_FMTBIT_S24_LE | \
- SNDRV_PCM_FMTBIT_S32_LE)
- /* Macros for packing register writes into a U32 */
- do { \
- ((reg) = ((packed >> 16) & (0xffff))); \
- ((mask) = ((packed >> 8) & (0xff))); \
- ((val) = ((packed) & (0xff))); \
- } while (0)
- static SOC_ENUM_SINGLE_DECL(name
- static const struct snd_kcontrol_new name
- SOC_DAPM_ENUM(STRING(name), name
- static SOC_ENUM_SINGLE_DECL(name
- static const struct snd_kcontrol_new name
- SOC_DAPM_ENUM_EXT(STRING(name), name
- SND_SOC_DAPM_MUX(name, SND_SOC_NOPM, shift, 0, &kctl
- enum {
- AUDIO_NOMINAL,
- HPH_PA_DELAY,
- CLSH_Z_CONFIG,
- ANC_MIC_AMIC1,
- ANC_MIC_AMIC2,
- ANC_MIC_AMIC3,
- };
- enum {
- INTn_1_INP_SEL_ZERO = 0,
- INTn_1_INP_SEL_DEC0,
- INTn_1_INP_SEL_DEC1,
- INTn_1_INP_SEL_IIR0,
- INTn_1_INP_SEL_IIR1,
- INTn_1_INP_SEL_RX0,
- INTn_1_INP_SEL_RX1,
- };
- enum {
- INTn_2_INP_SEL_ZERO = 0,
- INTn_2_INP_SEL_RX0,
- INTn_2_INP_SEL_RX1,
- INTn_2_INP_SEL_PROXIMITY,
- };
- /* Codec supports 2 IIR filters */
- enum {
- IIR0 = 0,
- IIR1,
- IIR_MAX,
- };
- enum {
- ASRC_IN_HPHL,
- ASRC_IN_HPHR,
- ASRC_INVALID,
- };
- enum {
- CONV_88P2K_TO_384K,
- CONV_96K_TO_352P8K,
- CONV_352P8K_TO_384K,
- CONV_384K_TO_352P8K,
- CONV_384K_TO_384K,
- CONV_96K_TO_384K,
- };
- enum aqt_notify_event {
- AQT_EVENT_INVALID,
- /* events for micbias ON and OFF */
- AQT_EVENT_PRE_MICBIAS_1_OFF,
- AQT_EVENT_POST_MICBIAS_1_OFF,
- AQT_EVENT_PRE_MICBIAS_1_ON,
- AQT_EVENT_POST_MICBIAS_1_ON,
- AQT_EVENT_PRE_DAPM_MICBIAS_1_OFF,
- AQT_EVENT_POST_DAPM_MICBIAS_1_OFF,
- AQT_EVENT_PRE_DAPM_MICBIAS_1_ON,
- AQT_EVENT_POST_DAPM_MICBIAS_1_ON,
- /* events for PA ON and OFF */
- AQT_EVENT_PRE_HPHL_PA_ON,
- AQT_EVENT_POST_HPHL_PA_OFF,
- AQT_EVENT_PRE_HPHR_PA_ON,
- AQT_EVENT_POST_HPHR_PA_OFF,
- AQT_EVENT_PRE_HPHL_PA_OFF,
- AQT_EVENT_PRE_HPHR_PA_OFF,
- AQT_EVENT_OCP_OFF,
- AQT_EVENT_OCP_ON,
- AQT_EVENT_LAST,
- };
- struct interp_sample_rate {
- int sample_rate;
- int rate_val;
- };
- extern struct regmap_config aqt1000_regmap_config;
- extern int aqt_register_codec(struct device *dev);
|