* Re: [PATCH] PalmTX aSoC sound support
[not found] ` <20080704202615.GB20719@sirena.org.uk>
@ 2008-07-04 22:19 ` Marek Vasut
2008-07-05 5:17 ` Marek Vasut
2008-07-07 11:01 ` Mark Brown
0 siblings, 2 replies; 12+ messages in thread
From: Marek Vasut @ 2008-07-04 22:19 UTC (permalink / raw)
To: Mark Brown; +Cc: alsa-devel, Russell King - ARM Linux, linux-arm-kernel
[-- Attachment #1: Type: text/plain, Size: 1262 bytes --]
Dne Friday 04 of July 2008 22:26:15 Mark Brown napsal(a):
> On Fri, Jul 04, 2008 at 09:49:57PM +0200, Marek Vasut wrote:
>
> Like Liam said, audio patches should be CCed to alsa-devel as well - a
>
> couple of comments from a quick scan through:
> > + /* add palmtx specific widgets */
> > + for (i = 0; i < ARRAY_SIZE(palmtx_dapm_widgets); i++)
> > + snd_soc_dapm_new_control(codec, &palmtx_dapm_widgets[i]);
>
> Ideally this should use the new snd_soc_dapm_new_controls() function...
>
> > + /* set up palmtx specific audio path audio_map */
> > + for (i = 0; audio_map[i][0] != NULL; i++)
> > + snd_soc_dapm_connect_input(codec, audio_map[i][0],
> > + audio_map[i][1], audio_map[i][2]);
>
> and this should use snd_soc_dapm_add_routes (which would also mean you
> could drop the null terminator from audio_map()). Both are queued for
> merge in the window - see ALSA git, it'll also appear in linux-next.
>
> > + ret = platform_device_add(palmtx_snd_device);
> > +
> > + if (!ret)
> > + return 0;
> > +
> > + platform_device_put(palmtx_snd_device);
>
> It took me a double take to follow this - it'd be more idiomatic to say:
>
> if (ret != 0)
> goto put_device;
>
> return 0;
> put_device:
ok, I applied some alsa patches to my branch of "devel"
[-- Attachment #2: palmtx-asoc-ml-v4.patch --]
[-- Type: text/x-diff, Size: 7779 bytes --]
Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
diff --git a/sound/soc/pxa/Kconfig b/sound/soc/pxa/Kconfig
index 329b33f..570b88a 100644
--- a/sound/soc/pxa/Kconfig
+++ b/sound/soc/pxa/Kconfig
@@ -63,3 +63,12 @@ config SND_PXA2XX_SOC_E800
help
Say Y if you want to add support for SoC audio on the
Toshiba e800 PDA
+
+config SND_PXA2XX_SOC_PALMTX
+ tristate "SoC AC97 Audio support for Palm T|X"
+ depends on SND_PXA2XX_SOC && MACH_XSCALE_PALMTX
+ select SND_PXA2XX_SOC_AC97
+ select SND_SOC_WM9712
+ help
+ Say Y if you want to add support for SoC audio on
+ Palm T|X.
diff --git a/sound/soc/pxa/Makefile b/sound/soc/pxa/Makefile
index 04e5646..9ab59f9 100644
--- a/sound/soc/pxa/Makefile
+++ b/sound/soc/pxa/Makefile
@@ -13,10 +13,12 @@ snd-soc-poodle-objs := poodle.o
snd-soc-tosa-objs := tosa.o
snd-soc-e800-objs := e800_wm9712.o
snd-soc-spitz-objs := spitz.o
+snd-soc-palmtx-objs := palmtx.o
obj-$(CONFIG_SND_PXA2XX_SOC_CORGI) += snd-soc-corgi.o
obj-$(CONFIG_SND_PXA2XX_SOC_POODLE) += snd-soc-poodle.o
obj-$(CONFIG_SND_PXA2XX_SOC_TOSA) += snd-soc-tosa.o
obj-$(CONFIG_SND_PXA2XX_SOC_E800) += snd-soc-e800.o
obj-$(CONFIG_SND_PXA2XX_SOC_SPITZ) += snd-soc-spitz.o
+obj-$(CONFIG_SND_PXA2XX_SOC_PALMTX) += snd-soc-palmtx.o
diff --git a/sound/soc/pxa/palmtx.c b/sound/soc/pxa/palmtx.c
new file mode 100644
index 0000000..d2b5d8c
--- /dev/null
+++ b/sound/soc/pxa/palmtx.c
@@ -0,0 +1,246 @@
+/*
+ * linux/sound/soc/pxa/palmtx.c
+ *
+ * SoC Audio driver for Palm T|X handheld
+ *
+ * based on tosa.c
+ *
+ * Copyright (C) 2008 Marek Vasut <marek.vasut@gmail.com>
+ *
+ * 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; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ */
+
+#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/arch/audio.h>
+#include <asm/arch/palmtx-gpio.h>
+
+#include "../codecs/wm9712.h"
+#include "pxa2xx-pcm.h"
+#include "pxa2xx-ac97.h"
+
+static int palmtx_jack_func;
+static int palmtx_spk_func;
+
+static void palmtx_ext_control(struct snd_soc_codec *codec)
+{
+ snd_soc_dapm_set_endpoint(codec, "Speaker", !palmtx_spk_func);
+ snd_soc_dapm_set_endpoint(codec, "Headphone Jack", !palmtx_jack_func);
+ snd_soc_dapm_sync_endpoints(codec);
+}
+
+static int palmtx_startup(struct snd_pcm_substream *substream)
+{
+ struct snd_soc_pcm_runtime *rtd = substream->private_data;
+ struct snd_soc_codec *codec = rtd->socdev->codec;
+
+ /* check the jack status at stream startup */
+ palmtx_ext_control(codec);
+ return 0;
+}
+
+static struct snd_soc_ops palmtx_ops = {
+ .startup = palmtx_startup,
+};
+
+static int palmtx_get_jack(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ ucontrol->value.integer.value[0] = palmtx_jack_func;
+ return 0;
+}
+
+static int palmtx_set_jack(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
+
+ if (palmtx_jack_func == ucontrol->value.integer.value[0])
+ return 0;
+
+ palmtx_jack_func = ucontrol->value.integer.value[0];
+ palmtx_ext_control(codec);
+ return 1;
+}
+
+static int palmtx_get_spk(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ ucontrol->value.integer.value[0] = palmtx_spk_func;
+ return 0;
+}
+
+static int palmtx_set_spk(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
+
+ if (palmtx_spk_func == ucontrol->value.integer.value[0])
+ return 0;
+
+ palmtx_spk_func = ucontrol->value.integer.value[0];
+ palmtx_ext_control(codec);
+ return 1;
+}
+
+/* PalmTX dapm event handlers */
+static int palmtx_hp_event(struct snd_soc_dapm_widget *w,
+ struct snd_kcontrol *k, int event)
+{
+ gpio_set_value(GPIO_NR_PALMTX_EARPHONE_DETECT,
+ SND_SOC_DAPM_EVENT_ON(event));
+ return 0;
+}
+
+/* PalmTX machine dapm widgets */
+static const struct snd_soc_dapm_widget palmtx_dapm_widgets[] = {
+ SND_SOC_DAPM_HP("Headphone Jack", palmtx_hp_event),
+ SND_SOC_DAPM_SPK("Speaker", NULL),
+};
+
+/* PalmTX audio map */
+static const char *audio_map[][3] = {
+
+ /* headphone connected to HPOUTL, HPOUTR */
+ {"Headphone Jack", NULL, "HPOUTL"},
+ {"Headphone Jack", NULL, "HPOUTR"},
+
+ /* ext speaker connected to LOUT2, ROUT2 */
+ {"Speaker", NULL, "LOUT2"},
+ {"Speaker", NULL, "ROUT2"},
+};
+
+static const char *jack_function[] = {"Headphone", "Off"};
+static const char *spk_function[] = {"On", "Off"};
+static const struct soc_enum palmtx_enum[] = {
+ SOC_ENUM_SINGLE_EXT(2, jack_function),
+ SOC_ENUM_SINGLE_EXT(2, spk_function),
+};
+
+static const struct snd_kcontrol_new palmtx_controls[] = {
+ SOC_ENUM_EXT("Jack Function", palmtx_enum[0], palmtx_get_jack,
+ palmtx_set_jack),
+ SOC_ENUM_EXT("Speaker Function", palmtx_enum[1], palmtx_get_spk,
+ palmtx_set_spk),
+};
+
+static int palmtx_ac97_init(struct snd_soc_codec *codec)
+{
+ int i, err;
+
+ snd_soc_dapm_set_endpoint(codec, "OUT3", 0);
+ snd_soc_dapm_set_endpoint(codec, "MONOOUT", 0);
+
+ /* add palmtx specific controls */
+ for (i = 0; i < ARRAY_SIZE(palmtx_controls); i++) {
+ err = snd_ctl_add(codec->card,
+ snd_soc_cnew(&palmtx_controls[i], codec, NULL));
+ if (err < 0)
+ return err;
+ }
+
+ /* add palmtx specific widgets */
+ snd_soc_dapm_new_controls(codec, palmtx_dapm_widgets,
+ ARRAY_SIZE(palmtx_dapm_widgets));
+
+ /* set up palmtx specific audio path audio_map */
+ snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map));
+
+ snd_soc_dapm_sync_endpoints(codec);
+ return 0;
+}
+
+static struct snd_soc_dai_link palmtx_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 = palmtx_ac97_init,
+ .ops = &palmtx_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 = &palmtx_ops,
+},
+};
+
+static struct snd_soc_machine palmtx_asoc = {
+ .name = "Palm T|X",
+ .dai_link = palmtx_dai,
+ .num_links = ARRAY_SIZE(palmtx_dai),
+};
+
+static struct snd_soc_device palmtx_snd_devdata = {
+ .machine = &palmtx_asoc,
+ .platform = &pxa2xx_soc_platform,
+ .codec_dev = &soc_codec_dev_wm9712,
+};
+
+static struct platform_device *palmtx_snd_device;
+
+static int __init palmtx_asoc_init(void)
+{
+ int ret;
+
+ if (!machine_is_xscale_palmtx())
+ return -ENODEV;
+
+ ret = gpio_request(GPIO_NR_PALMTX_EARPHONE_DETECT, "Headphone Jack");
+ if (ret)
+ return ret;
+ gpio_direction_output(GPIO_NR_PALMTX_EARPHONE_DETECT, 0);
+
+ palmtx_snd_device = platform_device_alloc("soc-audio", -1);
+ if (!palmtx_snd_device) {
+ ret = -ENOMEM;
+ goto err_alloc;
+ }
+
+ platform_set_drvdata(palmtx_snd_device, &palmtx_snd_devdata);
+ palmtx_snd_devdata.dev = &palmtx_snd_device->dev;
+ ret = platform_device_add(palmtx_snd_device);
+
+ if (ret != 0)
+ goto put_device;
+
+ return 0;
+
+put_device:
+ platform_device_put(palmtx_snd_device);
+
+err_alloc:
+ gpio_free(GPIO_NR_PALMTX_EARPHONE_DETECT);
+
+ return ret;
+}
+
+static void __exit palmtx_asoc_exit(void)
+{
+ platform_device_unregister(palmtx_snd_device);
+ gpio_free(GPIO_NR_PALMTX_EARPHONE_DETECT);
+}
+
+module_init(palmtx_asoc_init);
+module_exit(palmtx_asoc_exit);
+
+/* Module information */
+MODULE_AUTHOR("Marek Vasut <marek.vasut@gmail.com>");
+MODULE_DESCRIPTION("ALSA SoC Palm T|X");
+MODULE_LICENSE("GPL");
[-- Attachment #3: Type: text/plain, Size: 160 bytes --]
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH] PalmTX aSoC sound support
2008-07-04 22:19 ` [PATCH] PalmTX aSoC sound support Marek Vasut
@ 2008-07-05 5:17 ` Marek Vasut
2008-07-07 12:29 ` Mark Brown
2008-07-07 11:01 ` Mark Brown
1 sibling, 1 reply; 12+ messages in thread
From: Marek Vasut @ 2008-07-05 5:17 UTC (permalink / raw)
To: Mark Brown; +Cc: alsa-devel, Russell King - ARM Linux, linux-arm-kernel
[-- Attachment #1: Type: text/plain, Size: 1437 bytes --]
Dne Saturday 05 of July 2008 00:19:08 Marek Vasut napsal(a):
> Dne Friday 04 of July 2008 22:26:15 Mark Brown napsal(a):
> > On Fri, Jul 04, 2008 at 09:49:57PM +0200, Marek Vasut wrote:
> >
> > Like Liam said, audio patches should be CCed to alsa-devel as well - a
> >
> > couple of comments from a quick scan through:
> > > + /* add palmtx specific widgets */
> > > + for (i = 0; i < ARRAY_SIZE(palmtx_dapm_widgets); i++)
> > > + snd_soc_dapm_new_control(codec, &palmtx_dapm_widgets[i]);
> >
> > Ideally this should use the new snd_soc_dapm_new_controls() function...
> >
> > > + /* set up palmtx specific audio path audio_map */
> > > + for (i = 0; audio_map[i][0] != NULL; i++)
> > > + snd_soc_dapm_connect_input(codec, audio_map[i][0],
> > > + audio_map[i][1], audio_map[i][2]);
> >
> > and this should use snd_soc_dapm_add_routes (which would also mean you
> > could drop the null terminator from audio_map()). Both are queued for
> > merge in the window - see ALSA git, it'll also appear in linux-next.
> >
> > > + ret = platform_device_add(palmtx_snd_device);
> > > +
> > > + if (!ret)
> > > + return 0;
> > > +
> > > + platform_device_put(palmtx_snd_device);
> >
> > It took me a double take to follow this - it'd be more idiomatic to say:
> >
> > if (ret != 0)
> > goto put_device;
> >
> > return 0;
> > put_device:
>
> ok, I applied some alsa patches to my branch of "devel"
even better version of the previous one
[-- Attachment #2: palmtx-asoc-ml-v5.patch --]
[-- Type: text/x-diff, Size: 7796 bytes --]
Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
diff --git a/sound/soc/pxa/Kconfig b/sound/soc/pxa/Kconfig
index 329b33f..570b88a 100644
--- a/sound/soc/pxa/Kconfig
+++ b/sound/soc/pxa/Kconfig
@@ -63,3 +63,12 @@ config SND_PXA2XX_SOC_E800
help
Say Y if you want to add support for SoC audio on the
Toshiba e800 PDA
+
+config SND_PXA2XX_SOC_PALMTX
+ tristate "SoC AC97 Audio support for Palm T|X"
+ depends on SND_PXA2XX_SOC && MACH_XSCALE_PALMTX
+ select SND_PXA2XX_SOC_AC97
+ select SND_SOC_WM9712
+ help
+ Say Y if you want to add support for SoC audio on
+ Palm T|X.
diff --git a/sound/soc/pxa/Makefile b/sound/soc/pxa/Makefile
index 04e5646..9ab59f9 100644
--- a/sound/soc/pxa/Makefile
+++ b/sound/soc/pxa/Makefile
@@ -13,10 +13,12 @@ snd-soc-poodle-objs := poodle.o
snd-soc-tosa-objs := tosa.o
snd-soc-e800-objs := e800_wm9712.o
snd-soc-spitz-objs := spitz.o
+snd-soc-palmtx-objs := palmtx.o
obj-$(CONFIG_SND_PXA2XX_SOC_CORGI) += snd-soc-corgi.o
obj-$(CONFIG_SND_PXA2XX_SOC_POODLE) += snd-soc-poodle.o
obj-$(CONFIG_SND_PXA2XX_SOC_TOSA) += snd-soc-tosa.o
obj-$(CONFIG_SND_PXA2XX_SOC_E800) += snd-soc-e800.o
obj-$(CONFIG_SND_PXA2XX_SOC_SPITZ) += snd-soc-spitz.o
+obj-$(CONFIG_SND_PXA2XX_SOC_PALMTX) += snd-soc-palmtx.o
diff --git a/sound/soc/pxa/palmtx.c b/sound/soc/pxa/palmtx.c
new file mode 100644
index 0000000..72d8319
--- /dev/null
+++ b/sound/soc/pxa/palmtx.c
@@ -0,0 +1,246 @@
+/*
+ * linux/sound/soc/pxa/palmtx.c
+ *
+ * SoC Audio driver for Palm T|X handheld
+ *
+ * based on tosa.c
+ *
+ * Copyright (C) 2008 Marek Vasut <marek.vasut@gmail.com>
+ *
+ * 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; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ */
+
+#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/arch/audio.h>
+#include <asm/arch/palmtx-gpio.h>
+
+#include "../codecs/wm9712.h"
+#include "pxa2xx-pcm.h"
+#include "pxa2xx-ac97.h"
+
+static int palmtx_jack_func;
+static int palmtx_spk_func;
+
+static void palmtx_ext_control(struct snd_soc_codec *codec)
+{
+ snd_soc_dapm_set_endpoint(codec, "Speaker", !palmtx_spk_func);
+ snd_soc_dapm_set_endpoint(codec, "Headphone Jack", !palmtx_jack_func);
+ snd_soc_dapm_sync_endpoints(codec);
+}
+
+static int palmtx_startup(struct snd_pcm_substream *substream)
+{
+ struct snd_soc_pcm_runtime *rtd = substream->private_data;
+ struct snd_soc_codec *codec = rtd->socdev->codec;
+
+ /* check the jack status at stream startup */
+ palmtx_ext_control(codec);
+ return 0;
+}
+
+static struct snd_soc_ops palmtx_ops = {
+ .startup = palmtx_startup,
+};
+
+static int palmtx_get_jack(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ ucontrol->value.integer.value[0] = palmtx_jack_func;
+ return 0;
+}
+
+static int palmtx_set_jack(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
+
+ if (palmtx_jack_func == ucontrol->value.integer.value[0])
+ return 0;
+
+ palmtx_jack_func = ucontrol->value.integer.value[0];
+ palmtx_ext_control(codec);
+ return 1;
+}
+
+static int palmtx_get_spk(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ ucontrol->value.integer.value[0] = palmtx_spk_func;
+ return 0;
+}
+
+static int palmtx_set_spk(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
+
+ if (palmtx_spk_func == ucontrol->value.integer.value[0])
+ return 0;
+
+ palmtx_spk_func = ucontrol->value.integer.value[0];
+ palmtx_ext_control(codec);
+ return 1;
+}
+
+/* PalmTX dapm event handlers */
+static int palmtx_hp_event(struct snd_soc_dapm_widget *w,
+ struct snd_kcontrol *k, int event)
+{
+ gpio_set_value(GPIO_NR_PALMTX_EARPHONE_DETECT,
+ SND_SOC_DAPM_EVENT_ON(event));
+ return 0;
+}
+
+/* PalmTX machine dapm widgets */
+static const struct snd_soc_dapm_widget palmtx_dapm_widgets[] = {
+ SND_SOC_DAPM_HP("Headphone Jack", palmtx_hp_event),
+ SND_SOC_DAPM_SPK("Speaker", NULL),
+};
+
+/* PalmTX audio map */
+static const struct snd_soc_dapm_route audio_map[] = {
+
+ /* headphone connected to HPOUTL, HPOUTR */
+ {"Headphone Jack", NULL, "HPOUTL"},
+ {"Headphone Jack", NULL, "HPOUTR"},
+
+ /* ext speaker connected to LOUT2, ROUT2 */
+ {"Speaker", NULL, "LOUT2"},
+ {"Speaker", NULL, "ROUT2"},
+};
+
+static const char *jack_function[] = {"Headphone", "Off"};
+static const char *spk_function[] = {"On", "Off"};
+static const struct soc_enum palmtx_enum[] = {
+ SOC_ENUM_SINGLE_EXT(2, jack_function),
+ SOC_ENUM_SINGLE_EXT(2, spk_function),
+};
+
+static const struct snd_kcontrol_new palmtx_controls[] = {
+ SOC_ENUM_EXT("Jack Function", palmtx_enum[0], palmtx_get_jack,
+ palmtx_set_jack),
+ SOC_ENUM_EXT("Speaker Function", palmtx_enum[1], palmtx_get_spk,
+ palmtx_set_spk),
+};
+
+static int palmtx_ac97_init(struct snd_soc_codec *codec)
+{
+ int i, err;
+
+ snd_soc_dapm_set_endpoint(codec, "OUT3", 0);
+ snd_soc_dapm_set_endpoint(codec, "MONOOUT", 0);
+
+ /* add palmtx specific controls */
+ for (i = 0; i < ARRAY_SIZE(palmtx_controls); i++) {
+ err = snd_ctl_add(codec->card,
+ snd_soc_cnew(&palmtx_controls[i], codec, NULL));
+ if (err < 0)
+ return err;
+ }
+
+ /* add palmtx specific widgets */
+ snd_soc_dapm_new_controls(codec, palmtx_dapm_widgets,
+ ARRAY_SIZE(palmtx_dapm_widgets));
+
+ /* set up palmtx specific audio path audio_map */
+ snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map));
+
+ snd_soc_dapm_sync_endpoints(codec);
+ return 0;
+}
+
+static struct snd_soc_dai_link palmtx_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 = palmtx_ac97_init,
+ .ops = &palmtx_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 = &palmtx_ops,
+},
+};
+
+static struct snd_soc_machine palmtx_asoc = {
+ .name = "Palm T|X",
+ .dai_link = palmtx_dai,
+ .num_links = ARRAY_SIZE(palmtx_dai),
+};
+
+static struct snd_soc_device palmtx_snd_devdata = {
+ .machine = &palmtx_asoc,
+ .platform = &pxa2xx_soc_platform,
+ .codec_dev = &soc_codec_dev_wm9712,
+};
+
+static struct platform_device *palmtx_snd_device;
+
+static int __init palmtx_asoc_init(void)
+{
+ int ret;
+
+ if (!machine_is_xscale_palmtx())
+ return -ENODEV;
+
+ ret = gpio_request(GPIO_NR_PALMTX_EARPHONE_DETECT, "Headphone Jack");
+ if (ret)
+ return ret;
+ gpio_direction_output(GPIO_NR_PALMTX_EARPHONE_DETECT, 0);
+
+ palmtx_snd_device = platform_device_alloc("soc-audio", -1);
+ if (!palmtx_snd_device) {
+ ret = -ENOMEM;
+ goto err_alloc;
+ }
+
+ platform_set_drvdata(palmtx_snd_device, &palmtx_snd_devdata);
+ palmtx_snd_devdata.dev = &palmtx_snd_device->dev;
+ ret = platform_device_add(palmtx_snd_device);
+
+ if (ret != 0)
+ goto put_device;
+
+ return 0;
+
+put_device:
+ platform_device_put(palmtx_snd_device);
+
+err_alloc:
+ gpio_free(GPIO_NR_PALMTX_EARPHONE_DETECT);
+
+ return ret;
+}
+
+static void __exit palmtx_asoc_exit(void)
+{
+ platform_device_unregister(palmtx_snd_device);
+ gpio_free(GPIO_NR_PALMTX_EARPHONE_DETECT);
+}
+
+module_init(palmtx_asoc_init);
+module_exit(palmtx_asoc_exit);
+
+/* Module information */
+MODULE_AUTHOR("Marek Vasut <marek.vasut@gmail.com>");
+MODULE_DESCRIPTION("ALSA SoC Palm T|X");
+MODULE_LICENSE("GPL");
[-- Attachment #3: Type: text/plain, Size: 160 bytes --]
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH] PalmTX aSoC sound support
2008-07-04 22:19 ` [PATCH] PalmTX aSoC sound support Marek Vasut
2008-07-05 5:17 ` Marek Vasut
@ 2008-07-07 11:01 ` Mark Brown
1 sibling, 0 replies; 12+ messages in thread
From: Mark Brown @ 2008-07-07 11:01 UTC (permalink / raw)
To: Marek Vasut; +Cc: alsa-devel, Russell King - ARM Linux, linux-arm-kernel
On Sat, Jul 05, 2008 at 12:19:08AM +0200, Marek Vasut wrote:
> +/* PalmTX audio map */
> +static const char *audio_map[][3] = {
> +
This should be an array of struct snd_soc_dapm_route.
Other than that one minor nit everything looks good.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] PalmTX aSoC sound support
2008-07-05 5:17 ` Marek Vasut
@ 2008-07-07 12:29 ` Mark Brown
2008-07-07 15:58 ` Takashi Iwai
0 siblings, 1 reply; 12+ messages in thread
From: Mark Brown @ 2008-07-07 12:29 UTC (permalink / raw)
To: Marek Vasut; +Cc: alsa-devel, Russell King - ARM Linux, linux-arm-kernel
On Sat, Jul 05, 2008 at 07:17:41AM +0200, Marek Vasut wrote:
> even better version of the previous one
> Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
It might be best to merge this via the ARM tree since it depends on the
machine support which is still pending but the Kconfig should prevent
anyone actually trying to build it until that happens.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] PalmTX aSoC sound support
2008-07-07 12:29 ` Mark Brown
@ 2008-07-07 15:58 ` Takashi Iwai
2008-07-14 15:07 ` Mark Brown
0 siblings, 1 reply; 12+ messages in thread
From: Takashi Iwai @ 2008-07-07 15:58 UTC (permalink / raw)
To: Mark Brown
Cc: Marek Vasut, alsa-devel, Russell King - ARM Linux,
linux-arm-kernel
At Mon, 7 Jul 2008 13:29:25 +0100,
Mark Brown wrote:
>
> On Sat, Jul 05, 2008 at 07:17:41AM +0200, Marek Vasut wrote:
>
> > even better version of the previous one
>
> > Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
>
> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
>
> It might be best to merge this via the ARM tree since it depends on the
> machine support which is still pending but the Kconfig should prevent
> anyone actually trying to build it until that happens.
Doesn't matter much to me, so just let me know to merge via which
tree.
thanks,
Takashi
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] PalmTX aSoC sound support
2008-07-07 15:58 ` Takashi Iwai
@ 2008-07-14 15:07 ` Mark Brown
2008-07-16 11:17 ` Takashi Iwai
0 siblings, 1 reply; 12+ messages in thread
From: Mark Brown @ 2008-07-14 15:07 UTC (permalink / raw)
To: Takashi Iwai; +Cc: alsa-devel, Russell King - ARM Linux, linux-arm-kernel
On Mon, Jul 07, 2008 at 05:58:32PM +0200, Takashi Iwai wrote:
> Doesn't matter much to me, so just let me know to merge via which
> tree.
Either way it needs another spin of the driver so...
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] PalmTX aSoC sound support
2008-07-14 15:07 ` Mark Brown
@ 2008-07-16 11:17 ` Takashi Iwai
2008-07-16 20:10 ` Marek Vasut
0 siblings, 1 reply; 12+ messages in thread
From: Takashi Iwai @ 2008-07-16 11:17 UTC (permalink / raw)
To: Marek Vasut
Cc: alsa-devel, Mark Brown, Russell King - ARM Linux,
linux-arm-kernel
At Mon, 14 Jul 2008 16:07:58 +0100,
Mark Brown wrote:
>
> On Mon, Jul 07, 2008 at 05:58:32PM +0200, Takashi Iwai wrote:
>
> > Doesn't matter much to me, so just let me know to merge via which
> > tree.
>
> Either way it needs another spin of the driver so...
OK, it's fine to push it to ALSA tree. But I think it's a bit too
late for 2.6.27...
Marek, could you give a proper changelog? I had only a patch.
thanks,
Takashi
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] PalmTX aSoC sound support
2008-07-16 11:17 ` Takashi Iwai
@ 2008-07-16 20:10 ` Marek Vasut
2008-07-17 10:05 ` Takashi Iwai
0 siblings, 1 reply; 12+ messages in thread
From: Marek Vasut @ 2008-07-16 20:10 UTC (permalink / raw)
To: Takashi Iwai
Cc: alsa-devel, Mark Brown, Russell King - ARM Linux,
linux-arm-kernel
Dne Wednesday 16 of July 2008 13:17:53 Takashi Iwai napsal(a):
> At Mon, 14 Jul 2008 16:07:58 +0100,
>
> Mark Brown wrote:
> > On Mon, Jul 07, 2008 at 05:58:32PM +0200, Takashi Iwai wrote:
> > > Doesn't matter much to me, so just let me know to merge via which
> > > tree.
> >
> > Either way it needs another spin of the driver so...
>
> OK, it's fine to push it to ALSA tree. But I think it's a bit too
> late for 2.6.27...
wasnt merge window for .27 opened just a while ago ?
>
> Marek, could you give a proper changelog? I had only a patch.
>
I have better (more universal) patch, would you mind waiting for that one ?
>
> thanks,
>
> Takashi
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] PalmTX aSoC sound support
2008-07-16 20:10 ` Marek Vasut
@ 2008-07-17 10:05 ` Takashi Iwai
2008-07-18 14:49 ` Russell King - ARM Linux
0 siblings, 1 reply; 12+ messages in thread
From: Takashi Iwai @ 2008-07-17 10:05 UTC (permalink / raw)
To: Marek Vasut
Cc: alsa-devel, Mark Brown, Russell King - ARM Linux,
linux-arm-kernel
At Wed, 16 Jul 2008 22:10:09 +0200,
Marek Vasut wrote:
>
> Dne Wednesday 16 of July 2008 13:17:53 Takashi Iwai napsal(a):
> > At Mon, 14 Jul 2008 16:07:58 +0100,
> >
> > Mark Brown wrote:
> > > On Mon, Jul 07, 2008 at 05:58:32PM +0200, Takashi Iwai wrote:
> > > > Doesn't matter much to me, so just let me know to merge via which
> > > > tree.
> > >
> > > Either way it needs another spin of the driver so...
> >
> > OK, it's fine to push it to ALSA tree. But I think it's a bit too
> > late for 2.6.27...
> wasnt merge window for .27 opened just a while ago ?
It doesn't mean to allow us to push any unreviewed/untested patches.
Trivial or fix patches can go immediately, but a new driver code is a
different story. In general, the new driver codes should be merged to
the subsystem tree in a few weeks before the merge window.
> > Marek, could you give a proper changelog? I had only a patch.
> >
> I have better (more universal) patch, would you mind waiting for that one ?
Yes.
thanks,
Takashi
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] PalmTX aSoC sound support
2008-07-17 10:05 ` Takashi Iwai
@ 2008-07-18 14:49 ` Russell King - ARM Linux
2008-07-18 15:13 ` Takashi Iwai
0 siblings, 1 reply; 12+ messages in thread
From: Russell King - ARM Linux @ 2008-07-18 14:49 UTC (permalink / raw)
To: Takashi Iwai; +Cc: Marek Vasut, alsa-devel, Mark Brown, linux-arm-kernel
On Thu, Jul 17, 2008 at 12:05:43PM +0200, Takashi Iwai wrote:
> At Wed, 16 Jul 2008 22:10:09 +0200,
> Marek Vasut wrote:
> >
> > Dne Wednesday 16 of July 2008 13:17:53 Takashi Iwai napsal(a):
> > > At Mon, 14 Jul 2008 16:07:58 +0100,
> > >
> > > Mark Brown wrote:
> > > > On Mon, Jul 07, 2008 at 05:58:32PM +0200, Takashi Iwai wrote:
> > > > > Doesn't matter much to me, so just let me know to merge via which
> > > > > tree.
> > > >
> > > > Either way it needs another spin of the driver so...
> > >
> > > OK, it's fine to push it to ALSA tree. But I think it's a bit too
> > > late for 2.6.27...
> > wasnt merge window for .27 opened just a while ago ?
>
> It doesn't mean to allow us to push any unreviewed/untested patches.
> Trivial or fix patches can go immediately, but a new driver code is a
> different story. In general, the new driver codes should be merged to
> the subsystem tree in a few weeks before the merge window.
We can't moan about it not having been exposed though - it first appeared
on July 4th here, and July 5th on alsa-devel.
It has been reviewed by Mark Brown, and you yourself even said "so just
let me know to merge via which tree." which sounds to me like you were
ready to merge it - but just wanted to know _which_ route it was going
to take.
So, to now come back and whinge about it being unreviewed and/or untested
and about patches being submitted before the merge window is a little
silly, don't you think?
Anyway, my present position with my tree is that I'm not merging anything
further into my tree until the remainder of the code queued up previously
has been merged, which will only happen when the SPI tree is eventually
merged (or I get fed up with waiting for that to happen and choose
build time breakage over the correct merge ordering.)
The reason for this is simple - if I push a new tree out, the nice diff
versions for non-git users of my tree will vanish, despite there being
changes still in there, and I don't want a flood of "where's my changes
gone? they aren't in Linus' tree and they aren't in the diffs."
questions.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] PalmTX aSoC sound support
2008-07-18 14:49 ` Russell King - ARM Linux
@ 2008-07-18 15:13 ` Takashi Iwai
2008-07-18 15:23 ` Russell King - ARM Linux
0 siblings, 1 reply; 12+ messages in thread
From: Takashi Iwai @ 2008-07-18 15:13 UTC (permalink / raw)
To: Russell King - ARM Linux
Cc: Marek Vasut, alsa-devel, Mark Brown, linux-arm-kernel
At Fri, 18 Jul 2008 15:49:20 +0100,
Russell King - ARM Linux wrote:
>
> On Thu, Jul 17, 2008 at 12:05:43PM +0200, Takashi Iwai wrote:
> > At Wed, 16 Jul 2008 22:10:09 +0200,
> > Marek Vasut wrote:
> > >
> > > Dne Wednesday 16 of July 2008 13:17:53 Takashi Iwai napsal(a):
> > > > At Mon, 14 Jul 2008 16:07:58 +0100,
> > > >
> > > > Mark Brown wrote:
> > > > > On Mon, Jul 07, 2008 at 05:58:32PM +0200, Takashi Iwai wrote:
> > > > > > Doesn't matter much to me, so just let me know to merge via which
> > > > > > tree.
> > > > >
> > > > > Either way it needs another spin of the driver so...
> > > >
> > > > OK, it's fine to push it to ALSA tree. But I think it's a bit too
> > > > late for 2.6.27...
> > > wasnt merge window for .27 opened just a while ago ?
> >
> > It doesn't mean to allow us to push any unreviewed/untested patches.
> > Trivial or fix patches can go immediately, but a new driver code is a
> > different story. In general, the new driver codes should be merged to
> > the subsystem tree in a few weeks before the merge window.
>
> We can't moan about it not having been exposed though - it first appeared
> on July 4th here, and July 5th on alsa-devel.
>
> It has been reviewed by Mark Brown, and you yourself even said "so just
> let me know to merge via which tree." which sounds to me like you were
> ready to merge it - but just wanted to know _which_ route it was going
> to take.
>
> So, to now come back and whinge about it being unreviewed and/or untested
> and about patches being submitted before the merge window is a little
> silly, don't you think?
Not quite. Merging to the subsystem tree doesn't mean to push the
stuff to Linus tree "immediately" -- especially it's never been tested
with that merged tree. And in general, the new stuff has to be built
and checked via linux-next and/or mm trees properly before reaching to
the Linus tree. So, unless it's properly checked through the whole
usual process, one shouldn't expect much that it must be merged so
soonish.
Oh, before someone misunderstands again: actually I'm willing to merge
his patch soon when it's ready. My comment is whether to push for
2.6.27 now or not.
> Anyway, my present position with my tree is that I'm not merging anything
> further into my tree until the remainder of the code queued up previously
> has been merged, which will only happen when the SPI tree is eventually
> merged (or I get fed up with waiting for that to happen and choose
> build time breakage over the correct merge ordering.)
>
> The reason for this is simple - if I push a new tree out, the nice diff
> versions for non-git users of my tree will vanish, despite there being
> changes still in there, and I don't want a flood of "where's my changes
> gone? they aren't in Linus' tree and they aren't in the diffs."
> questions.
Well, changes over several areas are sometimes painful.
I still think the "right" order for this kind of changes (addition of
new driver depending on a certain architecture) should be:
arch-change -> driver-addition. So I've wanted to hear from your
first.
Anyway, I don't care much now how it's going. I'll merge the driver
part soon once after it's ready. That sounds like the most practical
solution.
thanks,
Takashi
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] PalmTX aSoC sound support
2008-07-18 15:13 ` Takashi Iwai
@ 2008-07-18 15:23 ` Russell King - ARM Linux
0 siblings, 0 replies; 12+ messages in thread
From: Russell King - ARM Linux @ 2008-07-18 15:23 UTC (permalink / raw)
To: Takashi Iwai; +Cc: Marek Vasut, alsa-devel, Mark Brown, linux-arm-kernel
On Fri, Jul 18, 2008 at 05:13:09PM +0200, Takashi Iwai wrote:
> At Fri, 18 Jul 2008 15:49:20 +0100,
> Russell King - ARM Linux wrote:
> > The reason for this is simple - if I push a new tree out, the nice diff
> > versions for non-git users of my tree will vanish, despite there being
> > changes still in there, and I don't want a flood of "where's my changes
> > gone? they aren't in Linus' tree and they aren't in the diffs."
> > questions.
>
> Well, changes over several areas are sometimes painful.
It doesn't have to be - in this particular instance is down to patch
5088/3, which introduced a new #include into pcm027.c, where the file
to be included is in the SPI tree.
In hind sight, that change should've been separated into two patches:
1. create the new API and change existing users over
2. add new pcm027 support (reliant on SPI tree)
This would've meant that things could have been arranged so that the
_only_ outstanding patch was (2) rather than the existing situation
where quite a lot of other peoples changes are currently stuck
(because they inadvertently and indirectly depend on (1)).
That's something to watch in the future...
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2008-07-18 15:23 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <200807042126.29154.marek.vasut@gmail.com>
[not found] ` <200807042149.57697.marek.vasut@gmail.com>
[not found] ` <20080704202615.GB20719@sirena.org.uk>
2008-07-04 22:19 ` [PATCH] PalmTX aSoC sound support Marek Vasut
2008-07-05 5:17 ` Marek Vasut
2008-07-07 12:29 ` Mark Brown
2008-07-07 15:58 ` Takashi Iwai
2008-07-14 15:07 ` Mark Brown
2008-07-16 11:17 ` Takashi Iwai
2008-07-16 20:10 ` Marek Vasut
2008-07-17 10:05 ` Takashi Iwai
2008-07-18 14:49 ` Russell King - ARM Linux
2008-07-18 15:13 ` Takashi Iwai
2008-07-18 15:23 ` Russell King - ARM Linux
2008-07-07 11:01 ` Mark Brown
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.