diff options
author | Daniel Baluta <daniel.baluta@nxp.com> | 2020-01-14 15:58:16 +0800 |
---|---|---|
committer | Zhang Peng <peng_zhang_8@nxp.com> | 2020-02-13 19:26:37 +0800 |
commit | fb29abcd7ae909c5b264c1eb3f9233a3d4584e0a (patch) | |
tree | 72cb3bd5ddde0449ee81feef2915797b6b632fb2 | |
parent | 196f718910e0a1fa8152360c965f8c2e8be4f0d3 (diff) |
MLK-23255-1: ASoC: fsl_dsp: Add Audio MIX DSP helper
This is a subdevice of audiomix MFD device, exposing
access to DSP control register from AudioMIX subsystem.
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
-rw-r--r-- | arch/arm64/boot/dts/freescale/imx8mp.dtsi | 2 | ||||
-rw-r--r-- | sound/soc/fsl/Kconfig | 6 | ||||
-rw-r--r-- | sound/soc/fsl/Makefile | 2 | ||||
-rw-r--r-- | sound/soc/fsl/fsl_dsp_audiomix.c | 56 | ||||
-rw-r--r-- | sound/soc/fsl/fsl_dsp_audiomix.h | 19 |
5 files changed, 84 insertions, 1 deletions
diff --git a/arch/arm64/boot/dts/freescale/imx8mp.dtsi b/arch/arm64/boot/dts/freescale/imx8mp.dtsi index da9b63bc2fef..ea9c9dbb689e 100644 --- a/arch/arm64/boot/dts/freescale/imx8mp.dtsi +++ b/arch/arm64/boot/dts/freescale/imx8mp.dtsi @@ -1875,7 +1875,7 @@ <&audiomix_clk IMX8MP_CLK_AUDIOMIX_MU2_ROOT>; clock-names = "ocram", "core", "debug", "mu2"; fsl,dsp-firmware = "imx/dsp/hifi4.bin"; - //power-domains = <&audiomix_pd>; + power-domains = <&audiomix_pd>; status = "disabled"; }; diff --git a/sound/soc/fsl/Kconfig b/sound/soc/fsl/Kconfig index df83213310de..817ff7b51062 100644 --- a/sound/soc/fsl/Kconfig +++ b/sound/soc/fsl/Kconfig @@ -115,6 +115,12 @@ config SND_SOC_FSL_AUD2HTX help Say Y if you want to add AUDIO TO HDMI TX support for NXP. +config SND_SOC_FSL_DSP_AUDIOMIX + tristate "Audio MIX DSP helper" + depends on MFD_IMX_AUDIOMIX + help + Say Y if you want to add Audio MIX helper for DSP + config SND_SOC_FSL_UTILS tristate diff --git a/sound/soc/fsl/Makefile b/sound/soc/fsl/Makefile index 7b41e0cd9cd7..3551980d9f56 100644 --- a/sound/soc/fsl/Makefile +++ b/sound/soc/fsl/Makefile @@ -13,6 +13,7 @@ obj-$(CONFIG_SND_SOC_P1022_RDK) += snd-soc-p1022-rdk.o # Freescale SSI/DMA/SAI/SPDIF Support snd-soc-fsl-audmix-objs := fsl_audmix.o +snd-soc-fsl-dsp-audiomix-objs := fsl_dsp_audiomix.o snd-soc-fsl-asrc-objs := fsl_asrc.o fsl_asrc_dma.o snd-soc-fsl-dsp-objs := fsl_dsp.o fsl_dsp_proxy.o fsl_dsp_pool.o \ fsl_dsp_library_load.o fsl_dsp_xaf_api.o fsl_dsp_cpu.o \ @@ -36,6 +37,7 @@ obj-$(CONFIG_SND_SOC_FSL_ASOC_CARD) += snd-soc-fsl-asoc-card.o snd-soc-fsl-hdmi-objs := fsl_hdmi.o obj-$(CONFIG_SND_SOC_FSL_ASRC) += snd-soc-fsl-asrc.o obj-$(CONFIG_SND_SOC_FSL_DSP) += snd-soc-fsl-dsp.o +obj-$(CONFIG_SND_SOC_FSL_DSP_AUDIOMIX) += snd-soc-fsl-dsp-audiomix.o obj-$(CONFIG_SND_SOC_FSL_SAI) += snd-soc-fsl-sai.o obj-$(CONFIG_SND_SOC_FSL_SSI) += snd-soc-fsl-ssi.o obj-$(CONFIG_SND_SOC_FSL_SPDIF) += snd-soc-fsl-spdif.o diff --git a/sound/soc/fsl/fsl_dsp_audiomix.c b/sound/soc/fsl/fsl_dsp_audiomix.c new file mode 100644 index 000000000000..d3dc75f7e65a --- /dev/null +++ b/sound/soc/fsl/fsl_dsp_audiomix.c @@ -0,0 +1,56 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright 2019 NXP. + */ + +#include <linux/err.h> +#include <linux/io.h> +#include <linux/module.h> +#include <linux/of.h> +#include <linux/of_address.h> +#include <linux/platform_device.h> + +#include "fsl_dsp_audiomix.h" + +struct imx_audiomix_dsp_data { + void __iomem *base; +}; + +void imx_audiomix_dsp_start(struct imx_audiomix_dsp_data *data) +{ + u32 val; + + val = readl(data->base + AudioDSP_REG2); + val &= ~(1 << 5); + writel(val, data->base + AudioDSP_REG2); +} + +static int imx_audiomix_dsp_probe(struct platform_device *pdev) +{ + struct imx_audiomix_dsp_data *drvdata; + struct device *dev = &pdev->dev; + + drvdata = devm_kzalloc(&pdev->dev, sizeof(*drvdata), GFP_KERNEL); + if (drvdata == NULL) + return -ENOMEM; + + drvdata->base = dev_get_drvdata(dev->parent); + + platform_set_drvdata(pdev, drvdata); + + return 0; +} + +static const struct of_device_id imx_audiomix_dsp_dt_ids[] = { + { .compatible = "fsl,audiomix-dsp", }, + { /* sentinel */ }, +}; + +static struct platform_driver imx_audiomix_dsp_driver = { + .probe = imx_audiomix_dsp_probe, + .driver = { + .name = "audiomix-dsp", + .of_match_table = imx_audiomix_dsp_dt_ids, + }, +}; +module_platform_driver(imx_audiomix_dsp_driver); diff --git a/sound/soc/fsl/fsl_dsp_audiomix.h b/sound/soc/fsl/fsl_dsp_audiomix.h new file mode 100644 index 000000000000..c4dea9903575 --- /dev/null +++ b/sound/soc/fsl/fsl_dsp_audiomix.h @@ -0,0 +1,19 @@ +/* SPDX-License-Identifier: (GPL-2.0+ OR MIT)*/ +/* + * Copyright (C) 2017 Cadence Design Systems, Inc. + * Copyright 2018 NXP + * + */ + +#ifndef FSL_DSP_AUDMIX_H +#define FSL_DSP_AUDMIX_H + +#define AudioDSP_REG0 0x100 +#define AudioDSP_REG1 0x104 +#define AudioDSP_REG2 0x108 +#define AudioDSP_REG3 0x10c + +struct imx_audiomix_dsp_data; +void imx_audiomix_dsp_start(struct imx_audiomix_dsp_data *data); + +#endif |