diff options
| author | Peter Ujfalusi <peter.ujfalusi@ti.com> | 2014-01-03 08:27:54 -0500 |
|---|---|---|
| committer | Mark Brown <broonie@linaro.org> | 2014-01-08 07:48:53 -0500 |
| commit | 7ded5fe020e670befeab6777e7b8bc4bec272a3f (patch) | |
| tree | c49b3ce1401c533a2f4f5b4cc911484a384b2436 | |
| parent | efc8acff1ffe18b981d70da7ab2525e5b3e5de85 (diff) | |
ASoC: twl4030: Parameter alignment fixes (for code consistency)
Over time the multi line alignment got messed up. Correct them in one go
so the code will look consistent.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
| -rw-r--r-- | sound/soc/codecs/twl4030.c | 93 |
1 files changed, 45 insertions, 48 deletions
diff --git a/sound/soc/codecs/twl4030.c b/sound/soc/codecs/twl4030.c index dda53e8c51e5..7a5b91e70f98 100644 --- a/sound/soc/codecs/twl4030.c +++ b/sound/soc/codecs/twl4030.c | |||
| @@ -171,8 +171,8 @@ static bool twl4030_can_write_to_chip(struct snd_soc_codec *codec, | |||
| 171 | return write_to_reg; | 171 | return write_to_reg; |
| 172 | } | 172 | } |
| 173 | 173 | ||
| 174 | static int twl4030_write(struct snd_soc_codec *codec, | 174 | static int twl4030_write(struct snd_soc_codec *codec, unsigned int reg, |
| 175 | unsigned int reg, unsigned int value) | 175 | unsigned int value) |
| 176 | { | 176 | { |
| 177 | twl4030_update_ctl_cache(codec, reg, value); | 177 | twl4030_update_ctl_cache(codec, reg, value); |
| 178 | if (twl4030_can_write_to_chip(codec, reg)) | 178 | if (twl4030_can_write_to_chip(codec, reg)) |
| @@ -298,11 +298,11 @@ static void twl4030_init_chip(struct snd_soc_codec *codec) | |||
| 298 | /* anti-pop when changing analog gain */ | 298 | /* anti-pop when changing analog gain */ |
| 299 | reg = twl4030_read(codec, TWL4030_REG_MISC_SET_1); | 299 | reg = twl4030_read(codec, TWL4030_REG_MISC_SET_1); |
| 300 | twl4030_write(codec, TWL4030_REG_MISC_SET_1, | 300 | twl4030_write(codec, TWL4030_REG_MISC_SET_1, |
| 301 | reg | TWL4030_SMOOTH_ANAVOL_EN); | 301 | reg | TWL4030_SMOOTH_ANAVOL_EN); |
| 302 | 302 | ||
| 303 | twl4030_write(codec, TWL4030_REG_OPTION, | 303 | twl4030_write(codec, TWL4030_REG_OPTION, |
| 304 | TWL4030_ATXL1_EN | TWL4030_ATXR1_EN | | 304 | TWL4030_ATXL1_EN | TWL4030_ATXR1_EN | |
| 305 | TWL4030_ARXL2_EN | TWL4030_ARXR2_EN); | 305 | TWL4030_ARXL2_EN | TWL4030_ARXR2_EN); |
| 306 | 306 | ||
| 307 | /* REG_ARXR2_APGA_CTL reset according to the TRM: 0dB, DA_EN */ | 307 | /* REG_ARXR2_APGA_CTL reset according to the TRM: 0dB, DA_EN */ |
| 308 | twl4030_write(codec, TWL4030_REG_ARXR2_APGA_CTL, 0x32); | 308 | twl4030_write(codec, TWL4030_REG_ARXR2_APGA_CTL, 0x32); |
| @@ -325,7 +325,7 @@ static void twl4030_init_chip(struct snd_soc_codec *codec) | |||
| 325 | reg &= ~TWL4030_OFFSET_CNCL_SEL; | 325 | reg &= ~TWL4030_OFFSET_CNCL_SEL; |
| 326 | reg |= pdata->offset_cncl_path; | 326 | reg |= pdata->offset_cncl_path; |
| 327 | twl4030_write(codec, TWL4030_REG_ANAMICL, | 327 | twl4030_write(codec, TWL4030_REG_ANAMICL, |
| 328 | reg | TWL4030_CNCL_OFFSET_START); | 328 | reg | TWL4030_CNCL_OFFSET_START); |
| 329 | 329 | ||
| 330 | /* | 330 | /* |
| 331 | * Wait for offset cancellation to complete. | 331 | * Wait for offset cancellation to complete. |
| @@ -337,7 +337,7 @@ static void twl4030_init_chip(struct snd_soc_codec *codec) | |||
| 337 | usleep_range(1000, 2000); | 337 | usleep_range(1000, 2000); |
| 338 | twl_set_regcache_bypass(TWL4030_MODULE_AUDIO_VOICE, true); | 338 | twl_set_regcache_bypass(TWL4030_MODULE_AUDIO_VOICE, true); |
| 339 | twl_i2c_read_u8(TWL4030_MODULE_AUDIO_VOICE, &byte, | 339 | twl_i2c_read_u8(TWL4030_MODULE_AUDIO_VOICE, &byte, |
| 340 | TWL4030_REG_ANAMICL); | 340 | TWL4030_REG_ANAMICL); |
| 341 | twl_set_regcache_bypass(TWL4030_MODULE_AUDIO_VOICE, false); | 341 | twl_set_regcache_bypass(TWL4030_MODULE_AUDIO_VOICE, false); |
| 342 | } while ((i++ < 100) && | 342 | } while ((i++ < 100) && |
| 343 | ((byte & TWL4030_CNCL_OFFSET_START) == | 343 | ((byte & TWL4030_CNCL_OFFSET_START) == |
| @@ -577,7 +577,7 @@ static const struct snd_kcontrol_new twl4030_dapm_dbypassv_control = | |||
| 577 | */ | 577 | */ |
| 578 | #define TWL4030_OUTPUT_PGA(pin_name, reg, mask) \ | 578 | #define TWL4030_OUTPUT_PGA(pin_name, reg, mask) \ |
| 579 | static int pin_name##pga_event(struct snd_soc_dapm_widget *w, \ | 579 | static int pin_name##pga_event(struct snd_soc_dapm_widget *w, \ |
| 580 | struct snd_kcontrol *kcontrol, int event) \ | 580 | struct snd_kcontrol *kcontrol, int event) \ |
| 581 | { \ | 581 | { \ |
| 582 | struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(w->codec); \ | 582 | struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(w->codec); \ |
| 583 | \ | 583 | \ |
| @@ -588,8 +588,7 @@ static int pin_name##pga_event(struct snd_soc_dapm_widget *w, \ | |||
| 588 | break; \ | 588 | break; \ |
| 589 | case SND_SOC_DAPM_POST_PMD: \ | 589 | case SND_SOC_DAPM_POST_PMD: \ |
| 590 | twl4030->pin_name##_enabled = 0; \ | 590 | twl4030->pin_name##_enabled = 0; \ |
| 591 | twl_i2c_write_u8(TWL4030_MODULE_AUDIO_VOICE, \ | 591 | twl_i2c_write_u8(TWL4030_MODULE_AUDIO_VOICE, 0, reg); \ |
| 592 | 0, reg); \ | ||
| 593 | break; \ | 592 | break; \ |
| 594 | } \ | 593 | } \ |
| 595 | return 0; \ | 594 | return 0; \ |
| @@ -632,7 +631,7 @@ static void handsfree_ramp(struct snd_soc_codec *codec, int reg, int ramp) | |||
| 632 | } | 631 | } |
| 633 | 632 | ||
| 634 | static int handsfreelpga_event(struct snd_soc_dapm_widget *w, | 633 | static int handsfreelpga_event(struct snd_soc_dapm_widget *w, |
| 635 | struct snd_kcontrol *kcontrol, int event) | 634 | struct snd_kcontrol *kcontrol, int event) |
| 636 | { | 635 | { |
| 637 | switch (event) { | 636 | switch (event) { |
| 638 | case SND_SOC_DAPM_POST_PMU: | 637 | case SND_SOC_DAPM_POST_PMU: |
| @@ -646,7 +645,7 @@ static int handsfreelpga_event(struct snd_soc_dapm_widget *w, | |||
| 646 | } | 645 | } |
| 647 | 646 | ||
| 648 | static int handsfreerpga_event(struct snd_soc_dapm_widget *w, | 647 | static int handsfreerpga_event(struct snd_soc_dapm_widget *w, |
| 649 | struct snd_kcontrol *kcontrol, int event) | 648 | struct snd_kcontrol *kcontrol, int event) |
| 650 | { | 649 | { |
| 651 | switch (event) { | 650 | switch (event) { |
| 652 | case SND_SOC_DAPM_POST_PMU: | 651 | case SND_SOC_DAPM_POST_PMU: |
| @@ -660,14 +659,14 @@ static int handsfreerpga_event(struct snd_soc_dapm_widget *w, | |||
| 660 | } | 659 | } |
| 661 | 660 | ||
| 662 | static int vibramux_event(struct snd_soc_dapm_widget *w, | 661 | static int vibramux_event(struct snd_soc_dapm_widget *w, |
| 663 | struct snd_kcontrol *kcontrol, int event) | 662 | struct snd_kcontrol *kcontrol, int event) |
| 664 | { | 663 | { |
| 665 | twl4030_write(w->codec, TWL4030_REG_VIBRA_SET, 0xff); | 664 | twl4030_write(w->codec, TWL4030_REG_VIBRA_SET, 0xff); |
| 666 | return 0; | 665 | return 0; |
| 667 | } | 666 | } |
| 668 | 667 | ||
| 669 | static int apll_event(struct snd_soc_dapm_widget *w, | 668 | static int apll_event(struct snd_soc_dapm_widget *w, |
| 670 | struct snd_kcontrol *kcontrol, int event) | 669 | struct snd_kcontrol *kcontrol, int event) |
| 671 | { | 670 | { |
| 672 | switch (event) { | 671 | switch (event) { |
| 673 | case SND_SOC_DAPM_PRE_PMU: | 672 | case SND_SOC_DAPM_PRE_PMU: |
| @@ -681,7 +680,7 @@ static int apll_event(struct snd_soc_dapm_widget *w, | |||
| 681 | } | 680 | } |
| 682 | 681 | ||
| 683 | static int aif_event(struct snd_soc_dapm_widget *w, | 682 | static int aif_event(struct snd_soc_dapm_widget *w, |
| 684 | struct snd_kcontrol *kcontrol, int event) | 683 | struct snd_kcontrol *kcontrol, int event) |
| 685 | { | 684 | { |
| 686 | u8 audio_if; | 685 | u8 audio_if; |
| 687 | 686 | ||
| @@ -693,12 +692,12 @@ static int aif_event(struct snd_soc_dapm_widget *w, | |||
| 693 | twl4030_apll_enable(w->codec, 1); | 692 | twl4030_apll_enable(w->codec, 1); |
| 694 | 693 | ||
| 695 | twl4030_write(w->codec, TWL4030_REG_AUDIO_IF, | 694 | twl4030_write(w->codec, TWL4030_REG_AUDIO_IF, |
| 696 | audio_if | TWL4030_AIF_EN); | 695 | audio_if | TWL4030_AIF_EN); |
| 697 | break; | 696 | break; |
| 698 | case SND_SOC_DAPM_POST_PMD: | 697 | case SND_SOC_DAPM_POST_PMD: |
| 699 | /* disable the DAI before we stop it's source PLL */ | 698 | /* disable the DAI before we stop it's source PLL */ |
| 700 | twl4030_write(w->codec, TWL4030_REG_AUDIO_IF, | 699 | twl4030_write(w->codec, TWL4030_REG_AUDIO_IF, |
| 701 | audio_if & ~TWL4030_AIF_EN); | 700 | audio_if & ~TWL4030_AIF_EN); |
| 702 | twl4030_apll_enable(w->codec, 0); | 701 | twl4030_apll_enable(w->codec, 0); |
| 703 | break; | 702 | break; |
| 704 | } | 703 | } |
| @@ -736,9 +735,8 @@ static void headset_ramp(struct snd_soc_codec *codec, int ramp) | |||
| 736 | hs_pop |= TWL4030_VMID_EN; | 735 | hs_pop |= TWL4030_VMID_EN; |
| 737 | twl4030_write(codec, TWL4030_REG_HS_POPN_SET, hs_pop); | 736 | twl4030_write(codec, TWL4030_REG_HS_POPN_SET, hs_pop); |
| 738 | /* Actually write to the register */ | 737 | /* Actually write to the register */ |
| 739 | twl_i2c_write_u8(TWL4030_MODULE_AUDIO_VOICE, | 738 | twl_i2c_write_u8(TWL4030_MODULE_AUDIO_VOICE, hs_gain, |
| 740 | hs_gain, | 739 | TWL4030_REG_HS_GAIN_SET); |
| 741 | TWL4030_REG_HS_GAIN_SET); | ||
| 742 | hs_pop |= TWL4030_RAMP_EN; | 740 | hs_pop |= TWL4030_RAMP_EN; |
| 743 | twl4030_write(codec, TWL4030_REG_HS_POPN_SET, hs_pop); | 741 | twl4030_write(codec, TWL4030_REG_HS_POPN_SET, hs_pop); |
| 744 | /* Wait ramp delay time + 1, so the VMID can settle */ | 742 | /* Wait ramp delay time + 1, so the VMID can settle */ |
| @@ -751,9 +749,8 @@ static void headset_ramp(struct snd_soc_codec *codec, int ramp) | |||
| 751 | /* Wait ramp delay time + 1, so the VMID can settle */ | 749 | /* Wait ramp delay time + 1, so the VMID can settle */ |
| 752 | twl4030_wait_ms(delay); | 750 | twl4030_wait_ms(delay); |
| 753 | /* Bypass the reg_cache to mute the headset */ | 751 | /* Bypass the reg_cache to mute the headset */ |
| 754 | twl_i2c_write_u8(TWL4030_MODULE_AUDIO_VOICE, | 752 | twl_i2c_write_u8(TWL4030_MODULE_AUDIO_VOICE, hs_gain & (~0x0f), |
| 755 | hs_gain & (~0x0f), | 753 | TWL4030_REG_HS_GAIN_SET); |
| 756 | TWL4030_REG_HS_GAIN_SET); | ||
| 757 | 754 | ||
| 758 | hs_pop &= ~TWL4030_VMID_EN; | 755 | hs_pop &= ~TWL4030_VMID_EN; |
| 759 | twl4030_write(codec, TWL4030_REG_HS_POPN_SET, hs_pop); | 756 | twl4030_write(codec, TWL4030_REG_HS_POPN_SET, hs_pop); |
| @@ -771,7 +768,7 @@ static void headset_ramp(struct snd_soc_codec *codec, int ramp) | |||
| 771 | } | 768 | } |
| 772 | 769 | ||
| 773 | static int headsetlpga_event(struct snd_soc_dapm_widget *w, | 770 | static int headsetlpga_event(struct snd_soc_dapm_widget *w, |
| 774 | struct snd_kcontrol *kcontrol, int event) | 771 | struct snd_kcontrol *kcontrol, int event) |
| 775 | { | 772 | { |
| 776 | struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(w->codec); | 773 | struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(w->codec); |
| 777 | 774 | ||
| @@ -795,7 +792,7 @@ static int headsetlpga_event(struct snd_soc_dapm_widget *w, | |||
| 795 | } | 792 | } |
| 796 | 793 | ||
| 797 | static int headsetrpga_event(struct snd_soc_dapm_widget *w, | 794 | static int headsetrpga_event(struct snd_soc_dapm_widget *w, |
| 798 | struct snd_kcontrol *kcontrol, int event) | 795 | struct snd_kcontrol *kcontrol, int event) |
| 799 | { | 796 | { |
| 800 | struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(w->codec); | 797 | struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(w->codec); |
| 801 | 798 | ||
| @@ -819,7 +816,7 @@ static int headsetrpga_event(struct snd_soc_dapm_widget *w, | |||
| 819 | } | 816 | } |
| 820 | 817 | ||
| 821 | static int digimic_event(struct snd_soc_dapm_widget *w, | 818 | static int digimic_event(struct snd_soc_dapm_widget *w, |
| 822 | struct snd_kcontrol *kcontrol, int event) | 819 | struct snd_kcontrol *kcontrol, int event) |
| 823 | { | 820 | { |
| 824 | struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(w->codec); | 821 | struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(w->codec); |
| 825 | struct twl4030_codec_data *pdata = twl4030->pdata; | 822 | struct twl4030_codec_data *pdata = twl4030->pdata; |
| @@ -840,7 +837,7 @@ static int digimic_event(struct snd_soc_dapm_widget *w, | |||
| 840 | * Custom volsw and volsw_2r get/put functions to handle these gain bits. | 837 | * Custom volsw and volsw_2r get/put functions to handle these gain bits. |
| 841 | */ | 838 | */ |
| 842 | static int snd_soc_get_volsw_twl4030(struct snd_kcontrol *kcontrol, | 839 | static int snd_soc_get_volsw_twl4030(struct snd_kcontrol *kcontrol, |
| 843 | struct snd_ctl_elem_value *ucontrol) | 840 | struct snd_ctl_elem_value *ucontrol) |
| 844 | { | 841 | { |
| 845 | struct soc_mixer_control *mc = | 842 | struct soc_mixer_control *mc = |
| 846 | (struct soc_mixer_control *)kcontrol->private_value; | 843 | (struct soc_mixer_control *)kcontrol->private_value; |
| @@ -869,7 +866,7 @@ static int snd_soc_get_volsw_twl4030(struct snd_kcontrol *kcontrol, | |||
| 869 | } | 866 | } |
| 870 | 867 | ||
| 871 | static int snd_soc_put_volsw_twl4030(struct snd_kcontrol *kcontrol, | 868 | static int snd_soc_put_volsw_twl4030(struct snd_kcontrol *kcontrol, |
| 872 | struct snd_ctl_elem_value *ucontrol) | 869 | struct snd_ctl_elem_value *ucontrol) |
| 873 | { | 870 | { |
| 874 | struct soc_mixer_control *mc = | 871 | struct soc_mixer_control *mc = |
| 875 | (struct soc_mixer_control *)kcontrol->private_value; | 872 | (struct soc_mixer_control *)kcontrol->private_value; |
| @@ -898,7 +895,7 @@ static int snd_soc_put_volsw_twl4030(struct snd_kcontrol *kcontrol, | |||
| 898 | } | 895 | } |
| 899 | 896 | ||
| 900 | static int snd_soc_get_volsw_r2_twl4030(struct snd_kcontrol *kcontrol, | 897 | static int snd_soc_get_volsw_r2_twl4030(struct snd_kcontrol *kcontrol, |
| 901 | struct snd_ctl_elem_value *ucontrol) | 898 | struct snd_ctl_elem_value *ucontrol) |
| 902 | { | 899 | { |
| 903 | struct soc_mixer_control *mc = | 900 | struct soc_mixer_control *mc = |
| 904 | (struct soc_mixer_control *)kcontrol->private_value; | 901 | (struct soc_mixer_control *)kcontrol->private_value; |
| @@ -925,7 +922,7 @@ static int snd_soc_get_volsw_r2_twl4030(struct snd_kcontrol *kcontrol, | |||
| 925 | } | 922 | } |
| 926 | 923 | ||
| 927 | static int snd_soc_put_volsw_r2_twl4030(struct snd_kcontrol *kcontrol, | 924 | static int snd_soc_put_volsw_r2_twl4030(struct snd_kcontrol *kcontrol, |
| 928 | struct snd_ctl_elem_value *ucontrol) | 925 | struct snd_ctl_elem_value *ucontrol) |
| 929 | { | 926 | { |
| 930 | struct soc_mixer_control *mc = | 927 | struct soc_mixer_control *mc = |
| 931 | (struct soc_mixer_control *)kcontrol->private_value; | 928 | (struct soc_mixer_control *)kcontrol->private_value; |
| @@ -1656,7 +1653,7 @@ static void twl4030_constraints(struct twl4030_priv *twl4030, | |||
| 1656 | /* In case of 4 channel mode, the RX1 L/R for playback and the TX2 L/R for | 1653 | /* In case of 4 channel mode, the RX1 L/R for playback and the TX2 L/R for |
| 1657 | * capture has to be enabled/disabled. */ | 1654 | * capture has to be enabled/disabled. */ |
| 1658 | static void twl4030_tdm_enable(struct snd_soc_codec *codec, int direction, | 1655 | static void twl4030_tdm_enable(struct snd_soc_codec *codec, int direction, |
| 1659 | int enable) | 1656 | int enable) |
| 1660 | { | 1657 | { |
| 1661 | u8 reg, mask; | 1658 | u8 reg, mask; |
| 1662 | 1659 | ||
| @@ -1695,8 +1692,8 @@ static int twl4030_startup(struct snd_pcm_substream *substream, | |||
| 1695 | * constraint for the first stream for channels, the | 1692 | * constraint for the first stream for channels, the |
| 1696 | * second stream will 'inherit' this cosntraint */ | 1693 | * second stream will 'inherit' this cosntraint */ |
| 1697 | snd_pcm_hw_constraint_minmax(substream->runtime, | 1694 | snd_pcm_hw_constraint_minmax(substream->runtime, |
| 1698 | SNDRV_PCM_HW_PARAM_CHANNELS, | 1695 | SNDRV_PCM_HW_PARAM_CHANNELS, |
| 1699 | 2, 2); | 1696 | 2, 2); |
| 1700 | } | 1697 | } |
| 1701 | twl4030->master_substream = substream; | 1698 | twl4030->master_substream = substream; |
| 1702 | } | 1699 | } |
| @@ -1728,8 +1725,8 @@ static void twl4030_shutdown(struct snd_pcm_substream *substream, | |||
| 1728 | } | 1725 | } |
| 1729 | 1726 | ||
| 1730 | static int twl4030_hw_params(struct snd_pcm_substream *substream, | 1727 | static int twl4030_hw_params(struct snd_pcm_substream *substream, |
| 1731 | struct snd_pcm_hw_params *params, | 1728 | struct snd_pcm_hw_params *params, |
| 1732 | struct snd_soc_dai *dai) | 1729 | struct snd_soc_dai *dai) |
| 1733 | { | 1730 | { |
| 1734 | struct snd_soc_codec *codec = dai->codec; | 1731 | struct snd_soc_codec *codec = dai->codec; |
| 1735 | struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec); | 1732 | struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec); |
| @@ -1845,8 +1842,8 @@ static int twl4030_hw_params(struct snd_pcm_substream *substream, | |||
| 1845 | return 0; | 1842 | return 0; |
| 1846 | } | 1843 | } |
| 1847 | 1844 | ||
| 1848 | static int twl4030_set_dai_sysclk(struct snd_soc_dai *codec_dai, | 1845 | static int twl4030_set_dai_sysclk(struct snd_soc_dai *codec_dai, int clk_id, |
| 1849 | int clk_id, unsigned int freq, int dir) | 1846 | unsigned int freq, int dir) |
| 1850 | { | 1847 | { |
| 1851 | struct snd_soc_codec *codec = codec_dai->codec; | 1848 | struct snd_soc_codec *codec = codec_dai->codec; |
| 1852 | struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec); | 1849 | struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec); |
| @@ -1871,8 +1868,7 @@ static int twl4030_set_dai_sysclk(struct snd_soc_dai *codec_dai, | |||
| 1871 | return 0; | 1868 | return 0; |
| 1872 | } | 1869 | } |
| 1873 | 1870 | ||
| 1874 | static int twl4030_set_dai_fmt(struct snd_soc_dai *codec_dai, | 1871 | static int twl4030_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt) |
| 1875 | unsigned int fmt) | ||
| 1876 | { | 1872 | { |
| 1877 | struct snd_soc_codec *codec = codec_dai->codec; | 1873 | struct snd_soc_codec *codec = codec_dai->codec; |
| 1878 | struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec); | 1874 | struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec); |
| @@ -1942,7 +1938,7 @@ static int twl4030_set_tristate(struct snd_soc_dai *dai, int tristate) | |||
| 1942 | /* In case of voice mode, the RX1 L(VRX) for downlink and the TX2 L/R | 1938 | /* In case of voice mode, the RX1 L(VRX) for downlink and the TX2 L/R |
| 1943 | * (VTXL, VTXR) for uplink has to be enabled/disabled. */ | 1939 | * (VTXL, VTXR) for uplink has to be enabled/disabled. */ |
| 1944 | static void twl4030_voice_enable(struct snd_soc_codec *codec, int direction, | 1940 | static void twl4030_voice_enable(struct snd_soc_codec *codec, int direction, |
| 1945 | int enable) | 1941 | int enable) |
| 1946 | { | 1942 | { |
| 1947 | u8 reg, mask; | 1943 | u8 reg, mask; |
| 1948 | 1944 | ||
| @@ -1962,7 +1958,7 @@ static void twl4030_voice_enable(struct snd_soc_codec *codec, int direction, | |||
| 1962 | } | 1958 | } |
| 1963 | 1959 | ||
| 1964 | static int twl4030_voice_startup(struct snd_pcm_substream *substream, | 1960 | static int twl4030_voice_startup(struct snd_pcm_substream *substream, |
| 1965 | struct snd_soc_dai *dai) | 1961 | struct snd_soc_dai *dai) |
| 1966 | { | 1962 | { |
| 1967 | struct snd_soc_codec *codec = dai->codec; | 1963 | struct snd_soc_codec *codec = dai->codec; |
| 1968 | struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec); | 1964 | struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec); |
| @@ -1994,7 +1990,7 @@ static int twl4030_voice_startup(struct snd_pcm_substream *substream, | |||
| 1994 | } | 1990 | } |
| 1995 | 1991 | ||
| 1996 | static void twl4030_voice_shutdown(struct snd_pcm_substream *substream, | 1992 | static void twl4030_voice_shutdown(struct snd_pcm_substream *substream, |
| 1997 | struct snd_soc_dai *dai) | 1993 | struct snd_soc_dai *dai) |
| 1998 | { | 1994 | { |
| 1999 | struct snd_soc_codec *codec = dai->codec; | 1995 | struct snd_soc_codec *codec = dai->codec; |
| 2000 | 1996 | ||
| @@ -2003,7 +1999,8 @@ static void twl4030_voice_shutdown(struct snd_pcm_substream *substream, | |||
| 2003 | } | 1999 | } |
| 2004 | 2000 | ||
| 2005 | static int twl4030_voice_hw_params(struct snd_pcm_substream *substream, | 2001 | static int twl4030_voice_hw_params(struct snd_pcm_substream *substream, |
| 2006 | struct snd_pcm_hw_params *params, struct snd_soc_dai *dai) | 2002 | struct snd_pcm_hw_params *params, |
| 2003 | struct snd_soc_dai *dai) | ||
| 2007 | { | 2004 | { |
| 2008 | struct snd_soc_codec *codec = dai->codec; | 2005 | struct snd_soc_codec *codec = dai->codec; |
| 2009 | struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec); | 2006 | struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec); |
| @@ -2013,8 +2010,8 @@ static int twl4030_voice_hw_params(struct snd_pcm_substream *substream, | |||
| 2013 | twl4030_voice_enable(codec, substream->stream, 1); | 2010 | twl4030_voice_enable(codec, substream->stream, 1); |
| 2014 | 2011 | ||
| 2015 | /* bit rate */ | 2012 | /* bit rate */ |
| 2016 | old_mode = twl4030_read(codec, TWL4030_REG_CODEC_MODE) | 2013 | old_mode = twl4030_read(codec, |
| 2017 | & ~(TWL4030_CODECPDZ); | 2014 | TWL4030_REG_CODEC_MODE) & ~TWL4030_CODECPDZ; |
| 2018 | mode = old_mode; | 2015 | mode = old_mode; |
| 2019 | 2016 | ||
| 2020 | switch (params_rate(params)) { | 2017 | switch (params_rate(params)) { |
| @@ -2048,7 +2045,7 @@ static int twl4030_voice_hw_params(struct snd_pcm_substream *substream, | |||
| 2048 | } | 2045 | } |
| 2049 | 2046 | ||
| 2050 | static int twl4030_voice_set_dai_sysclk(struct snd_soc_dai *codec_dai, | 2047 | static int twl4030_voice_set_dai_sysclk(struct snd_soc_dai *codec_dai, |
| 2051 | int clk_id, unsigned int freq, int dir) | 2048 | int clk_id, unsigned int freq, int dir) |
| 2052 | { | 2049 | { |
| 2053 | struct snd_soc_codec *codec = codec_dai->codec; | 2050 | struct snd_soc_codec *codec = codec_dai->codec; |
| 2054 | struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec); | 2051 | struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec); |
| @@ -2069,7 +2066,7 @@ static int twl4030_voice_set_dai_sysclk(struct snd_soc_dai *codec_dai, | |||
| 2069 | } | 2066 | } |
| 2070 | 2067 | ||
| 2071 | static int twl4030_voice_set_dai_fmt(struct snd_soc_dai *codec_dai, | 2068 | static int twl4030_voice_set_dai_fmt(struct snd_soc_dai *codec_dai, |
| 2072 | unsigned int fmt) | 2069 | unsigned int fmt) |
| 2073 | { | 2070 | { |
| 2074 | struct snd_soc_codec *codec = codec_dai->codec; | 2071 | struct snd_soc_codec *codec = codec_dai->codec; |
| 2075 | struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec); | 2072 | struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec); |
| @@ -2242,7 +2239,7 @@ static struct snd_soc_codec_driver soc_codec_dev_twl4030 = { | |||
| 2242 | static int twl4030_codec_probe(struct platform_device *pdev) | 2239 | static int twl4030_codec_probe(struct platform_device *pdev) |
| 2243 | { | 2240 | { |
| 2244 | return snd_soc_register_codec(&pdev->dev, &soc_codec_dev_twl4030, | 2241 | return snd_soc_register_codec(&pdev->dev, &soc_codec_dev_twl4030, |
| 2245 | twl4030_dai, ARRAY_SIZE(twl4030_dai)); | 2242 | twl4030_dai, ARRAY_SIZE(twl4030_dai)); |
| 2246 | } | 2243 | } |
| 2247 | 2244 | ||
| 2248 | static int twl4030_codec_remove(struct platform_device *pdev) | 2245 | static int twl4030_codec_remove(struct platform_device *pdev) |
