blob: f13f2886339ca4dee110746da3bbe838d99976c1 [file] [log] [blame]
Mark Browna2342ae2009-07-29 21:21:49 +01001/*
2 * wm_hubs.c -- WM8993/4 common code
3 *
4 * Copyright 2009 Wolfson Microelectronics plc
5 *
6 * Author: Mark Brown <broonie@opensource.wolfsonmicro.com>
7 *
8 *
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
11 * published by the Free Software Foundation.
12 */
13
14#include <linux/module.h>
15#include <linux/moduleparam.h>
16#include <linux/init.h>
17#include <linux/delay.h>
18#include <linux/pm.h>
19#include <linux/i2c.h>
Mark Brown79ef0ab2011-08-01 13:02:17 +090020#include <linux/mfd/wm8994/registers.h>
Mark Browna2342ae2009-07-29 21:21:49 +010021#include <sound/core.h>
22#include <sound/pcm.h>
23#include <sound/pcm_params.h>
24#include <sound/soc.h>
Mark Browna2342ae2009-07-29 21:21:49 +010025#include <sound/initval.h>
26#include <sound/tlv.h>
27
28#include "wm8993.h"
29#include "wm_hubs.h"
30
31const DECLARE_TLV_DB_SCALE(wm_hubs_spkmix_tlv, -300, 300, 0);
32EXPORT_SYMBOL_GPL(wm_hubs_spkmix_tlv);
33
34static const DECLARE_TLV_DB_SCALE(inpga_tlv, -1650, 150, 0);
35static const DECLARE_TLV_DB_SCALE(inmix_sw_tlv, 0, 3000, 0);
36static const DECLARE_TLV_DB_SCALE(inmix_tlv, -1500, 300, 1);
37static const DECLARE_TLV_DB_SCALE(earpiece_tlv, -600, 600, 0);
38static const DECLARE_TLV_DB_SCALE(outmix_tlv, -2100, 300, 0);
39static const DECLARE_TLV_DB_SCALE(spkmixout_tlv, -1800, 600, 1);
40static const DECLARE_TLV_DB_SCALE(outpga_tlv, -5700, 100, 0);
41static const unsigned int spkboost_tlv[] = {
Clemens Ladisch028aa632011-11-20 15:15:31 +010042 TLV_DB_RANGE_HEAD(2),
Mark Browna2342ae2009-07-29 21:21:49 +010043 0, 6, TLV_DB_SCALE_ITEM(0, 150, 0),
44 7, 7, TLV_DB_SCALE_ITEM(1200, 0, 0),
45};
46static const DECLARE_TLV_DB_SCALE(line_tlv, -600, 600, 0);
47
48static const char *speaker_ref_text[] = {
49 "SPKVDD/2",
50 "VMID",
51};
52
53static const struct soc_enum speaker_ref =
54 SOC_ENUM_SINGLE(WM8993_SPEAKER_MIXER, 8, 2, speaker_ref_text);
55
56static const char *speaker_mode_text[] = {
57 "Class D",
58 "Class AB",
59};
60
61static const struct soc_enum speaker_mode =
62 SOC_ENUM_SINGLE(WM8993_SPKMIXR_ATTENUATION, 8, 2, speaker_mode_text);
63
Mark Brown4dcc93d2010-03-29 17:18:41 +010064static void wait_for_dc_servo(struct snd_soc_codec *codec, unsigned int op)
Mark Browna2342ae2009-07-29 21:21:49 +010065{
Mark Brownd96ca3c2011-07-12 15:25:03 +090066 struct wm_hubs_data *hubs = snd_soc_codec_get_drvdata(codec);
Mark Browna2342ae2009-07-29 21:21:49 +010067 unsigned int reg;
68 int count = 0;
Mark Brown1479c3f2011-07-15 17:33:26 +090069 int timeout;
Mark Brown4dcc93d2010-03-29 17:18:41 +010070 unsigned int val;
71
72 val = op | WM8993_DCS_ENA_CHAN_0 | WM8993_DCS_ENA_CHAN_1;
73
74 /* Trigger the command */
75 snd_soc_write(codec, WM8993_DC_SERVO_0, val);
Mark Browna2342ae2009-07-29 21:21:49 +010076
77 dev_dbg(codec->dev, "Waiting for DC servo...\n");
Mark Brown3ed70742010-01-20 17:39:45 +000078
Mark Brown1479c3f2011-07-15 17:33:26 +090079 if (hubs->dcs_done_irq)
80 timeout = 4;
81 else
82 timeout = 400;
83
84 do {
85 count++;
86
87 if (hubs->dcs_done_irq)
88 wait_for_completion_timeout(&hubs->dcs_done,
89 msecs_to_jiffies(250));
90 else
91 msleep(1);
Mark Brownd96ca3c2011-07-12 15:25:03 +090092
Mark Brown4dcc93d2010-03-29 17:18:41 +010093 reg = snd_soc_read(codec, WM8993_DC_SERVO_0);
Mark Brown1479c3f2011-07-15 17:33:26 +090094 dev_dbg(codec->dev, "DC servo: %x\n", reg);
95 } while (reg & op && count < timeout);
Mark Browna2342ae2009-07-29 21:21:49 +010096
Mark Brown4dcc93d2010-03-29 17:18:41 +010097 if (reg & op)
Mark Brown5a9f91c2011-02-17 12:05:46 -080098 dev_err(codec->dev, "Timed out waiting for DC Servo %x\n",
99 op);
Mark Browna2342ae2009-07-29 21:21:49 +0100100}
101
Mark Brownd96ca3c2011-07-12 15:25:03 +0900102irqreturn_t wm_hubs_dcs_done(int irq, void *data)
103{
104 struct wm_hubs_data *hubs = data;
105
106 complete(&hubs->dcs_done);
107
108 return IRQ_HANDLED;
109}
110EXPORT_SYMBOL_GPL(wm_hubs_dcs_done);
111
Mark Browna2342ae2009-07-29 21:21:49 +0100112/*
Mark Brown3ed70742010-01-20 17:39:45 +0000113 * Startup calibration of the DC servo
114 */
115static void calibrate_dc_servo(struct snd_soc_codec *codec)
116{
Mark Brownb2c812e2010-04-14 15:35:19 +0900117 struct wm_hubs_data *hubs = snd_soc_codec_get_drvdata(codec);
Mark Brown20a4e7f2011-01-21 12:47:33 +0000118 s8 offset;
Mark Brown79ef0ab2011-08-01 13:02:17 +0900119 u16 reg, reg_l, reg_r, dcs_cfg, dcs_reg;
120
121 switch (hubs->dcs_readback_mode) {
122 case 2:
123 dcs_reg = WM8994_DC_SERVO_4E;
124 break;
125 default:
126 dcs_reg = WM8993_DC_SERVO_3;
127 break;
128 }
Mark Brown3ed70742010-01-20 17:39:45 +0000129
Mark Brownfec6dd82010-10-27 13:48:36 -0700130 /* If we're using a digital only path and have a previously
131 * callibrated DC servo offset stored then use that. */
132 if (hubs->class_w && hubs->class_w_dcs) {
133 dev_dbg(codec->dev, "Using cached DC servo offset %x\n",
134 hubs->class_w_dcs);
Mark Brown79ef0ab2011-08-01 13:02:17 +0900135 snd_soc_write(codec, dcs_reg, hubs->class_w_dcs);
Mark Brownfec6dd82010-10-27 13:48:36 -0700136 wait_for_dc_servo(codec,
137 WM8993_DCS_TRIG_DAC_WR_0 |
138 WM8993_DCS_TRIG_DAC_WR_1);
139 return;
140 }
141
Mark Brownf9acf9f2011-06-07 23:23:52 +0100142 if (hubs->series_startup) {
Mark Brown11cef5f2010-11-26 17:23:44 +0000143 /* Set for 32 series updates */
144 snd_soc_update_bits(codec, WM8993_DC_SERVO_1,
145 WM8993_DCS_SERIES_NO_01_MASK,
146 32 << WM8993_DCS_SERIES_NO_01_SHIFT);
147 wait_for_dc_servo(codec,
148 WM8993_DCS_TRIG_SERIES_0 |
149 WM8993_DCS_TRIG_SERIES_1);
150 } else {
151 wait_for_dc_servo(codec,
152 WM8993_DCS_TRIG_STARTUP_0 |
153 WM8993_DCS_TRIG_STARTUP_1);
154 }
Mark Brown3ed70742010-01-20 17:39:45 +0000155
Mark Brownfec6dd82010-10-27 13:48:36 -0700156 /* Different chips in the family support different readback
157 * methods.
158 */
159 switch (hubs->dcs_readback_mode) {
160 case 0:
161 reg_l = snd_soc_read(codec, WM8993_DC_SERVO_READBACK_1)
Joe Perchesef995e32010-11-15 09:09:17 -0800162 & WM8993_DCS_INTEG_CHAN_0_MASK;
Mark Brownfec6dd82010-10-27 13:48:36 -0700163 reg_r = snd_soc_read(codec, WM8993_DC_SERVO_READBACK_2)
164 & WM8993_DCS_INTEG_CHAN_1_MASK;
165 break;
Mark Brown79ef0ab2011-08-01 13:02:17 +0900166 case 2:
Mark Brownfec6dd82010-10-27 13:48:36 -0700167 case 1:
Mark Brown79ef0ab2011-08-01 13:02:17 +0900168 reg = snd_soc_read(codec, dcs_reg);
Mark Brownd5b040c2011-06-07 23:28:45 +0100169 reg_r = (reg & WM8993_DCS_DAC_WR_VAL_1_MASK)
Mark Brownfec6dd82010-10-27 13:48:36 -0700170 >> WM8993_DCS_DAC_WR_VAL_1_SHIFT;
Mark Brownd5b040c2011-06-07 23:28:45 +0100171 reg_l = reg & WM8993_DCS_DAC_WR_VAL_0_MASK;
Mark Brownfec6dd82010-10-27 13:48:36 -0700172 break;
173 default:
Mark Brown9e3be1e2010-11-02 09:58:49 -0400174 WARN(1, "Unknown DCS readback method\n");
Mark Browne778ba02012-02-29 15:39:56 +0000175 return;
Mark Brownfec6dd82010-10-27 13:48:36 -0700176 }
177
178 dev_dbg(codec->dev, "DCS input: %x %x\n", reg_l, reg_r);
179
Mark Brown3ed70742010-01-20 17:39:45 +0000180 /* Apply correction to DC servo result */
Mark Brown4537c4e2011-08-01 13:10:16 +0900181 if (hubs->dcs_codes_l || hubs->dcs_codes_r) {
182 dev_dbg(codec->dev,
183 "Applying %d/%d code DC servo correction\n",
184 hubs->dcs_codes_l, hubs->dcs_codes_r);
Mark Brown3ed70742010-01-20 17:39:45 +0000185
Mark Brownd5b040c2011-06-07 23:28:45 +0100186 /* HPOUT1R */
187 offset = reg_r;
Mark Brown4537c4e2011-08-01 13:10:16 +0900188 offset += hubs->dcs_codes_r;
Mark Brown20a4e7f2011-01-21 12:47:33 +0000189 dcs_cfg = (u8)offset << WM8993_DCS_DAC_WR_VAL_1_SHIFT;
Mark Brown3ed70742010-01-20 17:39:45 +0000190
Mark Brownd5b040c2011-06-07 23:28:45 +0100191 /* HPOUT1L */
192 offset = reg_l;
Mark Brown4537c4e2011-08-01 13:10:16 +0900193 offset += hubs->dcs_codes_l;
Mark Brown20a4e7f2011-01-21 12:47:33 +0000194 dcs_cfg |= (u8)offset;
Mark Brown3ed70742010-01-20 17:39:45 +0000195
Mark Brown3254d282010-05-10 14:56:03 +0100196 dev_dbg(codec->dev, "DCS result: %x\n", dcs_cfg);
197
Mark Brown3ed70742010-01-20 17:39:45 +0000198 /* Do it */
Mark Brown79ef0ab2011-08-01 13:02:17 +0900199 snd_soc_write(codec, dcs_reg, dcs_cfg);
Mark Brown4dcc93d2010-03-29 17:18:41 +0100200 wait_for_dc_servo(codec,
201 WM8993_DCS_TRIG_DAC_WR_0 |
202 WM8993_DCS_TRIG_DAC_WR_1);
Mark Brownfec6dd82010-10-27 13:48:36 -0700203 } else {
Mark Brownd5b040c2011-06-07 23:28:45 +0100204 dcs_cfg = reg_r << WM8993_DCS_DAC_WR_VAL_1_SHIFT;
205 dcs_cfg |= reg_l;
Mark Brown3ed70742010-01-20 17:39:45 +0000206 }
Mark Brownfec6dd82010-10-27 13:48:36 -0700207
208 /* Save the callibrated offset if we're in class W mode and
209 * therefore don't have any analogue signal mixed in. */
Mark Brown67109cb2012-02-29 16:40:08 +0000210 if (hubs->class_w && !hubs->no_cache_class_w)
Mark Brownfec6dd82010-10-27 13:48:36 -0700211 hubs->class_w_dcs = dcs_cfg;
Mark Brown3ed70742010-01-20 17:39:45 +0000212}
213
214/*
Mark Browna2342ae2009-07-29 21:21:49 +0100215 * Update the DC servo calibration on gain changes
216 */
217static int wm8993_put_dc_servo(struct snd_kcontrol *kcontrol,
Mark Brown3ed70742010-01-20 17:39:45 +0000218 struct snd_ctl_elem_value *ucontrol)
Mark Browna2342ae2009-07-29 21:21:49 +0100219{
220 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
Mark Brownb2c812e2010-04-14 15:35:19 +0900221 struct wm_hubs_data *hubs = snd_soc_codec_get_drvdata(codec);
Mark Browna2342ae2009-07-29 21:21:49 +0100222 int ret;
223
Peter Ujfalusic4671a92011-10-06 09:59:12 +0300224 ret = snd_soc_put_volsw(kcontrol, ucontrol);
Mark Browna2342ae2009-07-29 21:21:49 +0100225
Mark Brownfec6dd82010-10-27 13:48:36 -0700226 /* Updating the analogue gains invalidates the DC servo cache */
227 hubs->class_w_dcs = 0;
228
Mark Brownae9d8602010-03-29 16:34:42 +0100229 /* If we're applying an offset correction then updating the
230 * callibration would be likely to introduce further offsets. */
Mark Brown4537c4e2011-08-01 13:10:16 +0900231 if (hubs->dcs_codes_l || hubs->dcs_codes_r || hubs->no_series_update)
Mark Brownae9d8602010-03-29 16:34:42 +0100232 return ret;
233
Mark Browna2342ae2009-07-29 21:21:49 +0100234 /* Only need to do this if the outputs are active */
235 if (snd_soc_read(codec, WM8993_POWER_MANAGEMENT_1)
236 & (WM8993_HPOUT1L_ENA | WM8993_HPOUT1R_ENA))
237 snd_soc_update_bits(codec,
238 WM8993_DC_SERVO_0,
239 WM8993_DCS_TRIG_SINGLE_0 |
240 WM8993_DCS_TRIG_SINGLE_1,
241 WM8993_DCS_TRIG_SINGLE_0 |
242 WM8993_DCS_TRIG_SINGLE_1);
243
244 return ret;
245}
246
247static const struct snd_kcontrol_new analogue_snd_controls[] = {
248SOC_SINGLE_TLV("IN1L Volume", WM8993_LEFT_LINE_INPUT_1_2_VOLUME, 0, 31, 0,
249 inpga_tlv),
250SOC_SINGLE("IN1L Switch", WM8993_LEFT_LINE_INPUT_1_2_VOLUME, 7, 1, 1),
Mark Brownea02c632011-05-27 21:56:16 +0800251SOC_SINGLE("IN1L ZC Switch", WM8993_LEFT_LINE_INPUT_1_2_VOLUME, 6, 1, 0),
Mark Browna2342ae2009-07-29 21:21:49 +0100252
253SOC_SINGLE_TLV("IN1R Volume", WM8993_RIGHT_LINE_INPUT_1_2_VOLUME, 0, 31, 0,
254 inpga_tlv),
255SOC_SINGLE("IN1R Switch", WM8993_RIGHT_LINE_INPUT_1_2_VOLUME, 7, 1, 1),
Mark Brownea02c632011-05-27 21:56:16 +0800256SOC_SINGLE("IN1R ZC Switch", WM8993_RIGHT_LINE_INPUT_1_2_VOLUME, 6, 1, 0),
Mark Browna2342ae2009-07-29 21:21:49 +0100257
258
259SOC_SINGLE_TLV("IN2L Volume", WM8993_LEFT_LINE_INPUT_3_4_VOLUME, 0, 31, 0,
260 inpga_tlv),
261SOC_SINGLE("IN2L Switch", WM8993_LEFT_LINE_INPUT_3_4_VOLUME, 7, 1, 1),
Mark Brownea02c632011-05-27 21:56:16 +0800262SOC_SINGLE("IN2L ZC Switch", WM8993_LEFT_LINE_INPUT_3_4_VOLUME, 6, 1, 0),
Mark Browna2342ae2009-07-29 21:21:49 +0100263
264SOC_SINGLE_TLV("IN2R Volume", WM8993_RIGHT_LINE_INPUT_3_4_VOLUME, 0, 31, 0,
265 inpga_tlv),
266SOC_SINGLE("IN2R Switch", WM8993_RIGHT_LINE_INPUT_3_4_VOLUME, 7, 1, 1),
Mark Brownea02c632011-05-27 21:56:16 +0800267SOC_SINGLE("IN2R ZC Switch", WM8993_RIGHT_LINE_INPUT_3_4_VOLUME, 6, 1, 0),
Mark Browna2342ae2009-07-29 21:21:49 +0100268
269SOC_SINGLE_TLV("MIXINL IN2L Volume", WM8993_INPUT_MIXER3, 7, 1, 0,
270 inmix_sw_tlv),
271SOC_SINGLE_TLV("MIXINL IN1L Volume", WM8993_INPUT_MIXER3, 4, 1, 0,
272 inmix_sw_tlv),
273SOC_SINGLE_TLV("MIXINL Output Record Volume", WM8993_INPUT_MIXER3, 0, 7, 0,
274 inmix_tlv),
275SOC_SINGLE_TLV("MIXINL IN1LP Volume", WM8993_INPUT_MIXER5, 6, 7, 0, inmix_tlv),
276SOC_SINGLE_TLV("MIXINL Direct Voice Volume", WM8993_INPUT_MIXER5, 0, 6, 0,
277 inmix_tlv),
278
279SOC_SINGLE_TLV("MIXINR IN2R Volume", WM8993_INPUT_MIXER4, 7, 1, 0,
280 inmix_sw_tlv),
281SOC_SINGLE_TLV("MIXINR IN1R Volume", WM8993_INPUT_MIXER4, 4, 1, 0,
282 inmix_sw_tlv),
283SOC_SINGLE_TLV("MIXINR Output Record Volume", WM8993_INPUT_MIXER4, 0, 7, 0,
284 inmix_tlv),
285SOC_SINGLE_TLV("MIXINR IN1RP Volume", WM8993_INPUT_MIXER6, 6, 7, 0, inmix_tlv),
286SOC_SINGLE_TLV("MIXINR Direct Voice Volume", WM8993_INPUT_MIXER6, 0, 6, 0,
287 inmix_tlv),
288
289SOC_SINGLE_TLV("Left Output Mixer IN2RN Volume", WM8993_OUTPUT_MIXER5, 6, 7, 1,
290 outmix_tlv),
291SOC_SINGLE_TLV("Left Output Mixer IN2LN Volume", WM8993_OUTPUT_MIXER3, 6, 7, 1,
292 outmix_tlv),
293SOC_SINGLE_TLV("Left Output Mixer IN2LP Volume", WM8993_OUTPUT_MIXER3, 9, 7, 1,
294 outmix_tlv),
295SOC_SINGLE_TLV("Left Output Mixer IN1L Volume", WM8993_OUTPUT_MIXER3, 0, 7, 1,
296 outmix_tlv),
297SOC_SINGLE_TLV("Left Output Mixer IN1R Volume", WM8993_OUTPUT_MIXER3, 3, 7, 1,
298 outmix_tlv),
299SOC_SINGLE_TLV("Left Output Mixer Right Input Volume",
300 WM8993_OUTPUT_MIXER5, 3, 7, 1, outmix_tlv),
301SOC_SINGLE_TLV("Left Output Mixer Left Input Volume",
302 WM8993_OUTPUT_MIXER5, 0, 7, 1, outmix_tlv),
303SOC_SINGLE_TLV("Left Output Mixer DAC Volume", WM8993_OUTPUT_MIXER5, 9, 7, 1,
304 outmix_tlv),
305
306SOC_SINGLE_TLV("Right Output Mixer IN2LN Volume",
307 WM8993_OUTPUT_MIXER6, 6, 7, 1, outmix_tlv),
308SOC_SINGLE_TLV("Right Output Mixer IN2RN Volume",
309 WM8993_OUTPUT_MIXER4, 6, 7, 1, outmix_tlv),
310SOC_SINGLE_TLV("Right Output Mixer IN1L Volume",
311 WM8993_OUTPUT_MIXER4, 3, 7, 1, outmix_tlv),
312SOC_SINGLE_TLV("Right Output Mixer IN1R Volume",
313 WM8993_OUTPUT_MIXER4, 0, 7, 1, outmix_tlv),
314SOC_SINGLE_TLV("Right Output Mixer IN2RP Volume",
315 WM8993_OUTPUT_MIXER4, 9, 7, 1, outmix_tlv),
316SOC_SINGLE_TLV("Right Output Mixer Left Input Volume",
317 WM8993_OUTPUT_MIXER6, 3, 7, 1, outmix_tlv),
318SOC_SINGLE_TLV("Right Output Mixer Right Input Volume",
319 WM8993_OUTPUT_MIXER6, 6, 7, 1, outmix_tlv),
320SOC_SINGLE_TLV("Right Output Mixer DAC Volume",
321 WM8993_OUTPUT_MIXER6, 9, 7, 1, outmix_tlv),
322
323SOC_DOUBLE_R_TLV("Output Volume", WM8993_LEFT_OPGA_VOLUME,
324 WM8993_RIGHT_OPGA_VOLUME, 0, 63, 0, outpga_tlv),
325SOC_DOUBLE_R("Output Switch", WM8993_LEFT_OPGA_VOLUME,
326 WM8993_RIGHT_OPGA_VOLUME, 6, 1, 0),
327SOC_DOUBLE_R("Output ZC Switch", WM8993_LEFT_OPGA_VOLUME,
328 WM8993_RIGHT_OPGA_VOLUME, 7, 1, 0),
329
330SOC_SINGLE("Earpiece Switch", WM8993_HPOUT2_VOLUME, 5, 1, 1),
331SOC_SINGLE_TLV("Earpiece Volume", WM8993_HPOUT2_VOLUME, 4, 1, 1, earpiece_tlv),
332
333SOC_SINGLE_TLV("SPKL Input Volume", WM8993_SPKMIXL_ATTENUATION,
334 5, 1, 1, wm_hubs_spkmix_tlv),
335SOC_SINGLE_TLV("SPKL IN1LP Volume", WM8993_SPKMIXL_ATTENUATION,
336 4, 1, 1, wm_hubs_spkmix_tlv),
337SOC_SINGLE_TLV("SPKL Output Volume", WM8993_SPKMIXL_ATTENUATION,
338 3, 1, 1, wm_hubs_spkmix_tlv),
339
340SOC_SINGLE_TLV("SPKR Input Volume", WM8993_SPKMIXR_ATTENUATION,
341 5, 1, 1, wm_hubs_spkmix_tlv),
342SOC_SINGLE_TLV("SPKR IN1RP Volume", WM8993_SPKMIXR_ATTENUATION,
343 4, 1, 1, wm_hubs_spkmix_tlv),
344SOC_SINGLE_TLV("SPKR Output Volume", WM8993_SPKMIXR_ATTENUATION,
345 3, 1, 1, wm_hubs_spkmix_tlv),
346
347SOC_DOUBLE_R_TLV("Speaker Mixer Volume",
348 WM8993_SPKMIXL_ATTENUATION, WM8993_SPKMIXR_ATTENUATION,
349 0, 3, 1, spkmixout_tlv),
350SOC_DOUBLE_R_TLV("Speaker Volume",
351 WM8993_SPEAKER_VOLUME_LEFT, WM8993_SPEAKER_VOLUME_RIGHT,
352 0, 63, 0, outpga_tlv),
353SOC_DOUBLE_R("Speaker Switch",
354 WM8993_SPEAKER_VOLUME_LEFT, WM8993_SPEAKER_VOLUME_RIGHT,
355 6, 1, 0),
356SOC_DOUBLE_R("Speaker ZC Switch",
357 WM8993_SPEAKER_VOLUME_LEFT, WM8993_SPEAKER_VOLUME_RIGHT,
358 7, 1, 0),
Uk Kimed8cc472010-12-05 17:26:07 +0900359SOC_DOUBLE_TLV("Speaker Boost Volume", WM8993_SPKOUT_BOOST, 3, 0, 7, 0,
Mark Browna2342ae2009-07-29 21:21:49 +0100360 spkboost_tlv),
361SOC_ENUM("Speaker Reference", speaker_ref),
362SOC_ENUM("Speaker Mode", speaker_mode),
363
Peter Ujfalusi0f9887d2011-10-05 10:29:19 +0300364SOC_DOUBLE_R_EXT_TLV("Headphone Volume",
365 WM8993_LEFT_OUTPUT_VOLUME, WM8993_RIGHT_OUTPUT_VOLUME,
Peter Ujfalusic4671a92011-10-06 09:59:12 +0300366 0, 63, 0, snd_soc_get_volsw, wm8993_put_dc_servo,
Peter Ujfalusi0f9887d2011-10-05 10:29:19 +0300367 outpga_tlv),
368
Mark Browna2342ae2009-07-29 21:21:49 +0100369SOC_DOUBLE_R("Headphone Switch", WM8993_LEFT_OUTPUT_VOLUME,
370 WM8993_RIGHT_OUTPUT_VOLUME, 6, 1, 0),
371SOC_DOUBLE_R("Headphone ZC Switch", WM8993_LEFT_OUTPUT_VOLUME,
372 WM8993_RIGHT_OUTPUT_VOLUME, 7, 1, 0),
373
374SOC_SINGLE("LINEOUT1N Switch", WM8993_LINE_OUTPUTS_VOLUME, 6, 1, 1),
375SOC_SINGLE("LINEOUT1P Switch", WM8993_LINE_OUTPUTS_VOLUME, 5, 1, 1),
376SOC_SINGLE_TLV("LINEOUT1 Volume", WM8993_LINE_OUTPUTS_VOLUME, 4, 1, 1,
377 line_tlv),
378
379SOC_SINGLE("LINEOUT2N Switch", WM8993_LINE_OUTPUTS_VOLUME, 2, 1, 1),
380SOC_SINGLE("LINEOUT2P Switch", WM8993_LINE_OUTPUTS_VOLUME, 1, 1, 1),
381SOC_SINGLE_TLV("LINEOUT2 Volume", WM8993_LINE_OUTPUTS_VOLUME, 0, 1, 1,
382 line_tlv),
383};
384
Mark Brown3ed70742010-01-20 17:39:45 +0000385static int hp_supply_event(struct snd_soc_dapm_widget *w,
386 struct snd_kcontrol *kcontrol, int event)
387{
388 struct snd_soc_codec *codec = w->codec;
Mark Brownb2c812e2010-04-14 15:35:19 +0900389 struct wm_hubs_data *hubs = snd_soc_codec_get_drvdata(codec);
Mark Brown3ed70742010-01-20 17:39:45 +0000390
391 switch (event) {
392 case SND_SOC_DAPM_PRE_PMU:
393 switch (hubs->hp_startup_mode) {
394 case 0:
395 break;
396 case 1:
397 /* Enable the headphone amp */
398 snd_soc_update_bits(codec, WM8993_POWER_MANAGEMENT_1,
399 WM8993_HPOUT1L_ENA |
400 WM8993_HPOUT1R_ENA,
401 WM8993_HPOUT1L_ENA |
402 WM8993_HPOUT1R_ENA);
403
404 /* Enable the second stage */
405 snd_soc_update_bits(codec, WM8993_ANALOGUE_HP_0,
406 WM8993_HPOUT1L_DLY |
407 WM8993_HPOUT1R_DLY,
408 WM8993_HPOUT1L_DLY |
409 WM8993_HPOUT1R_DLY);
410 break;
411 default:
412 dev_err(codec->dev, "Unknown HP startup mode %d\n",
413 hubs->hp_startup_mode);
414 break;
415 }
416
417 case SND_SOC_DAPM_PRE_PMD:
418 snd_soc_update_bits(codec, WM8993_CHARGE_PUMP_1,
419 WM8993_CP_ENA, 0);
420 break;
421 }
422
423 return 0;
424}
425
Mark Browna2342ae2009-07-29 21:21:49 +0100426static int hp_event(struct snd_soc_dapm_widget *w,
427 struct snd_kcontrol *kcontrol, int event)
428{
429 struct snd_soc_codec *codec = w->codec;
430 unsigned int reg = snd_soc_read(codec, WM8993_ANALOGUE_HP_0);
431
432 switch (event) {
433 case SND_SOC_DAPM_POST_PMU:
434 snd_soc_update_bits(codec, WM8993_CHARGE_PUMP_1,
435 WM8993_CP_ENA, WM8993_CP_ENA);
436
437 msleep(5);
438
439 snd_soc_update_bits(codec, WM8993_POWER_MANAGEMENT_1,
440 WM8993_HPOUT1L_ENA | WM8993_HPOUT1R_ENA,
441 WM8993_HPOUT1L_ENA | WM8993_HPOUT1R_ENA);
442
443 reg |= WM8993_HPOUT1L_DLY | WM8993_HPOUT1R_DLY;
444 snd_soc_write(codec, WM8993_ANALOGUE_HP_0, reg);
445
Mark Brown3ed70742010-01-20 17:39:45 +0000446 snd_soc_update_bits(codec, WM8993_DC_SERVO_1,
Mark Brownf9925d42011-07-28 12:44:44 +0100447 WM8993_DCS_TIMER_PERIOD_01_MASK, 0);
Mark Brown3ed70742010-01-20 17:39:45 +0000448
449 calibrate_dc_servo(codec);
Mark Browna2342ae2009-07-29 21:21:49 +0100450
451 reg |= WM8993_HPOUT1R_OUTP | WM8993_HPOUT1R_RMV_SHORT |
452 WM8993_HPOUT1L_OUTP | WM8993_HPOUT1L_RMV_SHORT;
453 snd_soc_write(codec, WM8993_ANALOGUE_HP_0, reg);
454 break;
455
456 case SND_SOC_DAPM_PRE_PMD:
Mark Brown3ed70742010-01-20 17:39:45 +0000457 snd_soc_update_bits(codec, WM8993_ANALOGUE_HP_0,
Mark Brown6adb26b2010-05-10 16:13:11 +0100458 WM8993_HPOUT1L_OUTP |
459 WM8993_HPOUT1R_OUTP |
Mark Brown3ed70742010-01-20 17:39:45 +0000460 WM8993_HPOUT1L_RMV_SHORT |
461 WM8993_HPOUT1R_RMV_SHORT, 0);
Mark Browna2342ae2009-07-29 21:21:49 +0100462
Mark Brown3ed70742010-01-20 17:39:45 +0000463 snd_soc_update_bits(codec, WM8993_ANALOGUE_HP_0,
Mark Brown6adb26b2010-05-10 16:13:11 +0100464 WM8993_HPOUT1L_DLY |
465 WM8993_HPOUT1R_DLY, 0);
Mark Browna2342ae2009-07-29 21:21:49 +0100466
Mark Brown395e4b72010-05-10 21:06:14 +0100467 snd_soc_write(codec, WM8993_DC_SERVO_0, 0);
468
Mark Browna2342ae2009-07-29 21:21:49 +0100469 snd_soc_update_bits(codec, WM8993_POWER_MANAGEMENT_1,
470 WM8993_HPOUT1L_ENA | WM8993_HPOUT1R_ENA,
471 0);
Mark Browna2342ae2009-07-29 21:21:49 +0100472 break;
473 }
474
475 return 0;
476}
477
478static int earpiece_event(struct snd_soc_dapm_widget *w,
479 struct snd_kcontrol *control, int event)
480{
481 struct snd_soc_codec *codec = w->codec;
482 u16 reg = snd_soc_read(codec, WM8993_ANTIPOP1) & ~WM8993_HPOUT2_IN_ENA;
483
484 switch (event) {
485 case SND_SOC_DAPM_PRE_PMU:
486 reg |= WM8993_HPOUT2_IN_ENA;
487 snd_soc_write(codec, WM8993_ANTIPOP1, reg);
488 udelay(50);
489 break;
490
491 case SND_SOC_DAPM_POST_PMD:
492 snd_soc_write(codec, WM8993_ANTIPOP1, reg);
493 break;
494
495 default:
496 BUG();
497 break;
498 }
499
500 return 0;
501}
502
Mark Brown5f2f3892012-02-08 18:51:42 +0000503static int lineout_event(struct snd_soc_dapm_widget *w,
504 struct snd_kcontrol *control, int event)
505{
506 struct snd_soc_codec *codec = w->codec;
507 struct wm_hubs_data *hubs = snd_soc_codec_get_drvdata(codec);
508 bool *flag;
509
510 switch (w->shift) {
511 case WM8993_LINEOUT1N_ENA_SHIFT:
512 flag = &hubs->lineout1n_ena;
513 break;
514 case WM8993_LINEOUT1P_ENA_SHIFT:
515 flag = &hubs->lineout1p_ena;
516 break;
517 case WM8993_LINEOUT2N_ENA_SHIFT:
518 flag = &hubs->lineout2n_ena;
519 break;
520 case WM8993_LINEOUT2P_ENA_SHIFT:
521 flag = &hubs->lineout2p_ena;
522 break;
523 default:
524 WARN(1, "Unknown line output");
525 return -EINVAL;
526 }
527
528 *flag = SND_SOC_DAPM_EVENT_ON(event);
529
530 return 0;
531}
532
Mark Browna2342ae2009-07-29 21:21:49 +0100533static const struct snd_kcontrol_new in1l_pga[] = {
534SOC_DAPM_SINGLE("IN1LP Switch", WM8993_INPUT_MIXER2, 5, 1, 0),
535SOC_DAPM_SINGLE("IN1LN Switch", WM8993_INPUT_MIXER2, 4, 1, 0),
536};
537
538static const struct snd_kcontrol_new in1r_pga[] = {
539SOC_DAPM_SINGLE("IN1RP Switch", WM8993_INPUT_MIXER2, 1, 1, 0),
540SOC_DAPM_SINGLE("IN1RN Switch", WM8993_INPUT_MIXER2, 0, 1, 0),
541};
542
543static const struct snd_kcontrol_new in2l_pga[] = {
544SOC_DAPM_SINGLE("IN2LP Switch", WM8993_INPUT_MIXER2, 7, 1, 0),
545SOC_DAPM_SINGLE("IN2LN Switch", WM8993_INPUT_MIXER2, 6, 1, 0),
546};
547
548static const struct snd_kcontrol_new in2r_pga[] = {
549SOC_DAPM_SINGLE("IN2RP Switch", WM8993_INPUT_MIXER2, 3, 1, 0),
550SOC_DAPM_SINGLE("IN2RN Switch", WM8993_INPUT_MIXER2, 2, 1, 0),
551};
552
553static const struct snd_kcontrol_new mixinl[] = {
554SOC_DAPM_SINGLE("IN2L Switch", WM8993_INPUT_MIXER3, 8, 1, 0),
555SOC_DAPM_SINGLE("IN1L Switch", WM8993_INPUT_MIXER3, 5, 1, 0),
556};
557
558static const struct snd_kcontrol_new mixinr[] = {
559SOC_DAPM_SINGLE("IN2R Switch", WM8993_INPUT_MIXER4, 8, 1, 0),
560SOC_DAPM_SINGLE("IN1R Switch", WM8993_INPUT_MIXER4, 5, 1, 0),
561};
562
563static const struct snd_kcontrol_new left_output_mixer[] = {
564SOC_DAPM_SINGLE("Right Input Switch", WM8993_OUTPUT_MIXER1, 7, 1, 0),
565SOC_DAPM_SINGLE("Left Input Switch", WM8993_OUTPUT_MIXER1, 6, 1, 0),
566SOC_DAPM_SINGLE("IN2RN Switch", WM8993_OUTPUT_MIXER1, 5, 1, 0),
567SOC_DAPM_SINGLE("IN2LN Switch", WM8993_OUTPUT_MIXER1, 4, 1, 0),
568SOC_DAPM_SINGLE("IN2LP Switch", WM8993_OUTPUT_MIXER1, 1, 1, 0),
569SOC_DAPM_SINGLE("IN1R Switch", WM8993_OUTPUT_MIXER1, 3, 1, 0),
570SOC_DAPM_SINGLE("IN1L Switch", WM8993_OUTPUT_MIXER1, 2, 1, 0),
571SOC_DAPM_SINGLE("DAC Switch", WM8993_OUTPUT_MIXER1, 0, 1, 0),
572};
573
574static const struct snd_kcontrol_new right_output_mixer[] = {
575SOC_DAPM_SINGLE("Left Input Switch", WM8993_OUTPUT_MIXER2, 7, 1, 0),
576SOC_DAPM_SINGLE("Right Input Switch", WM8993_OUTPUT_MIXER2, 6, 1, 0),
577SOC_DAPM_SINGLE("IN2LN Switch", WM8993_OUTPUT_MIXER2, 5, 1, 0),
578SOC_DAPM_SINGLE("IN2RN Switch", WM8993_OUTPUT_MIXER2, 4, 1, 0),
579SOC_DAPM_SINGLE("IN1L Switch", WM8993_OUTPUT_MIXER2, 3, 1, 0),
580SOC_DAPM_SINGLE("IN1R Switch", WM8993_OUTPUT_MIXER2, 2, 1, 0),
581SOC_DAPM_SINGLE("IN2RP Switch", WM8993_OUTPUT_MIXER2, 1, 1, 0),
582SOC_DAPM_SINGLE("DAC Switch", WM8993_OUTPUT_MIXER2, 0, 1, 0),
583};
584
585static const struct snd_kcontrol_new earpiece_mixer[] = {
586SOC_DAPM_SINGLE("Direct Voice Switch", WM8993_HPOUT2_MIXER, 5, 1, 0),
587SOC_DAPM_SINGLE("Left Output Switch", WM8993_HPOUT2_MIXER, 4, 1, 0),
588SOC_DAPM_SINGLE("Right Output Switch", WM8993_HPOUT2_MIXER, 3, 1, 0),
589};
590
591static const struct snd_kcontrol_new left_speaker_boost[] = {
592SOC_DAPM_SINGLE("Direct Voice Switch", WM8993_SPKOUT_MIXERS, 5, 1, 0),
593SOC_DAPM_SINGLE("SPKL Switch", WM8993_SPKOUT_MIXERS, 4, 1, 0),
594SOC_DAPM_SINGLE("SPKR Switch", WM8993_SPKOUT_MIXERS, 3, 1, 0),
595};
596
597static const struct snd_kcontrol_new right_speaker_boost[] = {
598SOC_DAPM_SINGLE("Direct Voice Switch", WM8993_SPKOUT_MIXERS, 2, 1, 0),
599SOC_DAPM_SINGLE("SPKL Switch", WM8993_SPKOUT_MIXERS, 1, 1, 0),
600SOC_DAPM_SINGLE("SPKR Switch", WM8993_SPKOUT_MIXERS, 0, 1, 0),
601};
602
603static const struct snd_kcontrol_new line1_mix[] = {
604SOC_DAPM_SINGLE("IN1R Switch", WM8993_LINE_MIXER1, 2, 1, 0),
605SOC_DAPM_SINGLE("IN1L Switch", WM8993_LINE_MIXER1, 1, 1, 0),
606SOC_DAPM_SINGLE("Output Switch", WM8993_LINE_MIXER1, 0, 1, 0),
607};
608
609static const struct snd_kcontrol_new line1n_mix[] = {
610SOC_DAPM_SINGLE("Left Output Switch", WM8993_LINE_MIXER1, 6, 1, 0),
611SOC_DAPM_SINGLE("Right Output Switch", WM8993_LINE_MIXER1, 5, 1, 0),
612};
613
614static const struct snd_kcontrol_new line1p_mix[] = {
615SOC_DAPM_SINGLE("Left Output Switch", WM8993_LINE_MIXER1, 0, 1, 0),
616};
617
618static const struct snd_kcontrol_new line2_mix[] = {
Mark Brown43b6cec2012-02-01 23:46:58 +0000619SOC_DAPM_SINGLE("IN1L Switch", WM8993_LINE_MIXER2, 2, 1, 0),
620SOC_DAPM_SINGLE("IN1R Switch", WM8993_LINE_MIXER2, 1, 1, 0),
Mark Browna2342ae2009-07-29 21:21:49 +0100621SOC_DAPM_SINGLE("Output Switch", WM8993_LINE_MIXER2, 0, 1, 0),
622};
623
624static const struct snd_kcontrol_new line2n_mix[] = {
UK KIM114395c2012-01-28 01:52:22 +0900625SOC_DAPM_SINGLE("Left Output Switch", WM8993_LINE_MIXER2, 5, 1, 0),
626SOC_DAPM_SINGLE("Right Output Switch", WM8993_LINE_MIXER2, 6, 1, 0),
Mark Browna2342ae2009-07-29 21:21:49 +0100627};
628
629static const struct snd_kcontrol_new line2p_mix[] = {
630SOC_DAPM_SINGLE("Right Output Switch", WM8993_LINE_MIXER2, 0, 1, 0),
631};
632
633static const struct snd_soc_dapm_widget analogue_dapm_widgets[] = {
634SND_SOC_DAPM_INPUT("IN1LN"),
635SND_SOC_DAPM_INPUT("IN1LP"),
636SND_SOC_DAPM_INPUT("IN2LN"),
Joonyoung Shim34825942009-12-04 15:12:10 +0900637SND_SOC_DAPM_INPUT("IN2LP:VXRN"),
Mark Browna2342ae2009-07-29 21:21:49 +0100638SND_SOC_DAPM_INPUT("IN1RN"),
639SND_SOC_DAPM_INPUT("IN1RP"),
640SND_SOC_DAPM_INPUT("IN2RN"),
Joonyoung Shim34825942009-12-04 15:12:10 +0900641SND_SOC_DAPM_INPUT("IN2RP:VXRP"),
Mark Browna2342ae2009-07-29 21:21:49 +0100642
Mark Brown91e20852011-12-02 16:01:41 +0000643SND_SOC_DAPM_SUPPLY("MICBIAS2", WM8993_POWER_MANAGEMENT_1, 5, 0, NULL, 0),
644SND_SOC_DAPM_SUPPLY("MICBIAS1", WM8993_POWER_MANAGEMENT_1, 4, 0, NULL, 0),
Mark Browna2342ae2009-07-29 21:21:49 +0100645
646SND_SOC_DAPM_MIXER("IN1L PGA", WM8993_POWER_MANAGEMENT_2, 6, 0,
647 in1l_pga, ARRAY_SIZE(in1l_pga)),
648SND_SOC_DAPM_MIXER("IN1R PGA", WM8993_POWER_MANAGEMENT_2, 4, 0,
649 in1r_pga, ARRAY_SIZE(in1r_pga)),
650
651SND_SOC_DAPM_MIXER("IN2L PGA", WM8993_POWER_MANAGEMENT_2, 7, 0,
652 in2l_pga, ARRAY_SIZE(in2l_pga)),
653SND_SOC_DAPM_MIXER("IN2R PGA", WM8993_POWER_MANAGEMENT_2, 5, 0,
654 in2r_pga, ARRAY_SIZE(in2r_pga)),
655
Mark Browna2342ae2009-07-29 21:21:49 +0100656SND_SOC_DAPM_MIXER("MIXINL", WM8993_POWER_MANAGEMENT_2, 9, 0,
657 mixinl, ARRAY_SIZE(mixinl)),
658SND_SOC_DAPM_MIXER("MIXINR", WM8993_POWER_MANAGEMENT_2, 8, 0,
659 mixinr, ARRAY_SIZE(mixinr)),
660
Mark Browna2342ae2009-07-29 21:21:49 +0100661SND_SOC_DAPM_MIXER("Left Output Mixer", WM8993_POWER_MANAGEMENT_3, 5, 0,
662 left_output_mixer, ARRAY_SIZE(left_output_mixer)),
663SND_SOC_DAPM_MIXER("Right Output Mixer", WM8993_POWER_MANAGEMENT_3, 4, 0,
664 right_output_mixer, ARRAY_SIZE(right_output_mixer)),
665
666SND_SOC_DAPM_PGA("Left Output PGA", WM8993_POWER_MANAGEMENT_3, 7, 0, NULL, 0),
667SND_SOC_DAPM_PGA("Right Output PGA", WM8993_POWER_MANAGEMENT_3, 6, 0, NULL, 0),
668
Mark Brown3ed70742010-01-20 17:39:45 +0000669SND_SOC_DAPM_SUPPLY("Headphone Supply", SND_SOC_NOPM, 0, 0, hp_supply_event,
670 SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_PRE_PMD),
Mark Brown26422622012-02-21 09:36:49 +0000671SND_SOC_DAPM_OUT_DRV_E("Headphone PGA", SND_SOC_NOPM, 0, 0, NULL, 0,
672 hp_event, SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD),
Mark Browna2342ae2009-07-29 21:21:49 +0100673
674SND_SOC_DAPM_MIXER("Earpiece Mixer", SND_SOC_NOPM, 0, 0,
675 earpiece_mixer, ARRAY_SIZE(earpiece_mixer)),
676SND_SOC_DAPM_PGA_E("Earpiece Driver", WM8993_POWER_MANAGEMENT_1, 11, 0,
677 NULL, 0, earpiece_event,
678 SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD),
679
680SND_SOC_DAPM_MIXER("SPKL Boost", SND_SOC_NOPM, 0, 0,
681 left_speaker_boost, ARRAY_SIZE(left_speaker_boost)),
682SND_SOC_DAPM_MIXER("SPKR Boost", SND_SOC_NOPM, 0, 0,
683 right_speaker_boost, ARRAY_SIZE(right_speaker_boost)),
684
Mark Brown03431972011-11-04 17:11:54 +0000685SND_SOC_DAPM_SUPPLY("TSHUT", WM8993_POWER_MANAGEMENT_2, 14, 0, NULL, 0),
Mark Browndc9c7452012-02-07 14:24:57 +0000686SND_SOC_DAPM_OUT_DRV("SPKL Driver", WM8993_POWER_MANAGEMENT_1, 12, 0,
687 NULL, 0),
688SND_SOC_DAPM_OUT_DRV("SPKR Driver", WM8993_POWER_MANAGEMENT_1, 13, 0,
689 NULL, 0),
Mark Browna2342ae2009-07-29 21:21:49 +0100690
691SND_SOC_DAPM_MIXER("LINEOUT1 Mixer", SND_SOC_NOPM, 0, 0,
692 line1_mix, ARRAY_SIZE(line1_mix)),
693SND_SOC_DAPM_MIXER("LINEOUT2 Mixer", SND_SOC_NOPM, 0, 0,
694 line2_mix, ARRAY_SIZE(line2_mix)),
695
696SND_SOC_DAPM_MIXER("LINEOUT1N Mixer", SND_SOC_NOPM, 0, 0,
697 line1n_mix, ARRAY_SIZE(line1n_mix)),
698SND_SOC_DAPM_MIXER("LINEOUT1P Mixer", SND_SOC_NOPM, 0, 0,
699 line1p_mix, ARRAY_SIZE(line1p_mix)),
700SND_SOC_DAPM_MIXER("LINEOUT2N Mixer", SND_SOC_NOPM, 0, 0,
701 line2n_mix, ARRAY_SIZE(line2n_mix)),
702SND_SOC_DAPM_MIXER("LINEOUT2P Mixer", SND_SOC_NOPM, 0, 0,
703 line2p_mix, ARRAY_SIZE(line2p_mix)),
704
Mark Brown5f2f3892012-02-08 18:51:42 +0000705SND_SOC_DAPM_OUT_DRV_E("LINEOUT1N Driver", WM8993_POWER_MANAGEMENT_3, 13, 0,
706 NULL, 0, lineout_event,
707 SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD),
708SND_SOC_DAPM_OUT_DRV_E("LINEOUT1P Driver", WM8993_POWER_MANAGEMENT_3, 12, 0,
709 NULL, 0, lineout_event,
710 SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD),
711SND_SOC_DAPM_OUT_DRV_E("LINEOUT2N Driver", WM8993_POWER_MANAGEMENT_3, 11, 0,
712 NULL, 0, lineout_event,
713 SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD),
714SND_SOC_DAPM_OUT_DRV_E("LINEOUT2P Driver", WM8993_POWER_MANAGEMENT_3, 10, 0,
715 NULL, 0, lineout_event,
716 SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD),
Mark Browna2342ae2009-07-29 21:21:49 +0100717
718SND_SOC_DAPM_OUTPUT("SPKOUTLP"),
719SND_SOC_DAPM_OUTPUT("SPKOUTLN"),
720SND_SOC_DAPM_OUTPUT("SPKOUTRP"),
721SND_SOC_DAPM_OUTPUT("SPKOUTRN"),
722SND_SOC_DAPM_OUTPUT("HPOUT1L"),
723SND_SOC_DAPM_OUTPUT("HPOUT1R"),
724SND_SOC_DAPM_OUTPUT("HPOUT2P"),
725SND_SOC_DAPM_OUTPUT("HPOUT2N"),
726SND_SOC_DAPM_OUTPUT("LINEOUT1P"),
727SND_SOC_DAPM_OUTPUT("LINEOUT1N"),
728SND_SOC_DAPM_OUTPUT("LINEOUT2P"),
729SND_SOC_DAPM_OUTPUT("LINEOUT2N"),
730};
731
732static const struct snd_soc_dapm_route analogue_routes[] = {
Mark Brown4baafdd2011-02-18 15:05:53 -0800733 { "MICBIAS1", NULL, "CLK_SYS" },
734 { "MICBIAS2", NULL, "CLK_SYS" },
735
Mark Browna2342ae2009-07-29 21:21:49 +0100736 { "IN1L PGA", "IN1LP Switch", "IN1LP" },
737 { "IN1L PGA", "IN1LN Switch", "IN1LN" },
738
Mark Brown4e04ada2011-07-15 15:12:31 +0900739 { "IN1L PGA", NULL, "VMID" },
740 { "IN1R PGA", NULL, "VMID" },
741 { "IN2L PGA", NULL, "VMID" },
742 { "IN2R PGA", NULL, "VMID" },
743
Mark Browna2342ae2009-07-29 21:21:49 +0100744 { "IN1R PGA", "IN1RP Switch", "IN1RP" },
745 { "IN1R PGA", "IN1RN Switch", "IN1RN" },
746
Joonyoung Shim34825942009-12-04 15:12:10 +0900747 { "IN2L PGA", "IN2LP Switch", "IN2LP:VXRN" },
Mark Browna2342ae2009-07-29 21:21:49 +0100748 { "IN2L PGA", "IN2LN Switch", "IN2LN" },
749
Joonyoung Shim34825942009-12-04 15:12:10 +0900750 { "IN2R PGA", "IN2RP Switch", "IN2RP:VXRP" },
Mark Browna2342ae2009-07-29 21:21:49 +0100751 { "IN2R PGA", "IN2RN Switch", "IN2RN" },
752
Joonyoung Shim34825942009-12-04 15:12:10 +0900753 { "Direct Voice", NULL, "IN2LP:VXRN" },
754 { "Direct Voice", NULL, "IN2RP:VXRP" },
Mark Browna2342ae2009-07-29 21:21:49 +0100755
756 { "MIXINL", "IN1L Switch", "IN1L PGA" },
757 { "MIXINL", "IN2L Switch", "IN2L PGA" },
758 { "MIXINL", NULL, "Direct Voice" },
759 { "MIXINL", NULL, "IN1LP" },
760 { "MIXINL", NULL, "Left Output Mixer" },
Mark Brown4e04ada2011-07-15 15:12:31 +0900761 { "MIXINL", NULL, "VMID" },
Mark Browna2342ae2009-07-29 21:21:49 +0100762
763 { "MIXINR", "IN1R Switch", "IN1R PGA" },
764 { "MIXINR", "IN2R Switch", "IN2R PGA" },
765 { "MIXINR", NULL, "Direct Voice" },
766 { "MIXINR", NULL, "IN1RP" },
767 { "MIXINR", NULL, "Right Output Mixer" },
Mark Brown4e04ada2011-07-15 15:12:31 +0900768 { "MIXINR", NULL, "VMID" },
Mark Browna2342ae2009-07-29 21:21:49 +0100769
770 { "ADCL", NULL, "MIXINL" },
771 { "ADCR", NULL, "MIXINR" },
772
773 { "Left Output Mixer", "Left Input Switch", "MIXINL" },
774 { "Left Output Mixer", "Right Input Switch", "MIXINR" },
775 { "Left Output Mixer", "IN2RN Switch", "IN2RN" },
776 { "Left Output Mixer", "IN2LN Switch", "IN2LN" },
Joonyoung Shim34825942009-12-04 15:12:10 +0900777 { "Left Output Mixer", "IN2LP Switch", "IN2LP:VXRN" },
Mark Browna2342ae2009-07-29 21:21:49 +0100778 { "Left Output Mixer", "IN1L Switch", "IN1L PGA" },
779 { "Left Output Mixer", "IN1R Switch", "IN1R PGA" },
780
781 { "Right Output Mixer", "Left Input Switch", "MIXINL" },
782 { "Right Output Mixer", "Right Input Switch", "MIXINR" },
783 { "Right Output Mixer", "IN2LN Switch", "IN2LN" },
784 { "Right Output Mixer", "IN2RN Switch", "IN2RN" },
Joonyoung Shim34825942009-12-04 15:12:10 +0900785 { "Right Output Mixer", "IN2RP Switch", "IN2RP:VXRP" },
Mark Browna2342ae2009-07-29 21:21:49 +0100786 { "Right Output Mixer", "IN1L Switch", "IN1L PGA" },
787 { "Right Output Mixer", "IN1R Switch", "IN1R PGA" },
788
789 { "Left Output PGA", NULL, "Left Output Mixer" },
790 { "Left Output PGA", NULL, "TOCLK" },
791
792 { "Right Output PGA", NULL, "Right Output Mixer" },
793 { "Right Output PGA", NULL, "TOCLK" },
794
795 { "Earpiece Mixer", "Direct Voice Switch", "Direct Voice" },
796 { "Earpiece Mixer", "Left Output Switch", "Left Output PGA" },
797 { "Earpiece Mixer", "Right Output Switch", "Right Output PGA" },
798
Mark Brown4e04ada2011-07-15 15:12:31 +0900799 { "Earpiece Driver", NULL, "VMID" },
Mark Browna2342ae2009-07-29 21:21:49 +0100800 { "Earpiece Driver", NULL, "Earpiece Mixer" },
801 { "HPOUT2N", NULL, "Earpiece Driver" },
802 { "HPOUT2P", NULL, "Earpiece Driver" },
803
804 { "SPKL", "Input Switch", "MIXINL" },
805 { "SPKL", "IN1LP Switch", "IN1LP" },
Mark Brown39cca162011-04-08 16:32:16 +0900806 { "SPKL", "Output Switch", "Left Output PGA" },
Mark Browna2342ae2009-07-29 21:21:49 +0100807 { "SPKL", NULL, "TOCLK" },
808
809 { "SPKR", "Input Switch", "MIXINR" },
810 { "SPKR", "IN1RP Switch", "IN1RP" },
Mark Brown39cca162011-04-08 16:32:16 +0900811 { "SPKR", "Output Switch", "Right Output PGA" },
Mark Browna2342ae2009-07-29 21:21:49 +0100812 { "SPKR", NULL, "TOCLK" },
813
814 { "SPKL Boost", "Direct Voice Switch", "Direct Voice" },
815 { "SPKL Boost", "SPKL Switch", "SPKL" },
816 { "SPKL Boost", "SPKR Switch", "SPKR" },
817
818 { "SPKR Boost", "Direct Voice Switch", "Direct Voice" },
819 { "SPKR Boost", "SPKR Switch", "SPKR" },
820 { "SPKR Boost", "SPKL Switch", "SPKL" },
821
Mark Brown4e04ada2011-07-15 15:12:31 +0900822 { "SPKL Driver", NULL, "VMID" },
Mark Browna2342ae2009-07-29 21:21:49 +0100823 { "SPKL Driver", NULL, "SPKL Boost" },
824 { "SPKL Driver", NULL, "CLK_SYS" },
Mark Brown03431972011-11-04 17:11:54 +0000825 { "SPKL Driver", NULL, "TSHUT" },
Mark Browna2342ae2009-07-29 21:21:49 +0100826
Mark Brown4e04ada2011-07-15 15:12:31 +0900827 { "SPKR Driver", NULL, "VMID" },
Mark Browna2342ae2009-07-29 21:21:49 +0100828 { "SPKR Driver", NULL, "SPKR Boost" },
829 { "SPKR Driver", NULL, "CLK_SYS" },
Mark Brown03431972011-11-04 17:11:54 +0000830 { "SPKR Driver", NULL, "TSHUT" },
Mark Browna2342ae2009-07-29 21:21:49 +0100831
832 { "SPKOUTLP", NULL, "SPKL Driver" },
833 { "SPKOUTLN", NULL, "SPKL Driver" },
834 { "SPKOUTRP", NULL, "SPKR Driver" },
835 { "SPKOUTRN", NULL, "SPKR Driver" },
836
Mark Brown39cca162011-04-08 16:32:16 +0900837 { "Left Headphone Mux", "Mixer", "Left Output PGA" },
838 { "Right Headphone Mux", "Mixer", "Right Output PGA" },
Mark Browna2342ae2009-07-29 21:21:49 +0100839
840 { "Headphone PGA", NULL, "Left Headphone Mux" },
841 { "Headphone PGA", NULL, "Right Headphone Mux" },
Mark Brown4e04ada2011-07-15 15:12:31 +0900842 { "Headphone PGA", NULL, "VMID" },
Mark Browna2342ae2009-07-29 21:21:49 +0100843 { "Headphone PGA", NULL, "CLK_SYS" },
Mark Brown3ed70742010-01-20 17:39:45 +0000844 { "Headphone PGA", NULL, "Headphone Supply" },
Mark Browna2342ae2009-07-29 21:21:49 +0100845
846 { "HPOUT1L", NULL, "Headphone PGA" },
847 { "HPOUT1R", NULL, "Headphone PGA" },
848
Mark Brown4e04ada2011-07-15 15:12:31 +0900849 { "LINEOUT1N Driver", NULL, "VMID" },
850 { "LINEOUT1P Driver", NULL, "VMID" },
851 { "LINEOUT2N Driver", NULL, "VMID" },
852 { "LINEOUT2P Driver", NULL, "VMID" },
853
Mark Browna2342ae2009-07-29 21:21:49 +0100854 { "LINEOUT1N", NULL, "LINEOUT1N Driver" },
855 { "LINEOUT1P", NULL, "LINEOUT1P Driver" },
856 { "LINEOUT2N", NULL, "LINEOUT2N Driver" },
857 { "LINEOUT2P", NULL, "LINEOUT2P Driver" },
858};
859
860static const struct snd_soc_dapm_route lineout1_diff_routes[] = {
861 { "LINEOUT1 Mixer", "IN1L Switch", "IN1L PGA" },
862 { "LINEOUT1 Mixer", "IN1R Switch", "IN1R PGA" },
Mark Brownd0b48af2011-05-14 17:21:28 -0700863 { "LINEOUT1 Mixer", "Output Switch", "Left Output PGA" },
Mark Browna2342ae2009-07-29 21:21:49 +0100864
865 { "LINEOUT1N Driver", NULL, "LINEOUT1 Mixer" },
866 { "LINEOUT1P Driver", NULL, "LINEOUT1 Mixer" },
867};
868
869static const struct snd_soc_dapm_route lineout1_se_routes[] = {
Mark Brownd0b48af2011-05-14 17:21:28 -0700870 { "LINEOUT1N Mixer", "Left Output Switch", "Left Output PGA" },
871 { "LINEOUT1N Mixer", "Right Output Switch", "Right Output PGA" },
Mark Browna2342ae2009-07-29 21:21:49 +0100872
Mark Brownd0b48af2011-05-14 17:21:28 -0700873 { "LINEOUT1P Mixer", "Left Output Switch", "Left Output PGA" },
Mark Browna2342ae2009-07-29 21:21:49 +0100874
875 { "LINEOUT1N Driver", NULL, "LINEOUT1N Mixer" },
876 { "LINEOUT1P Driver", NULL, "LINEOUT1P Mixer" },
877};
878
879static const struct snd_soc_dapm_route lineout2_diff_routes[] = {
Mark Brownee767442012-01-31 11:55:32 +0000880 { "LINEOUT2 Mixer", "IN1L Switch", "IN1L PGA" },
881 { "LINEOUT2 Mixer", "IN1R Switch", "IN1R PGA" },
Mark Brownd0b48af2011-05-14 17:21:28 -0700882 { "LINEOUT2 Mixer", "Output Switch", "Right Output PGA" },
Mark Browna2342ae2009-07-29 21:21:49 +0100883
884 { "LINEOUT2N Driver", NULL, "LINEOUT2 Mixer" },
885 { "LINEOUT2P Driver", NULL, "LINEOUT2 Mixer" },
886};
887
888static const struct snd_soc_dapm_route lineout2_se_routes[] = {
Mark Brownd0b48af2011-05-14 17:21:28 -0700889 { "LINEOUT2N Mixer", "Left Output Switch", "Left Output PGA" },
890 { "LINEOUT2N Mixer", "Right Output Switch", "Right Output PGA" },
Mark Browna2342ae2009-07-29 21:21:49 +0100891
Mark Brownd0b48af2011-05-14 17:21:28 -0700892 { "LINEOUT2P Mixer", "Right Output Switch", "Right Output PGA" },
Mark Browna2342ae2009-07-29 21:21:49 +0100893
894 { "LINEOUT2N Driver", NULL, "LINEOUT2N Mixer" },
895 { "LINEOUT2P Driver", NULL, "LINEOUT2P Mixer" },
896};
897
898int wm_hubs_add_analogue_controls(struct snd_soc_codec *codec)
899{
Liam Girdwoodce6120c2010-11-05 15:53:46 +0200900 struct snd_soc_dapm_context *dapm = &codec->dapm;
901
Mark Browna2342ae2009-07-29 21:21:49 +0100902 /* Latch volume update bits & default ZC on */
903 snd_soc_update_bits(codec, WM8993_LEFT_LINE_INPUT_1_2_VOLUME,
904 WM8993_IN1_VU, WM8993_IN1_VU);
905 snd_soc_update_bits(codec, WM8993_RIGHT_LINE_INPUT_1_2_VOLUME,
906 WM8993_IN1_VU, WM8993_IN1_VU);
907 snd_soc_update_bits(codec, WM8993_LEFT_LINE_INPUT_3_4_VOLUME,
908 WM8993_IN2_VU, WM8993_IN2_VU);
909 snd_soc_update_bits(codec, WM8993_RIGHT_LINE_INPUT_3_4_VOLUME,
910 WM8993_IN2_VU, WM8993_IN2_VU);
911
Mark Brownfb5af532011-05-15 12:18:38 -0700912 snd_soc_update_bits(codec, WM8993_SPEAKER_VOLUME_LEFT,
913 WM8993_SPKOUT_VU, WM8993_SPKOUT_VU);
Mark Browna2342ae2009-07-29 21:21:49 +0100914 snd_soc_update_bits(codec, WM8993_SPEAKER_VOLUME_RIGHT,
915 WM8993_SPKOUT_VU, WM8993_SPKOUT_VU);
916
917 snd_soc_update_bits(codec, WM8993_LEFT_OUTPUT_VOLUME,
Mark Brownfb5af532011-05-15 12:18:38 -0700918 WM8993_HPOUT1_VU | WM8993_HPOUT1L_ZC,
919 WM8993_HPOUT1_VU | WM8993_HPOUT1L_ZC);
Mark Browna2342ae2009-07-29 21:21:49 +0100920 snd_soc_update_bits(codec, WM8993_RIGHT_OUTPUT_VOLUME,
921 WM8993_HPOUT1_VU | WM8993_HPOUT1R_ZC,
922 WM8993_HPOUT1_VU | WM8993_HPOUT1R_ZC);
923
924 snd_soc_update_bits(codec, WM8993_LEFT_OPGA_VOLUME,
Mark Brownfb5af532011-05-15 12:18:38 -0700925 WM8993_MIXOUTL_ZC | WM8993_MIXOUT_VU,
926 WM8993_MIXOUTL_ZC | WM8993_MIXOUT_VU);
Mark Browna2342ae2009-07-29 21:21:49 +0100927 snd_soc_update_bits(codec, WM8993_RIGHT_OPGA_VOLUME,
928 WM8993_MIXOUTR_ZC | WM8993_MIXOUT_VU,
929 WM8993_MIXOUTR_ZC | WM8993_MIXOUT_VU);
930
Liam Girdwood022658b2012-02-03 17:43:09 +0000931 snd_soc_add_codec_controls(codec, analogue_snd_controls,
Mark Browna2342ae2009-07-29 21:21:49 +0100932 ARRAY_SIZE(analogue_snd_controls));
933
Liam Girdwoodce6120c2010-11-05 15:53:46 +0200934 snd_soc_dapm_new_controls(dapm, analogue_dapm_widgets,
Mark Browna2342ae2009-07-29 21:21:49 +0100935 ARRAY_SIZE(analogue_dapm_widgets));
936 return 0;
937}
938EXPORT_SYMBOL_GPL(wm_hubs_add_analogue_controls);
939
940int wm_hubs_add_analogue_routes(struct snd_soc_codec *codec,
941 int lineout1_diff, int lineout2_diff)
942{
Mark Brownd96ca3c2011-07-12 15:25:03 +0900943 struct wm_hubs_data *hubs = snd_soc_codec_get_drvdata(codec);
Liam Girdwoodce6120c2010-11-05 15:53:46 +0200944 struct snd_soc_dapm_context *dapm = &codec->dapm;
945
Mark Brownd96ca3c2011-07-12 15:25:03 +0900946 init_completion(&hubs->dcs_done);
947
Liam Girdwoodce6120c2010-11-05 15:53:46 +0200948 snd_soc_dapm_add_routes(dapm, analogue_routes,
Mark Browna2342ae2009-07-29 21:21:49 +0100949 ARRAY_SIZE(analogue_routes));
950
951 if (lineout1_diff)
Liam Girdwoodce6120c2010-11-05 15:53:46 +0200952 snd_soc_dapm_add_routes(dapm,
Mark Browna2342ae2009-07-29 21:21:49 +0100953 lineout1_diff_routes,
954 ARRAY_SIZE(lineout1_diff_routes));
955 else
Liam Girdwoodce6120c2010-11-05 15:53:46 +0200956 snd_soc_dapm_add_routes(dapm,
Mark Browna2342ae2009-07-29 21:21:49 +0100957 lineout1_se_routes,
958 ARRAY_SIZE(lineout1_se_routes));
959
960 if (lineout2_diff)
Liam Girdwoodce6120c2010-11-05 15:53:46 +0200961 snd_soc_dapm_add_routes(dapm,
Mark Browna2342ae2009-07-29 21:21:49 +0100962 lineout2_diff_routes,
963 ARRAY_SIZE(lineout2_diff_routes));
964 else
Liam Girdwoodce6120c2010-11-05 15:53:46 +0200965 snd_soc_dapm_add_routes(dapm,
Mark Browna2342ae2009-07-29 21:21:49 +0100966 lineout2_se_routes,
967 ARRAY_SIZE(lineout2_se_routes));
968
969 return 0;
970}
971EXPORT_SYMBOL_GPL(wm_hubs_add_analogue_routes);
972
Mark Brownaa983d92009-09-30 14:16:11 +0100973int wm_hubs_handle_analogue_pdata(struct snd_soc_codec *codec,
974 int lineout1_diff, int lineout2_diff,
975 int lineout1fb, int lineout2fb,
976 int jd_scthr, int jd_thr, int micbias1_lvl,
977 int micbias2_lvl)
978{
Mark Brown5f2f3892012-02-08 18:51:42 +0000979 struct wm_hubs_data *hubs = snd_soc_codec_get_drvdata(codec);
980
981 hubs->lineout1_se = !lineout1_diff;
982 hubs->lineout2_se = !lineout2_diff;
983
Mark Brownaa983d92009-09-30 14:16:11 +0100984 if (!lineout1_diff)
985 snd_soc_update_bits(codec, WM8993_LINE_MIXER1,
986 WM8993_LINEOUT1_MODE,
987 WM8993_LINEOUT1_MODE);
988 if (!lineout2_diff)
989 snd_soc_update_bits(codec, WM8993_LINE_MIXER2,
990 WM8993_LINEOUT2_MODE,
991 WM8993_LINEOUT2_MODE);
992
Mark Brown5472bbc2012-03-19 17:31:56 +0000993 if (!lineout1_diff && !lineout2_diff)
994 snd_soc_update_bits(codec, WM8993_ANTIPOP1,
995 WM8993_LINEOUT_VMID_BUF_ENA,
996 WM8993_LINEOUT_VMID_BUF_ENA);
997
Mark Brownaa983d92009-09-30 14:16:11 +0100998 if (lineout1fb)
999 snd_soc_update_bits(codec, WM8993_ADDITIONAL_CONTROL,
1000 WM8993_LINEOUT1_FB, WM8993_LINEOUT1_FB);
1001
1002 if (lineout2fb)
1003 snd_soc_update_bits(codec, WM8993_ADDITIONAL_CONTROL,
1004 WM8993_LINEOUT2_FB, WM8993_LINEOUT2_FB);
1005
1006 snd_soc_update_bits(codec, WM8993_MICBIAS,
1007 WM8993_JD_SCTHR_MASK | WM8993_JD_THR_MASK |
1008 WM8993_MICB1_LVL | WM8993_MICB2_LVL,
1009 jd_scthr << WM8993_JD_SCTHR_SHIFT |
1010 jd_thr << WM8993_JD_THR_SHIFT |
1011 micbias1_lvl |
1012 micbias2_lvl << WM8993_MICB2_LVL_SHIFT);
1013
1014 return 0;
1015}
1016EXPORT_SYMBOL_GPL(wm_hubs_handle_analogue_pdata);
1017
Mark Brown5f2f3892012-02-08 18:51:42 +00001018void wm_hubs_vmid_ena(struct snd_soc_codec *codec)
1019{
1020 struct wm_hubs_data *hubs = snd_soc_codec_get_drvdata(codec);
1021 int val = 0;
1022
1023 if (hubs->lineout1_se)
1024 val |= WM8993_LINEOUT1N_ENA | WM8993_LINEOUT1P_ENA;
1025
1026 if (hubs->lineout2_se)
1027 val |= WM8993_LINEOUT2N_ENA | WM8993_LINEOUT2P_ENA;
1028
1029 /* Enable the line outputs while we power up */
1030 snd_soc_update_bits(codec, WM8993_POWER_MANAGEMENT_3, val, val);
1031}
1032EXPORT_SYMBOL_GPL(wm_hubs_vmid_ena);
1033
1034void wm_hubs_set_bias_level(struct snd_soc_codec *codec,
1035 enum snd_soc_bias_level level)
1036{
1037 struct wm_hubs_data *hubs = snd_soc_codec_get_drvdata(codec);
1038 int val;
1039
1040 switch (level) {
Mark Brownd60d6c32012-02-10 18:09:42 +00001041 case SND_SOC_BIAS_STANDBY:
1042 /* Clamp the inputs to VMID while we ramp to charge caps */
1043 snd_soc_update_bits(codec, WM8993_INPUTS_CLAMP_REG,
1044 WM8993_INPUTS_CLAMP, WM8993_INPUTS_CLAMP);
1045 break;
1046
Mark Brown5f2f3892012-02-08 18:51:42 +00001047 case SND_SOC_BIAS_ON:
1048 /* Turn off any unneded single ended outputs */
1049 val = 0;
1050
1051 if (hubs->lineout1_se && hubs->lineout1n_ena)
1052 val |= WM8993_LINEOUT1N_ENA;
1053
1054 if (hubs->lineout1_se && hubs->lineout1p_ena)
1055 val |= WM8993_LINEOUT1P_ENA;
1056
1057 if (hubs->lineout2_se && hubs->lineout2n_ena)
1058 val |= WM8993_LINEOUT2N_ENA;
1059
1060 if (hubs->lineout2_se && hubs->lineout2p_ena)
1061 val |= WM8993_LINEOUT2P_ENA;
1062
1063 snd_soc_update_bits(codec, WM8993_POWER_MANAGEMENT_3,
1064 WM8993_LINEOUT1N_ENA |
1065 WM8993_LINEOUT1P_ENA |
1066 WM8993_LINEOUT2N_ENA |
1067 WM8993_LINEOUT2P_ENA,
1068 val);
1069
Mark Brownd60d6c32012-02-10 18:09:42 +00001070 /* Remove the input clamps */
1071 snd_soc_update_bits(codec, WM8993_INPUTS_CLAMP_REG,
1072 WM8993_INPUTS_CLAMP, 0);
Mark Brown5f2f3892012-02-08 18:51:42 +00001073 break;
1074
1075 default:
1076 break;
1077 }
1078}
1079EXPORT_SYMBOL_GPL(wm_hubs_set_bias_level);
1080
Mark Browna2342ae2009-07-29 21:21:49 +01001081MODULE_DESCRIPTION("Shared support for Wolfson hubs products");
1082MODULE_AUTHOR("Mark Brown <broonie@opensource.wolfsonmicro.com>");
1083MODULE_LICENSE("GPL");