~ubuntu-branches/ubuntu/quantal/linux-linaro-mx51/quantal

« back to all changes in this revision

Viewing changes to sound/soc/codecs/wm8731.c

  • Committer: Package Import Robot
  • Author(s): John Rigby, John Rigby
  • Date: 2011-09-26 10:44:23 UTC
  • Revision ID: package-import@ubuntu.com-20110926104423-3o58a3c1bj7x00rs
Tags: 3.0.0-1007.9
[ John Rigby ]

Enable crypto modules and remove crypto-modules from
exclude-module files
LP: #826021

Show diffs side-by-side

added added

removed removed

Lines of Context:
175
175
SOC_DAPM_ENUM("Input Select", wm8731_insel_enum);
176
176
 
177
177
static const struct snd_soc_dapm_widget wm8731_dapm_widgets[] = {
 
178
SND_SOC_DAPM_SUPPLY("ACTIVE",WM8731_ACTIVE, 0, 0, NULL, 0),
178
179
SND_SOC_DAPM_SUPPLY("OSC", WM8731_PWR, 5, 1, NULL, 0),
179
180
SND_SOC_DAPM_MIXER("Output Mixer", WM8731_PWR, 4, 1,
180
181
        &wm8731_output_mixer_controls[0],
198
199
{
199
200
        struct wm8731_priv *wm8731 = snd_soc_codec_get_drvdata(source->codec);
200
201
 
201
 
        return wm8731->sysclk_type == WM8731_SYSCLK_MCLK;
 
202
        return wm8731->sysclk_type == WM8731_SYSCLK_XTAL;
202
203
}
203
204
 
204
205
static const struct snd_soc_dapm_route wm8731_intercon[] = {
205
206
        {"DAC", NULL, "OSC", wm8731_check_osc},
206
207
        {"ADC", NULL, "OSC", wm8731_check_osc},
 
208
        {"DAC", NULL, "ACTIVE"},
 
209
        {"ADC", NULL, "ACTIVE"},
207
210
 
208
211
        /* output mixer */
209
212
        {"Output Mixer", "Line Bypass Switch", "Line Input"},
315
318
        return 0;
316
319
}
317
320
 
318
 
static int wm8731_pcm_prepare(struct snd_pcm_substream *substream,
319
 
                              struct snd_soc_dai *dai)
320
 
{
321
 
        struct snd_soc_codec *codec = dai->codec;
322
 
 
323
 
        /* set active */
324
 
        snd_soc_write(codec, WM8731_ACTIVE, 0x0001);
325
 
 
326
 
        return 0;
327
 
}
328
 
 
329
 
static void wm8731_shutdown(struct snd_pcm_substream *substream,
330
 
                            struct snd_soc_dai *dai)
331
 
{
332
 
        struct snd_soc_codec *codec = dai->codec;
333
 
 
334
 
        /* deactivate */
335
 
        if (!codec->active) {
336
 
                udelay(50);
337
 
                snd_soc_write(codec, WM8731_ACTIVE, 0x0);
338
 
        }
339
 
}
340
 
 
341
321
static int wm8731_mute(struct snd_soc_dai *dai, int mute)
342
322
{
343
323
        struct snd_soc_codec *codec = dai->codec;
480
460
                snd_soc_write(codec, WM8731_PWR, reg | 0x0040);
481
461
                break;
482
462
        case SND_SOC_BIAS_OFF:
483
 
                snd_soc_write(codec, WM8731_ACTIVE, 0x0);
484
463
                snd_soc_write(codec, WM8731_PWR, 0xffff);
485
464
                regulator_bulk_disable(ARRAY_SIZE(wm8731->supplies),
486
465
                                       wm8731->supplies);
496
475
        SNDRV_PCM_FMTBIT_S24_LE)
497
476
 
498
477
static struct snd_soc_dai_ops wm8731_dai_ops = {
499
 
        .prepare        = wm8731_pcm_prepare,
500
478
        .hw_params      = wm8731_hw_params,
501
 
        .shutdown       = wm8731_shutdown,
502
479
        .digital_mute   = wm8731_mute,
503
480
        .set_sysclk     = wm8731_set_dai_sysclk,
504
481
        .set_fmt        = wm8731_set_dai_fmt,