linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: mpa@pengutronix.de (Markus Pargmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v9 03/10] ASoC: fsl: Move soc_ac97_ops from imx-ssi to fsl_ssi
Date: Thu, 20 Jun 2013 15:20:22 +0200	[thread overview]
Message-ID: <1371734429-6081-4-git-send-email-mpa@pengutronix.de> (raw)
In-Reply-To: <1371734429-6081-1-git-send-email-mpa@pengutronix.de>

fsl_ssi and imx-ssi can be both enabled at the same time. To be able to
add AC97 support to fsl_ssi, soc_ac97_ops have to be available to both
drivers.

fsl_ssi has DT support and should be the only driver at some point in
the future. This patch moves the definition of soc_ac97_ops to fsl_ssi.
imx-ssi copies its own ac97 ops struct into soc_ac97_ops when used in
AC97 mode.

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Tested-by: Shawn Guo <shawn.guo@linaro.org>
---
 sound/soc/fsl/Kconfig   | 1 +
 sound/soc/fsl/fsl_ssi.c | 8 ++++++++
 sound/soc/fsl/imx-ssi.c | 7 +++++--
 3 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/sound/soc/fsl/Kconfig b/sound/soc/fsl/Kconfig
index 7860cc2..74ef96e 100644
--- a/sound/soc/fsl/Kconfig
+++ b/sound/soc/fsl/Kconfig
@@ -107,6 +107,7 @@ if SND_IMX_SOC
 
 config SND_SOC_IMX_SSI
 	tristate
+	select SND_SOC_FSL_SSI
 
 config SND_SOC_IMX_PCM_FIQ
 	bool
diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c
index 2f2d837..db55499 100644
--- a/sound/soc/fsl/fsl_ssi.c
+++ b/sound/soc/fsl/fsl_ssi.c
@@ -587,6 +587,14 @@ static const struct snd_soc_component_driver fsl_ssi_component = {
 	.name		= "fsl-ssi",
 };
 
+/*
+ * FIXME: As soon as all boards using imx-ssi AC97 mode are able to use
+ * fsl-ssi, soc_ac97_ops can be used exclusively in this driver without copying
+ * the struct. AC97 support can then be removed from imx-ssi.
+ */
+struct snd_ac97_bus_ops soc_ac97_ops;
+EXPORT_SYMBOL_GPL(soc_ac97_ops);
+
 /* Show the statistics of a flag only if its interrupt is enabled.  The
  * compiler will optimze this code to a no-op if the interrupt is not
  * enabled.
diff --git a/sound/soc/fsl/imx-ssi.c b/sound/soc/fsl/imx-ssi.c
index 16ae16d..3760220 100644
--- a/sound/soc/fsl/imx-ssi.c
+++ b/sound/soc/fsl/imx-ssi.c
@@ -501,13 +501,14 @@ static void imx_ssi_ac97_warm_reset(struct snd_ac97 *ac97)
 	imx_ssi_ac97_read(ac97, 0);
 }
 
-struct snd_ac97_bus_ops soc_ac97_ops = {
+static struct snd_ac97_bus_ops imx_ssi_soc_ac97_ops = {
 	.read		= imx_ssi_ac97_read,
 	.write		= imx_ssi_ac97_write,
 	.reset		= imx_ssi_ac97_reset,
 	.warm_reset	= imx_ssi_ac97_warm_reset
 };
-EXPORT_SYMBOL_GPL(soc_ac97_ops);
+
+extern struct snd_ac97_bus_ops soc_ac97_ops;
 
 static int imx_ssi_probe(struct platform_device *pdev)
 {
@@ -547,6 +548,8 @@ static int imx_ssi_probe(struct platform_device *pdev)
 	}
 
 	if (ssi->flags & IMX_SSI_USE_AC97) {
+		memcpy(&soc_ac97_ops, &imx_ssi_soc_ac97_ops,
+				sizeof(soc_ac97_ops));
 		if (ac97_ssi) {
 			dev_err(&pdev->dev, "AC'97 SSI already registered\n");
 			ret = -EBUSY;
-- 
1.8.2.1

  parent reply	other threads:[~2013-06-20 13:20 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-20 13:20 ASoC: fsl-ssi: ac97-slave support Markus Pargmann
2013-06-20 13:20 ` [PATCH v9 01/10] ASoC: imx-pcm-dma: DT support Markus Pargmann
2013-06-23 17:49   ` Timur Tabi
2013-07-05 13:56     ` Markus Pargmann
2013-07-03 16:02   ` Mark Brown
2013-06-20 13:20 ` [PATCH v9 02/10] ASoC: imx-pcm-fiq: Introduce pcm-fiq-params Markus Pargmann
2013-07-03 16:02   ` Mark Brown
2013-06-20 13:20 ` Markus Pargmann [this message]
2013-07-03 16:07   ` [PATCH v9 03/10] ASoC: fsl: Move soc_ac97_ops from imx-ssi to fsl_ssi Mark Brown
2013-06-20 13:20 ` [PATCH v9 04/10] ASoC: fsl-ssi: Add support for imx-pcm-fiq Markus Pargmann
2013-07-03 16:06   ` Mark Brown
2013-07-06 17:13     ` Markus Pargmann
2013-07-08  8:04       ` Mark Brown
2013-06-20 13:20 ` [PATCH v9 05/10] ASoC: fsl-ssi: Use generic DMA bindings if possible Markus Pargmann
2013-06-20 13:20 ` [PATCH v9 06/10] ASoC: fsl-ssi: imx ac97 support Markus Pargmann
2013-06-20 13:20 ` [PATCH v9 07/10] ARM: imx: Export ac97 reset functions Markus Pargmann
2013-06-20 13:20 ` [PATCH v9 08/10] ASoC: Add phycore-ac97-dt driver Markus Pargmann
2013-07-03 16:17   ` Mark Brown
2013-07-07  7:19     ` Markus Pargmann
2013-07-07 13:16       ` [alsa-devel] " Fabio Estevam
2013-07-08  7:19         ` Markus Pargmann
2013-07-08  8:06       ` Mark Brown
2013-06-20 13:20 ` [PATCH v9 09/10] ASoC: fsl: Move fsl-ssi binding doc to sound/ Markus Pargmann
2013-07-03 16:18   ` Mark Brown
2013-06-20 13:20 ` [PATCH v9 10/10] ASoC: fsl: Update fsl-ssi binding doc Markus Pargmann
2013-07-03 16:19   ` Mark Brown

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=1371734429-6081-4-git-send-email-mpa@pengutronix.de \
    --to=mpa@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).