diff options
-rw-r--r-- | sound/soc/codecs/wm8350.c | 74 |
1 files changed, 37 insertions, 37 deletions
diff --git a/sound/soc/codecs/wm8350.c b/sound/soc/codecs/wm8350.c index 1dee57e67a1..54971fcb7e4 100644 --- a/sound/soc/codecs/wm8350.c +++ b/sound/soc/codecs/wm8350.c | |||
@@ -353,8 +353,8 @@ static int wm8350_put_volsw_2r_vu(struct snd_kcontrol *kcontrol, | |||
353 | return ret; | 353 | return ret; |
354 | 354 | ||
355 | /* now hit the volume update bits (always bit 8) */ | 355 | /* now hit the volume update bits (always bit 8) */ |
356 | val = wm8350_codec_read(codec, reg); | 356 | val = snd_soc_read(codec, reg); |
357 | wm8350_codec_write(codec, reg, val | WM8350_OUT1_VU); | 357 | snd_soc_write(codec, reg, val | WM8350_OUT1_VU); |
358 | return 1; | 358 | return 1; |
359 | } | 359 | } |
360 | 360 | ||
@@ -788,9 +788,9 @@ static int wm8350_set_dai_sysclk(struct snd_soc_dai *codec_dai, | |||
788 | case WM8350_MCLK_SEL_PLL_32K: | 788 | case WM8350_MCLK_SEL_PLL_32K: |
789 | wm8350_set_bits(wm8350, WM8350_CLOCK_CONTROL_1, | 789 | wm8350_set_bits(wm8350, WM8350_CLOCK_CONTROL_1, |
790 | WM8350_MCLK_SEL); | 790 | WM8350_MCLK_SEL); |
791 | fll_4 = wm8350_codec_read(codec, WM8350_FLL_CONTROL_4) & | 791 | fll_4 = snd_soc_read(codec, WM8350_FLL_CONTROL_4) & |
792 | ~WM8350_FLL_CLK_SRC_MASK; | 792 | ~WM8350_FLL_CLK_SRC_MASK; |
793 | wm8350_codec_write(codec, WM8350_FLL_CONTROL_4, fll_4 | clk_id); | 793 | snd_soc_write(codec, WM8350_FLL_CONTROL_4, fll_4 | clk_id); |
794 | break; | 794 | break; |
795 | } | 795 | } |
796 | 796 | ||
@@ -812,39 +812,39 @@ static int wm8350_set_clkdiv(struct snd_soc_dai *codec_dai, int div_id, int div) | |||
812 | 812 | ||
813 | switch (div_id) { | 813 | switch (div_id) { |
814 | case WM8350_ADC_CLKDIV: | 814 | case WM8350_ADC_CLKDIV: |
815 | val = wm8350_codec_read(codec, WM8350_ADC_DIVIDER) & | 815 | val = snd_soc_read(codec, WM8350_ADC_DIVIDER) & |
816 | ~WM8350_ADC_CLKDIV_MASK; | 816 | ~WM8350_ADC_CLKDIV_MASK; |
817 | wm8350_codec_write(codec, WM8350_ADC_DIVIDER, val | div); | 817 | snd_soc_write(codec, WM8350_ADC_DIVIDER, val | div); |
818 | break; | 818 | break; |
819 | case WM8350_DAC_CLKDIV: | 819 | case WM8350_DAC_CLKDIV: |
820 | val = wm8350_codec_read(codec, WM8350_DAC_CLOCK_CONTROL) & | 820 | val = snd_soc_read(codec, WM8350_DAC_CLOCK_CONTROL) & |
821 | ~WM8350_DAC_CLKDIV_MASK; | 821 | ~WM8350_DAC_CLKDIV_MASK; |
822 | wm8350_codec_write(codec, WM8350_DAC_CLOCK_CONTROL, val | div); | 822 | snd_soc_write(codec, WM8350_DAC_CLOCK_CONTROL, val | div); |
823 | break; | 823 | break; |
824 | case WM8350_BCLK_CLKDIV: | 824 | case WM8350_BCLK_CLKDIV: |
825 | val = wm8350_codec_read(codec, WM8350_CLOCK_CONTROL_1) & | 825 | val = snd_soc_read(codec, WM8350_CLOCK_CONTROL_1) & |
826 | ~WM8350_BCLK_DIV_MASK; | 826 | ~WM8350_BCLK_DIV_MASK; |
827 | wm8350_codec_write(codec, WM8350_CLOCK_CONTROL_1, val | div); | 827 | snd_soc_write(codec, WM8350_CLOCK_CONTROL_1, val | div); |
828 | break; | 828 | break; |
829 | case WM8350_OPCLK_CLKDIV: | 829 | case WM8350_OPCLK_CLKDIV: |
830 | val = wm8350_codec_read(codec, WM8350_CLOCK_CONTROL_1) & | 830 | val = snd_soc_read(codec, WM8350_CLOCK_CONTROL_1) & |
831 | ~WM8350_OPCLK_DIV_MASK; | 831 | ~WM8350_OPCLK_DIV_MASK; |
832 | wm8350_codec_write(codec, WM8350_CLOCK_CONTROL_1, val | div); | 832 | snd_soc_write(codec, WM8350_CLOCK_CONTROL_1, val | div); |
833 | break; | 833 | break; |
834 | case WM8350_SYS_CLKDIV: | 834 | case WM8350_SYS_CLKDIV: |
835 | val = wm8350_codec_read(codec, WM8350_CLOCK_CONTROL_1) & | 835 | val = snd_soc_read(codec, WM8350_CLOCK_CONTROL_1) & |
836 | ~WM8350_MCLK_DIV_MASK; | 836 | ~WM8350_MCLK_DIV_MASK; |
837 | wm8350_codec_write(codec, WM8350_CLOCK_CONTROL_1, val | div); | 837 | snd_soc_write(codec, WM8350_CLOCK_CONTROL_1, val | div); |
838 | break; | 838 | break; |
839 | case WM8350_DACLR_CLKDIV: | 839 | case WM8350_DACLR_CLKDIV: |
840 | val = wm8350_codec_read(codec, WM8350_DAC_LR_RATE) & | 840 | val = snd_soc_read(codec, WM8350_DAC_LR_RATE) & |
841 | ~WM8350_DACLRC_RATE_MASK; | 841 | ~WM8350_DACLRC_RATE_MASK; |
842 | wm8350_codec_write(codec, WM8350_DAC_LR_RATE, val | div); | 842 | snd_soc_write(codec, WM8350_DAC_LR_RATE, val | div); |
843 | break; | 843 | break; |
844 | case WM8350_ADCLR_CLKDIV: | 844 | case WM8350_ADCLR_CLKDIV: |
845 | val = wm8350_codec_read(codec, WM8350_ADC_LR_RATE) & | 845 | val = snd_soc_read(codec, WM8350_ADC_LR_RATE) & |
846 | ~WM8350_ADCLRC_RATE_MASK; | 846 | ~WM8350_ADCLRC_RATE_MASK; |
847 | wm8350_codec_write(codec, WM8350_ADC_LR_RATE, val | div); | 847 | snd_soc_write(codec, WM8350_ADC_LR_RATE, val | div); |
848 | break; | 848 | break; |
849 | default: | 849 | default: |
850 | return -EINVAL; | 850 | return -EINVAL; |
@@ -856,13 +856,13 @@ static int wm8350_set_clkdiv(struct snd_soc_dai *codec_dai, int div_id, int div) | |||
856 | static int wm8350_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt) | 856 | static int wm8350_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt) |
857 | { | 857 | { |
858 | struct snd_soc_codec *codec = codec_dai->codec; | 858 | struct snd_soc_codec *codec = codec_dai->codec; |
859 | u16 iface = wm8350_codec_read(codec, WM8350_AI_FORMATING) & | 859 | u16 iface = snd_soc_read(codec, WM8350_AI_FORMATING) & |
860 | ~(WM8350_AIF_BCLK_INV | WM8350_AIF_LRCLK_INV | WM8350_AIF_FMT_MASK); | 860 | ~(WM8350_AIF_BCLK_INV | WM8350_AIF_LRCLK_INV | WM8350_AIF_FMT_MASK); |
861 | u16 master = wm8350_codec_read(codec, WM8350_AI_DAC_CONTROL) & | 861 | u16 master = snd_soc_read(codec, WM8350_AI_DAC_CONTROL) & |
862 | ~WM8350_BCLK_MSTR; | 862 | ~WM8350_BCLK_MSTR; |
863 | u16 dac_lrc = wm8350_codec_read(codec, WM8350_DAC_LR_RATE) & | 863 | u16 dac_lrc = snd_soc_read(codec, WM8350_DAC_LR_RATE) & |
864 | ~WM8350_DACLRC_ENA; | 864 | ~WM8350_DACLRC_ENA; |
865 | u16 adc_lrc = wm8350_codec_read(codec, WM8350_ADC_LR_RATE) & | 865 | u16 adc_lrc = snd_soc_read(codec, WM8350_ADC_LR_RATE) & |
866 | ~WM8350_ADCLRC_ENA; | 866 | ~WM8350_ADCLRC_ENA; |
867 | 867 | ||
868 | /* set master/slave audio interface */ | 868 | /* set master/slave audio interface */ |
@@ -915,10 +915,10 @@ static int wm8350_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt) | |||
915 | return -EINVAL; | 915 | return -EINVAL; |
916 | } | 916 | } |
917 | 917 | ||
918 | wm8350_codec_write(codec, WM8350_AI_FORMATING, iface); | 918 | snd_soc_write(codec, WM8350_AI_FORMATING, iface); |
919 | wm8350_codec_write(codec, WM8350_AI_DAC_CONTROL, master); | 919 | snd_soc_write(codec, WM8350_AI_DAC_CONTROL, master); |
920 | wm8350_codec_write(codec, WM8350_DAC_LR_RATE, dac_lrc); | 920 | snd_soc_write(codec, WM8350_DAC_LR_RATE, dac_lrc); |
921 | wm8350_codec_write(codec, WM8350_ADC_LR_RATE, adc_lrc); | 921 | snd_soc_write(codec, WM8350_ADC_LR_RATE, adc_lrc); |
922 | return 0; | 922 | return 0; |
923 | } | 923 | } |
924 | 924 | ||
@@ -928,7 +928,7 @@ static int wm8350_pcm_hw_params(struct snd_pcm_substream *substream, | |||
928 | { | 928 | { |
929 | struct snd_soc_codec *codec = codec_dai->codec; | 929 | struct snd_soc_codec *codec = codec_dai->codec; |
930 | struct wm8350 *wm8350 = codec->control_data; | 930 | struct wm8350 *wm8350 = codec->control_data; |
931 | u16 iface = wm8350_codec_read(codec, WM8350_AI_FORMATING) & | 931 | u16 iface = snd_soc_read(codec, WM8350_AI_FORMATING) & |
932 | ~WM8350_AIF_WL_MASK; | 932 | ~WM8350_AIF_WL_MASK; |
933 | 933 | ||
934 | /* bit size */ | 934 | /* bit size */ |
@@ -946,7 +946,7 @@ static int wm8350_pcm_hw_params(struct snd_pcm_substream *substream, | |||
946 | break; | 946 | break; |
947 | } | 947 | } |
948 | 948 | ||
949 | wm8350_codec_write(codec, WM8350_AI_FORMATING, iface); | 949 | snd_soc_write(codec, WM8350_AI_FORMATING, iface); |
950 | 950 | ||
951 | /* The sloping stopband filter is recommended for use with | 951 | /* The sloping stopband filter is recommended for use with |
952 | * lower sample rates to improve performance. | 952 | * lower sample rates to improve performance. |
@@ -1065,17 +1065,17 @@ static int wm8350_set_fll(struct snd_soc_dai *codec_dai, | |||
1065 | fll_div.ratio); | 1065 | fll_div.ratio); |
1066 | 1066 | ||
1067 | /* set up N.K & dividers */ | 1067 | /* set up N.K & dividers */ |
1068 | fll_1 = wm8350_codec_read(codec, WM8350_FLL_CONTROL_1) & | 1068 | fll_1 = snd_soc_read(codec, WM8350_FLL_CONTROL_1) & |
1069 | ~(WM8350_FLL_OUTDIV_MASK | WM8350_FLL_RSP_RATE_MASK | 0xc000); | 1069 | ~(WM8350_FLL_OUTDIV_MASK | WM8350_FLL_RSP_RATE_MASK | 0xc000); |
1070 | wm8350_codec_write(codec, WM8350_FLL_CONTROL_1, | 1070 | snd_soc_write(codec, WM8350_FLL_CONTROL_1, |
1071 | fll_1 | (fll_div.div << 8) | 0x50); | 1071 | fll_1 | (fll_div.div << 8) | 0x50); |
1072 | wm8350_codec_write(codec, WM8350_FLL_CONTROL_2, | 1072 | snd_soc_write(codec, WM8350_FLL_CONTROL_2, |
1073 | (fll_div.ratio << 11) | (fll_div. | 1073 | (fll_div.ratio << 11) | (fll_div. |
1074 | n & WM8350_FLL_N_MASK)); | 1074 | n & WM8350_FLL_N_MASK)); |
1075 | wm8350_codec_write(codec, WM8350_FLL_CONTROL_3, fll_div.k); | 1075 | snd_soc_write(codec, WM8350_FLL_CONTROL_3, fll_div.k); |
1076 | fll_4 = wm8350_codec_read(codec, WM8350_FLL_CONTROL_4) & | 1076 | fll_4 = snd_soc_read(codec, WM8350_FLL_CONTROL_4) & |
1077 | ~(WM8350_FLL_FRAC | WM8350_FLL_SLOW_LOCK_REF); | 1077 | ~(WM8350_FLL_FRAC | WM8350_FLL_SLOW_LOCK_REF); |
1078 | wm8350_codec_write(codec, WM8350_FLL_CONTROL_4, | 1078 | snd_soc_write(codec, WM8350_FLL_CONTROL_4, |
1079 | fll_4 | (fll_div.k ? WM8350_FLL_FRAC : 0) | | 1079 | fll_4 | (fll_div.k ? WM8350_FLL_FRAC : 0) | |
1080 | (fll_div.ratio == 8 ? WM8350_FLL_SLOW_LOCK_REF : 0)); | 1080 | (fll_div.ratio == 8 ? WM8350_FLL_SLOW_LOCK_REF : 0)); |
1081 | 1081 | ||
@@ -1518,9 +1518,9 @@ static int wm8350_codec_probe(struct snd_soc_codec *codec) | |||
1518 | wm8350_set_bits(wm8350, WM8350_POWER_MGMT_5, WM8350_CODEC_ENA); | 1518 | wm8350_set_bits(wm8350, WM8350_POWER_MGMT_5, WM8350_CODEC_ENA); |
1519 | 1519 | ||
1520 | /* Enable robust clocking mode in ADC */ | 1520 | /* Enable robust clocking mode in ADC */ |
1521 | wm8350_codec_write(codec, WM8350_SECURITY, 0xa7); | 1521 | snd_soc_write(codec, WM8350_SECURITY, 0xa7); |
1522 | wm8350_codec_write(codec, 0xde, 0x13); | 1522 | snd_soc_write(codec, 0xde, 0x13); |
1523 | wm8350_codec_write(codec, WM8350_SECURITY, 0); | 1523 | snd_soc_write(codec, WM8350_SECURITY, 0); |
1524 | 1524 | ||
1525 | /* read OUT1 & OUT2 volumes */ | 1525 | /* read OUT1 & OUT2 volumes */ |
1526 | out1 = &priv->out1; | 1526 | out1 = &priv->out1; |