| OLD | NEW |
| 1 /* | 1 /* |
| 2 * wm_hubs.c -- WM8993/4 common code | 2 * wm_hubs.c -- WM8993/4 common code |
| 3 * | 3 * |
| 4 * Copyright 2009 Wolfson Microelectronics plc | 4 * Copyright 2009 Wolfson Microelectronics plc |
| 5 * | 5 * |
| 6 * Author: Mark Brown <broonie@opensource.wolfsonmicro.com> | 6 * Author: Mark Brown <broonie@opensource.wolfsonmicro.com> |
| 7 * | 7 * |
| 8 * | 8 * |
| 9 * This program is free software; you can redistribute it and/or modify | 9 * This program is free software; you can redistribute it and/or modify |
| 10 * it under the terms of the GNU General Public License version 2 as | 10 * it under the terms of the GNU General Public License version 2 as |
| 11 * published by the Free Software Foundation. | 11 * published by the Free Software Foundation. |
| 12 */ | 12 */ |
| 13 | 13 |
| 14 #include <linux/module.h> | 14 #include <linux/module.h> |
| 15 #include <linux/moduleparam.h> | 15 #include <linux/moduleparam.h> |
| 16 #include <linux/init.h> | 16 #include <linux/init.h> |
| 17 #include <linux/delay.h> | 17 #include <linux/delay.h> |
| 18 #include <linux/pm.h> | 18 #include <linux/pm.h> |
| 19 #include <linux/i2c.h> | 19 #include <linux/i2c.h> |
| 20 #include <linux/platform_device.h> | 20 #include <linux/platform_device.h> |
| 21 #include <sound/core.h> | 21 #include <sound/core.h> |
| 22 #include <sound/pcm.h> | 22 #include <sound/pcm.h> |
| 23 #include <sound/pcm_params.h> | 23 #include <sound/pcm_params.h> |
| 24 #include <sound/soc.h> | 24 #include <sound/soc.h> |
| 25 #include <sound/soc-dapm.h> | |
| 26 #include <sound/initval.h> | 25 #include <sound/initval.h> |
| 27 #include <sound/tlv.h> | 26 #include <sound/tlv.h> |
| 28 | 27 |
| 29 #include "wm8993.h" | 28 #include "wm8993.h" |
| 30 #include "wm_hubs.h" | 29 #include "wm_hubs.h" |
| 31 | 30 |
| 32 const DECLARE_TLV_DB_SCALE(wm_hubs_spkmix_tlv, -300, 300, 0); | 31 const DECLARE_TLV_DB_SCALE(wm_hubs_spkmix_tlv, -300, 300, 0); |
| 33 EXPORT_SYMBOL_GPL(wm_hubs_spkmix_tlv); | 32 EXPORT_SYMBOL_GPL(wm_hubs_spkmix_tlv); |
| 34 | 33 |
| 35 static const DECLARE_TLV_DB_SCALE(inpga_tlv, -1650, 150, 0); | 34 static const DECLARE_TLV_DB_SCALE(inpga_tlv, -1650, 150, 0); |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 if (reg & op) | 84 if (reg & op) |
| 86 dev_err(codec->dev, "Timed out waiting for DC Servo\n"); | 85 dev_err(codec->dev, "Timed out waiting for DC Servo\n"); |
| 87 } | 86 } |
| 88 | 87 |
| 89 /* | 88 /* |
| 90 * Startup calibration of the DC servo | 89 * Startup calibration of the DC servo |
| 91 */ | 90 */ |
| 92 static void calibrate_dc_servo(struct snd_soc_codec *codec) | 91 static void calibrate_dc_servo(struct snd_soc_codec *codec) |
| 93 { | 92 { |
| 94 struct wm_hubs_data *hubs = snd_soc_codec_get_drvdata(codec); | 93 struct wm_hubs_data *hubs = snd_soc_codec_get_drvdata(codec); |
| 94 s8 offset; |
| 95 u16 reg, reg_l, reg_r, dcs_cfg; | 95 u16 reg, reg_l, reg_r, dcs_cfg; |
| 96 | 96 |
| 97 » /* Set for 32 series updates */ | 97 » /* If we're using a digital only path and have a previously |
| 98 » snd_soc_update_bits(codec, WM8993_DC_SERVO_1, | 98 » * callibrated DC servo offset stored then use that. */ |
| 99 » » » WM8993_DCS_SERIES_NO_01_MASK, | 99 » if (hubs->class_w && hubs->class_w_dcs) { |
| 100 » » » 32 << WM8993_DCS_SERIES_NO_01_SHIFT); | 100 » » dev_dbg(codec->dev, "Using cached DC servo offset %x\n", |
| 101 » wait_for_dc_servo(codec, | 101 » » » hubs->class_w_dcs); |
| 102 » » » WM8993_DCS_TRIG_SERIES_0 | WM8993_DCS_TRIG_SERIES_1); | 102 » » snd_soc_write(codec, WM8993_DC_SERVO_3, hubs->class_w_dcs); |
| 103 » » wait_for_dc_servo(codec, |
| 104 » » » » WM8993_DCS_TRIG_DAC_WR_0 | |
| 105 » » » » WM8993_DCS_TRIG_DAC_WR_1); |
| 106 » » return; |
| 107 » } |
| 108 |
| 109 » /* Devices not using a DCS code correction have startup mode */ |
| 110 » if (hubs->dcs_codes) { |
| 111 » » /* Set for 32 series updates */ |
| 112 » » snd_soc_update_bits(codec, WM8993_DC_SERVO_1, |
| 113 » » » » WM8993_DCS_SERIES_NO_01_MASK, |
| 114 » » » » 32 << WM8993_DCS_SERIES_NO_01_SHIFT); |
| 115 » » wait_for_dc_servo(codec, |
| 116 » » » » WM8993_DCS_TRIG_SERIES_0 | |
| 117 » » » » WM8993_DCS_TRIG_SERIES_1); |
| 118 » } else { |
| 119 » » wait_for_dc_servo(codec, |
| 120 » » » » WM8993_DCS_TRIG_STARTUP_0 | |
| 121 » » » » WM8993_DCS_TRIG_STARTUP_1); |
| 122 » } |
| 123 |
| 124 » /* Different chips in the family support different readback |
| 125 » * methods. |
| 126 » */ |
| 127 » switch (hubs->dcs_readback_mode) { |
| 128 » case 0: |
| 129 » » reg_l = snd_soc_read(codec, WM8993_DC_SERVO_READBACK_1) |
| 130 » » » & WM8993_DCS_INTEG_CHAN_0_MASK; |
| 131 » » reg_r = snd_soc_read(codec, WM8993_DC_SERVO_READBACK_2) |
| 132 » » » & WM8993_DCS_INTEG_CHAN_1_MASK; |
| 133 » » break; |
| 134 » case 1: |
| 135 » » reg = snd_soc_read(codec, WM8993_DC_SERVO_3); |
| 136 » » reg_l = (reg & WM8993_DCS_DAC_WR_VAL_1_MASK) |
| 137 » » » >> WM8993_DCS_DAC_WR_VAL_1_SHIFT; |
| 138 » » reg_r = reg & WM8993_DCS_DAC_WR_VAL_0_MASK; |
| 139 » » break; |
| 140 » default: |
| 141 » » WARN(1, "Unknown DCS readback method\n"); |
| 142 » » break; |
| 143 » } |
| 144 |
| 145 » dev_dbg(codec->dev, "DCS input: %x %x\n", reg_l, reg_r); |
| 103 | 146 |
| 104 /* Apply correction to DC servo result */ | 147 /* Apply correction to DC servo result */ |
| 105 if (hubs->dcs_codes) { | 148 if (hubs->dcs_codes) { |
| 106 dev_dbg(codec->dev, "Applying %d code DC servo correction\n", | 149 dev_dbg(codec->dev, "Applying %d code DC servo correction\n", |
| 107 hubs->dcs_codes); | 150 hubs->dcs_codes); |
| 108 | 151 |
| 109 /* Different chips in the family support different | |
| 110 * readback methods. | |
| 111 */ | |
| 112 switch (hubs->dcs_readback_mode) { | |
| 113 case 0: | |
| 114 reg_l = snd_soc_read(codec, WM8993_DC_SERVO_READBACK_1) | |
| 115 & WM8993_DCS_INTEG_CHAN_0_MASK;; | |
| 116 reg_r = snd_soc_read(codec, WM8993_DC_SERVO_READBACK_2) | |
| 117 & WM8993_DCS_INTEG_CHAN_1_MASK; | |
| 118 break; | |
| 119 case 1: | |
| 120 reg = snd_soc_read(codec, WM8993_DC_SERVO_3); | |
| 121 reg_l = (reg & WM8993_DCS_DAC_WR_VAL_1_MASK) | |
| 122 >> WM8993_DCS_DAC_WR_VAL_1_SHIFT; | |
| 123 reg_r = reg & WM8993_DCS_DAC_WR_VAL_0_MASK; | |
| 124 break; | |
| 125 default: | |
| 126 WARN(1, "Unknown DCS readback method\n"); | |
| 127 break; | |
| 128 } | |
| 129 | |
| 130 dev_dbg(codec->dev, "DCS input: %x %x\n", reg_l, reg_r); | |
| 131 | |
| 132 /* HPOUT1L */ | 152 /* HPOUT1L */ |
| 133 » » if (reg_l + hubs->dcs_codes > 0 && | 153 » » offset = reg_l; |
| 134 » » reg_l + hubs->dcs_codes < 0xff) | 154 » » offset += hubs->dcs_codes; |
| 135 » » » reg_l += hubs->dcs_codes; | 155 » » dcs_cfg = (u8)offset << WM8993_DCS_DAC_WR_VAL_1_SHIFT; |
| 136 » » dcs_cfg = reg_l << WM8993_DCS_DAC_WR_VAL_1_SHIFT; | |
| 137 | 156 |
| 138 /* HPOUT1R */ | 157 /* HPOUT1R */ |
| 139 » » if (reg_r + hubs->dcs_codes > 0 && | 158 » » offset = reg_r; |
| 140 » » reg_r + hubs->dcs_codes < 0xff) | 159 » » offset += hubs->dcs_codes; |
| 141 » » » reg_r += hubs->dcs_codes; | 160 » » dcs_cfg |= (u8)offset; |
| 142 » » dcs_cfg |= reg_r; | |
| 143 | 161 |
| 144 dev_dbg(codec->dev, "DCS result: %x\n", dcs_cfg); | 162 dev_dbg(codec->dev, "DCS result: %x\n", dcs_cfg); |
| 145 | 163 |
| 146 /* Do it */ | 164 /* Do it */ |
| 147 snd_soc_write(codec, WM8993_DC_SERVO_3, dcs_cfg); | 165 snd_soc_write(codec, WM8993_DC_SERVO_3, dcs_cfg); |
| 148 wait_for_dc_servo(codec, | 166 wait_for_dc_servo(codec, |
| 149 WM8993_DCS_TRIG_DAC_WR_0 | | 167 WM8993_DCS_TRIG_DAC_WR_0 | |
| 150 WM8993_DCS_TRIG_DAC_WR_1); | 168 WM8993_DCS_TRIG_DAC_WR_1); |
| 169 } else { |
| 170 dcs_cfg = reg_l << WM8993_DCS_DAC_WR_VAL_1_SHIFT; |
| 171 dcs_cfg |= reg_r; |
| 151 } | 172 } |
| 173 |
| 174 /* Save the callibrated offset if we're in class W mode and |
| 175 * therefore don't have any analogue signal mixed in. */ |
| 176 if (hubs->class_w) |
| 177 hubs->class_w_dcs = dcs_cfg; |
| 152 } | 178 } |
| 153 | 179 |
| 154 /* | 180 /* |
| 155 * Update the DC servo calibration on gain changes | 181 * Update the DC servo calibration on gain changes |
| 156 */ | 182 */ |
| 157 static int wm8993_put_dc_servo(struct snd_kcontrol *kcontrol, | 183 static int wm8993_put_dc_servo(struct snd_kcontrol *kcontrol, |
| 158 struct snd_ctl_elem_value *ucontrol) | 184 struct snd_ctl_elem_value *ucontrol) |
| 159 { | 185 { |
| 160 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); | 186 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); |
| 161 struct wm_hubs_data *hubs = snd_soc_codec_get_drvdata(codec); | 187 struct wm_hubs_data *hubs = snd_soc_codec_get_drvdata(codec); |
| 162 int ret; | 188 int ret; |
| 163 | 189 |
| 164 ret = snd_soc_put_volsw_2r(kcontrol, ucontrol); | 190 ret = snd_soc_put_volsw_2r(kcontrol, ucontrol); |
| 165 | 191 |
| 192 /* Updating the analogue gains invalidates the DC servo cache */ |
| 193 hubs->class_w_dcs = 0; |
| 194 |
| 166 /* If we're applying an offset correction then updating the | 195 /* If we're applying an offset correction then updating the |
| 167 * callibration would be likely to introduce further offsets. */ | 196 * callibration would be likely to introduce further offsets. */ |
| 168 if (hubs->dcs_codes) | 197 if (hubs->dcs_codes) |
| 169 return ret; | 198 return ret; |
| 170 | 199 |
| 171 /* Only need to do this if the outputs are active */ | 200 /* Only need to do this if the outputs are active */ |
| 172 if (snd_soc_read(codec, WM8993_POWER_MANAGEMENT_1) | 201 if (snd_soc_read(codec, WM8993_POWER_MANAGEMENT_1) |
| 173 & (WM8993_HPOUT1L_ENA | WM8993_HPOUT1R_ENA)) | 202 & (WM8993_HPOUT1L_ENA | WM8993_HPOUT1R_ENA)) |
| 174 snd_soc_update_bits(codec, | 203 snd_soc_update_bits(codec, |
| 175 WM8993_DC_SERVO_0, | 204 WM8993_DC_SERVO_0, |
| (...skipping 608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 784 { "LINEOUT2N Mixer", "Right Output Switch", "Left Output Mixer" }, | 813 { "LINEOUT2N Mixer", "Right Output Switch", "Left Output Mixer" }, |
| 785 | 814 |
| 786 { "LINEOUT2P Mixer", "Right Output Switch", "Right Output Mixer" }, | 815 { "LINEOUT2P Mixer", "Right Output Switch", "Right Output Mixer" }, |
| 787 | 816 |
| 788 { "LINEOUT2N Driver", NULL, "LINEOUT2N Mixer" }, | 817 { "LINEOUT2N Driver", NULL, "LINEOUT2N Mixer" }, |
| 789 { "LINEOUT2P Driver", NULL, "LINEOUT2P Mixer" }, | 818 { "LINEOUT2P Driver", NULL, "LINEOUT2P Mixer" }, |
| 790 }; | 819 }; |
| 791 | 820 |
| 792 int wm_hubs_add_analogue_controls(struct snd_soc_codec *codec) | 821 int wm_hubs_add_analogue_controls(struct snd_soc_codec *codec) |
| 793 { | 822 { |
| 823 struct snd_soc_dapm_context *dapm = &codec->dapm; |
| 824 |
| 794 /* Latch volume update bits & default ZC on */ | 825 /* Latch volume update bits & default ZC on */ |
| 795 snd_soc_update_bits(codec, WM8993_LEFT_LINE_INPUT_1_2_VOLUME, | 826 snd_soc_update_bits(codec, WM8993_LEFT_LINE_INPUT_1_2_VOLUME, |
| 796 WM8993_IN1_VU, WM8993_IN1_VU); | 827 WM8993_IN1_VU, WM8993_IN1_VU); |
| 797 snd_soc_update_bits(codec, WM8993_RIGHT_LINE_INPUT_1_2_VOLUME, | 828 snd_soc_update_bits(codec, WM8993_RIGHT_LINE_INPUT_1_2_VOLUME, |
| 798 WM8993_IN1_VU, WM8993_IN1_VU); | 829 WM8993_IN1_VU, WM8993_IN1_VU); |
| 799 snd_soc_update_bits(codec, WM8993_LEFT_LINE_INPUT_3_4_VOLUME, | 830 snd_soc_update_bits(codec, WM8993_LEFT_LINE_INPUT_3_4_VOLUME, |
| 800 WM8993_IN2_VU, WM8993_IN2_VU); | 831 WM8993_IN2_VU, WM8993_IN2_VU); |
| 801 snd_soc_update_bits(codec, WM8993_RIGHT_LINE_INPUT_3_4_VOLUME, | 832 snd_soc_update_bits(codec, WM8993_RIGHT_LINE_INPUT_3_4_VOLUME, |
| 802 WM8993_IN2_VU, WM8993_IN2_VU); | 833 WM8993_IN2_VU, WM8993_IN2_VU); |
| 803 | 834 |
| 804 snd_soc_update_bits(codec, WM8993_SPEAKER_VOLUME_RIGHT, | 835 snd_soc_update_bits(codec, WM8993_SPEAKER_VOLUME_RIGHT, |
| 805 WM8993_SPKOUT_VU, WM8993_SPKOUT_VU); | 836 WM8993_SPKOUT_VU, WM8993_SPKOUT_VU); |
| 806 | 837 |
| 807 snd_soc_update_bits(codec, WM8993_LEFT_OUTPUT_VOLUME, | 838 snd_soc_update_bits(codec, WM8993_LEFT_OUTPUT_VOLUME, |
| 808 WM8993_HPOUT1L_ZC, WM8993_HPOUT1L_ZC); | 839 WM8993_HPOUT1L_ZC, WM8993_HPOUT1L_ZC); |
| 809 snd_soc_update_bits(codec, WM8993_RIGHT_OUTPUT_VOLUME, | 840 snd_soc_update_bits(codec, WM8993_RIGHT_OUTPUT_VOLUME, |
| 810 WM8993_HPOUT1_VU | WM8993_HPOUT1R_ZC, | 841 WM8993_HPOUT1_VU | WM8993_HPOUT1R_ZC, |
| 811 WM8993_HPOUT1_VU | WM8993_HPOUT1R_ZC); | 842 WM8993_HPOUT1_VU | WM8993_HPOUT1R_ZC); |
| 812 | 843 |
| 813 snd_soc_update_bits(codec, WM8993_LEFT_OPGA_VOLUME, | 844 snd_soc_update_bits(codec, WM8993_LEFT_OPGA_VOLUME, |
| 814 WM8993_MIXOUTL_ZC, WM8993_MIXOUTL_ZC); | 845 WM8993_MIXOUTL_ZC, WM8993_MIXOUTL_ZC); |
| 815 snd_soc_update_bits(codec, WM8993_RIGHT_OPGA_VOLUME, | 846 snd_soc_update_bits(codec, WM8993_RIGHT_OPGA_VOLUME, |
| 816 WM8993_MIXOUTR_ZC | WM8993_MIXOUT_VU, | 847 WM8993_MIXOUTR_ZC | WM8993_MIXOUT_VU, |
| 817 WM8993_MIXOUTR_ZC | WM8993_MIXOUT_VU); | 848 WM8993_MIXOUTR_ZC | WM8993_MIXOUT_VU); |
| 818 | 849 |
| 819 snd_soc_add_controls(codec, analogue_snd_controls, | 850 snd_soc_add_controls(codec, analogue_snd_controls, |
| 820 ARRAY_SIZE(analogue_snd_controls)); | 851 ARRAY_SIZE(analogue_snd_controls)); |
| 821 | 852 |
| 822 » snd_soc_dapm_new_controls(codec, analogue_dapm_widgets, | 853 » snd_soc_dapm_new_controls(dapm, analogue_dapm_widgets, |
| 823 ARRAY_SIZE(analogue_dapm_widgets)); | 854 ARRAY_SIZE(analogue_dapm_widgets)); |
| 824 return 0; | 855 return 0; |
| 825 } | 856 } |
| 826 EXPORT_SYMBOL_GPL(wm_hubs_add_analogue_controls); | 857 EXPORT_SYMBOL_GPL(wm_hubs_add_analogue_controls); |
| 827 | 858 |
| 828 int wm_hubs_add_analogue_routes(struct snd_soc_codec *codec, | 859 int wm_hubs_add_analogue_routes(struct snd_soc_codec *codec, |
| 829 int lineout1_diff, int lineout2_diff) | 860 int lineout1_diff, int lineout2_diff) |
| 830 { | 861 { |
| 831 » snd_soc_dapm_add_routes(codec, analogue_routes, | 862 » struct snd_soc_dapm_context *dapm = &codec->dapm; |
| 863 |
| 864 » snd_soc_dapm_add_routes(dapm, analogue_routes, |
| 832 ARRAY_SIZE(analogue_routes)); | 865 ARRAY_SIZE(analogue_routes)); |
| 833 | 866 |
| 834 if (lineout1_diff) | 867 if (lineout1_diff) |
| 835 » » snd_soc_dapm_add_routes(codec, | 868 » » snd_soc_dapm_add_routes(dapm, |
| 836 lineout1_diff_routes, | 869 lineout1_diff_routes, |
| 837 ARRAY_SIZE(lineout1_diff_routes)); | 870 ARRAY_SIZE(lineout1_diff_routes)); |
| 838 else | 871 else |
| 839 » » snd_soc_dapm_add_routes(codec, | 872 » » snd_soc_dapm_add_routes(dapm, |
| 840 lineout1_se_routes, | 873 lineout1_se_routes, |
| 841 ARRAY_SIZE(lineout1_se_routes)); | 874 ARRAY_SIZE(lineout1_se_routes)); |
| 842 | 875 |
| 843 if (lineout2_diff) | 876 if (lineout2_diff) |
| 844 » » snd_soc_dapm_add_routes(codec, | 877 » » snd_soc_dapm_add_routes(dapm, |
| 845 lineout2_diff_routes, | 878 lineout2_diff_routes, |
| 846 ARRAY_SIZE(lineout2_diff_routes)); | 879 ARRAY_SIZE(lineout2_diff_routes)); |
| 847 else | 880 else |
| 848 » » snd_soc_dapm_add_routes(codec, | 881 » » snd_soc_dapm_add_routes(dapm, |
| 849 lineout2_se_routes, | 882 lineout2_se_routes, |
| 850 ARRAY_SIZE(lineout2_se_routes)); | 883 ARRAY_SIZE(lineout2_se_routes)); |
| 851 | 884 |
| 852 return 0; | 885 return 0; |
| 853 } | 886 } |
| 854 EXPORT_SYMBOL_GPL(wm_hubs_add_analogue_routes); | 887 EXPORT_SYMBOL_GPL(wm_hubs_add_analogue_routes); |
| 855 | 888 |
| 856 int wm_hubs_handle_analogue_pdata(struct snd_soc_codec *codec, | 889 int wm_hubs_handle_analogue_pdata(struct snd_soc_codec *codec, |
| 857 int lineout1_diff, int lineout2_diff, | 890 int lineout1_diff, int lineout2_diff, |
| 858 int lineout1fb, int lineout2fb, | 891 int lineout1fb, int lineout2fb, |
| 859 int jd_scthr, int jd_thr, int micbias1_lvl, | 892 int jd_scthr, int jd_thr, int micbias1_lvl, |
| 860 int micbias2_lvl) | 893 int micbias2_lvl) |
| 861 { | 894 { |
| 862 if (!lineout1_diff) | 895 if (!lineout1_diff) |
| 863 snd_soc_update_bits(codec, WM8993_LINE_MIXER1, | 896 snd_soc_update_bits(codec, WM8993_LINE_MIXER1, |
| 864 WM8993_LINEOUT1_MODE, | 897 WM8993_LINEOUT1_MODE, |
| 865 WM8993_LINEOUT1_MODE); | 898 WM8993_LINEOUT1_MODE); |
| 866 if (!lineout2_diff) | 899 if (!lineout2_diff) |
| 867 snd_soc_update_bits(codec, WM8993_LINE_MIXER2, | 900 snd_soc_update_bits(codec, WM8993_LINE_MIXER2, |
| 868 WM8993_LINEOUT2_MODE, | 901 WM8993_LINEOUT2_MODE, |
| 869 WM8993_LINEOUT2_MODE); | 902 WM8993_LINEOUT2_MODE); |
| 870 | 903 |
| 871 /* If the line outputs are differential then we aren't presenting | 904 /* If the line outputs are differential then we aren't presenting |
| 872 * VMID as an output and can disable it. | 905 * VMID as an output and can disable it. |
| 873 */ | 906 */ |
| 874 if (lineout1_diff && lineout2_diff) | 907 if (lineout1_diff && lineout2_diff) |
| 875 » » codec->idle_bias_off = 1; | 908 » » codec->dapm.idle_bias_off = 1; |
| 876 | 909 |
| 877 if (lineout1fb) | 910 if (lineout1fb) |
| 878 snd_soc_update_bits(codec, WM8993_ADDITIONAL_CONTROL, | 911 snd_soc_update_bits(codec, WM8993_ADDITIONAL_CONTROL, |
| 879 WM8993_LINEOUT1_FB, WM8993_LINEOUT1_FB); | 912 WM8993_LINEOUT1_FB, WM8993_LINEOUT1_FB); |
| 880 | 913 |
| 881 if (lineout2fb) | 914 if (lineout2fb) |
| 882 snd_soc_update_bits(codec, WM8993_ADDITIONAL_CONTROL, | 915 snd_soc_update_bits(codec, WM8993_ADDITIONAL_CONTROL, |
| 883 WM8993_LINEOUT2_FB, WM8993_LINEOUT2_FB); | 916 WM8993_LINEOUT2_FB, WM8993_LINEOUT2_FB); |
| 884 | 917 |
| 885 snd_soc_update_bits(codec, WM8993_MICBIAS, | 918 snd_soc_update_bits(codec, WM8993_MICBIAS, |
| 886 WM8993_JD_SCTHR_MASK | WM8993_JD_THR_MASK | | 919 WM8993_JD_SCTHR_MASK | WM8993_JD_THR_MASK | |
| 887 WM8993_MICB1_LVL | WM8993_MICB2_LVL, | 920 WM8993_MICB1_LVL | WM8993_MICB2_LVL, |
| 888 jd_scthr << WM8993_JD_SCTHR_SHIFT | | 921 jd_scthr << WM8993_JD_SCTHR_SHIFT | |
| 889 jd_thr << WM8993_JD_THR_SHIFT | | 922 jd_thr << WM8993_JD_THR_SHIFT | |
| 890 micbias1_lvl | | 923 micbias1_lvl | |
| 891 micbias2_lvl << WM8993_MICB2_LVL_SHIFT); | 924 micbias2_lvl << WM8993_MICB2_LVL_SHIFT); |
| 892 | 925 |
| 893 return 0; | 926 return 0; |
| 894 } | 927 } |
| 895 EXPORT_SYMBOL_GPL(wm_hubs_handle_analogue_pdata); | 928 EXPORT_SYMBOL_GPL(wm_hubs_handle_analogue_pdata); |
| 896 | 929 |
| 897 MODULE_DESCRIPTION("Shared support for Wolfson hubs products"); | 930 MODULE_DESCRIPTION("Shared support for Wolfson hubs products"); |
| 898 MODULE_AUTHOR("Mark Brown <broonie@opensource.wolfsonmicro.com>"); | 931 MODULE_AUTHOR("Mark Brown <broonie@opensource.wolfsonmicro.com>"); |
| 899 MODULE_LICENSE("GPL"); | 932 MODULE_LICENSE("GPL"); |
| OLD | NEW |