Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp325860imm; Tue, 18 Sep 2018 22:50:17 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYxx1267WjYOiNco6p+KfOSCqHAarE2AUw6KamNnbhSEKwjxHPh2XUFznybzLp4sUWwgzhj X-Received: by 2002:a17:902:9307:: with SMTP id bc7-v6mr32257983plb.225.1537336217682; Tue, 18 Sep 2018 22:50:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537336217; cv=none; d=google.com; s=arc-20160816; b=XoptAGmfaGF7gWBQwWQIDu0lYkCGT278f5taRarh4KsljltiFDBjK2nyAEyQBVxI0l uoddM5K8By9O1aX5b0fF6Wb6FI7wHL05EaQG0k8o3O1zLtTzlqlHEydo/mDkZVRoNQ/K Ww3/z92koTbGHvwSYgj1SXqf155IucUxeJrFXLjXPxvCJ/78HtI4gnMN4VdLJjJtBLjc 0u4ENJARc4nriDnkjNxseldTX55csdrDIsKc0i2uvhxTbtq6kfkMjKZPOVDmrCYZm5ZD a0hPNqB88On8sr6SfEKAfEaOUaB9yJiszZ3LhkV50nKqx9UmaIClitUjHd6hn29IHE7x gXCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dmarc-filter :dkim-signature:dkim-signature; bh=A5Q1+PSnFg+YrkmuV/rBMCpNC3FqjufHsCesmyxWh6A=; b=kTSSUJB1ZZvSvX6viJLTLFxZx5XgsUV4ZQbmrDzvk7rRBS2Cu/VF7wY46jjVAhQ4zL CEH/JRgLkIrYi8+dy98HQIXwG/6rVnSspUnhAAiB03dAp47YDyG/jZiC3NeRAb3aYlbm 15HgHN2A/WRFouorukvgHBuHvq9XPBoEH7pAl5pZAIWCr+Be21h+Db46SS2oS8ZN6Gw/ lLkhJyVkqHzwEz7ObLKG7CJPOTbNYq875TWJy9upOtP2PqjZrRPSK8+1iudirN2s6Jtd nnPizwkqDIXjyjqbm+nMZVHpLNM3abY9Xlk4ko7qPEjvayydMPygYPMfWF3Tf8WGMdXU yZYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=iw5iCOZD; dkim=pass header.i=@codeaurora.org header.s=default header.b=Tuw4Y1xx; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s33-v6si21511817pga.302.2018.09.18.22.50.02; Tue, 18 Sep 2018 22:50:17 -0700 (PDT) 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=@codeaurora.org header.s=default header.b=iw5iCOZD; dkim=pass header.i=@codeaurora.org header.s=default header.b=Tuw4Y1xx; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730941AbeISL0C (ORCPT + 99 others); Wed, 19 Sep 2018 07:26:02 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:46228 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726972AbeISL0C (ORCPT ); Wed, 19 Sep 2018 07:26:02 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 92BB0607F7; Wed, 19 Sep 2018 05:49:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1537336185; bh=ShiRCLXYSEuLZ0LPq+UdWgfCsSzyjgSHUs0yQxxoChY=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=iw5iCOZDmxz7Rtbd8InNbju8iTn6BD3EHN2MITdEUx/P0OfUEmXQ09664YxOlL0of 9kqjfYm/sd8zBBH75Vn8AR1xxkpETMRdLTe1Yck6xf1vPt1e1PvVawbtXUsbG5GmPR GluNE1hBpbNyJyrHxhGVVyLfpaVQxwoQgJrcKrqU= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from [10.204.110.203] (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: rohitkr@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 64D9E607F7; Wed, 19 Sep 2018 05:49:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1537336184; bh=ShiRCLXYSEuLZ0LPq+UdWgfCsSzyjgSHUs0yQxxoChY=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=Tuw4Y1xxd1AmP58noouuywIs5719JlhyE7Xvtn1VjvnRmMvNdGruvUjEe3KDcTkRv P+vycGO8RpXyJxhPlWfZA2QyFTlGN+BKvegoVAFfWpVdbDmBTz6P4PaFwVj/7l/JqO RM+KT9oj4He2b6cYwSUBhguXEI8lNWrIaUCb+bUk= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 64D9E607F7 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=rohitkr@codeaurora.org Subject: Re: [alsa-devel] [PATCH v4 14/14] ASoC: qcom: common: move be_hw_fixup to common To: srinivas.kandagatla@linaro.org, lee.jones@linaro.org, robh+dt@kernel.org, broonie@kernel.org Cc: mark.rutland@arm.com, devicetree@vger.kernel.org, alsa-devel@alsa-project.org, bgoswami@codeaurora.org, lgirdwood@gmail.com, linux-kernel@vger.kernel.org, vkoul@kernel.org References: <20180917005727.32728-1-srinivas.kandagatla@linaro.org> <20180917005727.32728-15-srinivas.kandagatla@linaro.org> From: Rohit Kumar Message-ID: <500df2e4-6593-5537-ca08-b20a9b601c47@codeaurora.org> Date: Wed, 19 Sep 2018 11:19:38 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20180917005727.32728-15-srinivas.kandagatla@linaro.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Srinivas, We will add support for vi feedback usecase in sdm845 machine driver where we have to support 4 channel tx data for a particular backend. We should probably keep be_hw_params_fixup in respective machine driver for now to support such requirement. Thanks, Rohit On 9/17/2018 6:27 AM, srinivas.kandagatla@linaro.org wrote: > From: Srinivas Kandagatla > > be_hw_fixup for qdsp is common across mutiple qcom machine drivers, > so move it to common file and remove the redundant code. > > Signed-off-by: Srinivas Kandagatla > --- > sound/soc/qcom/apq8096.c | 15 --------------- > sound/soc/qcom/common.c | 17 +++++++++++++++++ > sound/soc/qcom/sdm845.c | 22 ++-------------------- > 3 files changed, 19 insertions(+), 35 deletions(-) > > diff --git a/sound/soc/qcom/apq8096.c b/sound/soc/qcom/apq8096.c > index daad43f..9cb26aee 100644 > --- a/sound/soc/qcom/apq8096.c > +++ b/sound/soc/qcom/apq8096.c > @@ -20,20 +20,6 @@ struct apq8096_card_data { > bool jack_setup; > }; > > -static int apq8096_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, > - struct snd_pcm_hw_params *params) > -{ > - struct snd_interval *rate = hw_param_interval(params, > - SNDRV_PCM_HW_PARAM_RATE); > - struct snd_interval *channels = hw_param_interval(params, > - SNDRV_PCM_HW_PARAM_CHANNELS); > - > - rate->min = rate->max = 48000; > - channels->min = channels->max = 2; > - > - return 0; > -} > - > static int msm_snd_hw_params(struct snd_pcm_substream *substream, > struct snd_pcm_hw_params *params) > { > @@ -139,7 +125,6 @@ static void apq8096_add_be_ops(struct snd_soc_card *card) > > for (i = 0; i < num_links; i++) { > if (link->no_pcm == 1) { > - link->be_hw_params_fixup = apq8096_be_hw_params_fixup; > link->init = apq8096_init; > link->ops = &apq8096_ops; > } > diff --git a/sound/soc/qcom/common.c b/sound/soc/qcom/common.c > index eb1b9da..ce8e759 100644 > --- a/sound/soc/qcom/common.c > +++ b/sound/soc/qcom/common.c > @@ -3,8 +3,24 @@ > // Copyright (c) 2018, The Linux Foundation. All rights reserved. > > #include > +#include > #include "common.h" > > +static int qcom_snd_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, > + struct snd_pcm_hw_params *params) > +{ > + struct snd_interval *rate = hw_param_interval(params, > + SNDRV_PCM_HW_PARAM_RATE); > + struct snd_interval *channels = hw_param_interval(params, > + SNDRV_PCM_HW_PARAM_CHANNELS); > + > + rate->min = rate->max = 48000; > + channels->min = channels->max = 2; > + params_set_format(params, SNDRV_PCM_FORMAT_S16_LE); > + > + return 0; > +} > + > int qcom_snd_parse_of(struct snd_soc_card *card) > { > struct device_node *np; > @@ -79,6 +95,7 @@ int qcom_snd_parse_of(struct snd_soc_card *card) > } > link->no_pcm = 1; > link->ignore_pmdown_time = 1; > + link->be_hw_params_fixup = qcom_snd_be_hw_params_fixup; > } else { > link->platform_of_node = link->cpu_of_node; > link->codec_dai_name = "snd-soc-dummy-dai"; > diff --git a/sound/soc/qcom/sdm845.c b/sound/soc/qcom/sdm845.c > index 2a781d8..87e150c 100644 > --- a/sound/soc/qcom/sdm845.c > +++ b/sound/soc/qcom/sdm845.c > @@ -11,7 +11,6 @@ > #include "common.h" > #include "qdsp6/q6afe.h" > > -#define DEFAULT_SAMPLE_RATE_48K 48000 > #define DEFAULT_MCLK_RATE 24576000 > #define DEFAULT_BCLK_RATE 12288000 > > @@ -177,32 +176,15 @@ static struct snd_soc_ops sdm845_be_ops = { > .shutdown = sdm845_snd_shutdown, > }; > > -static int sdm845_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, > - struct snd_pcm_hw_params *params) > -{ > - struct snd_interval *rate = hw_param_interval(params, > - SNDRV_PCM_HW_PARAM_RATE); > - struct snd_interval *channels = hw_param_interval(params, > - SNDRV_PCM_HW_PARAM_CHANNELS); > - struct snd_mask *fmt = hw_param_mask(params, SNDRV_PCM_HW_PARAM_FORMAT); > - > - rate->min = rate->max = DEFAULT_SAMPLE_RATE_48K; > - channels->min = channels->max = 2; > - snd_mask_set_format(fmt, SNDRV_PCM_FORMAT_S16_LE); > - > - return 0; > -} > - > static void sdm845_add_be_ops(struct snd_soc_card *card) > { > struct snd_soc_dai_link *link = card->dai_link; > int i, num_links = card->num_links; > > for (i = 0; i < num_links; i++) { > - if (link->no_pcm == 1) { > + if (link->no_pcm == 1) > link->ops = &sdm845_be_ops; > - link->be_hw_params_fixup = sdm845_be_hw_params_fixup; > - } > + > link++; > } > }