From: Jon Smirl <jonsmirl@gmail.com>
To: grant.likely@secretlab.ca, broonie@sirena.org.uk
Cc: alsa-devel@alsa-project.org
Subject: [PATCH V1 12/13] Fabric bindings for STAC9766 on the Efika
Date: Wed, 13 May 2009 21:59:24 -0400 [thread overview]
Message-ID: <20090514015924.28145.57971.stgit@terra> (raw)
In-Reply-To: <20090514015729.28145.30483.stgit@terra>
Fabric bindings for STAC9766 on the Efika. This includes an example of a custom fabric driver.
Signed-off-by: Jon Smirl <jonsmirl@gmail.com>
---
arch/powerpc/platforms/52xx/efika.c | 8 +++
sound/soc/fsl/Kconfig | 8 +++
sound/soc/fsl/Makefile | 3 +
sound/soc/fsl/efika-audio-fabric.c | 95 +++++++++++++++++++++++++++++++++++
4 files changed, 113 insertions(+), 1 deletions(-)
create mode 100644 sound/soc/fsl/efika-audio-fabric.c
diff --git a/arch/powerpc/platforms/52xx/efika.c b/arch/powerpc/platforms/52xx/efika.c
index a2068fa..c7a6a48 100644
--- a/arch/powerpc/platforms/52xx/efika.c
+++ b/arch/powerpc/platforms/52xx/efika.c
@@ -211,12 +211,18 @@ static int __init efika_probe(void)
return 1;
}
+static void __init efika_declare_platform_devices(void)
+{
+ mpc52xx_declare_of_platform_devices();
+ platform_device_register_simple("efika-audio-fabric", 0, NULL, 0);
+}
+
define_machine(efika)
{
.name = EFIKA_PLATFORM_NAME,
.probe = efika_probe,
.setup_arch = efika_setup_arch,
- .init = mpc52xx_declare_of_platform_devices,
+ .init = efika_declare_platform_devices,
.show_cpuinfo = efika_show_cpuinfo,
.init_IRQ = mpc52xx_init_irq,
.get_irq = mpc52xx_get_irq,
diff --git a/sound/soc/fsl/Kconfig b/sound/soc/fsl/Kconfig
index d8f63f5..266c6b7 100644
--- a/sound/soc/fsl/Kconfig
+++ b/sound/soc/fsl/Kconfig
@@ -40,4 +40,12 @@ config SND_SOC_MPC5200_AC97
help
Say Y here to support the MPC5200 PSCs in AC97 mode.
+config SND_MPC52xx_SOC_EFIKA
+ tristate "SoC AC97 Audio support for bbplan Efika and STAC9766"
+ depends on PPC_EFIKA
+ select SND_SOC_MPC5200_AC97
+ select SND_SOC_STAC9766
+ help
+ Say Y if you want to add support for sound on the Efika.
+
diff --git a/sound/soc/fsl/Makefile b/sound/soc/fsl/Makefile
index 14631a1..f406470 100644
--- a/sound/soc/fsl/Makefile
+++ b/sound/soc/fsl/Makefile
@@ -15,3 +15,6 @@ obj-$(CONFIG_SND_MPC52xx_DMA) += mpc5200_dma.o
obj-$(CONFIG_SND_SOC_MPC5200_I2S) += mpc5200_psc_i2s.o
obj-$(CONFIG_SND_SOC_MPC5200_AC97) += mpc5200_psc_ac97.o
+# MPC5200 Machine Support
+obj-$(CONFIG_SND_MPC52xx_SOC_EFIKA) += efika-audio-fabric.o
+
diff --git a/sound/soc/fsl/efika-audio-fabric.c b/sound/soc/fsl/efika-audio-fabric.c
new file mode 100644
index 0000000..56ae471
--- /dev/null
+++ b/sound/soc/fsl/efika-audio-fabric.c
@@ -0,0 +1,95 @@
+/*
+ * Efika driver for the PSC of the Freescale MPC52xx configured as AC97 interface
+ *
+ * Copyright 2008 Jon Smirl, Digispeaker
+ * Author: Jon Smirl <jonsmirl@gmail.com>
+ *
+ * This file is licensed under the terms of the GNU General Public License
+ * version 2. This program is licensed "as is" without any warranty of any
+ * kind, whether express or implied.
+ */
+
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/interrupt.h>
+#include <linux/device.h>
+#include <linux/delay.h>
+#include <linux/of_device.h>
+#include <linux/of_platform.h>
+#include <linux/dma-mapping.h>
+
+#include <sound/core.h>
+#include <sound/pcm.h>
+#include <sound/pcm_params.h>
+#include <sound/initval.h>
+#include <sound/soc.h>
+#include <sound/soc-of-simple.h>
+
+#include "mpc5200_dma.h"
+#include "mpc5200_psc_ac97.h"
+#include "../codecs/stac9766.h"
+
+static int efika_init(struct snd_soc_codec *codec)
+{
+ /* Skeleton driver showing framework for setting
+ * up board specific fabric drivers.
+ *
+ * set up Efika specific controls here
+ *
+ * Loading of this driver is trigger by
+ * platform_device_register_simple("efika-audio-fabric", 0, NULL, 0);
+ * in arch/powerpc/platforms/52xx/efika.c
+ */
+ return 0;
+}
+
+static int efika_stac9766_probe(struct platform_device *pdev)
+{
+ of_snd_soc_register_fabric("Efika", NULL, efika_init);
+ return 0;
+}
+
+#ifdef CONFIG_PM
+
+static int efika_stac9766_suspend(struct platform_device *pdev,
+ pm_message_t state)
+{
+ return 0;
+}
+
+static int efika_stac9766_resume(struct platform_device *pdev)
+{
+ return 0;
+}
+
+#else
+#define efika_stac9766_suspend NULL
+#define efika_stac9766_resume NULL
+#endif
+
+static struct platform_driver efika_fabric = {
+ .probe = efika_stac9766_probe,
+ .suspend = efika_stac9766_suspend,
+ .resume = efika_stac9766_resume,
+ .driver = {
+ .name = "efika-audio-fabric",
+ },
+};
+
+static __init int efika_fabric_init(void)
+{
+ return platform_driver_register(&efika_fabric);
+}
+
+static __exit void efika_fabric_exit(void)
+{
+}
+
+module_init(efika_fabric_init);
+module_exit(efika_fabric_exit);
+
+
+MODULE_AUTHOR("Jon Smirl <jonsmirl@gmail.com>");
+MODULE_DESCRIPTION(DRV_NAME ": mpc5200 Efika fabric driver");
+MODULE_LICENSE("GPL");
+
next prev parent reply other threads:[~2009-05-14 1:59 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-14 1:58 [PATCH V1 00/13] mpc5200 audio rework for AC97 Jon Smirl
2009-05-14 1:59 ` [PATCH V1 01/13] Temporarily undo 2008f137e92220b98120c4803499cdddb2b0fb06 Jon Smirl
2009-05-14 10:13 ` Mark Brown
2009-05-14 14:37 ` Jon Smirl
2009-05-14 16:25 ` Mark Brown
2009-05-14 20:21 ` Jon Smirl
2009-05-14 1:59 ` [PATCH V1 02/13] Basic split of mpc5200 DMA code out from mpc5200_psc_i2s Jon Smirl
2009-05-14 1:59 ` [PATCH V1 03/13] Rename the PSC functions to DMA Jon Smirl
2009-05-14 10:14 ` Mark Brown
2009-05-14 1:59 ` [PATCH V1 04/13] redo 2008f137e92220b98120c4803499cdddb2b0fb06 Jon Smirl
2009-05-14 1:59 ` [PATCH V1 05/13] Add a few more mpc5200 PSC defines Jon Smirl
2009-05-14 10:15 ` Mark Brown
2009-05-14 1:59 ` [PATCH V1 06/13] Allow a custom ASOC fabric driver with soc-of-simple Jon Smirl
2009-05-14 10:41 ` Mark Brown
2009-05-14 1:59 ` [PATCH V1 07/13] Add SNDRV_PCM_FMTBIT_S32_BE as a valid AC97 format Jon Smirl
2009-05-14 11:53 ` Mark Brown
2009-05-14 1:59 ` [PATCH V1 08/13] Have the WM9712 driver self register itself Jon Smirl
2009-05-14 10:45 ` Mark Brown
2009-05-14 1:59 ` [PATCH V1 09/13] Main rewite of the mpc5200 audio DMA code Jon Smirl
2009-05-14 10:51 ` Mark Brown
2009-05-14 14:50 ` Jon Smirl
2009-05-14 19:14 ` Mark Brown
2009-05-14 1:59 ` [PATCH V1 10/13] Codec for STAC9766 used on the Efika Jon Smirl
2009-05-14 11:03 ` Mark Brown
2009-05-14 1:59 ` [PATCH V1 11/13] AC97 driver for mpc5200 Jon Smirl
2009-05-14 2:17 ` Jon Smirl
2009-05-14 11:39 ` Mark Brown
2009-05-14 1:59 ` Jon Smirl [this message]
2009-05-14 1:59 ` [PATCH V1 13/13] Support for AC97 on Phytec pmc030 base board Jon Smirl
2009-05-14 2:03 ` [PATCH V1 00/13] mpc5200 audio rework for AC97 Jon Smirl
2009-05-14 3:34 ` Grant Likely
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090514015924.28145.57971.stgit@terra \
--to=jonsmirl@gmail.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@sirena.org.uk \
--cc=grant.likely@secretlab.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.