Message ID | 20180501120820.11016-1-srinivas.kandagatla@linaro.org |
---|---|
Headers | show |
Series | ASoC: qcom: Add support to QDSP based Audio | expand |
On Tue, May 01, 2018 at 01:08:00PM +0100, Srinivas Kandagatla wrote: > This patch add DT bindings for AFE (Audio Frontend) DSP module. > > Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> > Reviewed-and-tested-by: Rohit kumar <rohitkr@codeaurora.org> > --- > .../devicetree/bindings/sound/qcom,q6afe.txt | 104 +++++++++++++++++++++ > include/dt-bindings/sound/qcom,q6afe.h | 31 ++++++ > 2 files changed, 135 insertions(+) > create mode 100644 Documentation/devicetree/bindings/sound/qcom,q6afe.txt > create mode 100644 include/dt-bindings/sound/qcom,q6afe.h Reviewed-by: Rob Herring <robh@kernel.org> -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On 5/1/2018 5:07 AM, Srinivas Kandagatla wrote: > This patch add DT bindings for Q6CORE DSP module. > > Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> > Reviewed-and-tested-by: Rohit kumar <rohitkr@codeaurora.org> > Reviewed-by: Rob Herring <robh@kernel.org> > --- > .../devicetree/bindings/sound/qcom,q6core.txt | 21 +++++++++++++++++++++ > 1 file changed, 21 insertions(+) > create mode 100644 Documentation/devicetree/bindings/sound/qcom,q6core.txt > > diff --git a/Documentation/devicetree/bindings/sound/qcom,q6core.txt b/Documentation/devicetree/bindings/sound/qcom,q6core.txt > new file mode 100644 > index 000000000000..bd14e9a93490 > --- /dev/null > +++ b/Documentation/devicetree/bindings/sound/qcom,q6core.txt > @@ -0,0 +1,21 @@ > +Qualcomm ADSP Core service binding > + > +Q6CORE is one of the APR audio service on Q6DSP. > +Please refer to qcom,apr.txt for details of the coommon apr service bindings Correct "coommon" to "common". Otherwise looks good. Reviewed-by: Banajit Goswami <bgoswami@codeaurora.org> -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On 5/1/2018 5:08 AM, Srinivas Kandagatla wrote: > This patch add DT bindings for AFE (Audio Frontend) DSP module. > > Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> > Reviewed-and-tested-by: Rohit kumar <rohitkr@codeaurora.org> > --- > .../devicetree/bindings/sound/qcom,q6afe.txt | 104 +++++++++++++++++++++ > include/dt-bindings/sound/qcom,q6afe.h | 31 ++++++ > 2 files changed, 135 insertions(+) > create mode 100644 Documentation/devicetree/bindings/sound/qcom,q6afe.txt > create mode 100644 include/dt-bindings/sound/qcom,q6afe.h > Reviewed-by: Banajit Goswami <bgoswami@codeaurora.org> -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On 5/1/2018 5:08 AM, Srinivas Kandagatla wrote: > This patch add DT bindings for ADM (Audio Device Manager) DSP module. > This module implements mixer controls to setup the connections between > AFE ports and ASM streams. > > Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> > Reviewed-and-tested-by: Rohit kumar <rohitkr@codeaurora.org> > Reviewed-by: Rob Herring <robh@kernel.org> > --- > .../devicetree/bindings/sound/qcom,q6adm.txt | 33 ++++++++++++++++++++++ > 1 file changed, 33 insertions(+) > create mode 100644 Documentation/devicetree/bindings/sound/qcom,q6adm.txt > > diff --git a/Documentation/devicetree/bindings/sound/qcom,q6adm.txt b/Documentation/devicetree/bindings/sound/qcom,q6adm.txt > new file mode 100644 > index 000000000000..cb709e5dbc44 > --- /dev/null > +++ b/Documentation/devicetree/bindings/sound/qcom,q6adm.txt > @@ -0,0 +1,33 @@ > +Qualcomm Audio Device Manager (Q6ADM) binding > + > +Q6ADM is one of the APR audio service on Q6DSP. > +Please refer to qcom,apr.txt for details of the coommon apr service bindings Correct "coommon" to "common". Otherwise looks good. Reviewed-by: Banajit Goswami <bgoswami@codeaurora.org> -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On 5/1/2018 5:08 AM, Srinivas Kandagatla wrote: > This patch add DT bindings for ASM (Audio Stream Manager) DSP module. > > Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> > Reviewed-and-tested-by: Rohit kumar <rohitkr@codeaurora.org> > Reviewed-by: Rob Herring <robh@kernel.org> > --- > .../devicetree/bindings/sound/qcom,q6asm.txt | 33 ++++++++++++++++++++++ > include/dt-bindings/sound/qcom,q6asm.h | 22 +++++++++++++++ > 2 files changed, 55 insertions(+) > create mode 100644 Documentation/devicetree/bindings/sound/qcom,q6asm.txt > create mode 100644 include/dt-bindings/sound/qcom,q6asm.h Reviewed-by: Banajit Goswami <bgoswami@codeaurora.org> -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On 5/1/2018 5:38 PM, Srinivas Kandagatla wrote: > +static int __q6asm_run(struct audio_client *ac, uint32_t flags, > + uint32_t msw_ts, uint32_t lsw_ts, bool wait) > +{ > + struct asm_session_cmd_run_v2 *run; > + struct apr_pkt *pkt; > + int pkt_size, rc; > + void *p; > + > + pkt_size = APR_HDR_SIZE + sizeof(*run); > + p = kzalloc(pkt_size, GFP_KERNEL); Should be GFP_ATOMIC as this API is also called from interrupt context > + if (!p) > + return -ENOMEM; > + [..] > +int q6asm_read(struct audio_client *ac) > +{ > + struct asm_data_cmd_read_v2 *read; > + struct audio_port_data *port; > + struct audio_buffer *ab; > + struct apr_pkt *pkt; > + int pkt_size; > + int rc = 0; > + void *p; > + > + if (!(ac->io_mode & ASM_SYNC_IO_MODE)) > + return 0; > + > + pkt_size = APR_HDR_SIZE + sizeof(*read); > + p = kzalloc(pkt_size, GFP_KERNEL); same here. GFP_ATOMIC > + if (!p) > + return -ENOMEM; [..] > +int q6asm_write_async(struct audio_client *ac, uint32_t len, uint32_t msw_ts, > + uint32_t lsw_ts, uint32_t flags) > +{ > + struct asm_data_cmd_write_v2 *write; > + struct audio_port_data *port; > + struct audio_buffer *ab; > + struct apr_pkt *pkt; > + int pkt_size; > + int rc = 0; > + void *p; > + > + pkt_size = APR_HDR_SIZE + sizeof(*write); > + p = kzalloc(pkt_size, GFP_KERNEL); GFP_ATOMIC > + if (!p) > + return -ENOMEM; > Thanks, Rohit -- Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc., is a member of Code Aurora Forum, a Linux Foundation Collaborative Project. -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Tue 01 May 05:07 PDT 2018, Srinivas Kandagatla wrote: > This patch add dt bindings for Qualcomm APR (Asynchronous Packet Router) > bus driver. This bus is used for communicating with DSP which provides > audio and various other services to cpu. > > Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> > Reviewed-by: Rob Herring <robh@kernel.org> Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org> Regards, Bjorn > --- > .../devicetree/bindings/soc/qcom/qcom,apr.txt | 84 ++++++++++++++++++++++ > include/dt-bindings/soc/qcom,apr.h | 28 ++++++++ > 2 files changed, 112 insertions(+) > create mode 100644 Documentation/devicetree/bindings/soc/qcom/qcom,apr.txt > create mode 100644 include/dt-bindings/soc/qcom,apr.h > > diff --git a/Documentation/devicetree/bindings/soc/qcom/qcom,apr.txt b/Documentation/devicetree/bindings/soc/qcom/qcom,apr.txt > new file mode 100644 > index 000000000000..bcc612cc7423 > --- /dev/null > +++ b/Documentation/devicetree/bindings/soc/qcom/qcom,apr.txt > @@ -0,0 +1,84 @@ > +Qualcomm APR (Asynchronous Packet Router) binding > + > +This binding describes the Qualcomm APR. APR is a IPC protocol for > +communication between Application processor and QDSP. APR is mainly > +used for audio/voice services on the QDSP. > + > +- compatible: > + Usage: required > + Value type: <stringlist> > + Definition: must be "qcom,apr-v<VERSION-NUMBER>", example "qcom,apr-v2" > + > +- reg > + Usage: required > + Value type: <u32> > + Definition: Destination processor ID. > + Possible values are : > + 1 - APR simulator > + 2 - PC > + 3 - MODEM > + 4 - ADSP > + 5 - APPS > + 6 - MODEM2 > + 7 - APPS2 > + > += APR SERVICES > +Each subnode of the APR node represents service tied to this apr. The name > +of the nodes are not important. The properties of these nodes are defined > +by the individual bindings for the specific service > +- All APR services MUST contain the following property: > + > +- reg > + Usage: required > + Value type: <u32> > + Definition: APR Service ID > + Possible values are : > + 3 - DSP Core Service > + 4 - Audio Front End Service. > + 5 - Voice Stream Manager Service. > + 6 - Voice processing manager. > + 7 - Audio Stream Manager Service. > + 8 - Audio Device Manager Service. > + 9 - Multimode voice manager. > + 10 - Core voice stream. > + 11 - Core voice processor. > + 12 - Ultrasound stream manager. > + 13 - Listen stream manager. > + > += EXAMPLE > +The following example represents a QDSP based sound card on a MSM8996 device > +which uses apr as communication between Apps and QDSP. > + > + apr@4 { > + compatible = "qcom,apr-v2"; > + reg = <APR_DOMAIN_ADSP>; > + > + q6core@3 { > + compatible = "qcom,q6core"; > + reg = <APR_SVC_ADSP_CORE>; > + }; > + > + q6afe@4 { > + compatible = "qcom,q6afe"; > + reg = <APR_SVC_AFE>; > + > + dais { > + #sound-dai-cells = <1>; > + hdmi@1 { > + reg = <1>; > + }; > + }; > + }; > + > + q6asm@7 { > + compatible = "qcom,q6asm"; > + reg = <APR_SVC_ASM>; > + ... > + }; > + > + q6adm@8 { > + compatible = "qcom,q6adm"; > + reg = <APR_SVC_ADM>; > + ... > + }; > + }; > diff --git a/include/dt-bindings/soc/qcom,apr.h b/include/dt-bindings/soc/qcom,apr.h > new file mode 100644 > index 000000000000..006362400c0f > --- /dev/null > +++ b/include/dt-bindings/soc/qcom,apr.h > @@ -0,0 +1,28 @@ > +/* SPDX-License-Identifier: GPL-2.0 */ > +#ifndef __DT_BINDINGS_QCOM_APR_H > +#define __DT_BINDINGS_QCOM_APR_H > + > +/* Domain IDs */ > +#define APR_DOMAIN_SIM 0x1 > +#define APR_DOMAIN_PC 0x2 > +#define APR_DOMAIN_MODEM 0x3 > +#define APR_DOMAIN_ADSP 0x4 > +#define APR_DOMAIN_APPS 0x5 > +#define APR_DOMAIN_MAX 0x6 > + > +/* ADSP service IDs */ > +#define APR_SVC_ADSP_CORE 0x3 > +#define APR_SVC_AFE 0x4 > +#define APR_SVC_VSM 0x5 > +#define APR_SVC_VPM 0x6 > +#define APR_SVC_ASM 0x7 > +#define APR_SVC_ADM 0x8 > +#define APR_SVC_ADSP_MVM 0x09 > +#define APR_SVC_ADSP_CVS 0x0A > +#define APR_SVC_ADSP_CVP 0x0B > +#define APR_SVC_USM 0x0C > +#define APR_SVC_LSM 0x0D > +#define APR_SVC_VIDC 0x16 > +#define APR_SVC_MAX 0x17 > + > +#endif /* __DT_BINDINGS_QCOM_APR_H */ > -- > 2.16.2 > -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On 5/1/2018 5:08 AM, Srinivas Kandagatla wrote: > This patch adds support to core apr service, which is used to query > status of other static and dynamic services on the dsp. > > Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> > Reviewed-and-tested-by: Rohit kumar <rohitkr@codeaurora.org> > --- > sound/soc/qcom/Kconfig | 4 + > sound/soc/qcom/qdsp6/Makefile | 1 + > sound/soc/qcom/qdsp6/q6core.c | 380 ++++++++++++++++++++++++++++++++++++++++++ > sound/soc/qcom/qdsp6/q6core.h | 15 ++ > 4 files changed, 400 insertions(+) > create mode 100644 sound/soc/qcom/qdsp6/q6core.c > create mode 100644 sound/soc/qcom/qdsp6/q6core.h > > diff --git a/sound/soc/qcom/Kconfig b/sound/soc/qcom/Kconfig > index b44a9fcd7ed3..37ee0d958145 100644 > --- a/sound/soc/qcom/Kconfig > +++ b/sound/soc/qcom/Kconfig > @@ -44,10 +44,14 @@ config SND_SOC_APQ8016_SBC > config SND_SOC_QDSP6_COMMON > tristate > > +config SND_SOC_QDSP6_CORE > + tristate > + > config SND_SOC_QDSP6 > tristate "SoC ALSA audio driver for QDSP6" > depends on QCOM_APR && HAS_DMA > select SND_SOC_QDSP6_COMMON > + select SND_SOC_QDSP6_CORE > help > To add support for MSM QDSP6 Soc Audio. > This will enable sound soc platform specific > diff --git a/sound/soc/qcom/qdsp6/Makefile b/sound/soc/qcom/qdsp6/Makefile > index accebdb49306..03b8e89c9731 100644 > --- a/sound/soc/qcom/qdsp6/Makefile > +++ b/sound/soc/qcom/qdsp6/Makefile > @@ -1 +1,2 @@ > obj-$(CONFIG_SND_SOC_QDSP6_COMMON) += q6dsp-common.o > +obj-$(CONFIG_SND_SOC_QDSP6_CORE) += q6core.o > diff --git a/sound/soc/qcom/qdsp6/q6core.c b/sound/soc/qcom/qdsp6/q6core.c > new file mode 100644 > index 000000000000..701aa3f50a6a > --- /dev/null > +++ b/sound/soc/qcom/qdsp6/q6core.c > @@ -0,0 +1,380 @@ > +// SPDX-License-Identifier: GPL-2.0 > +// Copyright (c) 2011-2017, The Linux Foundation. All rights reserved. > +// Copyright (c) 2018, Linaro Limited > + > +#include <linux/slab.h> > +#include <linux/wait.h> > +#include <linux/kernel.h> > +#include <linux/module.h> > +#include <linux/sched.h> > +#include <linux/of.h> > +#include <linux/of_platform.h> > +#include <linux/jiffies.h> > +#include <linux/wait.h> > +#include <linux/soc/qcom/apr.h> > +#include "q6core.h" > +#include "q6dsp-errno.h" > + > +#define ADSP_STATE_READY_TIMEOUT_MS 3000 > +#define Q6_READY_TIMEOUT_MS 100 > +#define AVCS_CMD_ADSP_EVENT_GET_STATE 0x0001290C > +#define AVCS_CMDRSP_ADSP_EVENT_GET_STATE 0x0001290D > +#define AVCS_GET_VERSIONS 0x00012905 > +#define AVCS_GET_VERSIONS_RSP 0x00012906 > +#define AVCS_CMD_GET_FWK_VERSION 0x001292c > +#define AVCS_CMDRSP_GET_FWK_VERSION 0x001292d > + > +struct avcs_svc_info { <snip> > +}; > + > +static struct q6core *g_core; > + > +static int q6core_callback(struct apr_device *adev, struct apr_resp_pkt *data) > +{ > + struct q6core *core = dev_get_drvdata(&adev->dev); > + struct aprv2_ibasic_rsp_result_t *result; > + struct apr_hdr *hdr = &data->hdr; > + > + result = data->payload; > + switch (hdr->opcode) { > + case APR_BASIC_RSP_RESULT:{ > + result = data->payload; > + switch (result->opcode) { > + case AVCS_GET_VERSIONS: > + if (result->status == ADSP_EUNSUPPORTED) > + core->get_version_supported = false; > + core->resp_received = true; > + break; > + case AVCS_CMD_GET_FWK_VERSION: > + if (result->status == ADSP_EUNSUPPORTED) > + core->fwk_version_supported = false; > + core->resp_received = true; > + break; > + case AVCS_CMD_ADSP_EVENT_GET_STATE: > + if (result->status == ADSP_EUNSUPPORTED) > + core->get_state_supported = false; > + core->resp_received = true; > + break; > + } > + break; > + } > + case AVCS_CMDRSP_GET_FWK_VERSION: { > + struct avcs_cmdrsp_get_fwk_version *fwk; > + int bytes; > + > + fwk = data->payload; > + core->fwk_version_supported = true; > + bytes = sizeof(*fwk) + fwk->num_services * > + sizeof(fwk->svc_api_info[0]); > + > + core->fwk_version = kzalloc(bytes, GFP_ATOMIC); > + if (!core->fwk_version) > + return -ENOMEM; When the above allocation fails, core->fwk_version_supported will be still true, and q6core_get_fwk_versions() will return 0 (timeout as core->resp_received will not be set to true). This can cause a NULL pointer dereference inside the if() loop pointed below (added comment). Please move the line to set core->fwk_version_supported flag to after memset() to copy fwk version info. > + > + memcpy(core->fwk_version, data->payload, bytes); > + > + core->resp_received = true; > + > + break; > + } > + case AVCS_GET_VERSIONS_RSP: { > + struct avcs_cmdrsp_get_version *v; > + int len; > + > + v = data->payload; > + core->get_version_supported = true; > + <snip> > + } > + > + return rc; > +} > + > +static bool __q6core_is_adsp_ready(struct q6core *core) > +{ > + struct apr_device *adev = core->adev; > + struct apr_pkt pkt; > + int rc; > + > + core->get_state_supported = false; > + > + pkt.hdr.hdr_field = APR_HDR_FIELD(APR_MSG_TYPE_SEQ_CMD, > + APR_HDR_LEN(APR_HDR_SIZE), APR_PKT_VER); > + pkt.hdr.pkt_size = APR_HDR_SIZE; > + pkt.hdr.opcode = AVCS_CMD_ADSP_EVENT_GET_STATE; > + > + rc = apr_send_pkt(adev, &pkt); > + if (rc < 0) > + return false; > + > + rc = wait_event_timeout(core->wait, (core->resp_received), > + msecs_to_jiffies(Q6_READY_TIMEOUT_MS)); > + if (rc > 0 && core->resp_received) { > + core->resp_received = false; > + > + if (core->avcs_state == 0x1) The AVCS state can be different non-zero value then 0x1. A better way to handle this can be check for (core->avcs_state > 0) for success, and then return the "core->avcs_state" to the caller. > + return true; > + } > + > + /* assume that the adsp is up if we not support this command */ > + if (!core->get_state_supported) > + return true; > + > + return false; > +} > + > +/** > + * q6core_get_svc_api_info() - Get version number of a service. > + * > + * @svc_id: service id of the service. > + * @info: Valid struct pointer to fill svc api information. > + * > + * Return: zero on success and error code on failure or unsupported > + */ > +int q6core_get_svc_api_info(int svc_id, struct q6core_svc_api_info *ainfo) > +{ > + int i; > + int ret = -ENOTSUPP; > + > + if (!g_core || !ainfo) > + return 0; > + > + mutex_lock(&g_core->lock); > + if (!g_core->is_version_requested) { > + if (q6core_get_fwk_versions(g_core) == -ENOTSUPP) > + q6core_get_svc_versions(g_core); > + g_core->is_version_requested = true; > + } > + > + if (g_core->fwk_version_supported) { > + for (i = 0; i < g_core->fwk_version->num_services; i++) { ..NULL pointer dereference here. > + struct avcs_svc_api_info *info; > + > + info = &g_core->fwk_version->svc_api_info[i]; > + if (svc_id != info->service_id) > + continue; > + > + ainfo->api_version = info->api_version; > + ainfo->api_branch_version = info->api_branch_version; > + ret = 0; > + break; > + } > + } else if (g_core->get_version_supported) { > + for (i = 0; i < g_core->svc_version->num_services; i++) { Similar issue of NULL pointer dereference is also present for g_core->get_version_supported flag. > + struct avcs_svc_info *info; > + > + info = &g_core->svc_version->svc_api_info[i]; > + if (svc_id != info->service_id) > + continue; > + > + ainfo->api_version = info->version; > + ainfo->api_branch_version = 0; > + ret = 0; > + break; <snip> > + init_waitqueue_head(&g_core->wait); > + return 0; > +} > + > +static int q6core_exit(struct apr_device *adev) > +{ > + struct q6core *core = dev_get_drvdata(&adev->dev); > + > + if (core->fwk_version_supported) > + kfree(core->fwk_version); > + if (core->get_version_supported) > + kfree(core->svc_version); > + > + kfree(core); > + g_core = NULL; This assignment can be before kfree() to avoid any possible issue in using g_core, after the pointer is freed. -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On 5/1/2018 5:08 AM, Srinivas Kandagatla wrote: > This patch adds support to 4 MI2S ports on LPASS. > > Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> > Reviewed-and-tested-by: Rohit kumar <rohitkr@codeaurora.org> > --- > sound/soc/qcom/qdsp6/q6afe.c | 224 +++++++++++++++++++++++++++++++++++++++++++ > sound/soc/qcom/qdsp6/q6afe.h | 13 +++ > 2 files changed, 237 insertions(+) > > diff --git a/sound/soc/qcom/qdsp6/q6afe.c b/sound/soc/qcom/qdsp6/q6afe.c > index be55b3ab045f..ceb18aaa5af4 100644 > --- a/sound/soc/qcom/qdsp6/q6afe.c > +++ b/sound/soc/qcom/qdsp6/q6afe.c > @@ -14,6 +14,10 @@ > #include <linux/spinlock.h> > #include <linux/delay.h> > #include <linux/soc/qcom/apr.h> > +#include <sound/soc.h> > +#include <sound/soc-dai.h> > +#include <sound/pcm.h> <snip> > union afe_port_config { > struct afe_param_id_hdmi_multi_chan_audio_cfg hdmi_multi_ch; > struct afe_param_id_slimbus_cfg slim_cfg; > + struct afe_param_id_i2s_cfg i2s_cfg; > } __packed; > > struct q6afe_port { > @@ -210,6 +264,22 @@ static struct afe_port_map port_maps[AFE_PORT_MAX] = { > SLIMBUS_4_RX, 1, 1}, > [SLIMBUS_5_RX] = { AFE_PORT_ID_SLIMBUS_MULTI_CHAN_5_RX, > SLIMBUS_5_RX, 1, 1}, > + [QUATERNARY_MI2S_RX] = { AFE_PORT_ID_QUATERNARY_MI2S_RX, > + QUATERNARY_MI2S_RX, 1, 1}, > + [QUATERNARY_MI2S_TX] = { AFE_PORT_ID_QUATERNARY_MI2S_TX, > + QUATERNARY_MI2S_TX, 0, 1}, > + [SECONDARY_MI2S_RX] = { AFE_PORT_ID_SECONDARY_MI2S_RX, > + SECONDARY_MI2S_RX, 1, 1}, > + [SECONDARY_MI2S_TX] = { AFE_PORT_ID_SECONDARY_MI2S_TX, > + SECONDARY_MI2S_TX, 0, 1}, > + [TERTIARY_MI2S_RX] = { AFE_PORT_ID_TERTIARY_MI2S_RX, > + TERTIARY_MI2S_RX, 1, 1}, > + [TERTIARY_MI2S_TX] = { AFE_PORT_ID_TERTIARY_MI2S_TX, > + TERTIARY_MI2S_TX, 0, 1}, > + [PRIMARY_MI2S_RX] = { AFE_PORT_ID_PRIMARY_MI2S_RX, > + PRIMARY_MI2S_RX, 1, 1}, > + [PRIMARY_MI2S_TX] = { AFE_PORT_ID_PRIMARY_MI2S_TX, > + PRIMARY_MI2S_RX, 0, 1}, Can these be added after SLIMBUS_6_RX? Also, for better arrangement, please add the port_maps from PRIMARY_MI2S_RX to QUATERNARY_MI2S_TX in the same sequence of definition of AFE ports. Otherwise LGTM. Once fixed the above comment add- Acked-by: Banajit Goswami <bgoswami@codeaurora.org> -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Thanks Banajit for review! On 09/05/18 04:21, Banajit Goswami wrote: > > On 5/1/2018 5:08 AM, Srinivas Kandagatla wrote: >> This patch adds support to 4 MI2S ports on LPASS. >> >> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> >> Reviewed-and-tested-by: Rohit kumar <rohitkr@codeaurora.org> >> --- >> sound/soc/qcom/qdsp6/q6afe.c | 224 >> +++++++++++++++++++++++++++++++++++++++++++ >> sound/soc/qcom/qdsp6/q6afe.h | 13 +++ >> 2 files changed, 237 insertions(+) >> >> diff --git a/sound/soc/qcom/qdsp6/q6afe.c b/sound/soc/qcom/qdsp6/q6afe.c >> index be55b3ab045f..ceb18aaa5af4 100644 >> --- a/sound/soc/qcom/qdsp6/q6afe.c >> +++ b/sound/soc/qcom/qdsp6/q6afe.c >> @@ -14,6 +14,10 @@ >> #include <linux/spinlock.h> >> #include <linux/delay.h> >> #include <linux/soc/qcom/apr.h> >> +#include <sound/soc.h> >> +#include <sound/soc-dai.h> >> +#include <sound/pcm.h> > <snip> > >> union afe_port_config { >> struct afe_param_id_hdmi_multi_chan_audio_cfg hdmi_multi_ch; >> struct afe_param_id_slimbus_cfg slim_cfg; >> + struct afe_param_id_i2s_cfg i2s_cfg; >> } __packed; >> struct q6afe_port { >> @@ -210,6 +264,22 @@ static struct afe_port_map >> port_maps[AFE_PORT_MAX] = { >> SLIMBUS_4_RX, 1, 1}, >> [SLIMBUS_5_RX] = { AFE_PORT_ID_SLIMBUS_MULTI_CHAN_5_RX, >> SLIMBUS_5_RX, 1, 1}, >> + [QUATERNARY_MI2S_RX] = { AFE_PORT_ID_QUATERNARY_MI2S_RX, >> + QUATERNARY_MI2S_RX, 1, 1}, >> + [QUATERNARY_MI2S_TX] = { AFE_PORT_ID_QUATERNARY_MI2S_TX, >> + QUATERNARY_MI2S_TX, 0, 1}, >> + [SECONDARY_MI2S_RX] = { AFE_PORT_ID_SECONDARY_MI2S_RX, >> + SECONDARY_MI2S_RX, 1, 1}, >> + [SECONDARY_MI2S_TX] = { AFE_PORT_ID_SECONDARY_MI2S_TX, >> + SECONDARY_MI2S_TX, 0, 1}, >> + [TERTIARY_MI2S_RX] = { AFE_PORT_ID_TERTIARY_MI2S_RX, >> + TERTIARY_MI2S_RX, 1, 1}, >> + [TERTIARY_MI2S_TX] = { AFE_PORT_ID_TERTIARY_MI2S_TX, >> + TERTIARY_MI2S_TX, 0, 1}, >> + [PRIMARY_MI2S_RX] = { AFE_PORT_ID_PRIMARY_MI2S_RX, >> + PRIMARY_MI2S_RX, 1, 1}, >> + [PRIMARY_MI2S_TX] = { AFE_PORT_ID_PRIMARY_MI2S_TX, >> + PRIMARY_MI2S_RX, 0, 1}, > Can these be added after SLIMBUS_6_RX? > Also, for better arrangement, please add the port_maps from > PRIMARY_MI2S_RX to QUATERNARY_MI2S_TX in the same sequence of definition > of AFE ports. > Otherwise LGTM. Yep, I have reordered this now! > Once fixed the above comment add- > Acked-by: Banajit Goswami <bgoswami@codeaurora.org> > -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On 5/1/2018 5:08 AM, Srinivas Kandagatla wrote: > This patch adds basic support to Q6 ASM (Audio Stream Manager) module on > Q6DSP. ASM supports up to 8 concurrent streams. each stream can be setup > as playback/capture. ASM provides top control functions like > Pause/flush/resume for playback and record. ASM can Create/destroy encoder, > decoder and also provides POPP dynamic services. > > This patch adds support to basic features to allow hdmi playback. > > Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> > Reviewed-and-tested-by: Rohit kumar <rohitkr@codeaurora.org> > --- > sound/soc/qcom/Kconfig | 4 + > sound/soc/qcom/qdsp6/Makefile | 1 + > sound/soc/qcom/qdsp6/q6asm.c | 215 ++++++++++++++++++++++++++++++++++++++++++ > sound/soc/qcom/qdsp6/q6asm.h | 15 +++ > 4 files changed, 235 insertions(+) > create mode 100644 sound/soc/qcom/qdsp6/q6asm.c > create mode 100644 sound/soc/qcom/qdsp6/q6asm.h > > diff --git a/sound/soc/qcom/Kconfig b/sound/soc/qcom/Kconfig > index 971127edbc23..941774abd94f 100644 > --- a/sound/soc/qcom/Kconfig > +++ b/sound/soc/qcom/Kconfig > @@ -53,6 +53,9 @@ config SND_SOC_QDSP6_AFE > config SND_SOC_QDSP6_ADM > tristate > > +config SND_SOC_QDSP6_ASM <snip> > +static const struct of_device_id q6asm_device_id[] = { > + { .compatible = "qcom,q6asm" }, > + {}, > +}; > +MODULE_DEVICE_TABLE(of, q6asm_device_id); > + > +static struct apr_driver qcom_q6asm_driver = { > + .probe = q6asm_probe, > + .remove = q6asm_remove, > + .callback = q6asm_srvc_callback, > + .driver = { > + .name = "qcom-q6asm", > + .of_match_table = of_match_ptr(q6asm_device_id), > + }, > +}; > + > +module_apr_driver(qcom_q6asm_driver); > +MODULE_DESCRIPTION("Q6 Audio Stream Manager driver"); > +MODULE_LICENSE("GPL v2"); > diff --git a/sound/soc/qcom/qdsp6/q6asm.h b/sound/soc/qcom/qdsp6/q6asm.h > new file mode 100644 > index 000000000000..92cc0efaa2c8 > --- /dev/null > +++ b/sound/soc/qcom/qdsp6/q6asm.h > @@ -0,0 +1,15 @@ > +/* SPDX-License-Identifier: GPL-2.0 */ > +#ifndef __Q6_ASM_H__ > +#define __Q6_ASM_H__ > + > +#define MAX_SESSIONS 16 MAX_SESSIONS should be 8? Otherwise LGTM. Once addressed about, add acked-by- Acked-by: Banajit Goswami <bgoswami@codeaurora.org> -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On 5/1/2018 5:08 AM, Srinivas Kandagatla wrote: > This patch add support to MI2S mixers required to select path between > ASM stream and AFE ports. > > Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> > Reviewed-and-tested-by: Rohit kumar <rohitkr@codeaurora.org> > --- > sound/soc/qcom/qdsp6/q6routing.c | 329 +++++++++++++++++++++++++++++++++++++++ > 1 file changed, 329 insertions(+) > > Acked-by: Banajit Goswami <bgoswami@codeaurora.org> -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On 5/1/2018 5:08 AM, Srinivas Kandagatla wrote: > Add devicetree bindings documentation file for Qualcomm apq8096 sound card. > > Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> > Reviewed-by: Rob Herring <robh@kernel.org> > --- > .../devicetree/bindings/sound/qcom,apq8096.txt | 109 +++++++++++++++++++++ > 1 file changed, 109 insertions(+) > create mode 100644 Documentation/devicetree/bindings/sound/qcom,apq8096.txt > Reviewed-by: Banajit Goswami <bgoswami@codeaurora.org> -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On 5/1/2018 5:08 AM, Srinivas Kandagatla wrote: > This patch adds support to q6asm dai driver which configures Q6ASM streams > to pass pcm data. > > Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> > Reviewed-and-tested-by: Rohit kumar <rohitkr@codeaurora.org> > --- > sound/soc/qcom/Kconfig | 4 + > sound/soc/qcom/qdsp6/Makefile | 1 + > sound/soc/qcom/qdsp6/q6asm-dai.c | 628 +++++++++++++++++++++++++++++++++++++++ > 3 files changed, 633 insertions(+) > create mode 100644 sound/soc/qcom/qdsp6/q6asm-dai.c > Acked-by: Banajit Goswami <bgoswami@codeaurora.org> -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On 5/1/2018 5:08 AM, Srinivas Kandagatla wrote: > This patch adds support to open, write and media format commands > in the q6asm module. > > Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> > Reviewed-and-tested-by: Rohit kumar <rohitkr@codeaurora.org> > --- > sound/soc/qcom/qdsp6/q6asm.c | 839 ++++++++++++++++++++++++++++++++++++++++++- > sound/soc/qcom/qdsp6/q6asm.h | 49 +++ > 2 files changed, 887 insertions(+), 1 deletion(-) > > diff --git a/sound/soc/qcom/qdsp6/q6asm.c b/sound/soc/qcom/qdsp6/q6asm.c > index 5a573e927a5e..a3073de235e1 100644 > --- a/sound/soc/qcom/qdsp6/q6asm.c > +++ b/sound/soc/qcom/qdsp6/q6asm.c > @@ -10,6 +10,8 @@ <snip> > EXPORT_SYMBOL_GPL(q6asm_audio_client_alloc); > > +static int q6asm_ac_send_cmd_sync(struct audio_client *ac, struct apr_pkt *pkt) > +{ > + struct apr_hdr *hdr = &pkt->hdr; > + int rc; > + > + mutex_lock(&ac->lock); > + ac->result.opcode = 0; > + ac->result.status = 0; > + > + rc = apr_send_pkt(ac->adev, pkt); > + if (rc < 0) > + goto err; > + > + rc = wait_event_timeout(ac->cmd_wait, > + (ac->result.opcode == hdr->opcode), 5 * HZ); > + if (!rc) { > + dev_err(ac->dev, "CMD timeout\n"); > + rc = -ETIMEDOUT; > + goto err; > + } else set rc to 0 to avoid returning >0 value. LGTM otherwise. Acked-by: Banajit Goswami <bgoswami@codeaurora.org> -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html