Re: [alsa-devel] [PATCH v2 1/3] ASoC: zx: Add ZTE zx296702 pcm support
2015-05-06 20:38 GMT+08:00 Jun Nie jun.nie@linaro.org:
This patch adds zx296702 ASoC DMA audio support. It handle audio dma based on soc-dmaengine
Mark,
Do you have any comments on this patch set? Or you suggest to add HDMI API calling in the same serial patch? For the HDMI calling, I have no good idea except direct call currently. Because I need dts hook to audio driver, while no HDMI call back data can be shared from video side to audio side in this independent initialization case.
Jun
Signed-off-by: Jun Nie jun.nie@linaro.org
sound/soc/Kconfig | 1 + sound/soc/Makefile | 1 + sound/soc/zte/Kconfig | 8 ++++++++ sound/soc/zte/Makefile | 1 + sound/soc/zte/zx296702-pcm.c | 46 ++++++++++++++++++++++++++++++++++++++++++++ sound/soc/zte/zx296702-pcm.h | 6 ++++++ 6 files changed, 63 insertions(+) create mode 100644 sound/soc/zte/Kconfig create mode 100644 sound/soc/zte/Makefile create mode 100644 sound/soc/zte/zx296702-pcm.c create mode 100644 sound/soc/zte/zx296702-pcm.h
diff --git a/sound/soc/Kconfig b/sound/soc/Kconfig index 3ba52da..e2828e1 100644 --- a/sound/soc/Kconfig +++ b/sound/soc/Kconfig @@ -57,6 +57,7 @@ source "sound/soc/tegra/Kconfig" source "sound/soc/txx9/Kconfig" source "sound/soc/ux500/Kconfig" source "sound/soc/xtensa/Kconfig" +source "sound/soc/zte/Kconfig"
# Supported codecs source "sound/soc/codecs/Kconfig" diff --git a/sound/soc/Makefile b/sound/soc/Makefile index 974ba70..57bf32d 100644 --- a/sound/soc/Makefile +++ b/sound/soc/Makefile @@ -38,3 +38,4 @@ obj-$(CONFIG_SND_SOC) += tegra/ obj-$(CONFIG_SND_SOC) += txx9/ obj-$(CONFIG_SND_SOC) += ux500/ obj-$(CONFIG_SND_SOC) += xtensa/ +obj-$(CONFIG_SND_SOC) += zte/ diff --git a/sound/soc/zte/Kconfig b/sound/soc/zte/Kconfig new file mode 100644 index 0000000..392ffa6 --- /dev/null +++ b/sound/soc/zte/Kconfig @@ -0,0 +1,8 @@ +config SND_SOC_ZX296702
tristate "SoC Audio for the ZX296702 System-on-Chip"
depends on SOC_ZX296702 || COMPILE_TEST
depends on COMMON_CLK
select SND_SOC_GENERIC_DMAENGINE_PCM
help
Say Y or M here if you want support for SoC audio on ZX296702
chip.
diff --git a/sound/soc/zte/Makefile b/sound/soc/zte/Makefile new file mode 100644 index 0000000..f2a6af8 --- /dev/null +++ b/sound/soc/zte/Makefile @@ -0,0 +1 @@ +obj-$(CONFIG_SND_SOC_ZX296702) += zx296702-pcm.o diff --git a/sound/soc/zte/zx296702-pcm.c b/sound/soc/zte/zx296702-pcm.c new file mode 100644 index 0000000..6e1a61a --- /dev/null +++ b/sound/soc/zte/zx296702-pcm.c @@ -0,0 +1,46 @@ +/*
- Copyright (C) 2015 Linaro
- Author: Jun Nie jun.nie@linaro.org
- License terms: GNU General Public License (GPL) version 2
- */
+#include <linux/device.h> +#include <linux/init.h> +#include <linux/module.h> +#include <sound/core.h> +#include <sound/pcm.h> +#include <sound/soc.h> +#include <sound/dmaengine_pcm.h>
+#include "zx296702-pcm.h"
+static const struct snd_pcm_hardware snd_zx_hardware = {
.info = SNDRV_PCM_INFO_MMAP |
SNDRV_PCM_INFO_MMAP_VALID |
SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_PAUSE |
SNDRV_PCM_INFO_RESUME |
SNDRV_PCM_INFO_NO_PERIOD_WAKEUP,
.period_bytes_min = 32,
.period_bytes_max = 16 * 1024,
.periods_min = 2,
.periods_max = 32,
.buffer_bytes_max = 64 * 1024,
+};
+static const struct snd_dmaengine_pcm_config zx_dmaengine_pcm_config = {
.prepare_slave_config = snd_dmaengine_pcm_prepare_slave_config,
.pcm_hardware = &snd_zx_hardware,
.prealloc_buffer_size = 64 * 1024,
+};
+int zx_pcm_platform_register(struct device *dev) +{
return devm_snd_dmaengine_pcm_register(dev, &zx_dmaengine_pcm_config,
0);
+} +EXPORT_SYMBOL_GPL(zx_pcm_platform_register);
+MODULE_LICENSE("GPL"); diff --git a/sound/soc/zte/zx296702-pcm.h b/sound/soc/zte/zx296702-pcm.h new file mode 100644 index 0000000..4809a38 --- /dev/null +++ b/sound/soc/zte/zx296702-pcm.h @@ -0,0 +1,6 @@ +#ifndef _ZX_PCM_H +#define _ZX_PCM_H
+int zx_pcm_platform_register(struct device *dev);
+#endif
1.9.1
On Mon, May 18, 2015 at 04:04:30PM +0800, Jun Nie wrote:
2015-05-06 20:38 GMT+08:00 Jun Nie jun.nie@linaro.org:
Do you have any comments on this patch set? Or you suggest to add HDMI
Please don't send pings, they just add to the mail volume.
API calling in the same serial patch? For the HDMI calling, I have no good idea except direct call currently. Because I need dts hook to audio driver, while no HDMI call back data can be shared from video side to audio side in this independent initialization case.
My previous suggestion was to have a CODEC driver for the HDMI IP - I'm not sure why that would require a "direct call"?
2015-05-22 4:04 GMT+08:00 Mark Brown broonie@kernel.org:
On Mon, May 18, 2015 at 04:04:30PM +0800, Jun Nie wrote:
2015-05-06 20:38 GMT+08:00 Jun Nie jun.nie@linaro.org:
Do you have any comments on this patch set? Or you suggest to add HDMI
Please don't send pings, they just add to the mail volume.
API calling in the same serial patch? For the HDMI calling, I have no good idea except direct call currently. Because I need dts hook to audio driver, while no HDMI call back data can be shared from video side to audio side in this independent initialization case.
My previous suggestion was to have a CODEC driver for the HDMI IP - I'm not sure why that would require a "direct call"?
I mean I have to direct call HDMI API in HDMI codec driver, is that acceptable?
Jun
On Fri, May 22, 2015 at 09:08:51AM +0800, Jun Nie wrote:
2015-05-22 4:04 GMT+08:00 Mark Brown broonie@kernel.org:
My previous suggestion was to have a CODEC driver for the HDMI IP - I'm not sure why that would require a "direct call"?
I mean I have to direct call HDMI API in HDMI codec driver, is that acceptable?
I don't know what you mean when you talk about "direct call HDMI API" - what is the HDMI API to which you refer here?
2015-05-22 19:35 GMT+08:00 Mark Brown broonie@kernel.org:
On Fri, May 22, 2015 at 09:08:51AM +0800, Jun Nie wrote:
2015-05-22 4:04 GMT+08:00 Mark Brown broonie@kernel.org:
My previous suggestion was to have a CODEC driver for the HDMI IP - I'm not sure why that would require a "direct call"?
I mean I have to direct call HDMI API in HDMI codec driver, is that acceptable?
I don't know what you mean when you talk about "direct call HDMI API" - what is the HDMI API to which you refer here?
Sorry for confusing you. I mean HDMI function in video part. I have to call ZTE specific HDMI function from ASoC codec driver.
Jun
participants (2)
-
Jun Nie
-
Mark Brown