aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/s3c24xx/neo1973_gta02_wm8753.c
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2009-07-29 10:40:19 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2009-07-29 16:29:33 -0400
commit82c4362ee3d8a0b8797ba77222b25c7671696e2b (patch)
tree4c1fa7405fef2f843088cd649e502901647274b1 /sound/soc/s3c24xx/neo1973_gta02_wm8753.c
parent69331fbdeede932b64a0eaea6d196beaa9c40e0f (diff)
ASoC: neo1973_gta02_wm8753: Replace deprecated s3c_gpio calls with gpiolib
With the s3c platform has implementing gpiolib support the s3c_gpio api has been deprecated. This patch gets rid of all s3c_gpio calls and replaces them by using gpiolib. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/s3c24xx/neo1973_gta02_wm8753.c')
-rw-r--r--sound/soc/s3c24xx/neo1973_gta02_wm8753.c53
1 files changed, 36 insertions, 17 deletions
diff --git a/sound/soc/s3c24xx/neo1973_gta02_wm8753.c b/sound/soc/s3c24xx/neo1973_gta02_wm8753.c
index 75ee63db791..0c52e36ddd8 100644
--- a/sound/soc/s3c24xx/neo1973_gta02_wm8753.c
+++ b/sound/soc/s3c24xx/neo1973_gta02_wm8753.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * neo1973_gta02_wm8753.c -- SoC audio for Neo1973 2 * neo1973_gta02_wm8753.c -- SoC audio for Openmoko Freerunner(GTA02)
3 * 3 *
4 * Copyright 2007 Openmoko Inc 4 * Copyright 2007 Openmoko Inc
5 * Author: Graeme Gregory <graeme@openmoko.org> 5 * Author: Graeme Gregory <graeme@openmoko.org>
@@ -18,6 +18,7 @@
18#include <linux/timer.h> 18#include <linux/timer.h>
19#include <linux/interrupt.h> 19#include <linux/interrupt.h>
20#include <linux/platform_device.h> 20#include <linux/platform_device.h>
21#include <linux/gpio.h>
21#include <sound/core.h> 22#include <sound/core.h>
22#include <sound/pcm.h> 23#include <sound/pcm.h>
23#include <sound/soc.h> 24#include <sound/soc.h>
@@ -28,10 +29,7 @@
28#include <plat/regs-iis.h> 29#include <plat/regs-iis.h>
29 30
30#include <mach/regs-clock.h> 31#include <mach/regs-clock.h>
31#include <mach/regs-gpio.h>
32#include <mach/hardware.h>
33#include <asm/io.h> 32#include <asm/io.h>
34#include <mach/regs-gpioj.h>
35#include <mach/gta02.h> 33#include <mach/gta02.h>
36#include "../codecs/wm8753.h" 34#include "../codecs/wm8753.h"
37#include "s3c24xx-pcm.h" 35#include "s3c24xx-pcm.h"
@@ -243,10 +241,10 @@ static int lm4853_set_spk(struct snd_kcontrol *kcontrol,
243 241
244 if (val) { 242 if (val) {
245 lm4853_state |= LM4853_SPK; 243 lm4853_state |= LM4853_SPK;
246 s3c2410_gpio_setpin(GTA02_GPIO_HP_IN, 0); 244 gpio_set_value(GTA02_GPIO_HP_IN, 0);
247 } else { 245 } else {
248 lm4853_state &= ~LM4853_SPK; 246 lm4853_state &= ~LM4853_SPK;
249 s3c2410_gpio_setpin(GTA02_GPIO_HP_IN, 1); 247 gpio_set_value(GTA02_GPIO_HP_IN, 1);
250 } 248 }
251 249
252 return 0; 250 return 0;
@@ -264,11 +262,7 @@ static int lm4853_event(struct snd_soc_dapm_widget *w,
264 struct snd_kcontrol *k, 262 struct snd_kcontrol *k,
265 int event) 263 int event)
266{ 264{
267 if (SND_SOC_DAPM_EVENT_ON(event)) 265 gpio_set_value(GTA02_GPIO_AMP_SHUT, SND_SOC_DAPM_EVENT_OFF(value));
268 s3c2410_gpio_setpin(GTA02_GPIO_AMP_SHUT, 0);
269
270 if (SND_SOC_DAPM_EVENT_OFF(event))
271 s3c2410_gpio_setpin(GTA02_GPIO_AMP_SHUT, 1);
272 266
273 return 0; 267 return 0;
274} 268}
@@ -453,15 +447,38 @@ static int __init neo1973_gta02_init(void)
453 } 447 }
454 448
455 /* Initialise GPIOs used by amp */ 449 /* Initialise GPIOs used by amp */
456 s3c2410_gpio_cfgpin(GTA02_GPIO_HP_IN, S3C2410_GPIO_OUTPUT); 450 ret = gpio_request(GTA02_GPIO_HP_IN, "GTA02_HP_IN");
457 s3c2410_gpio_cfgpin(GTA02_GPIO_AMP_SHUT, S3C2410_GPIO_OUTPUT); 451 if (ret) {
452 pr_err("gta02_wm8753: Failed to register GPIO %d\n", GTA02_GPIO_HP_IN);
453 goto err_unregister_device;
454 }
458 455
459 /* Amp off by default */ 456 ret = gpio_direction_output(GTA02_GPIO_AMP_HP_IN, 1);
460 s3c2410_gpio_setpin(GTA02_GPIO_AMP_SHUT, 1); 457 if (ret) {
458 pr_err("gta02_wm8753: Failed to configure GPIO %d\n", GTA02_GPIO_HP_IN);
459 goto err_free_gpio_hp_in;
460 }
461 461
462 /* Speaker off by default */ 462 ret = gpio_request(GTA02_GPIO_AMP_SHUT, "GTA02_AMP_SHUT");
463 s3c2410_gpio_setpin(GTA02_GPIO_HP_IN, 1); 463 if (ret) {
464 pr_err("gta02_wm8753: Failed to register GPIO %d\n", GTA02_GPIO_AMP_SHUT);
465 goto err_free_gpio_hp_in;
466 }
464 467
468 ret = gpio_direction_output(GTA02_GPIO_AMP_SHUT, 1);
469 if (ret) {
470 pr_err("gta02_wm8753: Failed to configure GPIO %d\n", GTA02_GPIO_AMP_SHUT);
471 goto err_free_gpio_amp_shut;
472 }
473
474 return 0;
475
476err_free_gpio_amp_shut:
477 gpio_free(GTA02_GPIO_AMP_SHUT);
478err_free_gpio_hp_in:
479 gpio_free(GTA02_GPIO_HP_IN);
480err_unregister_device:
481 platform_device_unregister(neo1973_gta02_snd_device);
465 return ret; 482 return ret;
466} 483}
467module_init(neo1973_gta02_init); 484module_init(neo1973_gta02_init);
@@ -470,6 +487,8 @@ static void __exit neo1973_gta02_exit(void)
470{ 487{
471 snd_soc_unregister_dai(&bt_dai); 488 snd_soc_unregister_dai(&bt_dai);
472 platform_device_unregister(neo1973_gta02_snd_device); 489 platform_device_unregister(neo1973_gta02_snd_device);
490 gpio_free(GTA02_GPIO_HP_IN);
491 gpio_free(GTA02_GPIO_AMP_SHUT);
473} 492}
474module_exit(neo1973_gta02_exit); 493module_exit(neo1973_gta02_exit);
475 494