Skip to content

Commit

Permalink
[ARM] 5098/1: fix sound/soc/pxa/tosa.c to new gpio api
Browse files Browse the repository at this point in the history
The sound/soc/pxa/tosa.c contains dependencies on parts that never
ever hit mainline. Replace them with current support for tc6393xb.

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
  • Loading branch information
Dmitry Baryshkov authored and Russell King committed Jul 7, 2008
1 parent bf0116e commit 4440cbd
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 9 deletions.
1 change: 1 addition & 0 deletions sound/soc/pxa/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ config SND_PXA2XX_SOC_POODLE
config SND_PXA2XX_SOC_TOSA
tristate "SoC AC97 Audio support for Tosa"
depends on SND_PXA2XX_SOC && MACH_TOSA
depends on MFD_TC6393XB
select SND_PXA2XX_SOC_AC97
select SND_SOC_WM9712
help
Expand Down
29 changes: 20 additions & 9 deletions sound/soc/pxa/tosa.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,15 @@
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/device.h>
#include <linux/gpio.h>

#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/soc.h>
#include <sound/soc-dapm.h>

#include <asm/mach-types.h>
#include <asm/hardware/tmio.h>
#include <asm/arch/tosa.h>
#include <asm/arch/pxa-regs.h>
#include <asm/arch/hardware.h>
#include <asm/arch/audio.h>
Expand Down Expand Up @@ -138,10 +139,7 @@ static int tosa_set_spk(struct snd_kcontrol *kcontrol,
static int tosa_hp_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *k, int event)
{
if (SND_SOC_DAPM_EVENT_ON(event))
set_tc6393_gpio(&tc6393_device.dev,TOSA_TC6393_L_MUTE);
else
reset_tc6393_gpio(&tc6393_device.dev,TOSA_TC6393_L_MUTE);
gpio_set_value(TOSA_GPIO_L_MUTE, SND_SOC_DAPM_EVENT_ON(event) ? 1 :0);
return 0;
}

Expand Down Expand Up @@ -261,23 +259,36 @@ static int __init tosa_init(void)
if (!machine_is_tosa())
return -ENODEV;

ret = gpio_request(TOSA_GPIO_L_MUTE, "Headphone Jack");
if (ret)
return ret;
gpio_direction_output(TOSA_GPIO_L_MUTE, 0);

tosa_snd_device = platform_device_alloc("soc-audio", -1);
if (!tosa_snd_device)
return -ENOMEM;
if (!tosa_snd_device) {
ret = -ENOMEM;
goto err_alloc;
}

platform_set_drvdata(tosa_snd_device, &tosa_snd_devdata);
tosa_snd_devdata.dev = &tosa_snd_device->dev;
ret = platform_device_add(tosa_snd_device);

if (ret)
platform_device_put(tosa_snd_device);
if (!ret)
return 0;

platform_device_put(tosa_snd_device);

err_alloc:
gpio_free(TOSA_GPIO_L_MUTE);

return ret;
}

static void __exit tosa_exit(void)
{
platform_device_unregister(tosa_snd_device);
gpio_free(TOSA_GPIO_L_MUTE);
}

module_init(tosa_init);
Expand Down

0 comments on commit 4440cbd

Please sign in to comment.