* [PATCH v2 01/11] ASoC: phycore-ac97: Add DT support
[not found] ` <1365362721-3731-1-git-send-email-mpa-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
@ 2013-04-07 19:25 ` Markus Pargmann
2013-04-08 2:52 ` Timur Tabi
2013-04-07 19:25 ` [PATCH v2 03/11] ASoC: imx-pcm-fiq: Introduce pcm-fiq-params Markus Pargmann
` (7 subsequent siblings)
8 siblings, 1 reply; 35+ messages in thread
From: Markus Pargmann @ 2013-04-07 19:25 UTC (permalink / raw)
To: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
Cc: Fabio Estevam, alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw,
devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, Mark Brown, Timur Tabi,
Liam Girdwood, Sascha Hauer
Add devicetree support for this audio soc fabric driver.
Signed-off-by: Markus Pargmann <mpa-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
---
Notes:
Changes in v2:
- Simplify the driver, by combining audmux port configurations. The
audmux driver actually knows on which platform he is running and
will return the appropriate error code if we use functions for
another platform. So we don't need to have the knowledge about it
in phycore-ac97 and can try both functions. This removes the need
of different compatibilities and renames it to imx27-ac97.
- Use a phandle for the cpu_dai link.
- Add devicetree binding documentation.
- Rename binding to phytec,phycore-ac97 and fsl,ssi to phytec,ssi
.../bindings/sound/phytec,phycore-ac97.txt | 12 ++
sound/soc/fsl/phycore-ac97.c | 185 ++++++++++++++++++---
2 files changed, 174 insertions(+), 23 deletions(-)
create mode 100644 Documentation/devicetree/bindings/sound/phytec,phycore-ac97.txt
diff --git a/Documentation/devicetree/bindings/sound/phytec,phycore-ac97.txt b/Documentation/devicetree/bindings/sound/phytec,phycore-ac97.txt
new file mode 100644
index 0000000..e04221d
--- /dev/null
+++ b/Documentation/devicetree/bindings/sound/phytec,phycore-ac97.txt
@@ -0,0 +1,12 @@
+Phytec phycore AC97
+
+Required properties:
+- compatible: "phytec,phycore-ac97"
+- phytec,ssi: A phandle to the ssi device that is connected to ac97.
+
+Example:
+
+sound {
+ compatible = "phytec,phycore-ac97";
+ phytec,ssi = <&ssi1>;
+};
diff --git a/sound/soc/fsl/phycore-ac97.c b/sound/soc/fsl/phycore-ac97.c
index d146cec..123af2b 100644
--- a/sound/soc/fsl/phycore-ac97.c
+++ b/sound/soc/fsl/phycore-ac97.c
@@ -21,7 +21,10 @@
#include "imx-audmux.h"
+#define DRV_NAME "phycore-audio-fabric"
+
static struct snd_soc_card imx_phycore;
+static struct device_node *phycore_dai_cpu_node;
static struct snd_soc_ops imx_phycore_hifi_ops = {
};
@@ -32,8 +35,12 @@ static struct snd_soc_dai_link imx_phycore_dai_ac97[] = {
.stream_name = "HiFi",
.codec_dai_name = "wm9712-hifi",
.codec_name = "wm9712-codec",
+#ifdef CONFIG_MACH_IMX27_DT
+ .platform_name = "imx-fiq-pcm-audio",
+#else
.cpu_dai_name = "imx-ssi.0",
.platform_name = "imx-fiq-pcm-audio.0",
+#endif
.ops = &imx_phycore_hifi_ops,
},
};
@@ -45,41 +52,83 @@ static struct snd_soc_card imx_phycore = {
.num_links = ARRAY_SIZE(imx_phycore_dai_ac97),
};
-static struct platform_device *imx_phycore_snd_ac97_device;
+static int phycore_ac97_pca100_audmux(void)
+{
+ int ret;
+
+ ret = imx_audmux_v1_configure_port(MX27_AUDMUX_HPCR1_SSI0,
+ IMX_AUDMUX_V1_PCR_SYN | /* 4wire mode */
+ IMX_AUDMUX_V1_PCR_TFCSEL(3) |
+ IMX_AUDMUX_V1_PCR_TCLKDIR | /* clock is output */
+ IMX_AUDMUX_V1_PCR_RXDSEL(3));
+ if (ret)
+ return ret;
+
+ ret = imx_audmux_v1_configure_port(3,
+ IMX_AUDMUX_V1_PCR_SYN | /* 4wire mode */
+ IMX_AUDMUX_V1_PCR_TFCSEL(0) |
+ IMX_AUDMUX_V1_PCR_TFSDIR |
+ IMX_AUDMUX_V1_PCR_RXDSEL(0));
+ return ret;
+}
+
+static int phycore_ac97_pcm043_audmux(void)
+{
+ int ret;
+
+ ret = imx_audmux_v2_configure_port(3,
+ IMX_AUDMUX_V2_PTCR_SYN | /* 4wire mode */
+ IMX_AUDMUX_V2_PTCR_TFSEL(0) |
+ IMX_AUDMUX_V2_PTCR_TFSDIR,
+ IMX_AUDMUX_V2_PDCR_RXDSEL(0));
+ if (ret)
+ return ret;
+
+ ret = imx_audmux_v2_configure_port(0,
+ IMX_AUDMUX_V2_PTCR_SYN | /* 4wire mode */
+ IMX_AUDMUX_V2_PTCR_TCSEL(3) |
+ IMX_AUDMUX_V2_PTCR_TCLKDIR, /* clock is output */
+ IMX_AUDMUX_V2_PDCR_RXDSEL(3));
+ return ret;
+}
+
+static __maybe_unused int phycore_ac97_init_audmux(void)
+{
+ int ret;
+
+ /*
+ * This driver doesn't need to know which actual hardware is used.
+ * The audmux driver has knowledge about it's type, and returns
+ * an error if executed on the wrong type of hardware.
+ */
+ ret = phycore_ac97_pca100_audmux();
+ if (!ret)
+ return 0;
+
+ ret = phycore_ac97_pcm043_audmux();
+
+ return ret;
+}
+
static struct platform_device *imx_phycore_snd_device;
+#ifndef CONFIG_MACH_IMX27_DT
+
+static struct platform_device *imx_phycore_snd_ac97_device;
+
static int __init imx_phycore_init(void)
{
int ret;
if (machine_is_pca100()) {
- imx_audmux_v1_configure_port(MX27_AUDMUX_HPCR1_SSI0,
- IMX_AUDMUX_V1_PCR_SYN | /* 4wire mode */
- IMX_AUDMUX_V1_PCR_TFCSEL(3) |
- IMX_AUDMUX_V1_PCR_TCLKDIR | /* clock is output */
- IMX_AUDMUX_V1_PCR_RXDSEL(3));
- imx_audmux_v1_configure_port(3,
- IMX_AUDMUX_V1_PCR_SYN | /* 4wire mode */
- IMX_AUDMUX_V1_PCR_TFCSEL(0) |
- IMX_AUDMUX_V1_PCR_TFSDIR |
- IMX_AUDMUX_V1_PCR_RXDSEL(0));
+ phycore_ac97_pca100_audmux();
} else if (machine_is_pcm043()) {
- imx_audmux_v2_configure_port(3,
- IMX_AUDMUX_V2_PTCR_SYN | /* 4wire mode */
- IMX_AUDMUX_V2_PTCR_TFSEL(0) |
- IMX_AUDMUX_V2_PTCR_TFSDIR,
- IMX_AUDMUX_V2_PDCR_RXDSEL(0));
- imx_audmux_v2_configure_port(0,
- IMX_AUDMUX_V2_PTCR_SYN | /* 4wire mode */
- IMX_AUDMUX_V2_PTCR_TCSEL(3) |
- IMX_AUDMUX_V2_PTCR_TCLKDIR, /* clock is output */
- IMX_AUDMUX_V2_PDCR_RXDSEL(3));
+ phycore_ac97_pcm043_audmux();
} else {
/* return happy. We might run on a totally different machine */
return 0;
}
-
/*
* First add codec driver, otherwise soc-audio may be deferred and fails
* to load.
@@ -125,6 +174,96 @@ static void __exit imx_phycore_exit(void)
late_initcall(imx_phycore_init);
module_exit(imx_phycore_exit);
+#else /* !CONFIG_MACH_IMX27_DT */
+
+static const struct of_device_id imx_phycore_ac97_of_dev_id[] = {
+ {
+ .compatible = "phytec,phycore-ac97",
+ }, {
+ /* sentinel */
+ }
+};
+MODULE_DEVICE_TABLE(of, imx_phycore_ac97_of_dev_id);
+
+static int phycore_ac97_setup_devices(struct platform_device *pdev)
+{
+ int ret;
+
+ imx_phycore_snd_device = platform_device_alloc("wm9712-codec", -1);
+ if (!imx_phycore_snd_device)
+ return -ENOMEM;
+
+ ret = platform_device_add(imx_phycore_snd_device);
+ if (ret) {
+ dev_err(&pdev->dev, "ASoC: Platform device allocation failed\n");
+ goto fail1;
+ }
+
+ ret = snd_soc_register_card(&imx_phycore);
+ if (ret) {
+ dev_err(&pdev->dev, "ASoC: soc card registration failed\n");
+ goto fail2;
+ }
+ return 0;
+
+fail2:
+ platform_device_del(imx_phycore_snd_device);
+fail1:
+ platform_device_put(imx_phycore_snd_device);
+ return ret;
+}
+
+static int imx_phycore_ac97_probe(struct platform_device *pdev)
+{
+ int ret;
+ struct device_node *ssi_np;
+
+ imx_phycore.dev = &pdev->dev;
+
+ ret = phycore_ac97_init_audmux();
+ if (ret) {
+ dev_err(&pdev->dev, "Failed to initialize audmux\n");
+ return ret;
+ }
+
+ ssi_np = of_parse_phandle(pdev->dev.of_node, "phytec,ssi", 0);
+ if (!ssi_np) {
+ dev_err(&pdev->dev, "No valid ssi phandle found\n");
+ return -EINVAL;
+ }
+
+ imx_phycore_dai_ac97[0].cpu_of_node = ssi_np;
+ phycore_dai_cpu_node = ssi_np;
+
+
+ ret = phycore_ac97_setup_devices(pdev);
+ if (ret)
+ of_node_put(phycore_dai_cpu_node);
+
+ return ret;
+}
+
+static int imx_phycore_ac97_remove(struct platform_device *pdev)
+{
+ of_node_put(phycore_dai_cpu_node);
+ platform_device_unregister(imx_phycore_snd_device);
+ return 0;
+}
+
+static struct platform_driver imx_phycore_ac97_driver = {
+ .probe = imx_phycore_ac97_probe,
+ .remove = imx_phycore_ac97_remove,
+ .driver = {
+ .name = DRV_NAME,
+ .owner = THIS_MODULE,
+ .of_match_table = imx_phycore_ac97_of_dev_id,
+ },
+};
+
+module_platform_driver(imx_phycore_ac97_driver);
+
+#endif /* CONFIG_MACH_IMX27_DT */
+
MODULE_AUTHOR("Sascha Hauer <s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>");
-MODULE_DESCRIPTION("PhyCORE ALSA SoC driver");
+MODULE_DESCRIPTION(DRV_NAME ": PhyCORE ALSA SoC fabric driver");
MODULE_LICENSE("GPL");
--
1.8.1.5
^ permalink raw reply related [flat|nested] 35+ messages in thread
* Re: [PATCH v2 01/11] ASoC: phycore-ac97: Add DT support
2013-04-07 19:25 ` [PATCH v2 01/11] ASoC: phycore-ac97: Add DT support Markus Pargmann
@ 2013-04-08 2:52 ` Timur Tabi
2013-04-10 11:03 ` Markus Pargmann
0 siblings, 1 reply; 35+ messages in thread
From: Timur Tabi @ 2013-04-08 2:52 UTC (permalink / raw)
To: Markus Pargmann, linux-arm-kernel
Cc: Fabio Estevam, alsa-devel, devicetree-discuss, Mark Brown,
Liam Girdwood, Grant Likely, Sascha Hauer, Shawn Guo
Markus Pargmann wrote:
> Notes:
> Changes in v2:
> - Simplify the driver, by combining audmux port configurations. The
> audmux driver actually knows on which platform he is running and
> will return the appropriate error code if we use functions for
> another platform. So we don't need to have the knowledge about it
> in phycore-ac97 and can try both functions. This removes the need
> of different compatibilities and renames it to imx27-ac97.
> - Use a phandle for the cpu_dai link.
> - Add devicetree binding documentation.
> - Rename binding to phytec,phycore-ac97 and fsl,ssi to phytec,ssi
I think some of this information belongs in the changelog.
> +#ifdef CONFIG_MACH_IMX27_DT
> + .platform_name = "imx-fiq-pcm-audio",
> +#else
> .cpu_dai_name = "imx-ssi.0",
> .platform_name = "imx-fiq-pcm-audio.0",
> +#endif
What's the difference between "imx-fiq-pcm-audio" and "imx-fiq-pcm-audio.0"?
--
Timur Tabi
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH v2 01/11] ASoC: phycore-ac97: Add DT support
2013-04-08 2:52 ` Timur Tabi
@ 2013-04-10 11:03 ` Markus Pargmann
0 siblings, 0 replies; 35+ messages in thread
From: Markus Pargmann @ 2013-04-10 11:03 UTC (permalink / raw)
To: Timur Tabi
Cc: Fabio Estevam, alsa-devel, devicetree-discuss, Mark Brown,
Liam Girdwood, Grant Likely, Sascha Hauer, Shawn Guo,
linux-arm-kernel
On Sun, Apr 07, 2013 at 09:52:17PM -0500, Timur Tabi wrote:
> Markus Pargmann wrote:
> >Notes:
> > Changes in v2:
> > - Simplify the driver, by combining audmux port configurations. The
> > audmux driver actually knows on which platform he is running and
> > will return the appropriate error code if we use functions for
> > another platform. So we don't need to have the knowledge about it
> > in phycore-ac97 and can try both functions. This removes the need
> > of different compatibilities and renames it to imx27-ac97.
> > - Use a phandle for the cpu_dai link.
> > - Add devicetree binding documentation.
> > - Rename binding to phytec,phycore-ac97 and fsl,ssi to phytec,ssi
>
> I think some of this information belongs in the changelog.
Okay
>
> >+#ifdef CONFIG_MACH_IMX27_DT
> >+ .platform_name = "imx-fiq-pcm-audio",
> >+#else
> > .cpu_dai_name = "imx-ssi.0",
> > .platform_name = "imx-fiq-pcm-audio.0",
> >+#endif
>
> What's the difference between "imx-fiq-pcm-audio" and "imx-fiq-pcm-audio.0"?
The previous version of phycore-ac97 was using devices created by the
board init code. They passed a proper pdev id which was used in all
drivers they created. Since fsl-ssi is using DT, that id is -1 and is
ignored for the device name. So we have to remove the .0 for DT here.
This driver is not used multiple times in one system, so it shouldn't be
a problem.
Regards,
Markus
>
> --
> Timur Tabi
>
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
^ permalink raw reply [flat|nested] 35+ messages in thread
* [PATCH v2 03/11] ASoC: imx-pcm-fiq: Introduce pcm-fiq-params
[not found] ` <1365362721-3731-1-git-send-email-mpa-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2013-04-07 19:25 ` [PATCH v2 01/11] ASoC: phycore-ac97: Add DT support Markus Pargmann
@ 2013-04-07 19:25 ` Markus Pargmann
2013-04-07 19:25 ` [PATCH v2 04/11] ASoC: fsl-ssi: Add SACNT definitions Markus Pargmann
` (6 subsequent siblings)
8 siblings, 0 replies; 35+ messages in thread
From: Markus Pargmann @ 2013-04-07 19:25 UTC (permalink / raw)
To: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
Cc: Fabio Estevam, alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw,
devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, Mark Brown, Timur Tabi,
Liam Girdwood, Sascha Hauer
Cleaner parameter passing for imx-pcm-fiq. Create a seperated fiq-params
struct to pass all arguments.
Signed-off-by: Markus Pargmann <mpa-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
---
sound/soc/fsl/imx-pcm-fiq.c | 14 +++++++-------
sound/soc/fsl/imx-pcm.h | 9 +++++++++
sound/soc/fsl/imx-ssi.c | 7 ++++++-
sound/soc/fsl/imx-ssi.h | 1 +
4 files changed, 23 insertions(+), 8 deletions(-)
diff --git a/sound/soc/fsl/imx-pcm-fiq.c b/sound/soc/fsl/imx-pcm-fiq.c
index 920f945..995ed35 100644
--- a/sound/soc/fsl/imx-pcm-fiq.c
+++ b/sound/soc/fsl/imx-pcm-fiq.c
@@ -283,7 +283,7 @@ static struct snd_soc_platform_driver imx_soc_platform_fiq = {
int imx_pcm_fiq_init(struct platform_device *pdev)
{
- struct imx_ssi *ssi = platform_get_drvdata(pdev);
+ struct imx_pcm_fiq_params *params = platform_get_drvdata(pdev);
int ret;
ret = claim_fiq(&fh);
@@ -292,15 +292,15 @@ int imx_pcm_fiq_init(struct platform_device *pdev)
return ret;
}
- mxc_set_irq_fiq(ssi->irq, 1);
- ssi_irq = ssi->irq;
+ mxc_set_irq_fiq(params->irq, 1);
+ ssi_irq = params->irq;
- imx_pcm_fiq = ssi->irq;
+ imx_pcm_fiq = params->irq;
- imx_ssi_fiq_base = (unsigned long)ssi->base;
+ imx_ssi_fiq_base = (unsigned long)params->base;
- ssi->dma_params_tx.burstsize = 4;
- ssi->dma_params_rx.burstsize = 6;
+ params->dma_params_tx->burstsize = 4;
+ params->dma_params_rx->burstsize = 6;
ret = snd_soc_register_platform(&pdev->dev, &imx_soc_platform_fiq);
if (ret)
diff --git a/sound/soc/fsl/imx-pcm.h b/sound/soc/fsl/imx-pcm.h
index ff0cfdf..f568a0e 100644
--- a/sound/soc/fsl/imx-pcm.h
+++ b/sound/soc/fsl/imx-pcm.h
@@ -31,6 +31,15 @@ struct imx_pcm_dma_params {
const char *dma_req_name; /* DMA Request name from devicetree */
};
+struct imx_pcm_fiq_params {
+ int irq;
+ void __iomem *base;
+
+ /* Pointer to original ssi driver to setup tx rx sizes */
+ struct imx_pcm_dma_params *dma_params_tx;
+ struct imx_pcm_dma_params *dma_params_rx;
+};
+
int snd_imx_pcm_mmap(struct snd_pcm_substream *substream,
struct vm_area_struct *vma);
int imx_pcm_new(struct snd_soc_pcm_runtime *rtd);
diff --git a/sound/soc/fsl/imx-ssi.c b/sound/soc/fsl/imx-ssi.c
index 96e24a3..93f7562 100644
--- a/sound/soc/fsl/imx-ssi.c
+++ b/sound/soc/fsl/imx-ssi.c
@@ -608,7 +608,12 @@ static int imx_ssi_probe(struct platform_device *pdev)
goto failed_pdev_fiq_alloc;
}
- platform_set_drvdata(ssi->soc_platform_pdev_fiq, ssi);
+ ssi->fiq_params.irq = ssi->irq;
+ ssi->fiq_params.base = ssi->base;
+ ssi->fiq_params.dma_params_rx = &ssi->dma_params_rx;
+ ssi->fiq_params.dma_params_tx = &ssi->dma_params_tx;
+
+ platform_set_drvdata(ssi->soc_platform_pdev_fiq, &ssi->fiq_params);
ret = platform_device_add(ssi->soc_platform_pdev_fiq);
if (ret) {
dev_err(&pdev->dev, "failed to add platform device\n");
diff --git a/sound/soc/fsl/imx-ssi.h b/sound/soc/fsl/imx-ssi.h
index dc114bd..90a45ef 100644
--- a/sound/soc/fsl/imx-ssi.h
+++ b/sound/soc/fsl/imx-ssi.h
@@ -206,6 +206,7 @@ struct imx_ssi {
struct imx_pcm_dma_params dma_params_rx;
struct imx_pcm_dma_params dma_params_tx;
+ struct imx_pcm_fiq_params fiq_params;
int enabled;
--
1.8.1.5
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH v2 04/11] ASoC: fsl-ssi: Add SACNT definitions
[not found] ` <1365362721-3731-1-git-send-email-mpa-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2013-04-07 19:25 ` [PATCH v2 01/11] ASoC: phycore-ac97: Add DT support Markus Pargmann
2013-04-07 19:25 ` [PATCH v2 03/11] ASoC: imx-pcm-fiq: Introduce pcm-fiq-params Markus Pargmann
@ 2013-04-07 19:25 ` Markus Pargmann
2013-04-08 0:13 ` Timur Tabi
2013-04-07 19:25 ` [PATCH v2 05/11] ASoC: fsl-ssi: Add support for imx-pcm-fiq Markus Pargmann
` (5 subsequent siblings)
8 siblings, 1 reply; 35+ messages in thread
From: Markus Pargmann @ 2013-04-07 19:25 UTC (permalink / raw)
To: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
Cc: Fabio Estevam, alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw,
devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, Mark Brown, Timur Tabi,
Liam Girdwood, Sascha Hauer
Add definitions for AC97 control register.
Signed-off-by: Markus Pargmann <mpa-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
---
sound/soc/fsl/fsl_ssi.h | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/sound/soc/fsl/fsl_ssi.h b/sound/soc/fsl/fsl_ssi.h
index 2173000..e6b9a69 100644
--- a/sound/soc/fsl/fsl_ssi.h
+++ b/sound/soc/fsl/fsl_ssi.h
@@ -196,5 +196,13 @@ struct ccsr_ssi {
#define CCSR_SSI_SOR_WAIT(x) (((x) & 3) << CCSR_SSI_SOR_WAIT_SHIFT)
#define CCSR_SSI_SOR_SYNRST 0x00000001
+#define CCSR_SSI_SACNT_FRDIV(x) (((x) & 0x3f) << 5)
+#define CCSR_SSI_SACNT_WR 0x00000010
+#define CCSR_SSI_SACNT_RD 0x00000008
+#define CCSR_SSI_SACNT_RDWR_MASK 0x00000018
+#define CCSR_SSI_SACNT_TIF 0x00000004
+#define CCSR_SSI_SACNT_FV 0x00000002
+#define CCSR_SSI_SACNT_AC97EN 0x00000001
+
#endif
--
1.8.1.5
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH v2 05/11] ASoC: fsl-ssi: Add support for imx-pcm-fiq
[not found] ` <1365362721-3731-1-git-send-email-mpa-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
` (2 preceding siblings ...)
2013-04-07 19:25 ` [PATCH v2 04/11] ASoC: fsl-ssi: Add SACNT definitions Markus Pargmann
@ 2013-04-07 19:25 ` Markus Pargmann
2013-04-08 0:18 ` Timur Tabi
2013-04-07 19:25 ` [PATCH v2 06/11] ASoC: fsl-ssi: Setup generic imx dma params Markus Pargmann
` (4 subsequent siblings)
8 siblings, 1 reply; 35+ messages in thread
From: Markus Pargmann @ 2013-04-07 19:25 UTC (permalink / raw)
To: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
Cc: Fabio Estevam, alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw,
devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, Mark Brown, Timur Tabi,
Liam Girdwood, Sascha Hauer
Add support for non-dma pcm for imx platforms with imx-pcm-fiq support.
Instead of imx-pcm-audio, in this case imx-pcm-fiq-audio device is added
and the SIER flags are set differently.
Signed-off-by: Markus Pargmann <mpa-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
---
sound/soc/fsl/fsl_ssi.c | 70 ++++++++++++++++++++++++++++++++++++++++---------
1 file changed, 58 insertions(+), 12 deletions(-)
diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c
index 7decbd9..afb5a23 100644
--- a/sound/soc/fsl/fsl_ssi.c
+++ b/sound/soc/fsl/fsl_ssi.c
@@ -120,10 +120,12 @@ struct fsl_ssi_private {
bool new_binding;
bool ssi_on_imx;
+ bool dma;
struct clk *clk;
struct platform_device *imx_pcm_pdev;
struct imx_pcm_dma_params dma_params_tx;
struct imx_pcm_dma_params dma_params_rx;
+ struct imx_pcm_fiq_params fiq_params;
struct {
unsigned int rfrc;
@@ -353,7 +355,8 @@ static int fsl_ssi_startup(struct snd_pcm_substream *substream,
*/
/* Enable the interrupts and DMA requests */
- write_ssi(SIER_FLAGS, &ssi->sier);
+ if (ssi_private->dma)
+ write_ssi(SIER_FLAGS, &ssi->sier);
/*
* Set the watermark for transmit FIFI 0 and receive FIFO 0. We
@@ -520,6 +523,18 @@ static int fsl_ssi_trigger(struct snd_pcm_substream *substream, int cmd,
return -EINVAL;
}
+ if (!ssi_private->dma) {
+ if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
+ write_ssi(CCSR_SSI_SOR_TX_CLR, &ssi->sor);
+ write_ssi(CCSR_SSI_SIER_TIE | CCSR_SSI_SIER_TFE0_EN,
+ &ssi->sier);
+ } else {
+ write_ssi(CCSR_SSI_SOR_RX_CLR, &ssi->sor);
+ write_ssi(CCSR_SSI_SIER_RIE | CCSR_SSI_SIER_RFF0_EN,
+ &ssi->sier);
+ }
+ }
+
return 0;
}
@@ -680,6 +695,8 @@ static int fsl_ssi_probe(struct platform_device *pdev)
sizeof(fsl_ssi_dai_template));
ssi_private->cpu_dai_drv.name = ssi_private->name;
+ ssi_private->dma = !of_property_read_bool(np, "fsl,imx-fiq");
+
/* Get the addresses and IRQ */
ret = of_address_to_resource(np, 0, &res);
if (ret) {
@@ -701,12 +718,15 @@ static int fsl_ssi_probe(struct platform_device *pdev)
goto error_iomap;
}
- /* The 'name' should not have any slashes in it. */
- ret = request_irq(ssi_private->irq, fsl_ssi_isr, 0, ssi_private->name,
- ssi_private);
- if (ret < 0) {
- dev_err(&pdev->dev, "could not claim irq %u\n", ssi_private->irq);
- goto error_irqmap;
+ if (ssi_private->dma) {
+ /* The 'name' should not have any slashes in it. */
+ ret = request_irq(ssi_private->irq, fsl_ssi_isr, 0,
+ ssi_private->name, ssi_private);
+ if (ret < 0) {
+ dev_err(&pdev->dev, "could not claim irq %u\n",
+ ssi_private->irq);
+ goto error_irqmap;
+ }
}
/* Are the RX and the TX clocks locked? */
@@ -789,12 +809,38 @@ static int fsl_ssi_probe(struct platform_device *pdev)
}
if (ssi_private->ssi_on_imx) {
- ssi_private->imx_pcm_pdev =
- platform_device_register_simple("imx-pcm-audio",
+ if (!ssi_private->dma) {
+ ssi_private->imx_pcm_pdev = platform_device_alloc(
+ "imx-fiq-pcm-audio",
+ pdev->id);
+ if (!ssi_private->imx_pcm_pdev) {
+ ret = -ENOMEM;
+ goto error_dev;
+ }
+
+ ssi_private->fiq_params.irq = ssi_private->irq;
+ ssi_private->fiq_params.base = ssi_private->ssi;
+ ssi_private->fiq_params.dma_params_rx =
+ &ssi_private->dma_params_rx;
+ ssi_private->fiq_params.dma_params_tx =
+ &ssi_private->dma_params_tx;
+
+ platform_set_drvdata(ssi_private->imx_pcm_pdev,
+ &ssi_private->fiq_params);
+ ret = platform_device_add(ssi_private->imx_pcm_pdev);
+ if (ret) {
+ dev_err(&pdev->dev, "Failed to add imx-fiq-pcm-audio device\n");
+ platform_device_put(ssi_private->imx_pcm_pdev);
+ goto error_dev;
+ }
+ } else {
+ ssi_private->imx_pcm_pdev =
+ platform_device_register_simple("imx-pcm-audio",
-1, NULL, 0);
- if (IS_ERR(ssi_private->imx_pcm_pdev)) {
- ret = PTR_ERR(ssi_private->imx_pcm_pdev);
- goto error_dev;
+ if (IS_ERR(ssi_private->imx_pcm_pdev)) {
+ ret = PTR_ERR(ssi_private->imx_pcm_pdev);
+ goto error_dev;
+ }
}
}
--
1.8.1.5
^ permalink raw reply related [flat|nested] 35+ messages in thread
* Re: [PATCH v2 05/11] ASoC: fsl-ssi: Add support for imx-pcm-fiq
2013-04-07 19:25 ` [PATCH v2 05/11] ASoC: fsl-ssi: Add support for imx-pcm-fiq Markus Pargmann
@ 2013-04-08 0:18 ` Timur Tabi
[not found] ` <51620CEA.3010703-N01EOCouUvQ@public.gmane.org>
0 siblings, 1 reply; 35+ messages in thread
From: Timur Tabi @ 2013-04-08 0:18 UTC (permalink / raw)
To: Markus Pargmann, linux-arm-kernel
Cc: Fabio Estevam, alsa-devel, devicetree-discuss, Mark Brown,
Liam Girdwood, Grant Likely, Sascha Hauer, Shawn Guo
Markus Pargmann wrote:
> Add support for non-dma pcm for imx platforms with imx-pcm-fiq support.
> Instead of imx-pcm-audio, in this case imx-pcm-fiq-audio device is added
> and the SIER flags are set differently.
So just to be clear, this is interrupt-driven SSI audio? So you're
generating an interrupt every time the transmit FIFO goes below the threshold?
I wonder if it makes sense to enable both FIFOs, so that you take half as
many interrupts per second.
>
> Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
> ---
> sound/soc/fsl/fsl_ssi.c | 70 ++++++++++++++++++++++++++++++++++++++++---------
> 1 file changed, 58 insertions(+), 12 deletions(-)
>
> diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c
> index 7decbd9..afb5a23 100644
> --- a/sound/soc/fsl/fsl_ssi.c
> +++ b/sound/soc/fsl/fsl_ssi.c
> @@ -120,10 +120,12 @@ struct fsl_ssi_private {
>
> bool new_binding;
> bool ssi_on_imx;
> + bool dma;
Can you rename this to "use_dma" or something like that?
> struct clk *clk;
> struct platform_device *imx_pcm_pdev;
> struct imx_pcm_dma_params dma_params_tx;
> struct imx_pcm_dma_params dma_params_rx;
> + struct imx_pcm_fiq_params fiq_params;
>
> struct {
> unsigned int rfrc;
> @@ -353,7 +355,8 @@ static int fsl_ssi_startup(struct snd_pcm_substream *substream,
> */
>
> /* Enable the interrupts and DMA requests */
> - write_ssi(SIER_FLAGS, &ssi->sier);
> + if (ssi_private->dma)
> + write_ssi(SIER_FLAGS, &ssi->sier);
>
> /*
> * Set the watermark for transmit FIFI 0 and receive FIFO 0. We
> @@ -520,6 +523,18 @@ static int fsl_ssi_trigger(struct snd_pcm_substream *substream, int cmd,
> return -EINVAL;
> }
>
> + if (!ssi_private->dma) {
> + if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
> + write_ssi(CCSR_SSI_SOR_TX_CLR, &ssi->sor);
> + write_ssi(CCSR_SSI_SIER_TIE | CCSR_SSI_SIER_TFE0_EN,
> + &ssi->sier);
> + } else {
> + write_ssi(CCSR_SSI_SOR_RX_CLR, &ssi->sor);
> + write_ssi(CCSR_SSI_SIER_RIE | CCSR_SSI_SIER_RFF0_EN,
> + &ssi->sier);
> + }
> + }
> +
> return 0;
> }
>
> @@ -680,6 +695,8 @@ static int fsl_ssi_probe(struct platform_device *pdev)
> sizeof(fsl_ssi_dai_template));
> ssi_private->cpu_dai_drv.name = ssi_private->name;
>
> + ssi_private->dma = !of_property_read_bool(np, "fsl,imx-fiq");
Instead of looking for the FIQ property, maybe you should just look for
the absence of a DMA property/node, and then default to interrupts if
there is no DMA. That would make it more generic, and even work on
non-IMX systems.
--
Timur Tabi
^ permalink raw reply [flat|nested] 35+ messages in thread
* [PATCH v2 06/11] ASoC: fsl-ssi: Setup generic imx dma params
[not found] ` <1365362721-3731-1-git-send-email-mpa-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
` (3 preceding siblings ...)
2013-04-07 19:25 ` [PATCH v2 05/11] ASoC: fsl-ssi: Add support for imx-pcm-fiq Markus Pargmann
@ 2013-04-07 19:25 ` Markus Pargmann
2013-04-08 2:50 ` Timur Tabi
2013-04-07 19:25 ` [PATCH v2 07/11] ARM: imx: Export ac97 reset functions Markus Pargmann
` (3 subsequent siblings)
8 siblings, 1 reply; 35+ messages in thread
From: Markus Pargmann @ 2013-04-07 19:25 UTC (permalink / raw)
To: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
Cc: Fabio Estevam, alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw,
devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, Mark Brown, Timur Tabi,
Liam Girdwood, Sascha Hauer
Use device pointer as parameter for imx-pcm-dma. This allows usage of
the generic DMA DT bindings.
Signed-off-by: Markus Pargmann <mpa-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
---
sound/soc/fsl/fsl_ssi.c | 19 +++++--------------
1 file changed, 5 insertions(+), 14 deletions(-)
diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c
index afb5a23..bb9a1e0 100644
--- a/sound/soc/fsl/fsl_ssi.c
+++ b/sound/soc/fsl/fsl_ssi.c
@@ -742,7 +742,6 @@ static int fsl_ssi_probe(struct platform_device *pdev)
ssi_private->fifo_depth = 8;
if (of_device_is_compatible(pdev->dev.of_node, "fsl,imx21-ssi")) {
- u32 dma_events[2];
ssi_private->ssi_on_imx = true;
ssi_private->clk = clk_get(&pdev->dev, NULL);
@@ -765,18 +764,11 @@ static int fsl_ssi_probe(struct platform_device *pdev)
ssi_private->ssi_phys + offsetof(struct ccsr_ssi, stx0);
ssi_private->dma_params_rx.dma_addr =
ssi_private->ssi_phys + offsetof(struct ccsr_ssi, srx0);
- /*
- * TODO: This is a temporary solution and should be changed
- * to use generic DMA binding later when the helplers get in.
- */
- ret = of_property_read_u32_array(pdev->dev.of_node,
- "fsl,ssi-dma-events", dma_events, 2);
- if (ret) {
- dev_err(&pdev->dev, "could not get dma events\n");
- goto error_clk;
- }
- ssi_private->dma_params_tx.dma = dma_events[0];
- ssi_private->dma_params_rx.dma = dma_events[1];
+
+ ssi_private->dma_params_rx.dma_client_dev = &pdev->dev;
+ ssi_private->dma_params_rx.dma_req_name = "rx";
+ ssi_private->dma_params_tx.dma_client_dev = &pdev->dev;
+ ssi_private->dma_params_tx.dma_req_name = "tx";
ssi_private->dma_params_tx.shared_peripheral =
of_device_is_compatible(of_get_parent(np),
@@ -887,7 +879,6 @@ error_dev:
dev_set_drvdata(&pdev->dev, NULL);
device_remove_file(&pdev->dev, dev_attr);
-error_clk:
if (ssi_private->ssi_on_imx) {
clk_disable_unprepare(ssi_private->clk);
clk_put(ssi_private->clk);
--
1.8.1.5
^ permalink raw reply related [flat|nested] 35+ messages in thread
* Re: [PATCH v2 06/11] ASoC: fsl-ssi: Setup generic imx dma params
2013-04-07 19:25 ` [PATCH v2 06/11] ASoC: fsl-ssi: Setup generic imx dma params Markus Pargmann
@ 2013-04-08 2:50 ` Timur Tabi
2013-04-13 13:52 ` Markus Pargmann
0 siblings, 1 reply; 35+ messages in thread
From: Timur Tabi @ 2013-04-08 2:50 UTC (permalink / raw)
To: Markus Pargmann, linux-arm-kernel
Cc: Fabio Estevam, alsa-devel, devicetree-discuss, Mark Brown,
Liam Girdwood, Grant Likely, Sascha Hauer, Shawn Guo
Markus Pargmann wrote:
> - ret = of_property_read_u32_array(pdev->dev.of_node,
> - "fsl,ssi-dma-events", dma_events, 2);
Does this mean that the "fsl,ssi-dma-events" property is no longer used?
--
Timur Tabi
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH v2 06/11] ASoC: fsl-ssi: Setup generic imx dma params
2013-04-08 2:50 ` Timur Tabi
@ 2013-04-13 13:52 ` Markus Pargmann
0 siblings, 0 replies; 35+ messages in thread
From: Markus Pargmann @ 2013-04-13 13:52 UTC (permalink / raw)
To: Timur Tabi
Cc: Fabio Estevam, alsa-devel, devicetree-discuss, Mark Brown,
Liam Girdwood, Grant Likely, Sascha Hauer, Shawn Guo,
linux-arm-kernel
On Sun, Apr 07, 2013 at 09:50:19PM -0500, Timur Tabi wrote:
> Markus Pargmann wrote:
> >- ret = of_property_read_u32_array(pdev->dev.of_node,
> >- "fsl,ssi-dma-events", dma_events, 2);
>
> Does this mean that the "fsl,ssi-dma-events" property is no longer used?
Yes, I just realized that it would break all platforms that do not have
a DMA driver with generic bindings yet. So I will instead still check
for this property in case 'dmas' is not set.
Regards,
Markus
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
^ permalink raw reply [flat|nested] 35+ messages in thread
* [PATCH v2 07/11] ARM: imx: Export ac97 reset functions
[not found] ` <1365362721-3731-1-git-send-email-mpa-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
` (4 preceding siblings ...)
2013-04-07 19:25 ` [PATCH v2 06/11] ASoC: fsl-ssi: Setup generic imx dma params Markus Pargmann
@ 2013-04-07 19:25 ` Markus Pargmann
2013-04-07 19:25 ` [PATCH v2 08/11] ASoC: fsl-ssi: imx ac97 support Markus Pargmann
` (2 subsequent siblings)
8 siblings, 0 replies; 35+ messages in thread
From: Markus Pargmann @ 2013-04-07 19:25 UTC (permalink / raw)
To: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
Cc: Fabio Estevam, alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw,
devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, Mark Brown, Timur Tabi,
Liam Girdwood, Sascha Hauer
Signed-off-by: Markus Pargmann <mpa-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
---
arch/arm/mach-imx/mach-pca100.c | 7 +++++--
arch/arm/mach-imx/mach-pcm043.c | 7 +++++--
2 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/arch/arm/mach-imx/mach-pca100.c b/arch/arm/mach-imx/mach-pca100.c
index b8b15bb..68badf8 100644
--- a/arch/arm/mach-imx/mach-pca100.c
+++ b/arch/arm/mach-imx/mach-pca100.c
@@ -22,6 +22,7 @@
#include <linux/i2c.h>
#include <linux/i2c/at24.h>
#include <linux/dma-mapping.h>
+#include <linux/export.h>
#include <linux/spi/spi.h>
#include <linux/spi/eeprom.h>
#include <linux/irq.h>
@@ -208,7 +209,7 @@ static const struct spi_imx_master pca100_spi0_data __initconst = {
.num_chipselect = ARRAY_SIZE(pca100_spi_cs),
};
-static void pca100_ac97_warm_reset(struct snd_ac97 *ac97)
+void pca100_ac97_warm_reset(struct snd_ac97 *ac97)
{
mxc_gpio_mode(GPIO_PORTC | 20 | GPIO_GPIO | GPIO_OUT);
gpio_set_value(GPIO_PORTC + 20, 1);
@@ -217,8 +218,9 @@ static void pca100_ac97_warm_reset(struct snd_ac97 *ac97)
mxc_gpio_mode(PC20_PF_SSI1_FS);
msleep(2);
}
+EXPORT_SYMBOL(pca100_ac97_warm_reset);
-static void pca100_ac97_cold_reset(struct snd_ac97 *ac97)
+void pca100_ac97_cold_reset(struct snd_ac97 *ac97)
{
mxc_gpio_mode(GPIO_PORTC | 20 | GPIO_GPIO | GPIO_OUT); /* FS */
gpio_set_value(GPIO_PORTC + 20, 0);
@@ -232,6 +234,7 @@ static void pca100_ac97_cold_reset(struct snd_ac97 *ac97)
mxc_gpio_mode(PC22_PF_SSI1_TXD);
msleep(2);
}
+EXPORT_SYMBOL(pca100_ac97_cold_reset);
static const struct imx_ssi_platform_data pca100_ssi_pdata __initconst = {
.ac97_reset = pca100_ac97_cold_reset,
diff --git a/arch/arm/mach-imx/mach-pcm043.c b/arch/arm/mach-imx/mach-pcm043.c
index 8ed533f..4f318ca 100644
--- a/arch/arm/mach-imx/mach-pcm043.c
+++ b/arch/arm/mach-imx/mach-pcm043.c
@@ -27,6 +27,7 @@
#include <linux/i2c/at24.h>
#include <linux/usb/otg.h>
#include <linux/usb/ulpi.h>
+#include <linux/export.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
@@ -217,7 +218,7 @@ static iomux_v3_cfg_t pcm043_pads[] = {
#define SD1_GPIO_WP IMX_GPIO_NR(2, 23)
#define SD1_GPIO_CD IMX_GPIO_NR(2, 24)
-static void pcm043_ac97_warm_reset(struct snd_ac97 *ac97)
+void pcm043_ac97_warm_reset(struct snd_ac97 *ac97)
{
iomux_v3_cfg_t txfs_gpio = MX35_PAD_STXFS4__GPIO2_31;
iomux_v3_cfg_t txfs = MX35_PAD_STXFS4__AUDMUX_AUD4_TXFS;
@@ -239,8 +240,9 @@ static void pcm043_ac97_warm_reset(struct snd_ac97 *ac97)
gpio_free(AC97_GPIO_TXFS);
mxc_iomux_v3_setup_pad(txfs);
}
+EXPORT_SYMBOL(pcm043_ac97_warm_reset);
-static void pcm043_ac97_cold_reset(struct snd_ac97 *ac97)
+void pcm043_ac97_cold_reset(struct snd_ac97 *ac97)
{
iomux_v3_cfg_t txfs_gpio = MX35_PAD_STXFS4__GPIO2_31;
iomux_v3_cfg_t txfs = MX35_PAD_STXFS4__AUDMUX_AUD4_TXFS;
@@ -286,6 +288,7 @@ err1:
printk("%s failed with %d\n", __func__, ret);
mdelay(1);
}
+EXPORT_SYMBOL(pcm043_ac97_cold_reset);
static const struct imx_ssi_platform_data pcm043_ssi_pdata __initconst = {
.ac97_reset = pcm043_ac97_cold_reset,
--
1.8.1.5
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH v2 08/11] ASoC: fsl-ssi: imx ac97 support
[not found] ` <1365362721-3731-1-git-send-email-mpa-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
` (5 preceding siblings ...)
2013-04-07 19:25 ` [PATCH v2 07/11] ARM: imx: Export ac97 reset functions Markus Pargmann
@ 2013-04-07 19:25 ` Markus Pargmann
2013-04-08 2:49 ` Timur Tabi
2013-04-07 19:25 ` [PATCH v2 09/11] ASoC: fsl: Kconfig: Use fsl-ssi for phycore-ac97 Markus Pargmann
2013-04-07 19:25 ` [PATCH v2 11/11] ASoC: fsl: Update fsl-ssi binding doc Markus Pargmann
8 siblings, 1 reply; 35+ messages in thread
From: Markus Pargmann @ 2013-04-07 19:25 UTC (permalink / raw)
To: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
Cc: Fabio Estevam, alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw,
devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, Mark Brown, Timur Tabi,
Liam Girdwood, Sascha Hauer
This patch copies some parts from imx-ssi to support AC97 on
imx27-pca100 and imx27-pcm043. It is activated with a new fsl,imx-ac97
bool property. It was tested on imx27-pca100.
Signed-off-by: Markus Pargmann <mpa-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
---
sound/soc/fsl/fsl_ssi.c | 360 +++++++++++++++++++++++++++++++++++++-----------
1 file changed, 279 insertions(+), 81 deletions(-)
diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c
index bb9a1e0..06f52ce 100644
--- a/sound/soc/fsl/fsl_ssi.c
+++ b/sound/soc/fsl/fsl_ssi.c
@@ -120,6 +120,7 @@ struct fsl_ssi_private {
bool new_binding;
bool ssi_on_imx;
+ bool imx_ac97;
bool dma;
struct clk *clk;
struct platform_device *imx_pcm_pdev;
@@ -127,6 +128,9 @@ struct fsl_ssi_private {
struct imx_pcm_dma_params dma_params_rx;
struct imx_pcm_fiq_params fiq_params;
+ void (*ac97_reset) (struct snd_ac97 *ac97);
+ void (*ac97_warm_reset)(struct snd_ac97 *ac97);
+
struct {
unsigned int rfrc;
unsigned int tfrc;
@@ -323,67 +327,76 @@ static int fsl_ssi_startup(struct snd_pcm_substream *substream,
ssi_private->first_stream = substream;
- /*
- * Section 16.5 of the MPC8610 reference manual says that the
- * SSI needs to be disabled before updating the registers we set
- * here.
- */
- write_ssi_mask(&ssi->scr, CCSR_SSI_SCR_SSIEN, 0);
-
- /*
- * Program the SSI into I2S Slave Non-Network Synchronous mode.
- * Also enable the transmit and receive FIFO.
- *
- * FIXME: Little-endian samples require a different shift dir
- */
- write_ssi_mask(&ssi->scr,
- CCSR_SSI_SCR_I2S_MODE_MASK | CCSR_SSI_SCR_SYN,
- CCSR_SSI_SCR_TFR_CLK_DIS | CCSR_SSI_SCR_I2S_MODE_SLAVE
- | (synchronous ? CCSR_SSI_SCR_SYN : 0));
+ /* If we use AC97, the registers are already setup correctly */
+ if (!ssi_private->imx_ac97) {
+ /*
+ * Section 16.5 of the MPC8610 reference manual says
+ * that the SSI needs to be disabled before updating
+ * the registers we set here.
+ */
+ write_ssi_mask(&ssi->scr, CCSR_SSI_SCR_SSIEN, 0);
- write_ssi(CCSR_SSI_STCR_TXBIT0 | CCSR_SSI_STCR_TFEN0 |
- CCSR_SSI_STCR_TFSI | CCSR_SSI_STCR_TEFS |
- CCSR_SSI_STCR_TSCKP, &ssi->stcr);
+ /*
+ * Program the SSI into I2S Slave Non-Network
+ * Synchronous mode. Also enable the transmit and
+ * receive FIFO.
+ *
+ * FIXME: Little-endian samples require a different
+ * shift dir
+ */
+ write_ssi_mask(&ssi->scr,
+ CCSR_SSI_SCR_I2S_MODE_MASK | CCSR_SSI_SCR_SYN,
+ CCSR_SSI_SCR_TFR_CLK_DIS |
+ CCSR_SSI_SCR_I2S_MODE_SLAVE |
+ (synchronous ? CCSR_SSI_SCR_SYN : 0));
+
+ write_ssi(CCSR_SSI_STCR_TXBIT0 | CCSR_SSI_STCR_TFEN0 |
+ CCSR_SSI_STCR_TFSI | CCSR_SSI_STCR_TEFS |
+ CCSR_SSI_STCR_TSCKP, &ssi->stcr);
+
+ write_ssi(CCSR_SSI_SRCR_RXBIT0 | CCSR_SSI_SRCR_RFEN0 |
+ CCSR_SSI_SRCR_RFSI | CCSR_SSI_SRCR_REFS |
+ CCSR_SSI_SRCR_RSCKP, &ssi->srcr);
+ /*
+ * The DC and PM bits are only used if the SSI is the
+ * clock master.
+ */
- write_ssi(CCSR_SSI_SRCR_RXBIT0 | CCSR_SSI_SRCR_RFEN0 |
- CCSR_SSI_SRCR_RFSI | CCSR_SSI_SRCR_REFS |
- CCSR_SSI_SRCR_RSCKP, &ssi->srcr);
+ /*
+ * Set the watermark for transmit FIFI 0 and receive
+ * FIFO 0. We don't use FIFO 1. We program the
+ * transmit water to signal a DMA transfer if there are
+ * only two (or fewer) elements left in the FIFO. Two
+ * elements equals one frame (left channel, right
+ * channel). This value, however, depends on the depth
+ * of the transmit buffer.
+ *
+ * We program the receive FIFO to notify us if at least
+ * two elements (one frame) have been written to the
+ * FIFO. We could make this value larger (and maybe we
+ * should), but this way data will be written to memory
+ * as soon as it's available.
+ */
+ write_ssi(CCSR_SSI_SFCSR_TFWM0(ssi_private->fifo_depth - 2) |
+ CCSR_SSI_SFCSR_RFWM0(ssi_private->fifo_depth - 2),
+ &ssi->sfcsr);
- /*
- * The DC and PM bits are only used if the SSI is the clock
- * master.
- */
+ /*
+ * We keep the SSI disabled because if we enable it,
+ * then the DMA controller will start. It's not
+ * supposed to start until the SCR.TE (or SCR.RE) bit
+ * is set, but it does anyway. The DMA controller will
+ * transfer one "BWC" of data (i.e. the amount of data
+ * that the MR.BWC bits are set to). The reason this
+ * is bad is because at this point, the PCM driver has
+ * not finished initializing the DMA controller.
+ */
+ }
/* Enable the interrupts and DMA requests */
if (ssi_private->dma)
write_ssi(SIER_FLAGS, &ssi->sier);
- /*
- * Set the watermark for transmit FIFI 0 and receive FIFO 0. We
- * don't use FIFO 1. We program the transmit water to signal a
- * DMA transfer if there are only two (or fewer) elements left
- * in the FIFO. Two elements equals one frame (left channel,
- * right channel). This value, however, depends on the depth of
- * the transmit buffer.
- *
- * We program the receive FIFO to notify us if at least two
- * elements (one frame) have been written to the FIFO. We could
- * make this value larger (and maybe we should), but this way
- * data will be written to memory as soon as it's available.
- */
- write_ssi(CCSR_SSI_SFCSR_TFWM0(ssi_private->fifo_depth - 2) |
- CCSR_SSI_SFCSR_RFWM0(ssi_private->fifo_depth - 2),
- &ssi->sfcsr);
-
- /*
- * We keep the SSI disabled because if we enable it, then the
- * DMA controller will start. It's not supposed to start until
- * the SCR.TE (or SCR.RE) bit is set, but it does anyway. The
- * DMA controller will transfer one "BWC" of data (i.e. the
- * amount of data that the MR.BWC bits are set to). The reason
- * this is bad is because at this point, the PCM driver has not
- * finished initializing the DMA controller.
- */
} else {
if (synchronous) {
struct snd_pcm_runtime *first_runtime =
@@ -500,27 +513,29 @@ static int fsl_ssi_trigger(struct snd_pcm_substream *substream, int cmd,
struct fsl_ssi_private *ssi_private = snd_soc_dai_get_drvdata(rtd->cpu_dai);
struct ccsr_ssi __iomem *ssi = ssi_private->ssi;
- switch (cmd) {
- case SNDRV_PCM_TRIGGER_START:
- case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
- if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
- write_ssi_mask(&ssi->scr, 0,
- CCSR_SSI_SCR_SSIEN | CCSR_SSI_SCR_TE);
- else
- write_ssi_mask(&ssi->scr, 0,
- CCSR_SSI_SCR_SSIEN | CCSR_SSI_SCR_RE);
- break;
-
- case SNDRV_PCM_TRIGGER_STOP:
- case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
- if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
- write_ssi_mask(&ssi->scr, CCSR_SSI_SCR_TE, 0);
- else
- write_ssi_mask(&ssi->scr, CCSR_SSI_SCR_RE, 0);
- break;
-
- default:
- return -EINVAL;
+ if (!ssi_private->imx_ac97) {
+ switch (cmd) {
+ case SNDRV_PCM_TRIGGER_START:
+ case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
+ if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
+ write_ssi_mask(&ssi->scr, 0,
+ CCSR_SSI_SCR_SSIEN | CCSR_SSI_SCR_TE);
+ else
+ write_ssi_mask(&ssi->scr, 0,
+ CCSR_SSI_SCR_SSIEN | CCSR_SSI_SCR_RE);
+ break;
+
+ case SNDRV_PCM_TRIGGER_STOP:
+ case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
+ if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
+ write_ssi_mask(&ssi->scr, CCSR_SSI_SCR_TE, 0);
+ else
+ write_ssi_mask(&ssi->scr, CCSR_SSI_SCR_RE, 0);
+ break;
+
+ default:
+ return -EINVAL;
+ }
}
if (!ssi_private->dma) {
@@ -556,8 +571,9 @@ static void fsl_ssi_shutdown(struct snd_pcm_substream *substream,
/*
* If this is the last active substream, disable the SSI.
+ * If AC97 is active, we don't want to disable SSI.
*/
- if (!ssi_private->first_stream) {
+ if (!ssi_private->first_stream && !ssi_private->imx_ac97) {
struct ccsr_ssi __iomem *ssi = ssi_private->ssi;
write_ssi_mask(&ssi->scr, CCSR_SSI_SCR_SSIEN, 0);
@@ -589,6 +605,152 @@ static struct snd_soc_dai_driver fsl_ssi_dai_template = {
.ops = &fsl_ssi_dai_ops,
};
+static struct snd_soc_dai_driver fsl_ssi_ac97_dai = {
+ .ac97_control = 1,
+ .playback = {
+ .stream_name = "AC97 Playback",
+ .channels_min = 2,
+ .channels_max = 2,
+ .rates = SNDRV_PCM_RATE_8000_48000,
+ .formats = SNDRV_PCM_FMTBIT_S16_LE,
+ },
+ .capture = {
+ .stream_name = "AC97 Capture",
+ .channels_min = 2,
+ .channels_max = 2,
+ .rates = SNDRV_PCM_RATE_48000,
+ .formats = SNDRV_PCM_FMTBIT_S16_LE,
+ },
+ .ops = &fsl_ssi_dai_ops,
+};
+
+
+static struct fsl_ssi_private *fsl_ac97_data;
+
+static void fsl_ssi_ac97_setup(struct ccsr_ssi *ssi)
+{
+ write_ssi(0x0, &ssi->scr);
+ write_ssi(0x0, &ssi->stcr);
+ write_ssi(0x0, &ssi->srcr);
+
+ write_ssi(CCSR_SSI_SCR_SYN | CCSR_SSI_SCR_NET, &ssi->scr);
+
+ write_ssi(CCSR_SSI_SFCSR_RFWM0(8) | CCSR_SSI_SFCSR_TFWM0(8) |
+ CCSR_SSI_SFCSR_RFWM1(8) | CCSR_SSI_SFCSR_TFWM1(8),
+ &ssi->sfcsr);
+
+ write_ssi(CCSR_SSI_SxCCR_WL(17) | CCSR_SSI_SxCCR_DC(13),
+ &ssi->stccr);
+ write_ssi(CCSR_SSI_SxCCR_WL(17) | CCSR_SSI_SxCCR_DC(13),
+ &ssi->srccr);
+
+ write_ssi(CCSR_SSI_SCR_SYN | CCSR_SSI_SCR_NET |
+ CCSR_SSI_SCR_SSIEN, &ssi->scr);
+ write_ssi(CCSR_SSI_SOR_WAIT(3), &ssi->sor);
+
+ write_ssi(CCSR_SSI_SCR_SYN | CCSR_SSI_SCR_NET |
+ CCSR_SSI_SCR_SSIEN | CCSR_SSI_SCR_TE |
+ CCSR_SSI_SCR_RE, &ssi->scr);
+
+ write_ssi(CCSR_SSI_SACNT_AC97EN | CCSR_SSI_SACNT_FV,
+ &ssi->sacnt);
+ write_ssi(0xff, &ssi->saccdis);
+ write_ssi(0x300, &ssi->saccen);
+
+ write_ssi(0x0, &ssi->sier);
+}
+
+static void fsl_ssi_ac97_write(struct snd_ac97 *ac97, unsigned short reg,
+ unsigned short val)
+{
+ struct ccsr_ssi *ssi = fsl_ac97_data->ssi;
+ unsigned int lreg;
+ unsigned int lval;
+
+ if (reg > 0x7f)
+ return;
+
+
+ lreg = reg << 12;
+ write_ssi(lreg, &ssi->sacadd);
+
+ lval = val << 4;
+ write_ssi(lval , &ssi->sacdat);
+
+ write_ssi_mask(&ssi->sacnt, CCSR_SSI_SACNT_RDWR_MASK,
+ CCSR_SSI_SACNT_WR);
+ udelay(100);
+}
+
+static unsigned short fsl_ssi_ac97_read(struct snd_ac97 *ac97,
+ unsigned short reg)
+{
+ struct ccsr_ssi *ssi = fsl_ac97_data->ssi;
+
+ unsigned short val = -1;
+ unsigned int lreg;
+
+ lreg = (reg & 0x7f) << 12 ;
+ write_ssi(lreg, &ssi->sacadd);
+ write_ssi_mask(&ssi->sacnt, CCSR_SSI_SACNT_RDWR_MASK,
+ CCSR_SSI_SACNT_RD);
+
+ udelay(100);
+
+ val = (read_ssi(&ssi->sacdat) >> 4) & 0xffff;
+
+ return val;
+}
+
+static void fsl_ssi_ac97_reset(struct snd_ac97 *ac97)
+{
+ struct fsl_ssi_private *ssi_private = fsl_ac97_data;
+
+ if (ssi_private->ac97_reset)
+ ssi_private->ac97_reset(ac97);
+ /* First read sometimes fails, do a dummy read */
+ fsl_ssi_ac97_read(ac97, 0);
+}
+
+static void fsl_ssi_ac97_warm_reset(struct snd_ac97 *ac97)
+{
+ struct fsl_ssi_private *ssi_private = fsl_ac97_data;
+
+ if (ssi_private->ac97_warm_reset)
+ ssi_private->ac97_warm_reset(ac97);
+
+ /* First read sometimes fails, do a dummy read */
+ fsl_ssi_ac97_read(ac97, 0);
+}
+
+struct snd_ac97_bus_ops soc_ac97_ops = {
+ .read = fsl_ssi_ac97_read,
+ .write = fsl_ssi_ac97_write,
+ .reset = fsl_ssi_ac97_reset,
+ .warm_reset = fsl_ssi_ac97_warm_reset
+};
+EXPORT_SYMBOL_GPL(soc_ac97_ops);
+
+/*
+ * Pointer to AC97 reset functions for specific boards
+ */
+#if IS_ENABLED(CONFIG_MACH_PCA100)
+extern void pca100_ac97_cold_reset(struct snd_ac97 *ac97);
+extern void pca100_ac97_warm_reset(struct snd_ac97 *ac97);
+#else
+void pca100_ac97_cold_reset(struct snd_ac97 *ac97) { }
+void pca100_ac97_warm_reset(struct snd_ac97 *ac97) { }
+#endif
+
+#if IS_ENABLED(CONFIG_MACH_PCM043)
+extern void pcm043_ac97_cold_reset(struct snd_ac97 *ac97);
+extern void pcm043_ac97_warm_reset(struct snd_ac97 *ac97);
+#else
+void pcm043_ac97_cold_reset(struct snd_ac97 *ac97) { }
+void pcm043_ac97_warm_reset(struct snd_ac97 *ac97) { }
+#endif
+
+
/* 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.
@@ -664,6 +826,7 @@ static int fsl_ssi_probe(struct platform_device *pdev)
const uint32_t *iprop;
struct resource res;
char name[64];
+ bool ac97 = false;
/* SSIs that are not connected on the board should have a
* status = "disabled"
@@ -674,7 +837,13 @@ static int fsl_ssi_probe(struct platform_device *pdev)
/* We only support the SSI in "I2S Slave" mode */
sprop = of_get_property(np, "fsl,mode", NULL);
- if (!sprop || strcmp(sprop, "i2s-slave")) {
+ if (!sprop) {
+ dev_err(&pdev->dev, "fsl,mode property is necessary\n");
+ return -EINVAL;
+ }
+ if (!strcmp(sprop, "ac97-slave")) {
+ ac97 = true;
+ } else if (strcmp(sprop, "i2s-slave")) {
dev_notice(&pdev->dev, "mode %s is unsupported\n", sprop);
return -ENODEV;
}
@@ -690,13 +859,39 @@ static int fsl_ssi_probe(struct platform_device *pdev)
strcpy(ssi_private->name, p);
- /* Initialize this copy of the CPU DAI driver structure */
- memcpy(&ssi_private->cpu_dai_drv, &fsl_ssi_dai_template,
- sizeof(fsl_ssi_dai_template));
- ssi_private->cpu_dai_drv.name = ssi_private->name;
-
ssi_private->dma = !of_property_read_bool(np, "fsl,imx-fiq");
+ if (ac97) {
+ sprop = of_get_property(of_find_node_by_path("/"), "compatible",
+ NULL);
+ p = strrchr(sprop, ',');
+ if (p)
+ sprop = p + 1;
+
+ if (!strcmp(sprop, "imx27-pca100")) {
+ ssi_private->ac97_reset = pca100_ac97_cold_reset;
+ ssi_private->ac97_warm_reset = pca100_ac97_warm_reset;
+ } else if (!strcmp(sprop, "imx27-pcm043")) {
+ ssi_private->ac97_reset = pcm043_ac97_cold_reset;
+ ssi_private->ac97_warm_reset = pcm043_ac97_warm_reset;
+ } else {
+ dev_err(&pdev->dev, "Failed to enable ssi AC97 mode, unknown board.\n");
+ ret = -EINVAL;
+ goto error_kmalloc;
+ }
+
+ memcpy(&ssi_private->cpu_dai_drv, &fsl_ssi_ac97_dai,
+ sizeof(fsl_ssi_ac97_dai));
+
+ fsl_ac97_data = ssi_private;
+ ssi_private->imx_ac97 = true;
+ } else {
+ /* Initialize this copy of the CPU DAI driver structure */
+ memcpy(&ssi_private->cpu_dai_drv, &fsl_ssi_dai_template,
+ sizeof(fsl_ssi_dai_template));
+ }
+ ssi_private->cpu_dai_drv.name = ssi_private->name;
+
/* Get the addresses and IRQ */
ret = of_address_to_resource(np, 0, &res);
if (ret) {
@@ -729,6 +924,9 @@ static int fsl_ssi_probe(struct platform_device *pdev)
}
}
+ if (ssi_private->imx_ac97)
+ fsl_ssi_ac97_setup(ssi_private->ssi);
+
/* Are the RX and the TX clocks locked? */
if (!of_find_property(np, "fsl,ssi-asynchronous", NULL))
ssi_private->cpu_dai_drv.symmetric_rates = 1;
--
1.8.1.5
^ permalink raw reply related [flat|nested] 35+ messages in thread
* Re: [PATCH v2 08/11] ASoC: fsl-ssi: imx ac97 support
2013-04-07 19:25 ` [PATCH v2 08/11] ASoC: fsl-ssi: imx ac97 support Markus Pargmann
@ 2013-04-08 2:49 ` Timur Tabi
2013-04-10 11:33 ` Markus Pargmann
0 siblings, 1 reply; 35+ messages in thread
From: Timur Tabi @ 2013-04-08 2:49 UTC (permalink / raw)
To: Markus Pargmann, linux-arm-kernel
Cc: Fabio Estevam, alsa-devel, devicetree-discuss, Mark Brown,
Liam Girdwood, Grant Likely, Sascha Hauer, Shawn Guo
Markus Pargmann wrote:
> This patch copies some parts from imx-ssi to support AC97 on
> imx27-pca100 and imx27-pcm043. It is activated with a new fsl,imx-ac97
> bool property. It was tested on imx27-pca100.
I'm not crazy about this patch -- it seems a bit hackish. There are too
many "if (imx_ac97)" clauses. Large pieces of code that don't appear to
be related to AC97 are indented in an if-clause. I especially don't like
the "If we use AC97, the registers are already setup correctly".
--
Timur Tabi
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH v2 08/11] ASoC: fsl-ssi: imx ac97 support
2013-04-08 2:49 ` Timur Tabi
@ 2013-04-10 11:33 ` Markus Pargmann
0 siblings, 0 replies; 35+ messages in thread
From: Markus Pargmann @ 2013-04-10 11:33 UTC (permalink / raw)
To: Timur Tabi
Cc: Fabio Estevam, alsa-devel, devicetree-discuss, Mark Brown,
Liam Girdwood, Grant Likely, Sascha Hauer, Shawn Guo,
linux-arm-kernel
On Sun, Apr 07, 2013 at 09:49:03PM -0500, Timur Tabi wrote:
> Markus Pargmann wrote:
> >This patch copies some parts from imx-ssi to support AC97 on
> >imx27-pca100 and imx27-pcm043. It is activated with a new fsl,imx-ac97
> >bool property. It was tested on imx27-pca100.
>
> I'm not crazy about this patch -- it seems a bit hackish. There are
> too many "if (imx_ac97)" clauses. Large pieces of code that don't
> appear to be related to AC97 are indented in an if-clause. I
> especially don't like the "If we use AC97, the registers are already
> setup correctly".
>
I will try to seperate it a little bit cleaner by using different dai
ops for ac97 for the two big ifs and perhaps use a seperated register
setup function so it can be used from ssi startup and ac97_setup.
Regards,
Markus
> --
> Timur Tabi
>
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
^ permalink raw reply [flat|nested] 35+ messages in thread
* [PATCH v2 09/11] ASoC: fsl: Kconfig: Use fsl-ssi for phycore-ac97
[not found] ` <1365362721-3731-1-git-send-email-mpa-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
` (6 preceding siblings ...)
2013-04-07 19:25 ` [PATCH v2 08/11] ASoC: fsl-ssi: imx ac97 support Markus Pargmann
@ 2013-04-07 19:25 ` Markus Pargmann
2013-04-07 19:25 ` [PATCH v2 11/11] ASoC: fsl: Update fsl-ssi binding doc Markus Pargmann
8 siblings, 0 replies; 35+ messages in thread
From: Markus Pargmann @ 2013-04-07 19:25 UTC (permalink / raw)
To: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
Cc: Fabio Estevam, alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw,
devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, Mark Brown, Timur Tabi,
Liam Girdwood, Sascha Hauer
Signed-off-by: Markus Pargmann <mpa-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
---
sound/soc/fsl/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/fsl/Kconfig b/sound/soc/fsl/Kconfig
index 3b98159..5ace408 100644
--- a/sound/soc/fsl/Kconfig
+++ b/sound/soc/fsl/Kconfig
@@ -153,7 +153,7 @@ config SND_SOC_PHYCORE_AC97
select SND_SOC_WM9712
select SND_SOC_IMX_PCM_FIQ
select SND_SOC_IMX_AUDMUX
- select SND_SOC_IMX_SSI
+ select SND_SOC_FSL_SSI
help
Say Y if you want to add support for SoC audio on Phytec phyCORE
and phyCARD boards in AC97 mode
--
1.8.1.5
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH v2 11/11] ASoC: fsl: Update fsl-ssi binding doc
[not found] ` <1365362721-3731-1-git-send-email-mpa-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
` (7 preceding siblings ...)
2013-04-07 19:25 ` [PATCH v2 09/11] ASoC: fsl: Kconfig: Use fsl-ssi for phycore-ac97 Markus Pargmann
@ 2013-04-07 19:25 ` Markus Pargmann
8 siblings, 0 replies; 35+ messages in thread
From: Markus Pargmann @ 2013-04-07 19:25 UTC (permalink / raw)
To: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
Cc: Fabio Estevam, alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw,
devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, Mark Brown, Timur Tabi,
Liam Girdwood, Sascha Hauer
Update the fsl-ssi bindings. DMA is no required property anymore and
uses the generic DMA bindings. imx-fiq is a new alternative to DMA
Signed-off-by: Markus Pargmann <mpa-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
---
Documentation/devicetree/bindings/sound/fsl,ssi.txt | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/Documentation/devicetree/bindings/sound/fsl,ssi.txt b/Documentation/devicetree/bindings/sound/fsl,ssi.txt
index 5ff76c9..46282ec 100644
--- a/Documentation/devicetree/bindings/sound/fsl,ssi.txt
+++ b/Documentation/devicetree/bindings/sound/fsl,ssi.txt
@@ -24,12 +24,6 @@ Required properties:
"rj-master" - r.j., SSI is clock master
"ac97-slave" - AC97 mode, SSI is clock slave
"ac97-master" - AC97 mode, SSI is clock master
-- fsl,playback-dma: Phandle to a node for the DMA channel to use for
- playback of audio. This is typically dictated by SOC
- design. See the notes below.
-- fsl,capture-dma: Phandle to a node for the DMA channel to use for
- capture (recording) of audio. This is typically dictated
- by SOC design. See the notes below.
- fsl,fifo-depth: The number of elements in the transmit and receive FIFOs.
This number is the maximum allowed value for SFCSR[TFWM0].
- fsl,ssi-asynchronous:
@@ -43,10 +37,17 @@ Required properties:
together. This would still allow different sample sizes,
but not different sample rates.
+Note that either dmas, dma-names or fsl,imx-fiq are required.
+
Optional properties:
- codec-handle: Phandle to a 'codec' node that defines an audio
codec connected to this SSI. This node is typically
a child of an I2C or other control node.
+- dmas: Generic dma devicetree binding as described in
+ Documentation/devicetree/bindings/dma/dma.txt.
+- dma-names: Two dmas have to be defined, "tx" and "rx", if fsl,imx-fiq
+ is not defined.
+- fsl,imx-fiq: Bool property. Use imx-pcm-fiq instead of imx-pcm-dma.
Child 'codec' node required properties:
- compatible: Compatible list, contains the name of the codec
--
1.8.1.5
^ permalink raw reply related [flat|nested] 35+ messages in thread