lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4f0c3528-c7cd-37a9-7ca0-e30eb8e6d103@linaro.org>
Date:   Mon, 10 Feb 2020 17:13:36 +0000
From:   Srinivas Kandagatla <srinivas.kandagatla@...aro.org>
To:     Adam Serbinski <adam@...binski.com>,
        Mark Brown <broonie@...nel.org>,
        Rob Herring <robh+dt@...nel.org>,
        Bjorn Andersson <bjorn.andersson@...aro.org>
Cc:     Andy Gross <agross@...nel.org>,
        Mark Rutland <mark.rutland@....com>,
        Liam Girdwood <lgirdwood@...il.com>,
        Patrick Lai <plai@...eaurora.org>,
        Banajit Goswami <bgoswami@...eaurora.org>,
        Jaroslav Kysela <perex@...ex.cz>,
        Takashi Iwai <tiwai@...e.com>, alsa-devel@...a-project.org,
        linux-arm-msm@...r.kernel.org, devicetree@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 2/8] ASoC: qdsp6: q6afe: add support to pcm ports



On 09/02/2020 15:47, Adam Serbinski wrote:
> This patch adds support to pcm ports in AFE.
> 
> Signed-off-by: Adam Serbinski <adam@...binski.com>
> CC: Andy Gross <agross@...nel.org>
> CC: Mark Rutland <mark.rutland@....com>
> CC: Liam Girdwood <lgirdwood@...il.com>
> CC: Patrick Lai <plai@...eaurora.org>
> CC: Banajit Goswami <bgoswami@...eaurora.org>
> CC: Jaroslav Kysela <perex@...ex.cz>
> CC: Takashi Iwai <tiwai@...e.com>
> CC: alsa-devel@...a-project.org
> CC: linux-arm-msm@...r.kernel.org
> CC: devicetree@...r.kernel.org
> CC: linux-kernel@...r.kernel.org
> ---
>   sound/soc/qcom/qdsp6/q6afe.c | 246 +++++++++++++++++++++++++++++++++++
>   sound/soc/qcom/qdsp6/q6afe.h |   9 +-
>   2 files changed, 254 insertions(+), 1 deletion(-)
> 

Few general comments.

1>documentation to  "struct afe_param_id_pcm_cfg "
Either we follow kerneldoc style or not add this as we did with other 
similar afe port config structures.
Am okay either way!

2> some of the defines in this patch has no reals users, so we better 
remove all the unused constants.





> diff --git a/sound/soc/qcom/qdsp6/q6afe.c b/sound/soc/qcom/qdsp6/q6afe.c
> index e0945f7a58c8..b53ad14a78fd 100644
> --- a/sound/soc/qcom/qdsp6/q6afe.c
> +++ b/sound/soc/qcom/qdsp6/q6afe.c
> @@ -40,6 +40,7 @@
>   
...

> +/**
> + * q6afe_pcm_port_prepare() - Prepare pcm afe port.
> + *
> + * @port: Instance of afe port
> + * @cfg: PCM configuration for the afe port
> + *
> + */
> +int q6afe_pcm_port_prepare(struct q6afe_port *port, struct q6afe_pcm_cfg *cfg)
> +{
> +	union afe_port_config *pcfg = &port->port_cfg;
> +
> +	pcfg->pcm_cfg.pcm_cfg_minor_version = AFE_API_VERSION_PCM_CONFIG;
> +	pcfg->pcm_cfg.aux_mode = AFE_PORT_PCM_AUX_MODE_PCM;
> +
> +	switch (cfg->fmt & SND_SOC_DAIFMT_MASTER_MASK) {
> +	case SND_SOC_DAIFMT_CBS_CFS:
> +		pcfg->pcm_cfg.sync_src = AFE_PORT_PCM_SYNC_SRC_INTERNAL;
> +		break;
> +	case SND_SOC_DAIFMT_CBM_CFM:
> +		/* CPU is slave */
> +		pcfg->pcm_cfg.sync_src = AFE_PORT_PCM_SYNC_SRC_EXTERNAL;
> +		break;
> +	default:
> +		break;
> +	}
> +
> +	switch (cfg->sample_rate) {
> +	case 8000:
> +		pcfg->pcm_cfg.frame_setting = AFE_PORT_PCM_BITS_PER_FRAME_128;
> +		break;
> +	case 16000:
> +		pcfg->pcm_cfg.frame_setting = AFE_PORT_PCM_BITS_PER_FRAME_64;
> +		break;
> +	}
> +	pcfg->pcm_cfg.quantype = AFE_PORT_PCM_LINEAR_NOPADDING;
> +	pcfg->pcm_cfg.ctrl_data_out_enable = AFE_PORT_PCM_CTRL_DATA_OE_DISABLE;
> +	pcfg->pcm_cfg.reserved = 0;
> +	pcfg->pcm_cfg.sample_rate = cfg->sample_rate;
> +
> +	/* 16 bit mono */
> +	pcfg->pcm_cfg.bit_width = 16;
> +	pcfg->pcm_cfg.num_channels = 1;
> +	pcfg->pcm_cfg.slot_number_mapping[0] = 1;

PCM quantization type and Slot Mapping should come from device tree.



> +
> +	return 0;
> +}
> +EXPORT_SYMBOL_GPL(q6afe_pcm_port_prepare);
> +

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