From: <bob...@us...> - 2007-07-31 09:02:53
|
Revision: 1219 http://hackndev.svn.sourceforge.net/hackndev/?rev=1219&view=rev Author: bobofdoom Date: 2007-07-31 02:02:48 -0700 (Tue, 31 Jul 2007) Log Message: ----------- PalmT650: Initial SoC audio driver. - Just enough to make the audio routing via alasamixer work. Does not yet do anything clever like responding to headphone jack events, silent switch or powering up and down the ringtone speaker via GPIO 116. Modified Paths: -------------- linux4palm/linux/trunk/sound/soc/pxa/Kconfig linux4palm/linux/trunk/sound/soc/pxa/Makefile Added Paths: ----------- linux4palm/linux/trunk/sound/soc/pxa/palmt650.c Modified: linux4palm/linux/trunk/sound/soc/pxa/Kconfig =================================================================== --- linux4palm/linux/trunk/sound/soc/pxa/Kconfig 2007-07-29 17:32:54 UTC (rev 1218) +++ linux4palm/linux/trunk/sound/soc/pxa/Kconfig 2007-07-31 09:02:48 UTC (rev 1219) @@ -167,4 +167,14 @@ help Say Y if you want to add support for SoC audio on the H5000 iPAQs. + +config SND_PXA2XX_SOC_PALMT650 + tristate "SoC Audio support for Palm Treo 650" + depends on SND_PXA2XX_SOC && MACH_XSCALE_PALMTREO650 + select SND_PXA2XX_SOC_AC97 + help + Say Y if you want to add support for SoC audio on + the Palm Treo 650. + + endmenu Modified: linux4palm/linux/trunk/sound/soc/pxa/Makefile =================================================================== --- linux4palm/linux/trunk/sound/soc/pxa/Makefile 2007-07-29 17:32:54 UTC (rev 1218) +++ linux4palm/linux/trunk/sound/soc/pxa/Makefile 2007-07-31 09:02:48 UTC (rev 1219) @@ -26,6 +26,7 @@ snd-soc-amesom-tlv320-objs := amesom_tlv320.o snd-soc-blueangel-objs := blueangel.o snd-soc-h5000-objs := h5000.o +snd-soc-palmt650-objs := palmt650.o obj-$(CONFIG_SND_PXA2XX_SOC_CORGI) += snd-soc-corgi.o obj-$(CONFIG_SND_PXA2XX_SOC_MAINSTONE_WM8731) += snd-soc-mainstone-wm8731.o @@ -43,4 +44,5 @@ obj-$(CONFIG_SND_PXA2XX_SOC_AMESOM_TLV320) += snd-soc-amesom-tlv320.o obj-$(CONFIG_SND_PXA2XX_SOC_BLUEANGEL) += snd-soc-blueangel.o obj-$(CONFIG_SND_PXA2XX_SOC_H5000) += snd-soc-h5000.o +obj-$(CONFIG_SND_PXA2XX_SOC_PALMT650) += snd-soc-palmt650.o Added: linux4palm/linux/trunk/sound/soc/pxa/palmt650.c =================================================================== --- linux4palm/linux/trunk/sound/soc/pxa/palmt650.c (rev 0) +++ linux4palm/linux/trunk/sound/soc/pxa/palmt650.c 2007-07-31 09:02:48 UTC (rev 1219) @@ -0,0 +1,120 @@ +/* + * palmt650.c -- SoC audio for Palm Treo 650 + * + * Based on tosa.c + * + * Copyright 2007 (C) Alex Osborne <bob...@gm...> + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; version 2 ONLY. + * + * Revision history + * 31 Jul 2007 Initial version. + * + */ + +#include <linux/module.h> +#include <linux/moduleparam.h> +#include <linux/device.h> + +#include <sound/driver.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/arch/pxa-regs.h> +#include <asm/arch/hardware.h> +#include <asm/arch/audio.h> + +#include "../codecs/wm9712.h" +#include "pxa2xx-pcm.h" +#include "pxa2xx-ac97.h" + +static struct snd_soc_machine palmt650; + +static int palmt650_startup(struct snd_pcm_substream *substream) +{ + struct snd_soc_pcm_runtime *rtd = substream->private_data; + struct snd_soc_codec *codec = rtd->socdev->codec; + + /* TODO */ + return 0; +} + +static struct snd_soc_ops palmt650_ops = { + .startup = palmt650_startup, +}; + +static int palmt650_ac97_init(struct snd_soc_codec *codec) +{ + /* TODO */ + return 0; +} + +static struct snd_soc_dai_link palmt650_dai[] = { +{ + .name = "AC97", + .stream_name = "AC97 HiFi", + .cpu_dai = &pxa_ac97_dai[PXA2XX_DAI_AC97_HIFI], + .codec_dai = &wm9712_dai[WM9712_DAI_AC97_HIFI], + .init = palmt650_ac97_init, + .ops = &palmt650_ops, +}, +{ + .name = "AC97 Aux", + .stream_name = "AC97 Aux", + .cpu_dai = &pxa_ac97_dai[PXA2XX_DAI_AC97_AUX], + .codec_dai = &wm9712_dai[WM9712_DAI_AC97_AUX], + .ops = &palmt650_ops, +}, +}; + +static struct snd_soc_machine palmt650 = { + .name = "Palm Treo 650", + .dai_link = palmt650_dai, + .num_links = ARRAY_SIZE(palmt650_dai), +}; + +static struct snd_soc_device palmt650_snd_devdata = { + .machine = &palmt650, + .platform = &pxa2xx_soc_platform, + .codec_dev = &soc_codec_dev_wm9712, +}; + +static struct platform_device *palmt650_snd_device; + +static int __init palmt650_soc_init(void) +{ + int ret; + + if (!machine_is_xscale_treo650()) + return -ENODEV; + + palmt650_snd_device = platform_device_alloc("soc-audio", -1); + if (!palmt650_snd_device) + return -ENOMEM; + + platform_set_drvdata(palmt650_snd_device, &palmt650_snd_devdata); + palmt650_snd_devdata.dev = &palmt650_snd_device->dev; + ret = platform_device_add(palmt650_snd_device); + + if (ret) + platform_device_put(palmt650_snd_device); + + return ret; +} + +static void __exit palmt650_soc_exit(void) +{ + platform_device_unregister(palmt650_snd_device); +} + +module_init(palmt650_soc_init); +module_exit(palmt650_soc_exit); + +MODULE_AUTHOR("Alex Osborne <bob...@gm...>"); +MODULE_DESCRIPTION("ALSA SoC driver for Palm Treo 650"); +MODULE_LICENSE("GPL"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |