~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise

« back to all changes in this revision

Viewing changes to sound/soc/pxa/spitz.c

  • Committer: Bazaar Package Importer
  • Author(s): Paolo Pisati
  • Date: 2011-06-29 15:23:51 UTC
  • mfrom: (26.1.1 natty-proposed)
  • Revision ID: james.westby@ubuntu.com-20110629152351-xs96tm303d95rpbk
Tags: 3.0.0-1200.2
* Rebased against 3.0.0-6.7
* BSP from TI based on 3.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
 
43
43
static int spitz_jack_func;
44
44
static int spitz_spk_func;
 
45
static int spitz_mic_gpio;
45
46
 
46
47
static void spitz_ext_control(struct snd_soc_codec *codec)
47
48
{
217
218
static int spitz_mic_bias(struct snd_soc_dapm_widget *w,
218
219
        struct snd_kcontrol *k, int event)
219
220
{
220
 
        if (machine_is_borzoi() || machine_is_spitz())
221
 
                gpio_set_value(SPITZ_GPIO_MIC_BIAS,
222
 
                                SND_SOC_DAPM_EVENT_ON(event));
223
 
 
224
 
        if (machine_is_akita())
225
 
                gpio_set_value(AKITA_GPIO_MIC_BIAS,
226
 
                                SND_SOC_DAPM_EVENT_ON(event));
227
 
 
 
221
        gpio_set_value_cansleep(spitz_mic_gpio, SND_SOC_DAPM_EVENT_ON(event));
228
222
        return 0;
229
223
}
230
224
 
339
333
        if (!(machine_is_spitz() || machine_is_borzoi() || machine_is_akita()))
340
334
                return -ENODEV;
341
335
 
 
336
        if (machine_is_borzoi() || machine_is_spitz())
 
337
                spitz_mic_gpio = SPITZ_GPIO_MIC_BIAS;
 
338
        else
 
339
                spitz_mic_gpio = AKITA_GPIO_MIC_BIAS;
 
340
 
 
341
        ret = gpio_request(spitz_mic_gpio, "MIC GPIO");
 
342
        if (ret)
 
343
                goto err1;
 
344
 
 
345
        ret = gpio_direction_output(spitz_mic_gpio, 0);
 
346
        if (ret)
 
347
                goto err2;
 
348
 
342
349
        spitz_snd_device = platform_device_alloc("soc-audio", -1);
343
 
        if (!spitz_snd_device)
344
 
                return -ENOMEM;
 
350
        if (!spitz_snd_device) {
 
351
                ret = -ENOMEM;
 
352
                goto err2;
 
353
        }
345
354
 
346
355
        platform_set_drvdata(spitz_snd_device, &snd_soc_spitz);
 
356
 
347
357
        ret = platform_device_add(spitz_snd_device);
348
 
 
349
358
        if (ret)
350
 
                platform_device_put(spitz_snd_device);
351
 
 
 
359
                goto err3;
 
360
 
 
361
        return 0;
 
362
 
 
363
err3:
 
364
        platform_device_put(spitz_snd_device);
 
365
err2:
 
366
        gpio_free(spitz_mic_gpio);
 
367
err1:
352
368
        return ret;
353
369
}
354
370
 
355
371
static void __exit spitz_exit(void)
356
372
{
357
373
        platform_device_unregister(spitz_snd_device);
 
374
        gpio_free(spitz_mic_gpio);
358
375
}
359
376
 
360
377
module_init(spitz_init);