mbox series

[v7,00/24] ASoC: qcom: Add support to QDSP based Audio

Message ID 20180501120820.11016-1-srinivas.kandagatla@linaro.org
Headers show
Series ASoC: qcom: Add support to QDSP based Audio | expand

Message

Srinivas Kandagatla May 1, 2018, 12:07 p.m. UTC
Thankyou everyone for providing feedback and testing v6 patchset.
This patchset aims to provide a basic version of QCOM DSP based
audio support which is available in downstream andriod kernels.
This patchset support audio playback on HDMI-RX, MI2S, SLIMBus and
will add support to other features as we move on.

QDSP has both static and dynamic modules. static modules like AFE
(Audio FrontEnd), ADM (Audio Device Manager), ASM(Audio Stream Manager)
and CORE to provide this audio services.
All these services use APR (Asynchronous Packet Router) protocol
via smd/glink transport to communicate with Application processor.
More details on each module is availble in there respective patch.

This patchset is tested on DB820c, with HDMI audio playback, MI2S on
DB410c on top of mainline, Also tested SLIMBus analog audio using
wcd9355 with an additional patches. Patches are also tested on
SDM845 by Rohit.

Here is my test branch incase someone want to try these patches
https://git.linaro.org/people/srinivas.kandagatla/linux.git/log/?h=v4.17-qdsp6

Here is block diagram to give a quick overview of the components


  +---------+          +---------+         +---------+   
  |  q6asm  |          |q6routing|         | q6afe   | 
  |   dais  | <------> |  mixers | <-----> |  dais   |  
  +---------+          +---------+         +---------+   
      ^                     ^                   ^
      |                     |                   |
      |  +------------------+----------------+  |       
      |  |                  |                |  |       
      v  v                  v                v  v       
  +---------+          +---------+         +---------+ 
  |   q6ASM |          |  q6ADM  |         |   q6AFE |  
  +---------+          +---------+         +---------+  
      ^                     ^                   ^          ^
      |                     |                   | CPU Side |
------+---------------------+-------------------+--------
      |                     |                   |
      |                     |APR(smd/glink)     | 
      |                     |                   |
      |  +------------------+----------------+  |
      |  |                  |                |  |
+-----+--+-----------------------------------+--+-------
      |  |                  |                |  | QDSP Side |
      v  v                  v                v  v           v
 +---------+          +---------+         +---------+
 |   ASM   | <------> |   ADM   | <-----> |   AFE   |
 +---------+          +---------+         +---------+
                                               ^
                                               | 
                           +-------------------+
                           |
---------------------------+--------------------------
                           |            Audio I/O |
                           v                      v
    +--------------------------------------------------+
    |                Audio devices                     |
    | CODEC | HDMI-TX | PCM  | SLIMBUS | I2S |MI2S |...|
    |                                                  |
    +--------------------------------------------------+


