/* * rt298.h -- RT298 ALSA SoC audio driver * * Copyright 2011 Realtek Microelectronics * Author: Johnny Hsu * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ #ifndef __RT298_H__ #define __RT298_H__ #define VERB_CMD(V, N, D) ((N << 20) | (V << 8) | D) #define RT298_AUDIO_FUNCTION_GROUP 0x01 #define RT298_DAC_OUT1 0x02 #define RT298_DAC_OUT2 0x03 #define RT298_DIG_CVT 0x06 #define RT298_ADC_IN1 0x09 #define RT298_ADC_IN2 0x08 #define RT298_MIXER_IN 0x0b #define RT298_MIXER_OUT1 0x0c #define RT298_MIXER_OUT2 0x0d #define RT298_DMIC1 0x12 #define RT298_DMIC2 0x13 #define RT298_SPK_OUT 0x14 #define RT298_MIC1 0x18 #define RT298_LINE1 0x1a #define RT298_BEEP 0x1d #define RT298_SPDIF 0x1e #define RT298_VENDOR_REGISTERS 0x20 #define RT298_HP_OUT 0x21 #define RT298_MIXER_IN1 0x22 #define RT298_MIXER_IN2 0x23 #define RT298_INLINE_CMD 0x55 #define RT298_SET_PIN_SFT 6 #define RT298_SET_PIN_ENABLE 0x40 #define RT298_SET_PIN_DISABLE 0 #define RT298_SET_EAPD_HIGH 0x2 #define RT298_SET_EAPD_LOW 0 #define RT298_MUTE_SFT 7 /* Verb commands */ #define RT298_GET_PARAM(NID, PARAM) VERB_CMD(AC_VERB_PARAMETERS, NID, PARAM) #define RT298_SET_POWER(NID) VERB_CMD(AC_VERB_SET_POWER_STATE, NID, 0) #define RT298_SET_AUDIO_POWER RT298_SET_POWER(RT298_AUDIO_FUNCTION_GROUP) #define RT298_SET_HPO_POWER RT298_SET_POWER(RT298_HP_OUT) #define RT298_SET_SPK_POWER RT298_SET_POWER(RT298_SPK_OUT) #define RT298_SET_DMIC1_POWER RT298_SET_POWER(RT298_DMIC1) #define RT298_SPK_MUX\ VERB_CMD(AC_VERB_SET_CONNECT_SEL, RT298_SPK_OUT, 0) #define RT298_HPO_MUX\ VERB_CMD(AC_VERB_SET_CONNECT_SEL, RT298_HP_OUT, 0) #define RT298_ADC0_MUX\ VERB_CMD(AC_VERB_SET_CONNECT_SEL, RT298_MIXER_IN1, 0) #define RT298_ADC1_MUX\ VERB_CMD(AC_VERB_SET_CONNECT_SEL, RT298_MIXER_IN2, 0) #define RT298_SET_MIC1\ VERB_CMD(AC_VERB_SET_PIN_WIDGET_CONTROL, RT298_MIC1, 0) #define RT298_SET_PIN_HPO\ VERB_CMD(AC_VERB_SET_PIN_WIDGET_CONTROL, RT298_HP_OUT, 0) #define RT298_SET_PIN_SPK\ VERB_CMD(AC_VERB_SET_PIN_WIDGET_CONTROL, RT298_SPK_OUT, 0) #define RT298_SET_PIN_DMIC1\ VERB_CMD(AC_VERB_SET_PIN_WIDGET_CONTROL, RT298_DMIC1, 0) #define RT298_SET_PIN_SPDIF\ VERB_CMD(AC_VERB_SET_PIN_WIDGET_CONTROL, RT298_SPDIF, 0) #define RT298_SET_PIN_DIG_CVT\ VERB_CMD(AC_VERB_SET_DIGI_CONVERT_1, RT298_DIG_CVT, 0) #define RT298_SPK_EAPD\ VERB_CMD(AC_VERB_SET_EAPD_BTLENABLE, RT298_SPK_OUT, 0) #define RT298_SET_AMP_GAIN_HPO\ VERB_CMD(AC_VERB_SET_AMP_GAIN_MUTE, RT298_HP_OUT, 0) #define RT298_SET_AMP_GAIN_ADC_IN1\ VERB_CMD(AC_VERB_SET_AMP_GAIN_MUTE, RT298_ADC_IN1, 0) #define RT298_SET_AMP_GAIN_ADC_IN2\ VERB_CMD(AC_VERB_SET_AMP_GAIN_MUTE, RT298_ADC_IN2, 0) #define RT298_GET_HP_SENSE\ VERB_CMD(AC_VERB_GET_PIN_SENSE, RT298_HP_OUT, 0) #define RT298_GET_MIC1_SENSE\ VERB_CMD(AC_VERB_GET_PIN_SENSE, RT298_MIC1, 0) #define RT298_SET_DMIC2_DEFAULT\ VERB_CMD(AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, RT298_DMIC2, 0) #define RT298_SET_SPDIF_DEFAULT\ VERB_CMD(AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, RT298_SPDIF, 0) #define RT298_DACL_GAIN\ VERB_CMD(AC_VERB_SET_AMP_GAIN_MUTE, RT298_DAC_OUT1, 0xa000) #define RT298_DACR_GAIN\ VERB_CMD(AC_VERB_SET_AMP_GAIN_MUTE, RT298_DAC_OUT1, 0x9000) #define RT298_ADCL_GAIN\ VERB_CMD(AC_VERB_SET_AMP_GAIN_MUTE, RT298_ADC_IN1, 0x6000) #define RT298_ADCR_GAIN\ VERB_CMD(AC_VERB_SET_AMP_GAIN_MUTE, RT298_ADC_IN1, 0x5000) #define RT298_MIC_GAIN\ VERB_CMD(AC_VERB_SET_AMP_GAIN_MUTE, RT298_MIC1, 0x7000) #define RT298_SPOL_GAIN\ VERB_CMD(AC_VERB_SET_AMP_GAIN_MUTE, RT298_SPK_OUT, 0xa000) #define RT298_SPOR_GAIN\ VERB_CMD(AC_VERB_SET_AMP_GAIN_MUTE, RT298_SPK_OUT, 0x9000) #define RT298_HPOL_GAIN\ VERB_CMD(AC_VERB_SET_AMP_GAIN_MUTE, RT298_HP_OUT, 0xa000) #define RT298_HPOR_GAIN\ VERB_CMD(AC_VERB_SET_AMP_GAIN_MUTE, RT298_HP_OUT, 0x9000) #define RT298_F_DAC_SWITCH\ VERB_CMD(AC_VERB_SET_AMP_GAIN_MUTE, RT298_MIXER_OUT1, 0x7000) #define RT298_F_RECMIX_SWITCH\ VERB_CMD(AC_VERB_SET_AMP_GAIN_MUTE, RT298_MIXER_OUT1, 0x7100) #define RT298_REC_MIC_SWITCH\ VERB_CMD(AC_VERB_SET_AMP_GAIN_MUTE, RT298_MIXER_IN, 0x7000) #define RT298_REC_I2S_SWITCH\ VERB_CMD(AC_VERB_SET_AMP_GAIN_MUTE, RT298_MIXER_IN, 0x7100) #define RT298_REC_LINE_SWITCH\ VERB_CMD(AC_VERB_SET_AMP_GAIN_MUTE, RT298_MIXER_IN, 0x7200) #define RT298_REC_BEEP_SWITCH\ VERB_CMD(AC_VERB_SET_AMP_GAIN_MUTE, RT298_MIXER_IN, 0x7300) #define RT298_DAC_FORMAT\ VERB_CMD(AC_VERB_SET_STREAM_FORMAT, RT298_DAC_OUT1, 0) #define RT298_ADC_FORMAT\ VERB_CMD(AC_VERB_SET_STREAM_FORMAT, RT298_ADC_IN1, 0) #define RT298_COEF_INDEX\ VERB_CMD(AC_VERB_SET_COEF_INDEX, RT298_VENDOR_REGISTERS, 0) #define RT298_PROC_COEF\ VERB_CMD(AC_VERB_SET_PROC_COEF, RT298_VENDOR_REGISTERS, 0) #define RT298_UNSOLICITED_INLINE_CMD\ VERB_CMD(AC_VERB_SET_UNSOLICITED_ENABLE, RT298_INLINE_CMD, 0) #define RT298_UNSOLICITED_HP_OUT\ VERB_CMD(AC_VERB_SET_UNSOLICITED_ENABLE, RT298_HP_OUT, 0) #define RT298_UNSOLICITED_MIC1\ VERB_CMD(AC_VERB_SET_UNSOLICITED_ENABLE, RT298_MIC1, 0) /* Index registers */ #define RT298_A_BIAS_CTRL1 0x01 #define RT298_A_BIAS_CTRL2 0x02 #define RT298_POWER_CTRL1 0x03 #define RT298_A_BIAS_CTRL3 0x04 #define RT298_D_FILTER_CTRL 0x05 #define RT298_POWER_CTRL2 0x08 #define RT298_I2S_CTRL1 0x09 #define RT298_I2S_CTRL2 0x0a #define RT298_CLK_DIV 0x0b #define RT298_DC_GAIN 0x0d #define RT298_POWER_CTRL3 0x0f #define RT298_MIC1_DET_CTRL 0x19 #define RT298_MISC_CTRL1 0x20 #define RT298_IRQ_CTRL 0x33 #define RT298_WIND_FILTER_CTRL 0x46 #define RT298_PLL_CTRL1 0x49 #define RT298_VAD_CTRL 0x4e #define RT298_CBJ_CTRL1 0x4f #define RT298_CBJ_CTRL2 0x50 #define RT298_PLL_CTRL 0x63 #define RT298_DEPOP_CTRL1 0x66 #define RT298_DEPOP_CTRL2 0x67 #define RT298_DEPOP_CTRL3 0x68 #define RT298_DEPOP_CTRL4 0x69 #define RT298_IRQ_FLAG_CTRL 0x7c /* SPDIF (0x06) */ #define RT298_SPDIF_SEL_SFT 0 #define RT298_SPDIF_SEL_PCM0 0 #define RT298_SPDIF_SEL_PCM1 1 #define RT298_SPDIF_SEL_SPOUT 2 #define RT298_SPDIF_SEL_PP 3 /* RECMIX (0x0b) */ #define RT298_M_REC_BEEP_SFT 0 #define RT298_M_REC_LINE1_SFT 1 #define RT298_M_REC_MIC1_SFT 2 #define RT298_M_REC_I2S_SFT 3 /* Front (0x0c) */ #define RT298_M_FRONT_DAC_SFT 0 #define RT298_M_FRONT_REC_SFT 1 /* SPK-OUT (0x14) */ #define RT298_M_SPK_MUX_SFT 14 #define RT298_SPK_SEL_MASK 0x1 #define RT298_SPK_SEL_SFT 0 #define RT298_SPK_SEL_F 0 #define RT298_SPK_SEL_S 1 /* HP-OUT (0x21) */ #define RT298_M_HP_MUX_SFT 14 #define RT298_HP_SEL_MASK 0x1 #define RT298_HP_SEL_SFT 0 #define RT298_HP_SEL_F 0 #define RT298_HP_SEL_S 1 /* ADC (0x22) (0x23) */ #define RT298_ADC_SEL_MASK 0x7 #define RT298_ADC_SEL_SFT 0 #define RT298_ADC_SEL_SURR 0 #define RT298_ADC_SEL_FRONT 1 #define RT298_ADC_SEL_DMIC 2 #define RT298_ADC_SEL_BEEP 4 #define RT298_ADC_SEL_LINE1 5 #define RT298_ADC_SEL_I2S 6 #define RT298_ADC_SEL_MIC1 7 #define RT298_SCLK_S_MCLK 0 #define RT298_SCLK_S_PLL 1 enum { RT298_AIF1, RT298_AIF2, RT298_AIFS, }; int rt298_mic_detect(struct snd_soc_codec *codec, struct snd_soc_jack *jack); #endif /* __RT298_H__ */ >plain -rw-r--r--bcm21664.h1984logplain -rw-r--r--bcm281xx.h2456logplain -rw-r--r--bcm2835-aux.h635logplain -rw-r--r--bcm2835.h1962logplain -rw-r--r--berlin2.h1034logplain -rw-r--r--berlin2q.h695logplain -rw-r--r--clps711x-clock.h718logplain -rw-r--r--efm32-cmu.h1112logplain -rw-r--r--exynos-audss-clk.h597logplain -rw-r--r--exynos3250.h9083logplain -rw-r--r--exynos4.h8284logplain -rw-r--r--exynos4415.h9828logplain -rw-r--r--exynos5250.h4616logplain -rw-r--r--exynos5260-clk.h14876logplain -rw-r--r--exynos5410.h1689logplain -rw-r--r--exynos5420.h6857logplain -rw-r--r--exynos5433.h45372logplain -rw-r--r--exynos5440.h1141logplain -rw-r--r--exynos7-clk.h5281logplain -rw-r--r--gxbb-aoclkc.h2866logplain -rw-r--r--gxbb-clkc.h592logplain -rw-r--r--hi3516cv300-clock.h1668logplain -rw-r--r--hi3519-clock.h1328logplain -rw-r--r--hi3620-clock.h4496logplain -rw-r--r--hi6220-clock.h4508logplain -rw-r--r--hip04-clock.h1137logplain -rw-r--r--histb-clock.h2012logplain -rw-r--r--hix5hd2-clock.h2415logplain -rw-r--r--imx1-clock.h1055logplain -rw-r--r--imx21-clock.h2461logplain -rw-r--r--imx27-clock.h3494logplain -rw-r--r--imx5-clock.h7212logplain -rw-r--r--imx6qdl-clock.h9593logplain -rw-r--r--imx6sl-clock.h5849logplain -rw-r--r--imx6sx-clock.h9099logplain -rw-r--r--imx6ul-clock.h8203logplain -rw-r--r--imx7d-clock.h15974logplain -rw-r--r--jz4740-cgu.h1028logplain -rw-r--r--jz4780-cgu.h2470logplain -rw-r--r--lpc18xx-ccu.h2134logplain -rw-r--r--lpc18xx-cgu.h1142logplain -rw-r--r--lpc32xx-clock.h1633logplain -rw-r--r--lsi,axm5516-clks.h974logplain -rw-r--r--marvell,mmp2.h2022logplain -rw-r--r--marvell,pxa168.h1654logplain -rw-r--r--marvell,pxa1928.h1535logplain -rw-r--r--marvell,pxa910.h1598logplain -rw-r--r--maxim,max77620.h632logplain -rw-r--r--maxim,max77686.h648logplain -rw-r--r--maxim,max77802.h630logplain -rw-r--r--meson8b-clkc.h523logplain -rw-r--r--microchip,pic32-clock.h1150logplain -rw-r--r--mpc512x-clock.h2236logplain -rw-r--r--mt2701-clk.h13832logplain -rw-r--r--mt8135-clk.h5641logplain -rw-r--r--mt8173-clk.h9293logplain -rw-r--r--oxsemi,ox810se.h1002logplain -rw-r--r--oxsemi,ox820.h1203logplain -rw-r--r--pistachio-clk.h4863logplain -rw-r--r--pxa-clock.h1715logplain -rw-r--r--qcom,gcc-apq8084.h12872logplain -rw-r--r--qcom,gcc-ipq4019.h5423logplain -rw-r--r--qcom,gcc-ipq806x.h8574logplain -rw-r--r--qcom,gcc-mdm9615.h9497logplain -rw-r--r--qcom,gcc-msm8660.h7932logplain -rw-r--r--qcom,gcc-msm8916.h6190logplain -rw-r--r--qcom,gcc-msm8960.h9342logplain -rw-r--r--qcom,gcc-msm8974.h12340logplain -rw-r--r--qcom,gcc-msm8994.h4858logplain -rw-r--r--qcom,gcc-msm8996.h12575logplain -rw-r--r--qcom,lcc-ipq806x.h899logplain -rw-r--r--qcom,lcc-mdm9615.h1701logplain -rw-r--r--qcom,lcc-msm8960.h1616logplain -rw-r--r--qcom,mmcc-apq8084.h5722logplain -rw-r--r--qcom,mmcc-msm8960.h4109logplain -rw-r--r--qcom,mmcc-msm8974.h5223logplain -rw-r--r--qcom,mmcc-msm8996.h9403logplain -rw-r--r--qcom,rpmcc.h2101logplain -rw-r--r--r7s72100-clock.h1218logplain -rw-r--r--r8a73a4-clock.h1596logplain -rw-r--r--r8a7740-clock.h1992logplain -rw-r--r--r8a7743-cpg-mssr.h1269logplain -rw-r--r--r8a7745-cpg-mssr.h1298logplain -rw-r--r--r8a7778-clock.h1855logplain -rw-r--r--r8a7779-clock.h1647logplain -rw-r--r--r8a7790-clock.h4367logplain -rw-r--r--r8a7791-clock.h4388logplain -rw-r--r--r8a7792-clock.h2562logplain -rw-r--r--r8a7793-clock.h4561logplain -rw-r--r--r8a7794-clock.h3679logplain -rw-r--r--r8a7795-cpg-mssr.h1890logplain -rw-r--r--r8a7796-cpg-mssr.h2066logplain -rw-r--r--renesas-cpg-mssr.h542logplain -rw-r--r--rk1108-cru.h6605logplain -rw-r--r--rk3036-cru.h4584logplain -rw-r--r--rk3066a-cru.h1068logplain -rw-r--r--rk3188-cru-common.h6105logplain -rw-r--r--rk3188-cru.h1435logplain