Commit 8aaa414fadaec2b682168a5c937a3950a77956bf
Committed by
Mark Brown
1 parent
c9eaa447e7
Exists in
master
and in
13 other branches
ASoC: alc5623: Fix regmap endianness
Commit 0cd257bf9b9b0cbb4fa1a5c988a232506997867c, "ASoC: alc5623: Convert to direct regmap API usage" broke probing of the codec, because of wrong endinness of the ID and codec version read from the device. Fix this by removing the existing flipping of the endiannes, and extracting the codec type byte from the word from the regmap. Signed-off-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Mark Brown <broonie@linaro.org>
Showing 1 changed file with 1 additions and 1 deletions Inline Diff
sound/soc/codecs/alc5623.c
1 | /* | 1 | /* |
2 | * alc5623.c -- alc562[123] ALSA Soc Audio driver | 2 | * alc5623.c -- alc562[123] ALSA Soc Audio driver |
3 | * | 3 | * |
4 | * Copyright 2008 Realtek Microelectronics | 4 | * Copyright 2008 Realtek Microelectronics |
5 | * Author: flove <flove@realtek.com> Ethan <eku@marvell.com> | 5 | * Author: flove <flove@realtek.com> Ethan <eku@marvell.com> |
6 | * | 6 | * |
7 | * Copyright 2010 Arnaud Patard <arnaud.patard@rtp-net.org> | 7 | * Copyright 2010 Arnaud Patard <arnaud.patard@rtp-net.org> |
8 | * | 8 | * |
9 | * | 9 | * |
10 | * Based on WM8753.c | 10 | * Based on WM8753.c |
11 | * | 11 | * |
12 | * This program is free software; you can redistribute it and/or modify | 12 | * This program is free software; you can redistribute it and/or modify |
13 | * it under the terms of the GNU General Public License version 2 as | 13 | * it under the terms of the GNU General Public License version 2 as |
14 | * published by the Free Software Foundation. | 14 | * published by the Free Software Foundation. |
15 | * | 15 | * |
16 | */ | 16 | */ |
17 | 17 | ||
18 | #include <linux/module.h> | 18 | #include <linux/module.h> |
19 | #include <linux/kernel.h> | 19 | #include <linux/kernel.h> |
20 | #include <linux/init.h> | 20 | #include <linux/init.h> |
21 | #include <linux/delay.h> | 21 | #include <linux/delay.h> |
22 | #include <linux/pm.h> | 22 | #include <linux/pm.h> |
23 | #include <linux/i2c.h> | 23 | #include <linux/i2c.h> |
24 | #include <linux/regmap.h> | 24 | #include <linux/regmap.h> |
25 | #include <linux/slab.h> | 25 | #include <linux/slab.h> |
26 | #include <sound/core.h> | 26 | #include <sound/core.h> |
27 | #include <sound/pcm.h> | 27 | #include <sound/pcm.h> |
28 | #include <sound/pcm_params.h> | 28 | #include <sound/pcm_params.h> |
29 | #include <sound/tlv.h> | 29 | #include <sound/tlv.h> |
30 | #include <sound/soc.h> | 30 | #include <sound/soc.h> |
31 | #include <sound/initval.h> | 31 | #include <sound/initval.h> |
32 | #include <sound/alc5623.h> | 32 | #include <sound/alc5623.h> |
33 | 33 | ||
34 | #include "alc5623.h" | 34 | #include "alc5623.h" |
35 | 35 | ||
36 | static int caps_charge = 2000; | 36 | static int caps_charge = 2000; |
37 | module_param(caps_charge, int, 0); | 37 | module_param(caps_charge, int, 0); |
38 | MODULE_PARM_DESC(caps_charge, "ALC5623 cap charge time (msecs)"); | 38 | MODULE_PARM_DESC(caps_charge, "ALC5623 cap charge time (msecs)"); |
39 | 39 | ||
40 | /* codec private data */ | 40 | /* codec private data */ |
41 | struct alc5623_priv { | 41 | struct alc5623_priv { |
42 | struct regmap *regmap; | 42 | struct regmap *regmap; |
43 | u8 id; | 43 | u8 id; |
44 | unsigned int sysclk; | 44 | unsigned int sysclk; |
45 | unsigned int add_ctrl; | 45 | unsigned int add_ctrl; |
46 | unsigned int jack_det_ctrl; | 46 | unsigned int jack_det_ctrl; |
47 | }; | 47 | }; |
48 | 48 | ||
49 | static inline int alc5623_reset(struct snd_soc_codec *codec) | 49 | static inline int alc5623_reset(struct snd_soc_codec *codec) |
50 | { | 50 | { |
51 | return snd_soc_write(codec, ALC5623_RESET, 0); | 51 | return snd_soc_write(codec, ALC5623_RESET, 0); |
52 | } | 52 | } |
53 | 53 | ||
54 | static int amp_mixer_event(struct snd_soc_dapm_widget *w, | 54 | static int amp_mixer_event(struct snd_soc_dapm_widget *w, |
55 | struct snd_kcontrol *kcontrol, int event) | 55 | struct snd_kcontrol *kcontrol, int event) |
56 | { | 56 | { |
57 | /* to power-on/off class-d amp generators/speaker */ | 57 | /* to power-on/off class-d amp generators/speaker */ |
58 | /* need to write to 'index-46h' register : */ | 58 | /* need to write to 'index-46h' register : */ |
59 | /* so write index num (here 0x46) to reg 0x6a */ | 59 | /* so write index num (here 0x46) to reg 0x6a */ |
60 | /* and then 0xffff/0 to reg 0x6c */ | 60 | /* and then 0xffff/0 to reg 0x6c */ |
61 | snd_soc_write(w->codec, ALC5623_HID_CTRL_INDEX, 0x46); | 61 | snd_soc_write(w->codec, ALC5623_HID_CTRL_INDEX, 0x46); |
62 | 62 | ||
63 | switch (event) { | 63 | switch (event) { |
64 | case SND_SOC_DAPM_PRE_PMU: | 64 | case SND_SOC_DAPM_PRE_PMU: |
65 | snd_soc_write(w->codec, ALC5623_HID_CTRL_DATA, 0xFFFF); | 65 | snd_soc_write(w->codec, ALC5623_HID_CTRL_DATA, 0xFFFF); |
66 | break; | 66 | break; |
67 | case SND_SOC_DAPM_POST_PMD: | 67 | case SND_SOC_DAPM_POST_PMD: |
68 | snd_soc_write(w->codec, ALC5623_HID_CTRL_DATA, 0); | 68 | snd_soc_write(w->codec, ALC5623_HID_CTRL_DATA, 0); |
69 | break; | 69 | break; |
70 | } | 70 | } |
71 | 71 | ||
72 | return 0; | 72 | return 0; |
73 | } | 73 | } |
74 | 74 | ||
75 | /* | 75 | /* |
76 | * ALC5623 Controls | 76 | * ALC5623 Controls |
77 | */ | 77 | */ |
78 | 78 | ||
79 | static const DECLARE_TLV_DB_SCALE(vol_tlv, -3450, 150, 0); | 79 | static const DECLARE_TLV_DB_SCALE(vol_tlv, -3450, 150, 0); |
80 | static const DECLARE_TLV_DB_SCALE(hp_tlv, -4650, 150, 0); | 80 | static const DECLARE_TLV_DB_SCALE(hp_tlv, -4650, 150, 0); |
81 | static const DECLARE_TLV_DB_SCALE(adc_rec_tlv, -1650, 150, 0); | 81 | static const DECLARE_TLV_DB_SCALE(adc_rec_tlv, -1650, 150, 0); |
82 | static const unsigned int boost_tlv[] = { | 82 | static const unsigned int boost_tlv[] = { |
83 | TLV_DB_RANGE_HEAD(3), | 83 | TLV_DB_RANGE_HEAD(3), |
84 | 0, 0, TLV_DB_SCALE_ITEM(0, 0, 0), | 84 | 0, 0, TLV_DB_SCALE_ITEM(0, 0, 0), |
85 | 1, 1, TLV_DB_SCALE_ITEM(2000, 0, 0), | 85 | 1, 1, TLV_DB_SCALE_ITEM(2000, 0, 0), |
86 | 2, 2, TLV_DB_SCALE_ITEM(3000, 0, 0), | 86 | 2, 2, TLV_DB_SCALE_ITEM(3000, 0, 0), |
87 | }; | 87 | }; |
88 | static const DECLARE_TLV_DB_SCALE(dig_tlv, 0, 600, 0); | 88 | static const DECLARE_TLV_DB_SCALE(dig_tlv, 0, 600, 0); |
89 | 89 | ||
90 | static const struct snd_kcontrol_new alc5621_vol_snd_controls[] = { | 90 | static const struct snd_kcontrol_new alc5621_vol_snd_controls[] = { |
91 | SOC_DOUBLE_TLV("Speaker Playback Volume", | 91 | SOC_DOUBLE_TLV("Speaker Playback Volume", |
92 | ALC5623_SPK_OUT_VOL, 8, 0, 31, 1, hp_tlv), | 92 | ALC5623_SPK_OUT_VOL, 8, 0, 31, 1, hp_tlv), |
93 | SOC_DOUBLE("Speaker Playback Switch", | 93 | SOC_DOUBLE("Speaker Playback Switch", |
94 | ALC5623_SPK_OUT_VOL, 15, 7, 1, 1), | 94 | ALC5623_SPK_OUT_VOL, 15, 7, 1, 1), |
95 | SOC_DOUBLE_TLV("Headphone Playback Volume", | 95 | SOC_DOUBLE_TLV("Headphone Playback Volume", |
96 | ALC5623_HP_OUT_VOL, 8, 0, 31, 1, hp_tlv), | 96 | ALC5623_HP_OUT_VOL, 8, 0, 31, 1, hp_tlv), |
97 | SOC_DOUBLE("Headphone Playback Switch", | 97 | SOC_DOUBLE("Headphone Playback Switch", |
98 | ALC5623_HP_OUT_VOL, 15, 7, 1, 1), | 98 | ALC5623_HP_OUT_VOL, 15, 7, 1, 1), |
99 | }; | 99 | }; |
100 | 100 | ||
101 | static const struct snd_kcontrol_new alc5622_vol_snd_controls[] = { | 101 | static const struct snd_kcontrol_new alc5622_vol_snd_controls[] = { |
102 | SOC_DOUBLE_TLV("Speaker Playback Volume", | 102 | SOC_DOUBLE_TLV("Speaker Playback Volume", |
103 | ALC5623_SPK_OUT_VOL, 8, 0, 31, 1, hp_tlv), | 103 | ALC5623_SPK_OUT_VOL, 8, 0, 31, 1, hp_tlv), |
104 | SOC_DOUBLE("Speaker Playback Switch", | 104 | SOC_DOUBLE("Speaker Playback Switch", |
105 | ALC5623_SPK_OUT_VOL, 15, 7, 1, 1), | 105 | ALC5623_SPK_OUT_VOL, 15, 7, 1, 1), |
106 | SOC_DOUBLE_TLV("Line Playback Volume", | 106 | SOC_DOUBLE_TLV("Line Playback Volume", |
107 | ALC5623_HP_OUT_VOL, 8, 0, 31, 1, hp_tlv), | 107 | ALC5623_HP_OUT_VOL, 8, 0, 31, 1, hp_tlv), |
108 | SOC_DOUBLE("Line Playback Switch", | 108 | SOC_DOUBLE("Line Playback Switch", |
109 | ALC5623_HP_OUT_VOL, 15, 7, 1, 1), | 109 | ALC5623_HP_OUT_VOL, 15, 7, 1, 1), |
110 | }; | 110 | }; |
111 | 111 | ||
112 | static const struct snd_kcontrol_new alc5623_vol_snd_controls[] = { | 112 | static const struct snd_kcontrol_new alc5623_vol_snd_controls[] = { |
113 | SOC_DOUBLE_TLV("Line Playback Volume", | 113 | SOC_DOUBLE_TLV("Line Playback Volume", |
114 | ALC5623_SPK_OUT_VOL, 8, 0, 31, 1, hp_tlv), | 114 | ALC5623_SPK_OUT_VOL, 8, 0, 31, 1, hp_tlv), |
115 | SOC_DOUBLE("Line Playback Switch", | 115 | SOC_DOUBLE("Line Playback Switch", |
116 | ALC5623_SPK_OUT_VOL, 15, 7, 1, 1), | 116 | ALC5623_SPK_OUT_VOL, 15, 7, 1, 1), |
117 | SOC_DOUBLE_TLV("Headphone Playback Volume", | 117 | SOC_DOUBLE_TLV("Headphone Playback Volume", |
118 | ALC5623_HP_OUT_VOL, 8, 0, 31, 1, hp_tlv), | 118 | ALC5623_HP_OUT_VOL, 8, 0, 31, 1, hp_tlv), |
119 | SOC_DOUBLE("Headphone Playback Switch", | 119 | SOC_DOUBLE("Headphone Playback Switch", |
120 | ALC5623_HP_OUT_VOL, 15, 7, 1, 1), | 120 | ALC5623_HP_OUT_VOL, 15, 7, 1, 1), |
121 | }; | 121 | }; |
122 | 122 | ||
123 | static const struct snd_kcontrol_new alc5623_snd_controls[] = { | 123 | static const struct snd_kcontrol_new alc5623_snd_controls[] = { |
124 | SOC_DOUBLE_TLV("Auxout Playback Volume", | 124 | SOC_DOUBLE_TLV("Auxout Playback Volume", |
125 | ALC5623_MONO_AUX_OUT_VOL, 8, 0, 31, 1, hp_tlv), | 125 | ALC5623_MONO_AUX_OUT_VOL, 8, 0, 31, 1, hp_tlv), |
126 | SOC_DOUBLE("Auxout Playback Switch", | 126 | SOC_DOUBLE("Auxout Playback Switch", |
127 | ALC5623_MONO_AUX_OUT_VOL, 15, 7, 1, 1), | 127 | ALC5623_MONO_AUX_OUT_VOL, 15, 7, 1, 1), |
128 | SOC_DOUBLE_TLV("PCM Playback Volume", | 128 | SOC_DOUBLE_TLV("PCM Playback Volume", |
129 | ALC5623_STEREO_DAC_VOL, 8, 0, 31, 1, vol_tlv), | 129 | ALC5623_STEREO_DAC_VOL, 8, 0, 31, 1, vol_tlv), |
130 | SOC_DOUBLE_TLV("AuxI Capture Volume", | 130 | SOC_DOUBLE_TLV("AuxI Capture Volume", |
131 | ALC5623_AUXIN_VOL, 8, 0, 31, 1, vol_tlv), | 131 | ALC5623_AUXIN_VOL, 8, 0, 31, 1, vol_tlv), |
132 | SOC_DOUBLE_TLV("LineIn Capture Volume", | 132 | SOC_DOUBLE_TLV("LineIn Capture Volume", |
133 | ALC5623_LINE_IN_VOL, 8, 0, 31, 1, vol_tlv), | 133 | ALC5623_LINE_IN_VOL, 8, 0, 31, 1, vol_tlv), |
134 | SOC_SINGLE_TLV("Mic1 Capture Volume", | 134 | SOC_SINGLE_TLV("Mic1 Capture Volume", |
135 | ALC5623_MIC_VOL, 8, 31, 1, vol_tlv), | 135 | ALC5623_MIC_VOL, 8, 31, 1, vol_tlv), |
136 | SOC_SINGLE_TLV("Mic2 Capture Volume", | 136 | SOC_SINGLE_TLV("Mic2 Capture Volume", |
137 | ALC5623_MIC_VOL, 0, 31, 1, vol_tlv), | 137 | ALC5623_MIC_VOL, 0, 31, 1, vol_tlv), |
138 | SOC_DOUBLE_TLV("Rec Capture Volume", | 138 | SOC_DOUBLE_TLV("Rec Capture Volume", |
139 | ALC5623_ADC_REC_GAIN, 7, 0, 31, 0, adc_rec_tlv), | 139 | ALC5623_ADC_REC_GAIN, 7, 0, 31, 0, adc_rec_tlv), |
140 | SOC_SINGLE_TLV("Mic 1 Boost Volume", | 140 | SOC_SINGLE_TLV("Mic 1 Boost Volume", |
141 | ALC5623_MIC_CTRL, 10, 2, 0, boost_tlv), | 141 | ALC5623_MIC_CTRL, 10, 2, 0, boost_tlv), |
142 | SOC_SINGLE_TLV("Mic 2 Boost Volume", | 142 | SOC_SINGLE_TLV("Mic 2 Boost Volume", |
143 | ALC5623_MIC_CTRL, 8, 2, 0, boost_tlv), | 143 | ALC5623_MIC_CTRL, 8, 2, 0, boost_tlv), |
144 | SOC_SINGLE_TLV("Digital Boost Volume", | 144 | SOC_SINGLE_TLV("Digital Boost Volume", |
145 | ALC5623_ADD_CTRL_REG, 4, 3, 0, dig_tlv), | 145 | ALC5623_ADD_CTRL_REG, 4, 3, 0, dig_tlv), |
146 | }; | 146 | }; |
147 | 147 | ||
148 | /* | 148 | /* |
149 | * DAPM Controls | 149 | * DAPM Controls |
150 | */ | 150 | */ |
151 | static const struct snd_kcontrol_new alc5623_hp_mixer_controls[] = { | 151 | static const struct snd_kcontrol_new alc5623_hp_mixer_controls[] = { |
152 | SOC_DAPM_SINGLE("LI2HP Playback Switch", ALC5623_LINE_IN_VOL, 15, 1, 1), | 152 | SOC_DAPM_SINGLE("LI2HP Playback Switch", ALC5623_LINE_IN_VOL, 15, 1, 1), |
153 | SOC_DAPM_SINGLE("AUXI2HP Playback Switch", ALC5623_AUXIN_VOL, 15, 1, 1), | 153 | SOC_DAPM_SINGLE("AUXI2HP Playback Switch", ALC5623_AUXIN_VOL, 15, 1, 1), |
154 | SOC_DAPM_SINGLE("MIC12HP Playback Switch", ALC5623_MIC_ROUTING_CTRL, 15, 1, 1), | 154 | SOC_DAPM_SINGLE("MIC12HP Playback Switch", ALC5623_MIC_ROUTING_CTRL, 15, 1, 1), |
155 | SOC_DAPM_SINGLE("MIC22HP Playback Switch", ALC5623_MIC_ROUTING_CTRL, 7, 1, 1), | 155 | SOC_DAPM_SINGLE("MIC22HP Playback Switch", ALC5623_MIC_ROUTING_CTRL, 7, 1, 1), |
156 | SOC_DAPM_SINGLE("DAC2HP Playback Switch", ALC5623_STEREO_DAC_VOL, 15, 1, 1), | 156 | SOC_DAPM_SINGLE("DAC2HP Playback Switch", ALC5623_STEREO_DAC_VOL, 15, 1, 1), |
157 | }; | 157 | }; |
158 | 158 | ||
159 | static const struct snd_kcontrol_new alc5623_hpl_mixer_controls[] = { | 159 | static const struct snd_kcontrol_new alc5623_hpl_mixer_controls[] = { |
160 | SOC_DAPM_SINGLE("ADC2HP_L Playback Switch", ALC5623_ADC_REC_GAIN, 15, 1, 1), | 160 | SOC_DAPM_SINGLE("ADC2HP_L Playback Switch", ALC5623_ADC_REC_GAIN, 15, 1, 1), |
161 | }; | 161 | }; |
162 | 162 | ||
163 | static const struct snd_kcontrol_new alc5623_hpr_mixer_controls[] = { | 163 | static const struct snd_kcontrol_new alc5623_hpr_mixer_controls[] = { |
164 | SOC_DAPM_SINGLE("ADC2HP_R Playback Switch", ALC5623_ADC_REC_GAIN, 14, 1, 1), | 164 | SOC_DAPM_SINGLE("ADC2HP_R Playback Switch", ALC5623_ADC_REC_GAIN, 14, 1, 1), |
165 | }; | 165 | }; |
166 | 166 | ||
167 | static const struct snd_kcontrol_new alc5623_mono_mixer_controls[] = { | 167 | static const struct snd_kcontrol_new alc5623_mono_mixer_controls[] = { |
168 | SOC_DAPM_SINGLE("ADC2MONO_L Playback Switch", ALC5623_ADC_REC_GAIN, 13, 1, 1), | 168 | SOC_DAPM_SINGLE("ADC2MONO_L Playback Switch", ALC5623_ADC_REC_GAIN, 13, 1, 1), |
169 | SOC_DAPM_SINGLE("ADC2MONO_R Playback Switch", ALC5623_ADC_REC_GAIN, 12, 1, 1), | 169 | SOC_DAPM_SINGLE("ADC2MONO_R Playback Switch", ALC5623_ADC_REC_GAIN, 12, 1, 1), |
170 | SOC_DAPM_SINGLE("LI2MONO Playback Switch", ALC5623_LINE_IN_VOL, 13, 1, 1), | 170 | SOC_DAPM_SINGLE("LI2MONO Playback Switch", ALC5623_LINE_IN_VOL, 13, 1, 1), |
171 | SOC_DAPM_SINGLE("AUXI2MONO Playback Switch", ALC5623_AUXIN_VOL, 13, 1, 1), | 171 | SOC_DAPM_SINGLE("AUXI2MONO Playback Switch", ALC5623_AUXIN_VOL, 13, 1, 1), |
172 | SOC_DAPM_SINGLE("MIC12MONO Playback Switch", ALC5623_MIC_ROUTING_CTRL, 13, 1, 1), | 172 | SOC_DAPM_SINGLE("MIC12MONO Playback Switch", ALC5623_MIC_ROUTING_CTRL, 13, 1, 1), |
173 | SOC_DAPM_SINGLE("MIC22MONO Playback Switch", ALC5623_MIC_ROUTING_CTRL, 5, 1, 1), | 173 | SOC_DAPM_SINGLE("MIC22MONO Playback Switch", ALC5623_MIC_ROUTING_CTRL, 5, 1, 1), |
174 | SOC_DAPM_SINGLE("DAC2MONO Playback Switch", ALC5623_STEREO_DAC_VOL, 13, 1, 1), | 174 | SOC_DAPM_SINGLE("DAC2MONO Playback Switch", ALC5623_STEREO_DAC_VOL, 13, 1, 1), |
175 | }; | 175 | }; |
176 | 176 | ||
177 | static const struct snd_kcontrol_new alc5623_speaker_mixer_controls[] = { | 177 | static const struct snd_kcontrol_new alc5623_speaker_mixer_controls[] = { |
178 | SOC_DAPM_SINGLE("LI2SPK Playback Switch", ALC5623_LINE_IN_VOL, 14, 1, 1), | 178 | SOC_DAPM_SINGLE("LI2SPK Playback Switch", ALC5623_LINE_IN_VOL, 14, 1, 1), |
179 | SOC_DAPM_SINGLE("AUXI2SPK Playback Switch", ALC5623_AUXIN_VOL, 14, 1, 1), | 179 | SOC_DAPM_SINGLE("AUXI2SPK Playback Switch", ALC5623_AUXIN_VOL, 14, 1, 1), |
180 | SOC_DAPM_SINGLE("MIC12SPK Playback Switch", ALC5623_MIC_ROUTING_CTRL, 14, 1, 1), | 180 | SOC_DAPM_SINGLE("MIC12SPK Playback Switch", ALC5623_MIC_ROUTING_CTRL, 14, 1, 1), |
181 | SOC_DAPM_SINGLE("MIC22SPK Playback Switch", ALC5623_MIC_ROUTING_CTRL, 6, 1, 1), | 181 | SOC_DAPM_SINGLE("MIC22SPK Playback Switch", ALC5623_MIC_ROUTING_CTRL, 6, 1, 1), |
182 | SOC_DAPM_SINGLE("DAC2SPK Playback Switch", ALC5623_STEREO_DAC_VOL, 14, 1, 1), | 182 | SOC_DAPM_SINGLE("DAC2SPK Playback Switch", ALC5623_STEREO_DAC_VOL, 14, 1, 1), |
183 | }; | 183 | }; |
184 | 184 | ||
185 | /* Left Record Mixer */ | 185 | /* Left Record Mixer */ |
186 | static const struct snd_kcontrol_new alc5623_captureL_mixer_controls[] = { | 186 | static const struct snd_kcontrol_new alc5623_captureL_mixer_controls[] = { |
187 | SOC_DAPM_SINGLE("Mic1 Capture Switch", ALC5623_ADC_REC_MIXER, 14, 1, 1), | 187 | SOC_DAPM_SINGLE("Mic1 Capture Switch", ALC5623_ADC_REC_MIXER, 14, 1, 1), |
188 | SOC_DAPM_SINGLE("Mic2 Capture Switch", ALC5623_ADC_REC_MIXER, 13, 1, 1), | 188 | SOC_DAPM_SINGLE("Mic2 Capture Switch", ALC5623_ADC_REC_MIXER, 13, 1, 1), |
189 | SOC_DAPM_SINGLE("LineInL Capture Switch", ALC5623_ADC_REC_MIXER, 12, 1, 1), | 189 | SOC_DAPM_SINGLE("LineInL Capture Switch", ALC5623_ADC_REC_MIXER, 12, 1, 1), |
190 | SOC_DAPM_SINGLE("Left AuxI Capture Switch", ALC5623_ADC_REC_MIXER, 11, 1, 1), | 190 | SOC_DAPM_SINGLE("Left AuxI Capture Switch", ALC5623_ADC_REC_MIXER, 11, 1, 1), |
191 | SOC_DAPM_SINGLE("HPMixerL Capture Switch", ALC5623_ADC_REC_MIXER, 10, 1, 1), | 191 | SOC_DAPM_SINGLE("HPMixerL Capture Switch", ALC5623_ADC_REC_MIXER, 10, 1, 1), |
192 | SOC_DAPM_SINGLE("SPKMixer Capture Switch", ALC5623_ADC_REC_MIXER, 9, 1, 1), | 192 | SOC_DAPM_SINGLE("SPKMixer Capture Switch", ALC5623_ADC_REC_MIXER, 9, 1, 1), |
193 | SOC_DAPM_SINGLE("MonoMixer Capture Switch", ALC5623_ADC_REC_MIXER, 8, 1, 1), | 193 | SOC_DAPM_SINGLE("MonoMixer Capture Switch", ALC5623_ADC_REC_MIXER, 8, 1, 1), |
194 | }; | 194 | }; |
195 | 195 | ||
196 | /* Right Record Mixer */ | 196 | /* Right Record Mixer */ |
197 | static const struct snd_kcontrol_new alc5623_captureR_mixer_controls[] = { | 197 | static const struct snd_kcontrol_new alc5623_captureR_mixer_controls[] = { |
198 | SOC_DAPM_SINGLE("Mic1 Capture Switch", ALC5623_ADC_REC_MIXER, 6, 1, 1), | 198 | SOC_DAPM_SINGLE("Mic1 Capture Switch", ALC5623_ADC_REC_MIXER, 6, 1, 1), |
199 | SOC_DAPM_SINGLE("Mic2 Capture Switch", ALC5623_ADC_REC_MIXER, 5, 1, 1), | 199 | SOC_DAPM_SINGLE("Mic2 Capture Switch", ALC5623_ADC_REC_MIXER, 5, 1, 1), |
200 | SOC_DAPM_SINGLE("LineInR Capture Switch", ALC5623_ADC_REC_MIXER, 4, 1, 1), | 200 | SOC_DAPM_SINGLE("LineInR Capture Switch", ALC5623_ADC_REC_MIXER, 4, 1, 1), |
201 | SOC_DAPM_SINGLE("Right AuxI Capture Switch", ALC5623_ADC_REC_MIXER, 3, 1, 1), | 201 | SOC_DAPM_SINGLE("Right AuxI Capture Switch", ALC5623_ADC_REC_MIXER, 3, 1, 1), |
202 | SOC_DAPM_SINGLE("HPMixerR Capture Switch", ALC5623_ADC_REC_MIXER, 2, 1, 1), | 202 | SOC_DAPM_SINGLE("HPMixerR Capture Switch", ALC5623_ADC_REC_MIXER, 2, 1, 1), |
203 | SOC_DAPM_SINGLE("SPKMixer Capture Switch", ALC5623_ADC_REC_MIXER, 1, 1, 1), | 203 | SOC_DAPM_SINGLE("SPKMixer Capture Switch", ALC5623_ADC_REC_MIXER, 1, 1, 1), |
204 | SOC_DAPM_SINGLE("MonoMixer Capture Switch", ALC5623_ADC_REC_MIXER, 0, 1, 1), | 204 | SOC_DAPM_SINGLE("MonoMixer Capture Switch", ALC5623_ADC_REC_MIXER, 0, 1, 1), |
205 | }; | 205 | }; |
206 | 206 | ||
207 | static const char *alc5623_spk_n_sour_sel[] = { | 207 | static const char *alc5623_spk_n_sour_sel[] = { |
208 | "RN/-R", "RP/+R", "LN/-R", "Vmid" }; | 208 | "RN/-R", "RP/+R", "LN/-R", "Vmid" }; |
209 | static const char *alc5623_hpl_out_input_sel[] = { | 209 | static const char *alc5623_hpl_out_input_sel[] = { |
210 | "Vmid", "HP Left Mix"}; | 210 | "Vmid", "HP Left Mix"}; |
211 | static const char *alc5623_hpr_out_input_sel[] = { | 211 | static const char *alc5623_hpr_out_input_sel[] = { |
212 | "Vmid", "HP Right Mix"}; | 212 | "Vmid", "HP Right Mix"}; |
213 | static const char *alc5623_spkout_input_sel[] = { | 213 | static const char *alc5623_spkout_input_sel[] = { |
214 | "Vmid", "HPOut Mix", "Speaker Mix", "Mono Mix"}; | 214 | "Vmid", "HPOut Mix", "Speaker Mix", "Mono Mix"}; |
215 | static const char *alc5623_aux_out_input_sel[] = { | 215 | static const char *alc5623_aux_out_input_sel[] = { |
216 | "Vmid", "HPOut Mix", "Speaker Mix", "Mono Mix"}; | 216 | "Vmid", "HPOut Mix", "Speaker Mix", "Mono Mix"}; |
217 | 217 | ||
218 | /* auxout output mux */ | 218 | /* auxout output mux */ |
219 | static SOC_ENUM_SINGLE_DECL(alc5623_aux_out_input_enum, | 219 | static SOC_ENUM_SINGLE_DECL(alc5623_aux_out_input_enum, |
220 | ALC5623_OUTPUT_MIXER_CTRL, 6, | 220 | ALC5623_OUTPUT_MIXER_CTRL, 6, |
221 | alc5623_aux_out_input_sel); | 221 | alc5623_aux_out_input_sel); |
222 | static const struct snd_kcontrol_new alc5623_auxout_mux_controls = | 222 | static const struct snd_kcontrol_new alc5623_auxout_mux_controls = |
223 | SOC_DAPM_ENUM("Route", alc5623_aux_out_input_enum); | 223 | SOC_DAPM_ENUM("Route", alc5623_aux_out_input_enum); |
224 | 224 | ||
225 | /* speaker output mux */ | 225 | /* speaker output mux */ |
226 | static SOC_ENUM_SINGLE_DECL(alc5623_spkout_input_enum, | 226 | static SOC_ENUM_SINGLE_DECL(alc5623_spkout_input_enum, |
227 | ALC5623_OUTPUT_MIXER_CTRL, 10, | 227 | ALC5623_OUTPUT_MIXER_CTRL, 10, |
228 | alc5623_spkout_input_sel); | 228 | alc5623_spkout_input_sel); |
229 | static const struct snd_kcontrol_new alc5623_spkout_mux_controls = | 229 | static const struct snd_kcontrol_new alc5623_spkout_mux_controls = |
230 | SOC_DAPM_ENUM("Route", alc5623_spkout_input_enum); | 230 | SOC_DAPM_ENUM("Route", alc5623_spkout_input_enum); |
231 | 231 | ||
232 | /* headphone left output mux */ | 232 | /* headphone left output mux */ |
233 | static SOC_ENUM_SINGLE_DECL(alc5623_hpl_out_input_enum, | 233 | static SOC_ENUM_SINGLE_DECL(alc5623_hpl_out_input_enum, |
234 | ALC5623_OUTPUT_MIXER_CTRL, 9, | 234 | ALC5623_OUTPUT_MIXER_CTRL, 9, |
235 | alc5623_hpl_out_input_sel); | 235 | alc5623_hpl_out_input_sel); |
236 | static const struct snd_kcontrol_new alc5623_hpl_out_mux_controls = | 236 | static const struct snd_kcontrol_new alc5623_hpl_out_mux_controls = |
237 | SOC_DAPM_ENUM("Route", alc5623_hpl_out_input_enum); | 237 | SOC_DAPM_ENUM("Route", alc5623_hpl_out_input_enum); |
238 | 238 | ||
239 | /* headphone right output mux */ | 239 | /* headphone right output mux */ |
240 | static SOC_ENUM_SINGLE_DECL(alc5623_hpr_out_input_enum, | 240 | static SOC_ENUM_SINGLE_DECL(alc5623_hpr_out_input_enum, |
241 | ALC5623_OUTPUT_MIXER_CTRL, 8, | 241 | ALC5623_OUTPUT_MIXER_CTRL, 8, |
242 | alc5623_hpr_out_input_sel); | 242 | alc5623_hpr_out_input_sel); |
243 | static const struct snd_kcontrol_new alc5623_hpr_out_mux_controls = | 243 | static const struct snd_kcontrol_new alc5623_hpr_out_mux_controls = |
244 | SOC_DAPM_ENUM("Route", alc5623_hpr_out_input_enum); | 244 | SOC_DAPM_ENUM("Route", alc5623_hpr_out_input_enum); |
245 | 245 | ||
246 | /* speaker output N select */ | 246 | /* speaker output N select */ |
247 | static SOC_ENUM_SINGLE_DECL(alc5623_spk_n_sour_enum, | 247 | static SOC_ENUM_SINGLE_DECL(alc5623_spk_n_sour_enum, |
248 | ALC5623_OUTPUT_MIXER_CTRL, 14, | 248 | ALC5623_OUTPUT_MIXER_CTRL, 14, |
249 | alc5623_spk_n_sour_sel); | 249 | alc5623_spk_n_sour_sel); |
250 | static const struct snd_kcontrol_new alc5623_spkoutn_mux_controls = | 250 | static const struct snd_kcontrol_new alc5623_spkoutn_mux_controls = |
251 | SOC_DAPM_ENUM("Route", alc5623_spk_n_sour_enum); | 251 | SOC_DAPM_ENUM("Route", alc5623_spk_n_sour_enum); |
252 | 252 | ||
253 | static const struct snd_soc_dapm_widget alc5623_dapm_widgets[] = { | 253 | static const struct snd_soc_dapm_widget alc5623_dapm_widgets[] = { |
254 | /* Muxes */ | 254 | /* Muxes */ |
255 | SND_SOC_DAPM_MUX("AuxOut Mux", SND_SOC_NOPM, 0, 0, | 255 | SND_SOC_DAPM_MUX("AuxOut Mux", SND_SOC_NOPM, 0, 0, |
256 | &alc5623_auxout_mux_controls), | 256 | &alc5623_auxout_mux_controls), |
257 | SND_SOC_DAPM_MUX("SpeakerOut Mux", SND_SOC_NOPM, 0, 0, | 257 | SND_SOC_DAPM_MUX("SpeakerOut Mux", SND_SOC_NOPM, 0, 0, |
258 | &alc5623_spkout_mux_controls), | 258 | &alc5623_spkout_mux_controls), |
259 | SND_SOC_DAPM_MUX("Left Headphone Mux", SND_SOC_NOPM, 0, 0, | 259 | SND_SOC_DAPM_MUX("Left Headphone Mux", SND_SOC_NOPM, 0, 0, |
260 | &alc5623_hpl_out_mux_controls), | 260 | &alc5623_hpl_out_mux_controls), |
261 | SND_SOC_DAPM_MUX("Right Headphone Mux", SND_SOC_NOPM, 0, 0, | 261 | SND_SOC_DAPM_MUX("Right Headphone Mux", SND_SOC_NOPM, 0, 0, |
262 | &alc5623_hpr_out_mux_controls), | 262 | &alc5623_hpr_out_mux_controls), |
263 | SND_SOC_DAPM_MUX("SpeakerOut N Mux", SND_SOC_NOPM, 0, 0, | 263 | SND_SOC_DAPM_MUX("SpeakerOut N Mux", SND_SOC_NOPM, 0, 0, |
264 | &alc5623_spkoutn_mux_controls), | 264 | &alc5623_spkoutn_mux_controls), |
265 | 265 | ||
266 | /* output mixers */ | 266 | /* output mixers */ |
267 | SND_SOC_DAPM_MIXER("HP Mix", SND_SOC_NOPM, 0, 0, | 267 | SND_SOC_DAPM_MIXER("HP Mix", SND_SOC_NOPM, 0, 0, |
268 | &alc5623_hp_mixer_controls[0], | 268 | &alc5623_hp_mixer_controls[0], |
269 | ARRAY_SIZE(alc5623_hp_mixer_controls)), | 269 | ARRAY_SIZE(alc5623_hp_mixer_controls)), |
270 | SND_SOC_DAPM_MIXER("HPR Mix", ALC5623_PWR_MANAG_ADD2, 4, 0, | 270 | SND_SOC_DAPM_MIXER("HPR Mix", ALC5623_PWR_MANAG_ADD2, 4, 0, |
271 | &alc5623_hpr_mixer_controls[0], | 271 | &alc5623_hpr_mixer_controls[0], |
272 | ARRAY_SIZE(alc5623_hpr_mixer_controls)), | 272 | ARRAY_SIZE(alc5623_hpr_mixer_controls)), |
273 | SND_SOC_DAPM_MIXER("HPL Mix", ALC5623_PWR_MANAG_ADD2, 5, 0, | 273 | SND_SOC_DAPM_MIXER("HPL Mix", ALC5623_PWR_MANAG_ADD2, 5, 0, |
274 | &alc5623_hpl_mixer_controls[0], | 274 | &alc5623_hpl_mixer_controls[0], |
275 | ARRAY_SIZE(alc5623_hpl_mixer_controls)), | 275 | ARRAY_SIZE(alc5623_hpl_mixer_controls)), |
276 | SND_SOC_DAPM_MIXER("HPOut Mix", SND_SOC_NOPM, 0, 0, NULL, 0), | 276 | SND_SOC_DAPM_MIXER("HPOut Mix", SND_SOC_NOPM, 0, 0, NULL, 0), |
277 | SND_SOC_DAPM_MIXER("Mono Mix", ALC5623_PWR_MANAG_ADD2, 2, 0, | 277 | SND_SOC_DAPM_MIXER("Mono Mix", ALC5623_PWR_MANAG_ADD2, 2, 0, |
278 | &alc5623_mono_mixer_controls[0], | 278 | &alc5623_mono_mixer_controls[0], |
279 | ARRAY_SIZE(alc5623_mono_mixer_controls)), | 279 | ARRAY_SIZE(alc5623_mono_mixer_controls)), |
280 | SND_SOC_DAPM_MIXER("Speaker Mix", ALC5623_PWR_MANAG_ADD2, 3, 0, | 280 | SND_SOC_DAPM_MIXER("Speaker Mix", ALC5623_PWR_MANAG_ADD2, 3, 0, |
281 | &alc5623_speaker_mixer_controls[0], | 281 | &alc5623_speaker_mixer_controls[0], |
282 | ARRAY_SIZE(alc5623_speaker_mixer_controls)), | 282 | ARRAY_SIZE(alc5623_speaker_mixer_controls)), |
283 | 283 | ||
284 | /* input mixers */ | 284 | /* input mixers */ |
285 | SND_SOC_DAPM_MIXER("Left Capture Mix", ALC5623_PWR_MANAG_ADD2, 1, 0, | 285 | SND_SOC_DAPM_MIXER("Left Capture Mix", ALC5623_PWR_MANAG_ADD2, 1, 0, |
286 | &alc5623_captureL_mixer_controls[0], | 286 | &alc5623_captureL_mixer_controls[0], |
287 | ARRAY_SIZE(alc5623_captureL_mixer_controls)), | 287 | ARRAY_SIZE(alc5623_captureL_mixer_controls)), |
288 | SND_SOC_DAPM_MIXER("Right Capture Mix", ALC5623_PWR_MANAG_ADD2, 0, 0, | 288 | SND_SOC_DAPM_MIXER("Right Capture Mix", ALC5623_PWR_MANAG_ADD2, 0, 0, |
289 | &alc5623_captureR_mixer_controls[0], | 289 | &alc5623_captureR_mixer_controls[0], |
290 | ARRAY_SIZE(alc5623_captureR_mixer_controls)), | 290 | ARRAY_SIZE(alc5623_captureR_mixer_controls)), |
291 | 291 | ||
292 | SND_SOC_DAPM_DAC("Left DAC", "Left HiFi Playback", | 292 | SND_SOC_DAPM_DAC("Left DAC", "Left HiFi Playback", |
293 | ALC5623_PWR_MANAG_ADD2, 9, 0), | 293 | ALC5623_PWR_MANAG_ADD2, 9, 0), |
294 | SND_SOC_DAPM_DAC("Right DAC", "Right HiFi Playback", | 294 | SND_SOC_DAPM_DAC("Right DAC", "Right HiFi Playback", |
295 | ALC5623_PWR_MANAG_ADD2, 8, 0), | 295 | ALC5623_PWR_MANAG_ADD2, 8, 0), |
296 | SND_SOC_DAPM_MIXER("I2S Mix", ALC5623_PWR_MANAG_ADD1, 15, 0, NULL, 0), | 296 | SND_SOC_DAPM_MIXER("I2S Mix", ALC5623_PWR_MANAG_ADD1, 15, 0, NULL, 0), |
297 | SND_SOC_DAPM_MIXER("AuxI Mix", SND_SOC_NOPM, 0, 0, NULL, 0), | 297 | SND_SOC_DAPM_MIXER("AuxI Mix", SND_SOC_NOPM, 0, 0, NULL, 0), |
298 | SND_SOC_DAPM_MIXER("Line Mix", SND_SOC_NOPM, 0, 0, NULL, 0), | 298 | SND_SOC_DAPM_MIXER("Line Mix", SND_SOC_NOPM, 0, 0, NULL, 0), |
299 | SND_SOC_DAPM_ADC("Left ADC", "Left HiFi Capture", | 299 | SND_SOC_DAPM_ADC("Left ADC", "Left HiFi Capture", |
300 | ALC5623_PWR_MANAG_ADD2, 7, 0), | 300 | ALC5623_PWR_MANAG_ADD2, 7, 0), |
301 | SND_SOC_DAPM_ADC("Right ADC", "Right HiFi Capture", | 301 | SND_SOC_DAPM_ADC("Right ADC", "Right HiFi Capture", |
302 | ALC5623_PWR_MANAG_ADD2, 6, 0), | 302 | ALC5623_PWR_MANAG_ADD2, 6, 0), |
303 | SND_SOC_DAPM_PGA("Left Headphone", ALC5623_PWR_MANAG_ADD3, 10, 0, NULL, 0), | 303 | SND_SOC_DAPM_PGA("Left Headphone", ALC5623_PWR_MANAG_ADD3, 10, 0, NULL, 0), |
304 | SND_SOC_DAPM_PGA("Right Headphone", ALC5623_PWR_MANAG_ADD3, 9, 0, NULL, 0), | 304 | SND_SOC_DAPM_PGA("Right Headphone", ALC5623_PWR_MANAG_ADD3, 9, 0, NULL, 0), |
305 | SND_SOC_DAPM_PGA("SpeakerOut", ALC5623_PWR_MANAG_ADD3, 12, 0, NULL, 0), | 305 | SND_SOC_DAPM_PGA("SpeakerOut", ALC5623_PWR_MANAG_ADD3, 12, 0, NULL, 0), |
306 | SND_SOC_DAPM_PGA("Left AuxOut", ALC5623_PWR_MANAG_ADD3, 14, 0, NULL, 0), | 306 | SND_SOC_DAPM_PGA("Left AuxOut", ALC5623_PWR_MANAG_ADD3, 14, 0, NULL, 0), |
307 | SND_SOC_DAPM_PGA("Right AuxOut", ALC5623_PWR_MANAG_ADD3, 13, 0, NULL, 0), | 307 | SND_SOC_DAPM_PGA("Right AuxOut", ALC5623_PWR_MANAG_ADD3, 13, 0, NULL, 0), |
308 | SND_SOC_DAPM_PGA("Left LineIn", ALC5623_PWR_MANAG_ADD3, 7, 0, NULL, 0), | 308 | SND_SOC_DAPM_PGA("Left LineIn", ALC5623_PWR_MANAG_ADD3, 7, 0, NULL, 0), |
309 | SND_SOC_DAPM_PGA("Right LineIn", ALC5623_PWR_MANAG_ADD3, 6, 0, NULL, 0), | 309 | SND_SOC_DAPM_PGA("Right LineIn", ALC5623_PWR_MANAG_ADD3, 6, 0, NULL, 0), |
310 | SND_SOC_DAPM_PGA("Left AuxI", ALC5623_PWR_MANAG_ADD3, 5, 0, NULL, 0), | 310 | SND_SOC_DAPM_PGA("Left AuxI", ALC5623_PWR_MANAG_ADD3, 5, 0, NULL, 0), |
311 | SND_SOC_DAPM_PGA("Right AuxI", ALC5623_PWR_MANAG_ADD3, 4, 0, NULL, 0), | 311 | SND_SOC_DAPM_PGA("Right AuxI", ALC5623_PWR_MANAG_ADD3, 4, 0, NULL, 0), |
312 | SND_SOC_DAPM_PGA("MIC1 PGA", ALC5623_PWR_MANAG_ADD3, 3, 0, NULL, 0), | 312 | SND_SOC_DAPM_PGA("MIC1 PGA", ALC5623_PWR_MANAG_ADD3, 3, 0, NULL, 0), |
313 | SND_SOC_DAPM_PGA("MIC2 PGA", ALC5623_PWR_MANAG_ADD3, 2, 0, NULL, 0), | 313 | SND_SOC_DAPM_PGA("MIC2 PGA", ALC5623_PWR_MANAG_ADD3, 2, 0, NULL, 0), |
314 | SND_SOC_DAPM_PGA("MIC1 Pre Amp", ALC5623_PWR_MANAG_ADD3, 1, 0, NULL, 0), | 314 | SND_SOC_DAPM_PGA("MIC1 Pre Amp", ALC5623_PWR_MANAG_ADD3, 1, 0, NULL, 0), |
315 | SND_SOC_DAPM_PGA("MIC2 Pre Amp", ALC5623_PWR_MANAG_ADD3, 0, 0, NULL, 0), | 315 | SND_SOC_DAPM_PGA("MIC2 Pre Amp", ALC5623_PWR_MANAG_ADD3, 0, 0, NULL, 0), |
316 | SND_SOC_DAPM_MICBIAS("Mic Bias1", ALC5623_PWR_MANAG_ADD1, 11, 0), | 316 | SND_SOC_DAPM_MICBIAS("Mic Bias1", ALC5623_PWR_MANAG_ADD1, 11, 0), |
317 | 317 | ||
318 | SND_SOC_DAPM_OUTPUT("AUXOUTL"), | 318 | SND_SOC_DAPM_OUTPUT("AUXOUTL"), |
319 | SND_SOC_DAPM_OUTPUT("AUXOUTR"), | 319 | SND_SOC_DAPM_OUTPUT("AUXOUTR"), |
320 | SND_SOC_DAPM_OUTPUT("HPL"), | 320 | SND_SOC_DAPM_OUTPUT("HPL"), |
321 | SND_SOC_DAPM_OUTPUT("HPR"), | 321 | SND_SOC_DAPM_OUTPUT("HPR"), |
322 | SND_SOC_DAPM_OUTPUT("SPKOUT"), | 322 | SND_SOC_DAPM_OUTPUT("SPKOUT"), |
323 | SND_SOC_DAPM_OUTPUT("SPKOUTN"), | 323 | SND_SOC_DAPM_OUTPUT("SPKOUTN"), |
324 | SND_SOC_DAPM_INPUT("LINEINL"), | 324 | SND_SOC_DAPM_INPUT("LINEINL"), |
325 | SND_SOC_DAPM_INPUT("LINEINR"), | 325 | SND_SOC_DAPM_INPUT("LINEINR"), |
326 | SND_SOC_DAPM_INPUT("AUXINL"), | 326 | SND_SOC_DAPM_INPUT("AUXINL"), |
327 | SND_SOC_DAPM_INPUT("AUXINR"), | 327 | SND_SOC_DAPM_INPUT("AUXINR"), |
328 | SND_SOC_DAPM_INPUT("MIC1"), | 328 | SND_SOC_DAPM_INPUT("MIC1"), |
329 | SND_SOC_DAPM_INPUT("MIC2"), | 329 | SND_SOC_DAPM_INPUT("MIC2"), |
330 | SND_SOC_DAPM_VMID("Vmid"), | 330 | SND_SOC_DAPM_VMID("Vmid"), |
331 | }; | 331 | }; |
332 | 332 | ||
333 | static const char *alc5623_amp_names[] = {"AB Amp", "D Amp"}; | 333 | static const char *alc5623_amp_names[] = {"AB Amp", "D Amp"}; |
334 | static SOC_ENUM_SINGLE_DECL(alc5623_amp_enum, | 334 | static SOC_ENUM_SINGLE_DECL(alc5623_amp_enum, |
335 | ALC5623_OUTPUT_MIXER_CTRL, 13, | 335 | ALC5623_OUTPUT_MIXER_CTRL, 13, |
336 | alc5623_amp_names); | 336 | alc5623_amp_names); |
337 | static const struct snd_kcontrol_new alc5623_amp_mux_controls = | 337 | static const struct snd_kcontrol_new alc5623_amp_mux_controls = |
338 | SOC_DAPM_ENUM("Route", alc5623_amp_enum); | 338 | SOC_DAPM_ENUM("Route", alc5623_amp_enum); |
339 | 339 | ||
340 | static const struct snd_soc_dapm_widget alc5623_dapm_amp_widgets[] = { | 340 | static const struct snd_soc_dapm_widget alc5623_dapm_amp_widgets[] = { |
341 | SND_SOC_DAPM_PGA_E("D Amp", ALC5623_PWR_MANAG_ADD2, 14, 0, NULL, 0, | 341 | SND_SOC_DAPM_PGA_E("D Amp", ALC5623_PWR_MANAG_ADD2, 14, 0, NULL, 0, |
342 | amp_mixer_event, SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD), | 342 | amp_mixer_event, SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD), |
343 | SND_SOC_DAPM_PGA("AB Amp", ALC5623_PWR_MANAG_ADD2, 15, 0, NULL, 0), | 343 | SND_SOC_DAPM_PGA("AB Amp", ALC5623_PWR_MANAG_ADD2, 15, 0, NULL, 0), |
344 | SND_SOC_DAPM_MUX("AB-D Amp Mux", SND_SOC_NOPM, 0, 0, | 344 | SND_SOC_DAPM_MUX("AB-D Amp Mux", SND_SOC_NOPM, 0, 0, |
345 | &alc5623_amp_mux_controls), | 345 | &alc5623_amp_mux_controls), |
346 | }; | 346 | }; |
347 | 347 | ||
348 | static const struct snd_soc_dapm_route intercon[] = { | 348 | static const struct snd_soc_dapm_route intercon[] = { |
349 | /* virtual mixer - mixes left & right channels */ | 349 | /* virtual mixer - mixes left & right channels */ |
350 | {"I2S Mix", NULL, "Left DAC"}, | 350 | {"I2S Mix", NULL, "Left DAC"}, |
351 | {"I2S Mix", NULL, "Right DAC"}, | 351 | {"I2S Mix", NULL, "Right DAC"}, |
352 | {"Line Mix", NULL, "Right LineIn"}, | 352 | {"Line Mix", NULL, "Right LineIn"}, |
353 | {"Line Mix", NULL, "Left LineIn"}, | 353 | {"Line Mix", NULL, "Left LineIn"}, |
354 | {"AuxI Mix", NULL, "Left AuxI"}, | 354 | {"AuxI Mix", NULL, "Left AuxI"}, |
355 | {"AuxI Mix", NULL, "Right AuxI"}, | 355 | {"AuxI Mix", NULL, "Right AuxI"}, |
356 | {"AUXOUTL", NULL, "Left AuxOut"}, | 356 | {"AUXOUTL", NULL, "Left AuxOut"}, |
357 | {"AUXOUTR", NULL, "Right AuxOut"}, | 357 | {"AUXOUTR", NULL, "Right AuxOut"}, |
358 | 358 | ||
359 | /* HP mixer */ | 359 | /* HP mixer */ |
360 | {"HPL Mix", "ADC2HP_L Playback Switch", "Left Capture Mix"}, | 360 | {"HPL Mix", "ADC2HP_L Playback Switch", "Left Capture Mix"}, |
361 | {"HPL Mix", NULL, "HP Mix"}, | 361 | {"HPL Mix", NULL, "HP Mix"}, |
362 | {"HPR Mix", "ADC2HP_R Playback Switch", "Right Capture Mix"}, | 362 | {"HPR Mix", "ADC2HP_R Playback Switch", "Right Capture Mix"}, |
363 | {"HPR Mix", NULL, "HP Mix"}, | 363 | {"HPR Mix", NULL, "HP Mix"}, |
364 | {"HP Mix", "LI2HP Playback Switch", "Line Mix"}, | 364 | {"HP Mix", "LI2HP Playback Switch", "Line Mix"}, |
365 | {"HP Mix", "AUXI2HP Playback Switch", "AuxI Mix"}, | 365 | {"HP Mix", "AUXI2HP Playback Switch", "AuxI Mix"}, |
366 | {"HP Mix", "MIC12HP Playback Switch", "MIC1 PGA"}, | 366 | {"HP Mix", "MIC12HP Playback Switch", "MIC1 PGA"}, |
367 | {"HP Mix", "MIC22HP Playback Switch", "MIC2 PGA"}, | 367 | {"HP Mix", "MIC22HP Playback Switch", "MIC2 PGA"}, |
368 | {"HP Mix", "DAC2HP Playback Switch", "I2S Mix"}, | 368 | {"HP Mix", "DAC2HP Playback Switch", "I2S Mix"}, |
369 | 369 | ||
370 | /* speaker mixer */ | 370 | /* speaker mixer */ |
371 | {"Speaker Mix", "LI2SPK Playback Switch", "Line Mix"}, | 371 | {"Speaker Mix", "LI2SPK Playback Switch", "Line Mix"}, |
372 | {"Speaker Mix", "AUXI2SPK Playback Switch", "AuxI Mix"}, | 372 | {"Speaker Mix", "AUXI2SPK Playback Switch", "AuxI Mix"}, |
373 | {"Speaker Mix", "MIC12SPK Playback Switch", "MIC1 PGA"}, | 373 | {"Speaker Mix", "MIC12SPK Playback Switch", "MIC1 PGA"}, |
374 | {"Speaker Mix", "MIC22SPK Playback Switch", "MIC2 PGA"}, | 374 | {"Speaker Mix", "MIC22SPK Playback Switch", "MIC2 PGA"}, |
375 | {"Speaker Mix", "DAC2SPK Playback Switch", "I2S Mix"}, | 375 | {"Speaker Mix", "DAC2SPK Playback Switch", "I2S Mix"}, |
376 | 376 | ||
377 | /* mono mixer */ | 377 | /* mono mixer */ |
378 | {"Mono Mix", "ADC2MONO_L Playback Switch", "Left Capture Mix"}, | 378 | {"Mono Mix", "ADC2MONO_L Playback Switch", "Left Capture Mix"}, |
379 | {"Mono Mix", "ADC2MONO_R Playback Switch", "Right Capture Mix"}, | 379 | {"Mono Mix", "ADC2MONO_R Playback Switch", "Right Capture Mix"}, |
380 | {"Mono Mix", "LI2MONO Playback Switch", "Line Mix"}, | 380 | {"Mono Mix", "LI2MONO Playback Switch", "Line Mix"}, |
381 | {"Mono Mix", "AUXI2MONO Playback Switch", "AuxI Mix"}, | 381 | {"Mono Mix", "AUXI2MONO Playback Switch", "AuxI Mix"}, |
382 | {"Mono Mix", "MIC12MONO Playback Switch", "MIC1 PGA"}, | 382 | {"Mono Mix", "MIC12MONO Playback Switch", "MIC1 PGA"}, |
383 | {"Mono Mix", "MIC22MONO Playback Switch", "MIC2 PGA"}, | 383 | {"Mono Mix", "MIC22MONO Playback Switch", "MIC2 PGA"}, |
384 | {"Mono Mix", "DAC2MONO Playback Switch", "I2S Mix"}, | 384 | {"Mono Mix", "DAC2MONO Playback Switch", "I2S Mix"}, |
385 | 385 | ||
386 | /* Left record mixer */ | 386 | /* Left record mixer */ |
387 | {"Left Capture Mix", "LineInL Capture Switch", "LINEINL"}, | 387 | {"Left Capture Mix", "LineInL Capture Switch", "LINEINL"}, |
388 | {"Left Capture Mix", "Left AuxI Capture Switch", "AUXINL"}, | 388 | {"Left Capture Mix", "Left AuxI Capture Switch", "AUXINL"}, |
389 | {"Left Capture Mix", "Mic1 Capture Switch", "MIC1 Pre Amp"}, | 389 | {"Left Capture Mix", "Mic1 Capture Switch", "MIC1 Pre Amp"}, |
390 | {"Left Capture Mix", "Mic2 Capture Switch", "MIC2 Pre Amp"}, | 390 | {"Left Capture Mix", "Mic2 Capture Switch", "MIC2 Pre Amp"}, |
391 | {"Left Capture Mix", "HPMixerL Capture Switch", "HPL Mix"}, | 391 | {"Left Capture Mix", "HPMixerL Capture Switch", "HPL Mix"}, |
392 | {"Left Capture Mix", "SPKMixer Capture Switch", "Speaker Mix"}, | 392 | {"Left Capture Mix", "SPKMixer Capture Switch", "Speaker Mix"}, |
393 | {"Left Capture Mix", "MonoMixer Capture Switch", "Mono Mix"}, | 393 | {"Left Capture Mix", "MonoMixer Capture Switch", "Mono Mix"}, |
394 | 394 | ||
395 | /*Right record mixer */ | 395 | /*Right record mixer */ |
396 | {"Right Capture Mix", "LineInR Capture Switch", "LINEINR"}, | 396 | {"Right Capture Mix", "LineInR Capture Switch", "LINEINR"}, |
397 | {"Right Capture Mix", "Right AuxI Capture Switch", "AUXINR"}, | 397 | {"Right Capture Mix", "Right AuxI Capture Switch", "AUXINR"}, |
398 | {"Right Capture Mix", "Mic1 Capture Switch", "MIC1 Pre Amp"}, | 398 | {"Right Capture Mix", "Mic1 Capture Switch", "MIC1 Pre Amp"}, |
399 | {"Right Capture Mix", "Mic2 Capture Switch", "MIC2 Pre Amp"}, | 399 | {"Right Capture Mix", "Mic2 Capture Switch", "MIC2 Pre Amp"}, |
400 | {"Right Capture Mix", "HPMixerR Capture Switch", "HPR Mix"}, | 400 | {"Right Capture Mix", "HPMixerR Capture Switch", "HPR Mix"}, |
401 | {"Right Capture Mix", "SPKMixer Capture Switch", "Speaker Mix"}, | 401 | {"Right Capture Mix", "SPKMixer Capture Switch", "Speaker Mix"}, |
402 | {"Right Capture Mix", "MonoMixer Capture Switch", "Mono Mix"}, | 402 | {"Right Capture Mix", "MonoMixer Capture Switch", "Mono Mix"}, |
403 | 403 | ||
404 | /* headphone left mux */ | 404 | /* headphone left mux */ |
405 | {"Left Headphone Mux", "HP Left Mix", "HPL Mix"}, | 405 | {"Left Headphone Mux", "HP Left Mix", "HPL Mix"}, |
406 | {"Left Headphone Mux", "Vmid", "Vmid"}, | 406 | {"Left Headphone Mux", "Vmid", "Vmid"}, |
407 | 407 | ||
408 | /* headphone right mux */ | 408 | /* headphone right mux */ |
409 | {"Right Headphone Mux", "HP Right Mix", "HPR Mix"}, | 409 | {"Right Headphone Mux", "HP Right Mix", "HPR Mix"}, |
410 | {"Right Headphone Mux", "Vmid", "Vmid"}, | 410 | {"Right Headphone Mux", "Vmid", "Vmid"}, |
411 | 411 | ||
412 | /* speaker out mux */ | 412 | /* speaker out mux */ |
413 | {"SpeakerOut Mux", "Vmid", "Vmid"}, | 413 | {"SpeakerOut Mux", "Vmid", "Vmid"}, |
414 | {"SpeakerOut Mux", "HPOut Mix", "HPOut Mix"}, | 414 | {"SpeakerOut Mux", "HPOut Mix", "HPOut Mix"}, |
415 | {"SpeakerOut Mux", "Speaker Mix", "Speaker Mix"}, | 415 | {"SpeakerOut Mux", "Speaker Mix", "Speaker Mix"}, |
416 | {"SpeakerOut Mux", "Mono Mix", "Mono Mix"}, | 416 | {"SpeakerOut Mux", "Mono Mix", "Mono Mix"}, |
417 | 417 | ||
418 | /* Mono/Aux Out mux */ | 418 | /* Mono/Aux Out mux */ |
419 | {"AuxOut Mux", "Vmid", "Vmid"}, | 419 | {"AuxOut Mux", "Vmid", "Vmid"}, |
420 | {"AuxOut Mux", "HPOut Mix", "HPOut Mix"}, | 420 | {"AuxOut Mux", "HPOut Mix", "HPOut Mix"}, |
421 | {"AuxOut Mux", "Speaker Mix", "Speaker Mix"}, | 421 | {"AuxOut Mux", "Speaker Mix", "Speaker Mix"}, |
422 | {"AuxOut Mux", "Mono Mix", "Mono Mix"}, | 422 | {"AuxOut Mux", "Mono Mix", "Mono Mix"}, |
423 | 423 | ||
424 | /* output pga */ | 424 | /* output pga */ |
425 | {"HPL", NULL, "Left Headphone"}, | 425 | {"HPL", NULL, "Left Headphone"}, |
426 | {"Left Headphone", NULL, "Left Headphone Mux"}, | 426 | {"Left Headphone", NULL, "Left Headphone Mux"}, |
427 | {"HPR", NULL, "Right Headphone"}, | 427 | {"HPR", NULL, "Right Headphone"}, |
428 | {"Right Headphone", NULL, "Right Headphone Mux"}, | 428 | {"Right Headphone", NULL, "Right Headphone Mux"}, |
429 | {"Left AuxOut", NULL, "AuxOut Mux"}, | 429 | {"Left AuxOut", NULL, "AuxOut Mux"}, |
430 | {"Right AuxOut", NULL, "AuxOut Mux"}, | 430 | {"Right AuxOut", NULL, "AuxOut Mux"}, |
431 | 431 | ||
432 | /* input pga */ | 432 | /* input pga */ |
433 | {"Left LineIn", NULL, "LINEINL"}, | 433 | {"Left LineIn", NULL, "LINEINL"}, |
434 | {"Right LineIn", NULL, "LINEINR"}, | 434 | {"Right LineIn", NULL, "LINEINR"}, |
435 | {"Left AuxI", NULL, "AUXINL"}, | 435 | {"Left AuxI", NULL, "AUXINL"}, |
436 | {"Right AuxI", NULL, "AUXINR"}, | 436 | {"Right AuxI", NULL, "AUXINR"}, |
437 | {"MIC1 Pre Amp", NULL, "MIC1"}, | 437 | {"MIC1 Pre Amp", NULL, "MIC1"}, |
438 | {"MIC2 Pre Amp", NULL, "MIC2"}, | 438 | {"MIC2 Pre Amp", NULL, "MIC2"}, |
439 | {"MIC1 PGA", NULL, "MIC1 Pre Amp"}, | 439 | {"MIC1 PGA", NULL, "MIC1 Pre Amp"}, |
440 | {"MIC2 PGA", NULL, "MIC2 Pre Amp"}, | 440 | {"MIC2 PGA", NULL, "MIC2 Pre Amp"}, |
441 | 441 | ||
442 | /* left ADC */ | 442 | /* left ADC */ |
443 | {"Left ADC", NULL, "Left Capture Mix"}, | 443 | {"Left ADC", NULL, "Left Capture Mix"}, |
444 | 444 | ||
445 | /* right ADC */ | 445 | /* right ADC */ |
446 | {"Right ADC", NULL, "Right Capture Mix"}, | 446 | {"Right ADC", NULL, "Right Capture Mix"}, |
447 | 447 | ||
448 | {"SpeakerOut N Mux", "RN/-R", "SpeakerOut"}, | 448 | {"SpeakerOut N Mux", "RN/-R", "SpeakerOut"}, |
449 | {"SpeakerOut N Mux", "RP/+R", "SpeakerOut"}, | 449 | {"SpeakerOut N Mux", "RP/+R", "SpeakerOut"}, |
450 | {"SpeakerOut N Mux", "LN/-R", "SpeakerOut"}, | 450 | {"SpeakerOut N Mux", "LN/-R", "SpeakerOut"}, |
451 | {"SpeakerOut N Mux", "Vmid", "Vmid"}, | 451 | {"SpeakerOut N Mux", "Vmid", "Vmid"}, |
452 | 452 | ||
453 | {"SPKOUT", NULL, "SpeakerOut"}, | 453 | {"SPKOUT", NULL, "SpeakerOut"}, |
454 | {"SPKOUTN", NULL, "SpeakerOut N Mux"}, | 454 | {"SPKOUTN", NULL, "SpeakerOut N Mux"}, |
455 | }; | 455 | }; |
456 | 456 | ||
457 | static const struct snd_soc_dapm_route intercon_spk[] = { | 457 | static const struct snd_soc_dapm_route intercon_spk[] = { |
458 | {"SpeakerOut", NULL, "SpeakerOut Mux"}, | 458 | {"SpeakerOut", NULL, "SpeakerOut Mux"}, |
459 | }; | 459 | }; |
460 | 460 | ||
461 | static const struct snd_soc_dapm_route intercon_amp_spk[] = { | 461 | static const struct snd_soc_dapm_route intercon_amp_spk[] = { |
462 | {"AB Amp", NULL, "SpeakerOut Mux"}, | 462 | {"AB Amp", NULL, "SpeakerOut Mux"}, |
463 | {"D Amp", NULL, "SpeakerOut Mux"}, | 463 | {"D Amp", NULL, "SpeakerOut Mux"}, |
464 | {"AB-D Amp Mux", "AB Amp", "AB Amp"}, | 464 | {"AB-D Amp Mux", "AB Amp", "AB Amp"}, |
465 | {"AB-D Amp Mux", "D Amp", "D Amp"}, | 465 | {"AB-D Amp Mux", "D Amp", "D Amp"}, |
466 | {"SpeakerOut", NULL, "AB-D Amp Mux"}, | 466 | {"SpeakerOut", NULL, "AB-D Amp Mux"}, |
467 | }; | 467 | }; |
468 | 468 | ||
469 | /* PLL divisors */ | 469 | /* PLL divisors */ |
470 | struct _pll_div { | 470 | struct _pll_div { |
471 | u32 pll_in; | 471 | u32 pll_in; |
472 | u32 pll_out; | 472 | u32 pll_out; |
473 | u16 regvalue; | 473 | u16 regvalue; |
474 | }; | 474 | }; |
475 | 475 | ||
476 | /* Note : pll code from original alc5623 driver. Not sure of how good it is */ | 476 | /* Note : pll code from original alc5623 driver. Not sure of how good it is */ |
477 | /* useful only for master mode */ | 477 | /* useful only for master mode */ |
478 | static const struct _pll_div codec_master_pll_div[] = { | 478 | static const struct _pll_div codec_master_pll_div[] = { |
479 | 479 | ||
480 | { 2048000, 8192000, 0x0ea0}, | 480 | { 2048000, 8192000, 0x0ea0}, |
481 | { 3686400, 8192000, 0x4e27}, | 481 | { 3686400, 8192000, 0x4e27}, |
482 | { 12000000, 8192000, 0x456b}, | 482 | { 12000000, 8192000, 0x456b}, |
483 | { 13000000, 8192000, 0x495f}, | 483 | { 13000000, 8192000, 0x495f}, |
484 | { 13100000, 8192000, 0x0320}, | 484 | { 13100000, 8192000, 0x0320}, |
485 | { 2048000, 11289600, 0xf637}, | 485 | { 2048000, 11289600, 0xf637}, |
486 | { 3686400, 11289600, 0x2f22}, | 486 | { 3686400, 11289600, 0x2f22}, |
487 | { 12000000, 11289600, 0x3e2f}, | 487 | { 12000000, 11289600, 0x3e2f}, |
488 | { 13000000, 11289600, 0x4d5b}, | 488 | { 13000000, 11289600, 0x4d5b}, |
489 | { 13100000, 11289600, 0x363b}, | 489 | { 13100000, 11289600, 0x363b}, |
490 | { 2048000, 16384000, 0x1ea0}, | 490 | { 2048000, 16384000, 0x1ea0}, |
491 | { 3686400, 16384000, 0x9e27}, | 491 | { 3686400, 16384000, 0x9e27}, |
492 | { 12000000, 16384000, 0x452b}, | 492 | { 12000000, 16384000, 0x452b}, |
493 | { 13000000, 16384000, 0x542f}, | 493 | { 13000000, 16384000, 0x542f}, |
494 | { 13100000, 16384000, 0x03a0}, | 494 | { 13100000, 16384000, 0x03a0}, |
495 | { 2048000, 16934400, 0xe625}, | 495 | { 2048000, 16934400, 0xe625}, |
496 | { 3686400, 16934400, 0x9126}, | 496 | { 3686400, 16934400, 0x9126}, |
497 | { 12000000, 16934400, 0x4d2c}, | 497 | { 12000000, 16934400, 0x4d2c}, |
498 | { 13000000, 16934400, 0x742f}, | 498 | { 13000000, 16934400, 0x742f}, |
499 | { 13100000, 16934400, 0x3c27}, | 499 | { 13100000, 16934400, 0x3c27}, |
500 | { 2048000, 22579200, 0x2aa0}, | 500 | { 2048000, 22579200, 0x2aa0}, |
501 | { 3686400, 22579200, 0x2f20}, | 501 | { 3686400, 22579200, 0x2f20}, |
502 | { 12000000, 22579200, 0x7e2f}, | 502 | { 12000000, 22579200, 0x7e2f}, |
503 | { 13000000, 22579200, 0x742f}, | 503 | { 13000000, 22579200, 0x742f}, |
504 | { 13100000, 22579200, 0x3c27}, | 504 | { 13100000, 22579200, 0x3c27}, |
505 | { 2048000, 24576000, 0x2ea0}, | 505 | { 2048000, 24576000, 0x2ea0}, |
506 | { 3686400, 24576000, 0xee27}, | 506 | { 3686400, 24576000, 0xee27}, |
507 | { 12000000, 24576000, 0x2915}, | 507 | { 12000000, 24576000, 0x2915}, |
508 | { 13000000, 24576000, 0x772e}, | 508 | { 13000000, 24576000, 0x772e}, |
509 | { 13100000, 24576000, 0x0d20}, | 509 | { 13100000, 24576000, 0x0d20}, |
510 | }; | 510 | }; |
511 | 511 | ||
512 | static const struct _pll_div codec_slave_pll_div[] = { | 512 | static const struct _pll_div codec_slave_pll_div[] = { |
513 | 513 | ||
514 | { 1024000, 16384000, 0x3ea0}, | 514 | { 1024000, 16384000, 0x3ea0}, |
515 | { 1411200, 22579200, 0x3ea0}, | 515 | { 1411200, 22579200, 0x3ea0}, |
516 | { 1536000, 24576000, 0x3ea0}, | 516 | { 1536000, 24576000, 0x3ea0}, |
517 | { 2048000, 16384000, 0x1ea0}, | 517 | { 2048000, 16384000, 0x1ea0}, |
518 | { 2822400, 22579200, 0x1ea0}, | 518 | { 2822400, 22579200, 0x1ea0}, |
519 | { 3072000, 24576000, 0x1ea0}, | 519 | { 3072000, 24576000, 0x1ea0}, |
520 | 520 | ||
521 | }; | 521 | }; |
522 | 522 | ||
523 | static int alc5623_set_dai_pll(struct snd_soc_dai *codec_dai, int pll_id, | 523 | static int alc5623_set_dai_pll(struct snd_soc_dai *codec_dai, int pll_id, |
524 | int source, unsigned int freq_in, unsigned int freq_out) | 524 | int source, unsigned int freq_in, unsigned int freq_out) |
525 | { | 525 | { |
526 | int i; | 526 | int i; |
527 | struct snd_soc_codec *codec = codec_dai->codec; | 527 | struct snd_soc_codec *codec = codec_dai->codec; |
528 | int gbl_clk = 0, pll_div = 0; | 528 | int gbl_clk = 0, pll_div = 0; |
529 | u16 reg; | 529 | u16 reg; |
530 | 530 | ||
531 | if (pll_id < ALC5623_PLL_FR_MCLK || pll_id > ALC5623_PLL_FR_BCK) | 531 | if (pll_id < ALC5623_PLL_FR_MCLK || pll_id > ALC5623_PLL_FR_BCK) |
532 | return -ENODEV; | 532 | return -ENODEV; |
533 | 533 | ||
534 | /* Disable PLL power */ | 534 | /* Disable PLL power */ |
535 | snd_soc_update_bits(codec, ALC5623_PWR_MANAG_ADD2, | 535 | snd_soc_update_bits(codec, ALC5623_PWR_MANAG_ADD2, |
536 | ALC5623_PWR_ADD2_PLL, | 536 | ALC5623_PWR_ADD2_PLL, |
537 | 0); | 537 | 0); |
538 | 538 | ||
539 | /* pll is not used in slave mode */ | 539 | /* pll is not used in slave mode */ |
540 | reg = snd_soc_read(codec, ALC5623_DAI_CONTROL); | 540 | reg = snd_soc_read(codec, ALC5623_DAI_CONTROL); |
541 | if (reg & ALC5623_DAI_SDP_SLAVE_MODE) | 541 | if (reg & ALC5623_DAI_SDP_SLAVE_MODE) |
542 | return 0; | 542 | return 0; |
543 | 543 | ||
544 | if (!freq_in || !freq_out) | 544 | if (!freq_in || !freq_out) |
545 | return 0; | 545 | return 0; |
546 | 546 | ||
547 | switch (pll_id) { | 547 | switch (pll_id) { |
548 | case ALC5623_PLL_FR_MCLK: | 548 | case ALC5623_PLL_FR_MCLK: |
549 | for (i = 0; i < ARRAY_SIZE(codec_master_pll_div); i++) { | 549 | for (i = 0; i < ARRAY_SIZE(codec_master_pll_div); i++) { |
550 | if (codec_master_pll_div[i].pll_in == freq_in | 550 | if (codec_master_pll_div[i].pll_in == freq_in |
551 | && codec_master_pll_div[i].pll_out == freq_out) { | 551 | && codec_master_pll_div[i].pll_out == freq_out) { |
552 | /* PLL source from MCLK */ | 552 | /* PLL source from MCLK */ |
553 | pll_div = codec_master_pll_div[i].regvalue; | 553 | pll_div = codec_master_pll_div[i].regvalue; |
554 | break; | 554 | break; |
555 | } | 555 | } |
556 | } | 556 | } |
557 | break; | 557 | break; |
558 | case ALC5623_PLL_FR_BCK: | 558 | case ALC5623_PLL_FR_BCK: |
559 | for (i = 0; i < ARRAY_SIZE(codec_slave_pll_div); i++) { | 559 | for (i = 0; i < ARRAY_SIZE(codec_slave_pll_div); i++) { |
560 | if (codec_slave_pll_div[i].pll_in == freq_in | 560 | if (codec_slave_pll_div[i].pll_in == freq_in |
561 | && codec_slave_pll_div[i].pll_out == freq_out) { | 561 | && codec_slave_pll_div[i].pll_out == freq_out) { |
562 | /* PLL source from Bitclk */ | 562 | /* PLL source from Bitclk */ |
563 | gbl_clk = ALC5623_GBL_CLK_PLL_SOUR_SEL_BITCLK; | 563 | gbl_clk = ALC5623_GBL_CLK_PLL_SOUR_SEL_BITCLK; |
564 | pll_div = codec_slave_pll_div[i].regvalue; | 564 | pll_div = codec_slave_pll_div[i].regvalue; |
565 | break; | 565 | break; |
566 | } | 566 | } |
567 | } | 567 | } |
568 | break; | 568 | break; |
569 | default: | 569 | default: |
570 | return -EINVAL; | 570 | return -EINVAL; |
571 | } | 571 | } |
572 | 572 | ||
573 | if (!pll_div) | 573 | if (!pll_div) |
574 | return -EINVAL; | 574 | return -EINVAL; |
575 | 575 | ||
576 | snd_soc_write(codec, ALC5623_GLOBAL_CLK_CTRL_REG, gbl_clk); | 576 | snd_soc_write(codec, ALC5623_GLOBAL_CLK_CTRL_REG, gbl_clk); |
577 | snd_soc_write(codec, ALC5623_PLL_CTRL, pll_div); | 577 | snd_soc_write(codec, ALC5623_PLL_CTRL, pll_div); |
578 | snd_soc_update_bits(codec, ALC5623_PWR_MANAG_ADD2, | 578 | snd_soc_update_bits(codec, ALC5623_PWR_MANAG_ADD2, |
579 | ALC5623_PWR_ADD2_PLL, | 579 | ALC5623_PWR_ADD2_PLL, |
580 | ALC5623_PWR_ADD2_PLL); | 580 | ALC5623_PWR_ADD2_PLL); |
581 | gbl_clk |= ALC5623_GBL_CLK_SYS_SOUR_SEL_PLL; | 581 | gbl_clk |= ALC5623_GBL_CLK_SYS_SOUR_SEL_PLL; |
582 | snd_soc_write(codec, ALC5623_GLOBAL_CLK_CTRL_REG, gbl_clk); | 582 | snd_soc_write(codec, ALC5623_GLOBAL_CLK_CTRL_REG, gbl_clk); |
583 | 583 | ||
584 | return 0; | 584 | return 0; |
585 | } | 585 | } |
586 | 586 | ||
587 | struct _coeff_div { | 587 | struct _coeff_div { |
588 | u16 fs; | 588 | u16 fs; |
589 | u16 regvalue; | 589 | u16 regvalue; |
590 | }; | 590 | }; |
591 | 591 | ||
592 | /* codec hifi mclk (after PLL) clock divider coefficients */ | 592 | /* codec hifi mclk (after PLL) clock divider coefficients */ |
593 | /* values inspired from column BCLK=32Fs of Appendix A table */ | 593 | /* values inspired from column BCLK=32Fs of Appendix A table */ |
594 | static const struct _coeff_div coeff_div[] = { | 594 | static const struct _coeff_div coeff_div[] = { |
595 | {256*8, 0x3a69}, | 595 | {256*8, 0x3a69}, |
596 | {384*8, 0x3c6b}, | 596 | {384*8, 0x3c6b}, |
597 | {256*4, 0x2a69}, | 597 | {256*4, 0x2a69}, |
598 | {384*4, 0x2c6b}, | 598 | {384*4, 0x2c6b}, |
599 | {256*2, 0x1a69}, | 599 | {256*2, 0x1a69}, |
600 | {384*2, 0x1c6b}, | 600 | {384*2, 0x1c6b}, |
601 | {256*1, 0x0a69}, | 601 | {256*1, 0x0a69}, |
602 | {384*1, 0x0c6b}, | 602 | {384*1, 0x0c6b}, |
603 | }; | 603 | }; |
604 | 604 | ||
605 | static int get_coeff(struct snd_soc_codec *codec, int rate) | 605 | static int get_coeff(struct snd_soc_codec *codec, int rate) |
606 | { | 606 | { |
607 | struct alc5623_priv *alc5623 = snd_soc_codec_get_drvdata(codec); | 607 | struct alc5623_priv *alc5623 = snd_soc_codec_get_drvdata(codec); |
608 | int i; | 608 | int i; |
609 | 609 | ||
610 | for (i = 0; i < ARRAY_SIZE(coeff_div); i++) { | 610 | for (i = 0; i < ARRAY_SIZE(coeff_div); i++) { |
611 | if (coeff_div[i].fs * rate == alc5623->sysclk) | 611 | if (coeff_div[i].fs * rate == alc5623->sysclk) |
612 | return i; | 612 | return i; |
613 | } | 613 | } |
614 | return -EINVAL; | 614 | return -EINVAL; |
615 | } | 615 | } |
616 | 616 | ||
617 | /* | 617 | /* |
618 | * Clock after PLL and dividers | 618 | * Clock after PLL and dividers |
619 | */ | 619 | */ |
620 | static int alc5623_set_dai_sysclk(struct snd_soc_dai *codec_dai, | 620 | static int alc5623_set_dai_sysclk(struct snd_soc_dai *codec_dai, |
621 | int clk_id, unsigned int freq, int dir) | 621 | int clk_id, unsigned int freq, int dir) |
622 | { | 622 | { |
623 | struct snd_soc_codec *codec = codec_dai->codec; | 623 | struct snd_soc_codec *codec = codec_dai->codec; |
624 | struct alc5623_priv *alc5623 = snd_soc_codec_get_drvdata(codec); | 624 | struct alc5623_priv *alc5623 = snd_soc_codec_get_drvdata(codec); |
625 | 625 | ||
626 | switch (freq) { | 626 | switch (freq) { |
627 | case 8192000: | 627 | case 8192000: |
628 | case 11289600: | 628 | case 11289600: |
629 | case 12288000: | 629 | case 12288000: |
630 | case 16384000: | 630 | case 16384000: |
631 | case 16934400: | 631 | case 16934400: |
632 | case 18432000: | 632 | case 18432000: |
633 | case 22579200: | 633 | case 22579200: |
634 | case 24576000: | 634 | case 24576000: |
635 | alc5623->sysclk = freq; | 635 | alc5623->sysclk = freq; |
636 | return 0; | 636 | return 0; |
637 | } | 637 | } |
638 | return -EINVAL; | 638 | return -EINVAL; |
639 | } | 639 | } |
640 | 640 | ||
641 | static int alc5623_set_dai_fmt(struct snd_soc_dai *codec_dai, | 641 | static int alc5623_set_dai_fmt(struct snd_soc_dai *codec_dai, |
642 | unsigned int fmt) | 642 | unsigned int fmt) |
643 | { | 643 | { |
644 | struct snd_soc_codec *codec = codec_dai->codec; | 644 | struct snd_soc_codec *codec = codec_dai->codec; |
645 | u16 iface = 0; | 645 | u16 iface = 0; |
646 | 646 | ||
647 | /* set master/slave audio interface */ | 647 | /* set master/slave audio interface */ |
648 | switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) { | 648 | switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) { |
649 | case SND_SOC_DAIFMT_CBM_CFM: | 649 | case SND_SOC_DAIFMT_CBM_CFM: |
650 | iface = ALC5623_DAI_SDP_MASTER_MODE; | 650 | iface = ALC5623_DAI_SDP_MASTER_MODE; |
651 | break; | 651 | break; |
652 | case SND_SOC_DAIFMT_CBS_CFS: | 652 | case SND_SOC_DAIFMT_CBS_CFS: |
653 | iface = ALC5623_DAI_SDP_SLAVE_MODE; | 653 | iface = ALC5623_DAI_SDP_SLAVE_MODE; |
654 | break; | 654 | break; |
655 | default: | 655 | default: |
656 | return -EINVAL; | 656 | return -EINVAL; |
657 | } | 657 | } |
658 | 658 | ||
659 | /* interface format */ | 659 | /* interface format */ |
660 | switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) { | 660 | switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) { |
661 | case SND_SOC_DAIFMT_I2S: | 661 | case SND_SOC_DAIFMT_I2S: |
662 | iface |= ALC5623_DAI_I2S_DF_I2S; | 662 | iface |= ALC5623_DAI_I2S_DF_I2S; |
663 | break; | 663 | break; |
664 | case SND_SOC_DAIFMT_RIGHT_J: | 664 | case SND_SOC_DAIFMT_RIGHT_J: |
665 | iface |= ALC5623_DAI_I2S_DF_RIGHT; | 665 | iface |= ALC5623_DAI_I2S_DF_RIGHT; |
666 | break; | 666 | break; |
667 | case SND_SOC_DAIFMT_LEFT_J: | 667 | case SND_SOC_DAIFMT_LEFT_J: |
668 | iface |= ALC5623_DAI_I2S_DF_LEFT; | 668 | iface |= ALC5623_DAI_I2S_DF_LEFT; |
669 | break; | 669 | break; |
670 | case SND_SOC_DAIFMT_DSP_A: | 670 | case SND_SOC_DAIFMT_DSP_A: |
671 | iface |= ALC5623_DAI_I2S_DF_PCM; | 671 | iface |= ALC5623_DAI_I2S_DF_PCM; |
672 | break; | 672 | break; |
673 | case SND_SOC_DAIFMT_DSP_B: | 673 | case SND_SOC_DAIFMT_DSP_B: |
674 | iface |= ALC5623_DAI_I2S_DF_PCM | ALC5623_DAI_I2S_PCM_MODE; | 674 | iface |= ALC5623_DAI_I2S_DF_PCM | ALC5623_DAI_I2S_PCM_MODE; |
675 | break; | 675 | break; |
676 | default: | 676 | default: |
677 | return -EINVAL; | 677 | return -EINVAL; |
678 | } | 678 | } |
679 | 679 | ||
680 | /* clock inversion */ | 680 | /* clock inversion */ |
681 | switch (fmt & SND_SOC_DAIFMT_INV_MASK) { | 681 | switch (fmt & SND_SOC_DAIFMT_INV_MASK) { |
682 | case SND_SOC_DAIFMT_NB_NF: | 682 | case SND_SOC_DAIFMT_NB_NF: |
683 | break; | 683 | break; |
684 | case SND_SOC_DAIFMT_IB_IF: | 684 | case SND_SOC_DAIFMT_IB_IF: |
685 | iface |= ALC5623_DAI_MAIN_I2S_BCLK_POL_CTRL; | 685 | iface |= ALC5623_DAI_MAIN_I2S_BCLK_POL_CTRL; |
686 | break; | 686 | break; |
687 | case SND_SOC_DAIFMT_IB_NF: | 687 | case SND_SOC_DAIFMT_IB_NF: |
688 | iface |= ALC5623_DAI_MAIN_I2S_BCLK_POL_CTRL; | 688 | iface |= ALC5623_DAI_MAIN_I2S_BCLK_POL_CTRL; |
689 | break; | 689 | break; |
690 | case SND_SOC_DAIFMT_NB_IF: | 690 | case SND_SOC_DAIFMT_NB_IF: |
691 | break; | 691 | break; |
692 | default: | 692 | default: |
693 | return -EINVAL; | 693 | return -EINVAL; |
694 | } | 694 | } |
695 | 695 | ||
696 | return snd_soc_write(codec, ALC5623_DAI_CONTROL, iface); | 696 | return snd_soc_write(codec, ALC5623_DAI_CONTROL, iface); |
697 | } | 697 | } |
698 | 698 | ||
699 | static int alc5623_pcm_hw_params(struct snd_pcm_substream *substream, | 699 | static int alc5623_pcm_hw_params(struct snd_pcm_substream *substream, |
700 | struct snd_pcm_hw_params *params, struct snd_soc_dai *dai) | 700 | struct snd_pcm_hw_params *params, struct snd_soc_dai *dai) |
701 | { | 701 | { |
702 | struct snd_soc_codec *codec = dai->codec; | 702 | struct snd_soc_codec *codec = dai->codec; |
703 | struct alc5623_priv *alc5623 = snd_soc_codec_get_drvdata(codec); | 703 | struct alc5623_priv *alc5623 = snd_soc_codec_get_drvdata(codec); |
704 | int coeff, rate; | 704 | int coeff, rate; |
705 | u16 iface; | 705 | u16 iface; |
706 | 706 | ||
707 | iface = snd_soc_read(codec, ALC5623_DAI_CONTROL); | 707 | iface = snd_soc_read(codec, ALC5623_DAI_CONTROL); |
708 | iface &= ~ALC5623_DAI_I2S_DL_MASK; | 708 | iface &= ~ALC5623_DAI_I2S_DL_MASK; |
709 | 709 | ||
710 | /* bit size */ | 710 | /* bit size */ |
711 | switch (params_width(params)) { | 711 | switch (params_width(params)) { |
712 | case 16: | 712 | case 16: |
713 | iface |= ALC5623_DAI_I2S_DL_16; | 713 | iface |= ALC5623_DAI_I2S_DL_16; |
714 | break; | 714 | break; |
715 | case 20: | 715 | case 20: |
716 | iface |= ALC5623_DAI_I2S_DL_20; | 716 | iface |= ALC5623_DAI_I2S_DL_20; |
717 | break; | 717 | break; |
718 | case 24: | 718 | case 24: |
719 | iface |= ALC5623_DAI_I2S_DL_24; | 719 | iface |= ALC5623_DAI_I2S_DL_24; |
720 | break; | 720 | break; |
721 | case 32: | 721 | case 32: |
722 | iface |= ALC5623_DAI_I2S_DL_32; | 722 | iface |= ALC5623_DAI_I2S_DL_32; |
723 | break; | 723 | break; |
724 | default: | 724 | default: |
725 | return -EINVAL; | 725 | return -EINVAL; |
726 | } | 726 | } |
727 | 727 | ||
728 | /* set iface & srate */ | 728 | /* set iface & srate */ |
729 | snd_soc_write(codec, ALC5623_DAI_CONTROL, iface); | 729 | snd_soc_write(codec, ALC5623_DAI_CONTROL, iface); |
730 | rate = params_rate(params); | 730 | rate = params_rate(params); |
731 | coeff = get_coeff(codec, rate); | 731 | coeff = get_coeff(codec, rate); |
732 | if (coeff < 0) | 732 | if (coeff < 0) |
733 | return -EINVAL; | 733 | return -EINVAL; |
734 | 734 | ||
735 | coeff = coeff_div[coeff].regvalue; | 735 | coeff = coeff_div[coeff].regvalue; |
736 | dev_dbg(codec->dev, "%s: sysclk=%d,rate=%d,coeff=0x%04x\n", | 736 | dev_dbg(codec->dev, "%s: sysclk=%d,rate=%d,coeff=0x%04x\n", |
737 | __func__, alc5623->sysclk, rate, coeff); | 737 | __func__, alc5623->sysclk, rate, coeff); |
738 | snd_soc_write(codec, ALC5623_STEREO_AD_DA_CLK_CTRL, coeff); | 738 | snd_soc_write(codec, ALC5623_STEREO_AD_DA_CLK_CTRL, coeff); |
739 | 739 | ||
740 | return 0; | 740 | return 0; |
741 | } | 741 | } |
742 | 742 | ||
743 | static int alc5623_mute(struct snd_soc_dai *dai, int mute) | 743 | static int alc5623_mute(struct snd_soc_dai *dai, int mute) |
744 | { | 744 | { |
745 | struct snd_soc_codec *codec = dai->codec; | 745 | struct snd_soc_codec *codec = dai->codec; |
746 | u16 hp_mute = ALC5623_MISC_M_DAC_L_INPUT | ALC5623_MISC_M_DAC_R_INPUT; | 746 | u16 hp_mute = ALC5623_MISC_M_DAC_L_INPUT | ALC5623_MISC_M_DAC_R_INPUT; |
747 | u16 mute_reg = snd_soc_read(codec, ALC5623_MISC_CTRL) & ~hp_mute; | 747 | u16 mute_reg = snd_soc_read(codec, ALC5623_MISC_CTRL) & ~hp_mute; |
748 | 748 | ||
749 | if (mute) | 749 | if (mute) |
750 | mute_reg |= hp_mute; | 750 | mute_reg |= hp_mute; |
751 | 751 | ||
752 | return snd_soc_write(codec, ALC5623_MISC_CTRL, mute_reg); | 752 | return snd_soc_write(codec, ALC5623_MISC_CTRL, mute_reg); |
753 | } | 753 | } |
754 | 754 | ||
755 | #define ALC5623_ADD2_POWER_EN (ALC5623_PWR_ADD2_VREF \ | 755 | #define ALC5623_ADD2_POWER_EN (ALC5623_PWR_ADD2_VREF \ |
756 | | ALC5623_PWR_ADD2_DAC_REF_CIR) | 756 | | ALC5623_PWR_ADD2_DAC_REF_CIR) |
757 | 757 | ||
758 | #define ALC5623_ADD3_POWER_EN (ALC5623_PWR_ADD3_MAIN_BIAS \ | 758 | #define ALC5623_ADD3_POWER_EN (ALC5623_PWR_ADD3_MAIN_BIAS \ |
759 | | ALC5623_PWR_ADD3_MIC1_BOOST_AD) | 759 | | ALC5623_PWR_ADD3_MIC1_BOOST_AD) |
760 | 760 | ||
761 | #define ALC5623_ADD1_POWER_EN \ | 761 | #define ALC5623_ADD1_POWER_EN \ |
762 | (ALC5623_PWR_ADD1_SHORT_CURR_DET_EN | ALC5623_PWR_ADD1_SOFTGEN_EN \ | 762 | (ALC5623_PWR_ADD1_SHORT_CURR_DET_EN | ALC5623_PWR_ADD1_SOFTGEN_EN \ |
763 | | ALC5623_PWR_ADD1_DEPOP_BUF_HP | ALC5623_PWR_ADD1_HP_OUT_AMP \ | 763 | | ALC5623_PWR_ADD1_DEPOP_BUF_HP | ALC5623_PWR_ADD1_HP_OUT_AMP \ |
764 | | ALC5623_PWR_ADD1_HP_OUT_ENH_AMP) | 764 | | ALC5623_PWR_ADD1_HP_OUT_ENH_AMP) |
765 | 765 | ||
766 | #define ALC5623_ADD1_POWER_EN_5622 \ | 766 | #define ALC5623_ADD1_POWER_EN_5622 \ |
767 | (ALC5623_PWR_ADD1_SHORT_CURR_DET_EN \ | 767 | (ALC5623_PWR_ADD1_SHORT_CURR_DET_EN \ |
768 | | ALC5623_PWR_ADD1_HP_OUT_AMP) | 768 | | ALC5623_PWR_ADD1_HP_OUT_AMP) |
769 | 769 | ||
770 | static void enable_power_depop(struct snd_soc_codec *codec) | 770 | static void enable_power_depop(struct snd_soc_codec *codec) |
771 | { | 771 | { |
772 | struct alc5623_priv *alc5623 = snd_soc_codec_get_drvdata(codec); | 772 | struct alc5623_priv *alc5623 = snd_soc_codec_get_drvdata(codec); |
773 | 773 | ||
774 | snd_soc_update_bits(codec, ALC5623_PWR_MANAG_ADD1, | 774 | snd_soc_update_bits(codec, ALC5623_PWR_MANAG_ADD1, |
775 | ALC5623_PWR_ADD1_SOFTGEN_EN, | 775 | ALC5623_PWR_ADD1_SOFTGEN_EN, |
776 | ALC5623_PWR_ADD1_SOFTGEN_EN); | 776 | ALC5623_PWR_ADD1_SOFTGEN_EN); |
777 | 777 | ||
778 | snd_soc_write(codec, ALC5623_PWR_MANAG_ADD3, ALC5623_ADD3_POWER_EN); | 778 | snd_soc_write(codec, ALC5623_PWR_MANAG_ADD3, ALC5623_ADD3_POWER_EN); |
779 | 779 | ||
780 | snd_soc_update_bits(codec, ALC5623_MISC_CTRL, | 780 | snd_soc_update_bits(codec, ALC5623_MISC_CTRL, |
781 | ALC5623_MISC_HP_DEPOP_MODE2_EN, | 781 | ALC5623_MISC_HP_DEPOP_MODE2_EN, |
782 | ALC5623_MISC_HP_DEPOP_MODE2_EN); | 782 | ALC5623_MISC_HP_DEPOP_MODE2_EN); |
783 | 783 | ||
784 | msleep(500); | 784 | msleep(500); |
785 | 785 | ||
786 | snd_soc_write(codec, ALC5623_PWR_MANAG_ADD2, ALC5623_ADD2_POWER_EN); | 786 | snd_soc_write(codec, ALC5623_PWR_MANAG_ADD2, ALC5623_ADD2_POWER_EN); |
787 | 787 | ||
788 | /* avoid writing '1' into 5622 reserved bits */ | 788 | /* avoid writing '1' into 5622 reserved bits */ |
789 | if (alc5623->id == 0x22) | 789 | if (alc5623->id == 0x22) |
790 | snd_soc_write(codec, ALC5623_PWR_MANAG_ADD1, | 790 | snd_soc_write(codec, ALC5623_PWR_MANAG_ADD1, |
791 | ALC5623_ADD1_POWER_EN_5622); | 791 | ALC5623_ADD1_POWER_EN_5622); |
792 | else | 792 | else |
793 | snd_soc_write(codec, ALC5623_PWR_MANAG_ADD1, | 793 | snd_soc_write(codec, ALC5623_PWR_MANAG_ADD1, |
794 | ALC5623_ADD1_POWER_EN); | 794 | ALC5623_ADD1_POWER_EN); |
795 | 795 | ||
796 | /* disable HP Depop2 */ | 796 | /* disable HP Depop2 */ |
797 | snd_soc_update_bits(codec, ALC5623_MISC_CTRL, | 797 | snd_soc_update_bits(codec, ALC5623_MISC_CTRL, |
798 | ALC5623_MISC_HP_DEPOP_MODE2_EN, | 798 | ALC5623_MISC_HP_DEPOP_MODE2_EN, |
799 | 0); | 799 | 0); |
800 | 800 | ||
801 | } | 801 | } |
802 | 802 | ||
803 | static int alc5623_set_bias_level(struct snd_soc_codec *codec, | 803 | static int alc5623_set_bias_level(struct snd_soc_codec *codec, |
804 | enum snd_soc_bias_level level) | 804 | enum snd_soc_bias_level level) |
805 | { | 805 | { |
806 | switch (level) { | 806 | switch (level) { |
807 | case SND_SOC_BIAS_ON: | 807 | case SND_SOC_BIAS_ON: |
808 | enable_power_depop(codec); | 808 | enable_power_depop(codec); |
809 | break; | 809 | break; |
810 | case SND_SOC_BIAS_PREPARE: | 810 | case SND_SOC_BIAS_PREPARE: |
811 | break; | 811 | break; |
812 | case SND_SOC_BIAS_STANDBY: | 812 | case SND_SOC_BIAS_STANDBY: |
813 | /* everything off except vref/vmid, */ | 813 | /* everything off except vref/vmid, */ |
814 | snd_soc_write(codec, ALC5623_PWR_MANAG_ADD2, | 814 | snd_soc_write(codec, ALC5623_PWR_MANAG_ADD2, |
815 | ALC5623_PWR_ADD2_VREF); | 815 | ALC5623_PWR_ADD2_VREF); |
816 | snd_soc_write(codec, ALC5623_PWR_MANAG_ADD3, | 816 | snd_soc_write(codec, ALC5623_PWR_MANAG_ADD3, |
817 | ALC5623_PWR_ADD3_MAIN_BIAS); | 817 | ALC5623_PWR_ADD3_MAIN_BIAS); |
818 | break; | 818 | break; |
819 | case SND_SOC_BIAS_OFF: | 819 | case SND_SOC_BIAS_OFF: |
820 | /* everything off, dac mute, inactive */ | 820 | /* everything off, dac mute, inactive */ |
821 | snd_soc_write(codec, ALC5623_PWR_MANAG_ADD2, 0); | 821 | snd_soc_write(codec, ALC5623_PWR_MANAG_ADD2, 0); |
822 | snd_soc_write(codec, ALC5623_PWR_MANAG_ADD3, 0); | 822 | snd_soc_write(codec, ALC5623_PWR_MANAG_ADD3, 0); |
823 | snd_soc_write(codec, ALC5623_PWR_MANAG_ADD1, 0); | 823 | snd_soc_write(codec, ALC5623_PWR_MANAG_ADD1, 0); |
824 | break; | 824 | break; |
825 | } | 825 | } |
826 | codec->dapm.bias_level = level; | 826 | codec->dapm.bias_level = level; |
827 | return 0; | 827 | return 0; |
828 | } | 828 | } |
829 | 829 | ||
830 | #define ALC5623_FORMATS (SNDRV_PCM_FMTBIT_S16_LE \ | 830 | #define ALC5623_FORMATS (SNDRV_PCM_FMTBIT_S16_LE \ |
831 | | SNDRV_PCM_FMTBIT_S24_LE \ | 831 | | SNDRV_PCM_FMTBIT_S24_LE \ |
832 | | SNDRV_PCM_FMTBIT_S32_LE) | 832 | | SNDRV_PCM_FMTBIT_S32_LE) |
833 | 833 | ||
834 | static const struct snd_soc_dai_ops alc5623_dai_ops = { | 834 | static const struct snd_soc_dai_ops alc5623_dai_ops = { |
835 | .hw_params = alc5623_pcm_hw_params, | 835 | .hw_params = alc5623_pcm_hw_params, |
836 | .digital_mute = alc5623_mute, | 836 | .digital_mute = alc5623_mute, |
837 | .set_fmt = alc5623_set_dai_fmt, | 837 | .set_fmt = alc5623_set_dai_fmt, |
838 | .set_sysclk = alc5623_set_dai_sysclk, | 838 | .set_sysclk = alc5623_set_dai_sysclk, |
839 | .set_pll = alc5623_set_dai_pll, | 839 | .set_pll = alc5623_set_dai_pll, |
840 | }; | 840 | }; |
841 | 841 | ||
842 | static struct snd_soc_dai_driver alc5623_dai = { | 842 | static struct snd_soc_dai_driver alc5623_dai = { |
843 | .name = "alc5623-hifi", | 843 | .name = "alc5623-hifi", |
844 | .playback = { | 844 | .playback = { |
845 | .stream_name = "Playback", | 845 | .stream_name = "Playback", |
846 | .channels_min = 1, | 846 | .channels_min = 1, |
847 | .channels_max = 2, | 847 | .channels_max = 2, |
848 | .rate_min = 8000, | 848 | .rate_min = 8000, |
849 | .rate_max = 48000, | 849 | .rate_max = 48000, |
850 | .rates = SNDRV_PCM_RATE_8000_48000, | 850 | .rates = SNDRV_PCM_RATE_8000_48000, |
851 | .formats = ALC5623_FORMATS,}, | 851 | .formats = ALC5623_FORMATS,}, |
852 | .capture = { | 852 | .capture = { |
853 | .stream_name = "Capture", | 853 | .stream_name = "Capture", |
854 | .channels_min = 1, | 854 | .channels_min = 1, |
855 | .channels_max = 2, | 855 | .channels_max = 2, |
856 | .rate_min = 8000, | 856 | .rate_min = 8000, |
857 | .rate_max = 48000, | 857 | .rate_max = 48000, |
858 | .rates = SNDRV_PCM_RATE_8000_48000, | 858 | .rates = SNDRV_PCM_RATE_8000_48000, |
859 | .formats = ALC5623_FORMATS,}, | 859 | .formats = ALC5623_FORMATS,}, |
860 | 860 | ||
861 | .ops = &alc5623_dai_ops, | 861 | .ops = &alc5623_dai_ops, |
862 | }; | 862 | }; |
863 | 863 | ||
864 | static int alc5623_suspend(struct snd_soc_codec *codec) | 864 | static int alc5623_suspend(struct snd_soc_codec *codec) |
865 | { | 865 | { |
866 | struct alc5623_priv *alc5623 = snd_soc_codec_get_drvdata(codec); | 866 | struct alc5623_priv *alc5623 = snd_soc_codec_get_drvdata(codec); |
867 | 867 | ||
868 | alc5623_set_bias_level(codec, SND_SOC_BIAS_OFF); | 868 | alc5623_set_bias_level(codec, SND_SOC_BIAS_OFF); |
869 | regcache_cache_only(alc5623->regmap, true); | 869 | regcache_cache_only(alc5623->regmap, true); |
870 | 870 | ||
871 | return 0; | 871 | return 0; |
872 | } | 872 | } |
873 | 873 | ||
874 | static int alc5623_resume(struct snd_soc_codec *codec) | 874 | static int alc5623_resume(struct snd_soc_codec *codec) |
875 | { | 875 | { |
876 | struct alc5623_priv *alc5623 = snd_soc_codec_get_drvdata(codec); | 876 | struct alc5623_priv *alc5623 = snd_soc_codec_get_drvdata(codec); |
877 | int ret; | 877 | int ret; |
878 | 878 | ||
879 | /* Sync reg_cache with the hardware */ | 879 | /* Sync reg_cache with the hardware */ |
880 | regcache_cache_only(alc5623->regmap, false); | 880 | regcache_cache_only(alc5623->regmap, false); |
881 | ret = regcache_sync(alc5623->regmap); | 881 | ret = regcache_sync(alc5623->regmap); |
882 | if (ret != 0) { | 882 | if (ret != 0) { |
883 | dev_err(codec->dev, "Failed to sync register cache: %d\n", | 883 | dev_err(codec->dev, "Failed to sync register cache: %d\n", |
884 | ret); | 884 | ret); |
885 | regcache_cache_only(alc5623->regmap, true); | 885 | regcache_cache_only(alc5623->regmap, true); |
886 | return ret; | 886 | return ret; |
887 | } | 887 | } |
888 | 888 | ||
889 | alc5623_set_bias_level(codec, SND_SOC_BIAS_STANDBY); | 889 | alc5623_set_bias_level(codec, SND_SOC_BIAS_STANDBY); |
890 | 890 | ||
891 | /* charge alc5623 caps */ | 891 | /* charge alc5623 caps */ |
892 | if (codec->dapm.suspend_bias_level == SND_SOC_BIAS_ON) { | 892 | if (codec->dapm.suspend_bias_level == SND_SOC_BIAS_ON) { |
893 | alc5623_set_bias_level(codec, SND_SOC_BIAS_STANDBY); | 893 | alc5623_set_bias_level(codec, SND_SOC_BIAS_STANDBY); |
894 | codec->dapm.bias_level = SND_SOC_BIAS_ON; | 894 | codec->dapm.bias_level = SND_SOC_BIAS_ON; |
895 | alc5623_set_bias_level(codec, codec->dapm.bias_level); | 895 | alc5623_set_bias_level(codec, codec->dapm.bias_level); |
896 | } | 896 | } |
897 | 897 | ||
898 | return 0; | 898 | return 0; |
899 | } | 899 | } |
900 | 900 | ||
901 | static int alc5623_probe(struct snd_soc_codec *codec) | 901 | static int alc5623_probe(struct snd_soc_codec *codec) |
902 | { | 902 | { |
903 | struct alc5623_priv *alc5623 = snd_soc_codec_get_drvdata(codec); | 903 | struct alc5623_priv *alc5623 = snd_soc_codec_get_drvdata(codec); |
904 | struct snd_soc_dapm_context *dapm = &codec->dapm; | 904 | struct snd_soc_dapm_context *dapm = &codec->dapm; |
905 | 905 | ||
906 | alc5623_reset(codec); | 906 | alc5623_reset(codec); |
907 | 907 | ||
908 | /* power on device */ | 908 | /* power on device */ |
909 | alc5623_set_bias_level(codec, SND_SOC_BIAS_STANDBY); | 909 | alc5623_set_bias_level(codec, SND_SOC_BIAS_STANDBY); |
910 | 910 | ||
911 | if (alc5623->add_ctrl) { | 911 | if (alc5623->add_ctrl) { |
912 | snd_soc_write(codec, ALC5623_ADD_CTRL_REG, | 912 | snd_soc_write(codec, ALC5623_ADD_CTRL_REG, |
913 | alc5623->add_ctrl); | 913 | alc5623->add_ctrl); |
914 | } | 914 | } |
915 | 915 | ||
916 | if (alc5623->jack_det_ctrl) { | 916 | if (alc5623->jack_det_ctrl) { |
917 | snd_soc_write(codec, ALC5623_JACK_DET_CTRL, | 917 | snd_soc_write(codec, ALC5623_JACK_DET_CTRL, |
918 | alc5623->jack_det_ctrl); | 918 | alc5623->jack_det_ctrl); |
919 | } | 919 | } |
920 | 920 | ||
921 | switch (alc5623->id) { | 921 | switch (alc5623->id) { |
922 | case 0x21: | 922 | case 0x21: |
923 | snd_soc_add_codec_controls(codec, alc5621_vol_snd_controls, | 923 | snd_soc_add_codec_controls(codec, alc5621_vol_snd_controls, |
924 | ARRAY_SIZE(alc5621_vol_snd_controls)); | 924 | ARRAY_SIZE(alc5621_vol_snd_controls)); |
925 | break; | 925 | break; |
926 | case 0x22: | 926 | case 0x22: |
927 | snd_soc_add_codec_controls(codec, alc5622_vol_snd_controls, | 927 | snd_soc_add_codec_controls(codec, alc5622_vol_snd_controls, |
928 | ARRAY_SIZE(alc5622_vol_snd_controls)); | 928 | ARRAY_SIZE(alc5622_vol_snd_controls)); |
929 | break; | 929 | break; |
930 | case 0x23: | 930 | case 0x23: |
931 | snd_soc_add_codec_controls(codec, alc5623_vol_snd_controls, | 931 | snd_soc_add_codec_controls(codec, alc5623_vol_snd_controls, |
932 | ARRAY_SIZE(alc5623_vol_snd_controls)); | 932 | ARRAY_SIZE(alc5623_vol_snd_controls)); |
933 | break; | 933 | break; |
934 | default: | 934 | default: |
935 | return -EINVAL; | 935 | return -EINVAL; |
936 | } | 936 | } |
937 | 937 | ||
938 | snd_soc_add_codec_controls(codec, alc5623_snd_controls, | 938 | snd_soc_add_codec_controls(codec, alc5623_snd_controls, |
939 | ARRAY_SIZE(alc5623_snd_controls)); | 939 | ARRAY_SIZE(alc5623_snd_controls)); |
940 | 940 | ||
941 | snd_soc_dapm_new_controls(dapm, alc5623_dapm_widgets, | 941 | snd_soc_dapm_new_controls(dapm, alc5623_dapm_widgets, |
942 | ARRAY_SIZE(alc5623_dapm_widgets)); | 942 | ARRAY_SIZE(alc5623_dapm_widgets)); |
943 | 943 | ||
944 | /* set up audio path interconnects */ | 944 | /* set up audio path interconnects */ |
945 | snd_soc_dapm_add_routes(dapm, intercon, ARRAY_SIZE(intercon)); | 945 | snd_soc_dapm_add_routes(dapm, intercon, ARRAY_SIZE(intercon)); |
946 | 946 | ||
947 | switch (alc5623->id) { | 947 | switch (alc5623->id) { |
948 | case 0x21: | 948 | case 0x21: |
949 | case 0x22: | 949 | case 0x22: |
950 | snd_soc_dapm_new_controls(dapm, alc5623_dapm_amp_widgets, | 950 | snd_soc_dapm_new_controls(dapm, alc5623_dapm_amp_widgets, |
951 | ARRAY_SIZE(alc5623_dapm_amp_widgets)); | 951 | ARRAY_SIZE(alc5623_dapm_amp_widgets)); |
952 | snd_soc_dapm_add_routes(dapm, intercon_amp_spk, | 952 | snd_soc_dapm_add_routes(dapm, intercon_amp_spk, |
953 | ARRAY_SIZE(intercon_amp_spk)); | 953 | ARRAY_SIZE(intercon_amp_spk)); |
954 | break; | 954 | break; |
955 | case 0x23: | 955 | case 0x23: |
956 | snd_soc_dapm_add_routes(dapm, intercon_spk, | 956 | snd_soc_dapm_add_routes(dapm, intercon_spk, |
957 | ARRAY_SIZE(intercon_spk)); | 957 | ARRAY_SIZE(intercon_spk)); |
958 | break; | 958 | break; |
959 | default: | 959 | default: |
960 | return -EINVAL; | 960 | return -EINVAL; |
961 | } | 961 | } |
962 | 962 | ||
963 | return 0; | 963 | return 0; |
964 | } | 964 | } |
965 | 965 | ||
966 | /* power down chip */ | 966 | /* power down chip */ |
967 | static int alc5623_remove(struct snd_soc_codec *codec) | 967 | static int alc5623_remove(struct snd_soc_codec *codec) |
968 | { | 968 | { |
969 | alc5623_set_bias_level(codec, SND_SOC_BIAS_OFF); | 969 | alc5623_set_bias_level(codec, SND_SOC_BIAS_OFF); |
970 | return 0; | 970 | return 0; |
971 | } | 971 | } |
972 | 972 | ||
973 | static struct snd_soc_codec_driver soc_codec_device_alc5623 = { | 973 | static struct snd_soc_codec_driver soc_codec_device_alc5623 = { |
974 | .probe = alc5623_probe, | 974 | .probe = alc5623_probe, |
975 | .remove = alc5623_remove, | 975 | .remove = alc5623_remove, |
976 | .suspend = alc5623_suspend, | 976 | .suspend = alc5623_suspend, |
977 | .resume = alc5623_resume, | 977 | .resume = alc5623_resume, |
978 | .set_bias_level = alc5623_set_bias_level, | 978 | .set_bias_level = alc5623_set_bias_level, |
979 | }; | 979 | }; |
980 | 980 | ||
981 | static const struct regmap_config alc5623_regmap = { | 981 | static const struct regmap_config alc5623_regmap = { |
982 | .reg_bits = 8, | 982 | .reg_bits = 8, |
983 | .val_bits = 16, | 983 | .val_bits = 16, |
984 | .reg_stride = 2, | 984 | .reg_stride = 2, |
985 | 985 | ||
986 | .max_register = ALC5623_VENDOR_ID2, | 986 | .max_register = ALC5623_VENDOR_ID2, |
987 | .cache_type = REGCACHE_RBTREE, | 987 | .cache_type = REGCACHE_RBTREE, |
988 | }; | 988 | }; |
989 | 989 | ||
990 | /* | 990 | /* |
991 | * ALC5623 2 wire address is determined by A1 pin | 991 | * ALC5623 2 wire address is determined by A1 pin |
992 | * state during powerup. | 992 | * state during powerup. |
993 | * low = 0x1a | 993 | * low = 0x1a |
994 | * high = 0x1b | 994 | * high = 0x1b |
995 | */ | 995 | */ |
996 | static int alc5623_i2c_probe(struct i2c_client *client, | 996 | static int alc5623_i2c_probe(struct i2c_client *client, |
997 | const struct i2c_device_id *id) | 997 | const struct i2c_device_id *id) |
998 | { | 998 | { |
999 | struct alc5623_platform_data *pdata; | 999 | struct alc5623_platform_data *pdata; |
1000 | struct alc5623_priv *alc5623; | 1000 | struct alc5623_priv *alc5623; |
1001 | unsigned int vid1, vid2; | 1001 | unsigned int vid1, vid2; |
1002 | int ret; | 1002 | int ret; |
1003 | 1003 | ||
1004 | alc5623 = devm_kzalloc(&client->dev, sizeof(struct alc5623_priv), | 1004 | alc5623 = devm_kzalloc(&client->dev, sizeof(struct alc5623_priv), |
1005 | GFP_KERNEL); | 1005 | GFP_KERNEL); |
1006 | if (alc5623 == NULL) | 1006 | if (alc5623 == NULL) |
1007 | return -ENOMEM; | 1007 | return -ENOMEM; |
1008 | 1008 | ||
1009 | alc5623->regmap = devm_regmap_init_i2c(client, &alc5623_regmap); | 1009 | alc5623->regmap = devm_regmap_init_i2c(client, &alc5623_regmap); |
1010 | if (IS_ERR(alc5623->regmap)) { | 1010 | if (IS_ERR(alc5623->regmap)) { |
1011 | ret = PTR_ERR(alc5623->regmap); | 1011 | ret = PTR_ERR(alc5623->regmap); |
1012 | dev_err(&client->dev, "Failed to initialise I/O: %d\n", ret); | 1012 | dev_err(&client->dev, "Failed to initialise I/O: %d\n", ret); |
1013 | return ret; | 1013 | return ret; |
1014 | } | 1014 | } |
1015 | 1015 | ||
1016 | ret = regmap_read(alc5623->regmap, ALC5623_VENDOR_ID1, &vid1); | 1016 | ret = regmap_read(alc5623->regmap, ALC5623_VENDOR_ID1, &vid1); |
1017 | if (ret < 0) { | 1017 | if (ret < 0) { |
1018 | dev_err(&client->dev, "failed to read vendor ID1: %d\n", ret); | 1018 | dev_err(&client->dev, "failed to read vendor ID1: %d\n", ret); |
1019 | return ret; | 1019 | return ret; |
1020 | } | 1020 | } |
1021 | vid1 = ((vid1 & 0xff) << 8) | (vid1 >> 8); | ||
1022 | 1021 | ||
1023 | ret = regmap_read(alc5623->regmap, ALC5623_VENDOR_ID2, &vid2); | 1022 | ret = regmap_read(alc5623->regmap, ALC5623_VENDOR_ID2, &vid2); |
1024 | if (ret < 0) { | 1023 | if (ret < 0) { |
1025 | dev_err(&client->dev, "failed to read vendor ID2: %d\n", ret); | 1024 | dev_err(&client->dev, "failed to read vendor ID2: %d\n", ret); |
1026 | return ret; | 1025 | return ret; |
1027 | } | 1026 | } |
1027 | vid2 >>= 8; | ||
1028 | 1028 | ||
1029 | if ((vid1 != 0x10ec) || (vid2 != id->driver_data)) { | 1029 | if ((vid1 != 0x10ec) || (vid2 != id->driver_data)) { |
1030 | dev_err(&client->dev, "unknown or wrong codec\n"); | 1030 | dev_err(&client->dev, "unknown or wrong codec\n"); |
1031 | dev_err(&client->dev, "Expected %x:%lx, got %x:%x\n", | 1031 | dev_err(&client->dev, "Expected %x:%lx, got %x:%x\n", |
1032 | 0x10ec, id->driver_data, | 1032 | 0x10ec, id->driver_data, |
1033 | vid1, vid2); | 1033 | vid1, vid2); |
1034 | return -ENODEV; | 1034 | return -ENODEV; |
1035 | } | 1035 | } |
1036 | 1036 | ||
1037 | dev_dbg(&client->dev, "Found codec id : alc56%02x\n", vid2); | 1037 | dev_dbg(&client->dev, "Found codec id : alc56%02x\n", vid2); |
1038 | 1038 | ||
1039 | pdata = client->dev.platform_data; | 1039 | pdata = client->dev.platform_data; |
1040 | if (pdata) { | 1040 | if (pdata) { |
1041 | alc5623->add_ctrl = pdata->add_ctrl; | 1041 | alc5623->add_ctrl = pdata->add_ctrl; |
1042 | alc5623->jack_det_ctrl = pdata->jack_det_ctrl; | 1042 | alc5623->jack_det_ctrl = pdata->jack_det_ctrl; |
1043 | } | 1043 | } |
1044 | 1044 | ||
1045 | alc5623->id = vid2; | 1045 | alc5623->id = vid2; |
1046 | switch (alc5623->id) { | 1046 | switch (alc5623->id) { |
1047 | case 0x21: | 1047 | case 0x21: |
1048 | alc5623_dai.name = "alc5621-hifi"; | 1048 | alc5623_dai.name = "alc5621-hifi"; |
1049 | break; | 1049 | break; |
1050 | case 0x22: | 1050 | case 0x22: |
1051 | alc5623_dai.name = "alc5622-hifi"; | 1051 | alc5623_dai.name = "alc5622-hifi"; |
1052 | break; | 1052 | break; |
1053 | case 0x23: | 1053 | case 0x23: |
1054 | alc5623_dai.name = "alc5623-hifi"; | 1054 | alc5623_dai.name = "alc5623-hifi"; |
1055 | break; | 1055 | break; |
1056 | default: | 1056 | default: |
1057 | return -EINVAL; | 1057 | return -EINVAL; |
1058 | } | 1058 | } |
1059 | 1059 | ||
1060 | i2c_set_clientdata(client, alc5623); | 1060 | i2c_set_clientdata(client, alc5623); |
1061 | 1061 | ||
1062 | ret = snd_soc_register_codec(&client->dev, | 1062 | ret = snd_soc_register_codec(&client->dev, |
1063 | &soc_codec_device_alc5623, &alc5623_dai, 1); | 1063 | &soc_codec_device_alc5623, &alc5623_dai, 1); |
1064 | if (ret != 0) | 1064 | if (ret != 0) |
1065 | dev_err(&client->dev, "Failed to register codec: %d\n", ret); | 1065 | dev_err(&client->dev, "Failed to register codec: %d\n", ret); |
1066 | 1066 | ||
1067 | return ret; | 1067 | return ret; |
1068 | } | 1068 | } |
1069 | 1069 | ||
1070 | static int alc5623_i2c_remove(struct i2c_client *client) | 1070 | static int alc5623_i2c_remove(struct i2c_client *client) |
1071 | { | 1071 | { |
1072 | snd_soc_unregister_codec(&client->dev); | 1072 | snd_soc_unregister_codec(&client->dev); |
1073 | return 0; | 1073 | return 0; |
1074 | } | 1074 | } |
1075 | 1075 | ||
1076 | static const struct i2c_device_id alc5623_i2c_table[] = { | 1076 | static const struct i2c_device_id alc5623_i2c_table[] = { |
1077 | {"alc5621", 0x21}, | 1077 | {"alc5621", 0x21}, |
1078 | {"alc5622", 0x22}, | 1078 | {"alc5622", 0x22}, |
1079 | {"alc5623", 0x23}, | 1079 | {"alc5623", 0x23}, |
1080 | {} | 1080 | {} |
1081 | }; | 1081 | }; |
1082 | MODULE_DEVICE_TABLE(i2c, alc5623_i2c_table); | 1082 | MODULE_DEVICE_TABLE(i2c, alc5623_i2c_table); |
1083 | 1083 | ||
1084 | /* i2c codec control layer */ | 1084 | /* i2c codec control layer */ |
1085 | static struct i2c_driver alc5623_i2c_driver = { | 1085 | static struct i2c_driver alc5623_i2c_driver = { |
1086 | .driver = { | 1086 | .driver = { |
1087 | .name = "alc562x-codec", | 1087 | .name = "alc562x-codec", |
1088 | .owner = THIS_MODULE, | 1088 | .owner = THIS_MODULE, |
1089 | }, | 1089 | }, |
1090 | .probe = alc5623_i2c_probe, | 1090 | .probe = alc5623_i2c_probe, |
1091 | .remove = alc5623_i2c_remove, | 1091 | .remove = alc5623_i2c_remove, |
1092 | .id_table = alc5623_i2c_table, | 1092 | .id_table = alc5623_i2c_table, |
1093 | }; | 1093 | }; |
1094 | 1094 | ||
1095 | module_i2c_driver(alc5623_i2c_driver); | 1095 | module_i2c_driver(alc5623_i2c_driver); |
1096 | 1096 | ||
1097 | MODULE_DESCRIPTION("ASoC alc5621/2/3 driver"); | 1097 | MODULE_DESCRIPTION("ASoC alc5621/2/3 driver"); |
1098 | MODULE_AUTHOR("Arnaud Patard <arnaud.patard@rtp-net.org>"); | 1098 | MODULE_AUTHOR("Arnaud Patard <arnaud.patard@rtp-net.org>"); |
1099 | MODULE_LICENSE("GPL"); | 1099 | MODULE_LICENSE("GPL"); |