Changes since v6 (https://lkml.org/lkml/2018/4/26/264)
- Added relevant acks and reviewed-by tags.
- Update apr_pkt_send and callbacks to take structures
 instead of void * suggested by Bjorn
- Updated q6afe bindings to explain clearly on grandchild
 dai node bindings, suggested by Rob H.
- Fixed few typos in APR commit msg spotted by Mark B.
- rebased patchset on top of
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git/?h=for-next

Srinivas Kandagatla (24):
  soc: qcom dt-bindings: Add APR bus bindings
  soc: qcom: Add APR bus driver
  ASoC: qdsp6: dt-bindings: Add q6core dt bindings
  ASoC: qdsp6: dt-bindings: Add q6afe dt bindings
  ASoC: qdsp6: dt-bindings: Add q6adm dt bindings
  ASoC: qdsp6: dt-bindings: Add q6asm dt bindings
  ASoC: qdsp6: q6common: Add qdsp6 helper functions
  ASoC: qdsp6: q6core: Add q6core driver
  ASoC: qdsp6: q6afe: Add q6afe driver
  ASoC: qdsp6: qdafe: Add SLIMBus port Support
  ASoC: qdsp6: q6afe: Add support to MI2S ports
  ASoC: qdsp6: q6afe: Add support to MI2S sysclks
  ASoC: qdsp6: q6adm: Add q6adm driver
  ASoC: qdsp6: q6asm: Add q6asm driver
  ASoC: qdsp6: q6asm: Add support to memory map and unmap
  ASoC: qdsp6: q6asm: Add support to audio stream apis
  ASoC: qdsp6: q6routing: Add q6routing driver
  ASoC: qdsp6: q6routing: Add support to all SLIMBus Mixers
  ASoC: qdsp6: q6routing: Add support to MI2S Mixers
  ASoC: qdsp6: q6afe: Add q6afe dai driver
  ASoC: qdsp6: q6asm: Add q6asm dai driver
  ASoC: qdsp6: dt-bindings: Add apq8096 machine bindings
  ASoC: qcom: apq8096: Add db820c machine driver
  MAINTAINERS: Add myself as co-maintainer of qcom audio

 .../devicetree/bindings/soc/qcom/qcom,apr.txt      |   84 ++
 .../devicetree/bindings/sound/qcom,apq8096.txt     |  109 ++
 .../devicetree/bindings/sound/qcom,q6adm.txt       |   33 +
 .../devicetree/bindings/sound/qcom,q6afe.txt       |  104 ++
 .../devicetree/bindings/sound/qcom,q6asm.txt       |   33 +
 .../devicetree/bindings/sound/qcom,q6core.txt      |   21 +
 MAINTAINERS                                        |    1 +
 drivers/soc/qcom/Kconfig                           |    9 +
 drivers/soc/qcom/Makefile                          |    1 +
 drivers/soc/qcom/apr.c                             |  378 ++++++
 include/dt-bindings/soc/qcom,apr.h                 |   28 +
 include/dt-bindings/sound/qcom,q6afe.h             |   31 +
 include/dt-bindings/sound/qcom,q6asm.h             |   22 +
 include/linux/mod_devicetable.h                    |   11 +
 include/linux/soc/qcom/apr.h                       |  128 ++
 sound/soc/qcom/Kconfig                             |   50 +
 sound/soc/qcom/Makefile                            |    5 +
 sound/soc/qcom/apq8096.c                           |  238 ++++
 sound/soc/qcom/qdsp6/Makefile                      |    8 +
 sound/soc/qcom/qdsp6/q6adm.c                       |  636 +++++++++
 sound/soc/qcom/qdsp6/q6adm.h                       |   25 +
 sound/soc/qcom/qdsp6/q6afe-dai.c                   |  752 +++++++++++
 sound/soc/qcom/qdsp6/q6afe.c                       | 1046 +++++++++++++++
 sound/soc/qcom/qdsp6/q6afe.h                       |  193 +++
 sound/soc/qcom/qdsp6/q6asm-dai.c                   |  628 +++++++++
 sound/soc/qcom/qdsp6/q6asm.c                       | 1401 ++++++++++++++++++++
 sound/soc/qcom/qdsp6/q6asm.h                       |   69 +
 sound/soc/qcom/qdsp6/q6core.c                      |  380 ++++++
 sound/soc/qcom/qdsp6/q6core.h                      |   15 +
 sound/soc/qcom/qdsp6/q6dsp-common.c                |   66 +
 sound/soc/qcom/qdsp6/q6dsp-common.h                |   24 +
 sound/soc/qcom/qdsp6/q6dsp-errno.h                 |   51 +
 sound/soc/qcom/qdsp6/q6routing.c                   |  983 ++++++++++++++
 sound/soc/qcom/qdsp6/q6routing.h                   |    9 +
 34 files changed, 7572 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/soc/qcom/qcom,apr.txt
 create mode 100644 Documentation/devicetree/bindings/sound/qcom,apq8096.txt
 create mode 100644 Documentation/devicetree/bindings/sound/qcom,q6adm.txt
 create mode 100644 Documentation/devicetree/bindings/sound/qcom,q6afe.txt
 create mode 100644 Documentation/devicetree/bindings/sound/qcom,q6asm.txt
 create mode 100644 Documentation/devicetree/bindings/sound/qcom,q6core.txt
 create mode 100644 drivers/soc/qcom/apr.c
 create mode 100644 include/dt-bindings/soc/qcom,apr.h
 create mode 100644 include/dt-bindings/sound/qcom,q6afe.h
 create mode 100644 include/dt-bindings/sound/qcom,q6asm.h
 create mode 100644 include/linux/soc/qcom/apr.h
 create mode 100644 sound/soc/qcom/apq8096.c
 create mode 100644 sound/soc/qcom/qdsp6/Makefile
 create mode 100644 sound/soc/qcom/qdsp6/q6adm.c
 create mode 100644 sound/soc/qcom/qdsp6/q6adm.h
 create mode 100644 sound/soc/qcom/qdsp6/q6afe-dai.c
 create mode 100644 sound/soc/qcom/qdsp6/q6afe.c
 create mode 100644 sound/soc/qcom/qdsp6/q6afe.h
 create mode 100644 sound/soc/qcom/qdsp6/q6asm-dai.c
 create mode 100644 sound/soc/qcom/qdsp6/q6asm.c
 create mode 100644 sound/soc/qcom/qdsp6/q6asm.h
 create mode 100644 sound/soc/qcom/qdsp6/q6core.c
 create mode 100644 sound/soc/qcom/qdsp6/q6core.h
 create mode 100644 sound/soc/qcom/qdsp6/q6dsp-common.c
 create mode 100644 sound/soc/qcom/qdsp6/q6dsp-common.h
 create mode 100644 sound/soc/qcom/qdsp6/q6dsp-errno.h
 create mode 100644 sound/soc/qcom/qdsp6/q6routing.c
 create mode 100644 sound/soc/qcom/qdsp6/q6routing.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

Comments

Rob Herring (Arm) May 1, 2018, 12:37 p.m. UTC | #1
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
Banajit Goswami May 3, 2018, 11:45 p.m. UTC | #2
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
Banajit Goswami May 3, 2018, 11:50 p.m. UTC | #3
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
Banajit Goswami May 3, 2018, 11:53 p.m. UTC | #4
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
Banajit Goswami May 3, 2018, 11:56 p.m. UTC | #5
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
Rohit Kumar May 4, 2018, 7:11 a.m. UTC | #6
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
Bjorn Andersson May 4, 2018, 5:33 p.m. UTC | #7
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
Banajit Goswami May 4, 2018, 7:04 p.m. UTC | #8
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
Banajit Goswami May 9, 2018, 3:21 a.m. UTC | #9
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
Srinivas Kandagatla May 9, 2018, 6:05 a.m. UTC | #10
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
Banajit Goswami May 9, 2018, 8:10 a.m. UTC | #11
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
Banajit Goswami May 9, 2018, 8:34 a.m. UTC | #12
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
Banajit Goswami May 9, 2018, 9:01 a.m. UTC | #13
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
Banajit Goswami May 9, 2018, 9:57 a.m. UTC | #14
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
Banajit Goswami May 9, 2018, 10:16 a.m. UTC | #15
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