Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp3941689ybv; Mon, 10 Feb 2020 09:14:09 -0800 (PST) X-Google-Smtp-Source: APXvYqz7KL8Wq2HYOoorMEE4cp2VdzTY/d9qapvnhi0aosTUS0YDFlnsoyi7FNQoR5cIFlZOPe4I X-Received: by 2002:a9d:5d07:: with SMTP id b7mr1881194oti.209.1581354848870; Mon, 10 Feb 2020 09:14:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581354848; cv=none; d=google.com; s=arc-20160816; b=yhqHZ87T2EM0IF4uw0Kr+zCcZ3dVvTgjabvuMRGLpNkCFggmpTMi0OT2yrUXq0avBM YGlJV/RWzeLASu2CBfiNTF/uC2giQCUJAAg7BYy0nHGF51KzyeQ68AYtH4/l49ile+t+ 6lSqAvDz3GSrEcTaIlXFDh2YbFt1gLN8p8mIghf7Z1ziQ8zBtBOASquXLuNHooqxGcnO b2FFqaZeQ2l4ZRrJAv1g5pB67t0eBxuaubw22QG6Oqhj9jI5i+zdfvqymQCNk+MNT83T QEGOKQCskN44itTOrsThp/m3dqAPLRln1YSL/ivGd41Zq58eD6HCXLHsCpMp9h5xAFdd 2LJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=dT6SGlIAayRtxR7LTqZPmk0Gfcmis2qaH+GTfxwu2fw=; b=LqISdmzZQbwS365k6H0GJKhcLXAV2hKb/MUHbNpDt99FbkZxZXTrkrVwnpvwRlFzkA JaTvQ70L0pJoDkig4bQKQgv9Yf80dyw8wWaDpW7xoDuXzSCPT/alyyqvzfdj8IQFC2gI +uZBvaSk7m8msIpEwt8jrYUNBMOVCeg2hs/13lngsneZmeSec8f7kUQ54pwiEGVeFJNH e7yic8LZVt83nmMr7M0DUvrQLQExGUuPcNMMXt+m80V/x7d0d5d+BwVJsRbqP6bE3SkC AUZgtWUZOpDRmFMtg8F9JWd22nL9LPFI3BhwFihDf7Z//7EZ90ZXDqZ70qzUlTG0O2fT L4bQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LApxvCvQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 64si466345otx.50.2020.02.10.09.13.56; Mon, 10 Feb 2020 09:14:08 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LApxvCvQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728028AbgBJRNl (ORCPT + 99 others); Mon, 10 Feb 2020 12:13:41 -0500 Received: from mail-wr1-f66.google.com ([209.85.221.66]:40259 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728006AbgBJRNk (ORCPT ); Mon, 10 Feb 2020 12:13:40 -0500 Received: by mail-wr1-f66.google.com with SMTP id t3so8755345wru.7 for ; Mon, 10 Feb 2020 09:13:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=dT6SGlIAayRtxR7LTqZPmk0Gfcmis2qaH+GTfxwu2fw=; b=LApxvCvQZSOS8im3yL3XTp3sia6J46w3IYYvV71fXEnLvHAOrAN1whLz/i/42Dov04 JGkUaMrQrz1JINwmFOqiDDGtJD/NFaUCOs1pZ9Wo03nfmMxCsx+BnTe15r4sig6p7I48 KHNehvY4fwWNlrIGMZsQMuBnw0DyEae5fgTRP+F/R/3Hl2ZgIgr0q4EOzQ3BjwnpFrYH Jc5j4pioKx8ZMHeZ/S7AEg8RyCbIB/GDa8QEg8b/1xqTpzi42oqmI8Rj1DF5kGQH0paw MyCUak2nt328yKNe+mNvtVbv7+I55GDbHz6ZsValEHju/AGpImAtW1fKveV/02Fm7Nkd q83w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=dT6SGlIAayRtxR7LTqZPmk0Gfcmis2qaH+GTfxwu2fw=; b=WEq73XU4MPjTRDT3p5ngVc5P9IzUIrn5yZmol2OMFxRpQFOwVu56luhGxNeHMf3j+U m63xpD5nP+6gZpgTYe975xSwMXhwWMw4Ujo+A1aY7TmoyzKchRhhyFQVJIa68/HPE+cp bhs6pkOUPPpV9s3JSRGjysOZ0kdCbQgkNSCFECgJonKkBaKLBHfOQKY0vhUK1Qdo4LfD /4Sv7KzxfSvjYRDtKFNFqSEw2HYMrPgZ0Qp+ThreD+nYC43af0YEmd9vOXE0B2a9qGWB ecnnvGNmXVSZmgvA4tgxB/9hBakptAh0Njl/IRT6ge/p1EMvvmvu15OSC+4JM4wgml0V 9VgA== X-Gm-Message-State: APjAAAXOFe13pWsnto62TNyEEqf9CxB2W7I72rqifpt0Jxk4Xs77s9/1 SUHfR92sBH4wn3aU8akdwCd6SoG9kyQ= X-Received: by 2002:a5d:55c1:: with SMTP id i1mr3193454wrw.347.1581354818558; Mon, 10 Feb 2020 09:13:38 -0800 (PST) Received: from [192.168.86.34] (cpc89974-aztw32-2-0-cust43.18-1.cable.virginm.net. [86.30.250.44]) by smtp.googlemail.com with ESMTPSA id a5sm1169894wmb.37.2020.02.10.09.13.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Feb 2020 09:13:37 -0800 (PST) Subject: Re: [PATCH v2 2/8] ASoC: qdsp6: q6afe: add support to pcm ports To: Adam Serbinski , Mark Brown , Rob Herring , Bjorn Andersson Cc: Andy Gross , Mark Rutland , Liam Girdwood , Patrick Lai , Banajit Goswami , Jaroslav Kysela , Takashi Iwai , alsa-devel@alsa-project.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org References: <20200207205013.12274-1-adam@serbinski.com> <20200209154748.3015-1-adam@serbinski.com> <20200209154748.3015-3-adam@serbinski.com> From: Srinivas Kandagatla Message-ID: <4f0c3528-c7cd-37a9-7ca0-e30eb8e6d103@linaro.org> Date: Mon, 10 Feb 2020 17:13:36 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20200209154748.3015-3-adam@serbinski.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/02/2020 15:47, Adam Serbinski wrote: > This patch adds support to pcm ports in AFE. > > Signed-off-by: Adam Serbinski > CC: Andy Gross > CC: Mark Rutland > CC: Liam Girdwood > CC: Patrick Lai > CC: Banajit Goswami > CC: Jaroslav Kysela > CC: Takashi Iwai > CC: alsa-devel@alsa-project.org > CC: linux-arm-msm@vger.kernel.org > CC: devicetree@vger.kernel.org > CC: linux-kernel@vger.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); > +