Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp5162633pxj; Wed, 9 Jun 2021 10:32:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwIUBT9Z7VH1ifL+lcrVeZsFCfA03rAvlG22slQOM9tn3Aloy84WFaPD3P8LdG15ihmWIRn X-Received: by 2002:a05:6402:511:: with SMTP id m17mr531341edv.1.1623259932201; Wed, 09 Jun 2021 10:32:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623259932; cv=none; d=google.com; s=arc-20160816; b=m/zMM2Atb1DINtoInlsweO1V3wo2QrP1glPcNTRnxdI2ZM4FU1BBiKN8Fgti+nbsKS MqDl88+odTHylXdy6VFwivAWVJPOboyx7//NVGaMefjixtGk5ef2ExGMiNYfkRnu70vh c6Hwy8u4QG0b0EFBBiLkQxUN488ko9t3R2OIRosfHA2EHnKAFWhGNd5tKR5uaKM6gQZm DMrUNo02Jr0QYt+txzdxvIGcLi+ZwtB0FGO2tMaoRSR7SM5VMXY+mzDRnsw+fqLA2XCv hTQWdGF15IwgnVYGbETO4aBV/7JNjDrYAk+iGIZI4JAHJM6arJhPUO12w05X58ckw02N UE6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :to:subject:dkim-signature; bh=lUdke6htwmhA5dwmH5nqrl72FFCl9nDLwry0d6NYq10=; b=Q07h5sgZWGFV+7MdNAg0TZLhUHkAw53i2+LxzhIBzawGfxRgBZjwBXG5dJOVt9mge4 FtoGqyX/3VqwC1YtezKMiBlElqXzglZ7l9Pj0uic5SGsYtqNAzsA7hduVpeqt2vkLeHQ wKaI3GbNdVdE2FrI/Ss3Dn9cRiY64MrLdMZKkePbVWfjXmXs/Y9tLoosiTqgK2K/RCcf aNmsDoydJdBwc3Rzsxzt0OeuAI5Iv1iJztp13HucL6onTd0+uXCOzHGaaQZ3goRGktL5 96MvTJvMowuHbQDu42eVkkC4fsXsE84DgK2B0eif9INnjiLMrbZdu6UWe7dFflN0VKrF a8cQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=R8mGoDMw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id l18si280855ejr.283.2021.06.09.10.31.46; Wed, 09 Jun 2021 10:32:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=R8mGoDMw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S235938AbhFINff (ORCPT + 99 others); Wed, 9 Jun 2021 09:35:35 -0400 Received: from mail-wr1-f48.google.com ([209.85.221.48]:33492 "EHLO mail-wr1-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236421AbhFINfZ (ORCPT ); Wed, 9 Jun 2021 09:35:25 -0400 Received: by mail-wr1-f48.google.com with SMTP id a20so25580155wrc.0 for ; Wed, 09 Jun 2021 06:33:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=lUdke6htwmhA5dwmH5nqrl72FFCl9nDLwry0d6NYq10=; b=R8mGoDMwBBV4hbsRgCugAOZRINIEA08feaDk66tA1/lvBXWu/S4mRWoZjlLTMQUcZb B8+GK7X12x72JgBelnNELBMtYhTs4wrfoQDGA/Pzy+e5QoYH4e5G0JJpPwKEp1gn7QPA JR8mJ9uO0uI17pQoEOzhV6Hp0ubeniwuLMc/BdnbdXiZgLA6EO9I4ziIrnSWDn3h1nK2 eljT/7K45PN6HgdIetUOoiIbNLJ0tthL1GCmIrOpOQS/umywKSxrGq1FbEpazIafkUkx gFaDXtSIEFArgmBZRXSkSaJvnZE6tb2BsLMBxTNXEmgAR2RbKsl6FC08bkKGqZQOkmfo D+/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=lUdke6htwmhA5dwmH5nqrl72FFCl9nDLwry0d6NYq10=; b=TfEDc9KQzEwJbN35zUOeM3EKjz35D0Cbb/SDZoHC+9tzdLT2lS5ENWaQX8+lDVkkHZ QKw0n4wIYxZnVdmEX3GwG3lTYb1XkKzMoNgOL3P/8KpEeAqf/FC8nF8PXOJltV2V3MUN Nwku4CqsRs+3hb6Xv22I4571G7qTmPkLAAapTthQ6JtornQvOAUOk/0CfiRLyaFYM75X jd7Rke1KooNJDxfmc0ShNbQCuyLs7wZs/wc5kqZ5gpI5qJQ/dKK3IdmwVLnzdrP1qIzC 6tB/JXKBRsDSCt7F6sZW4gvYQZsPMTUzr6vtinO8r3U/xH9NDOpeh30CZsuzbArLZ7ZO Y8Mg== X-Gm-Message-State: AOAM53046oTS+zKEySFWHVi2U0S9PfR09SpgH6SSTLMw8hakn2Rp3B0d GFW5EhzWON6Dwfrw8ycwpJWv2A== X-Received: by 2002:a5d:59af:: with SMTP id p15mr18312086wrr.292.1623245550059; Wed, 09 Jun 2021 06:32:30 -0700 (PDT) Received: from [192.168.86.34] (cpc86377-aztw32-2-0-cust226.18-1.cable.virginm.net. [92.233.226.227]) by smtp.googlemail.com with ESMTPSA id v18sm26112965wrb.10.2021.06.09.06.32.28 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 Jun 2021 06:32:29 -0700 (PDT) Subject: Re: [PATCH v3] ASoC: qcom: Add four speaker support on MI2S secondary To: Srinivasa Rao Mandadapu , agross@kernel.org, bjorn.andersson@linaro.org, lgirdwood@gmail.com, broonie@kernel.org, robh+dt@kernel.org, plai@codeaurora.org, bgoswami@codeaurora.org, perex@perex.cz, tiwai@suse.com, rohitkr@codeaurora.org, linux-arm-msm@vger.kernel.org, alsa-devel@alsa-project.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, swboyd@chromium.org, judyhsiao@chromium.org References: <20210609133039.4648-1-srivasam@codeaurora.org> From: Srinivas Kandagatla Message-ID: Date: Wed, 9 Jun 2021 14:32:28 +0100 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: <20210609133039.4648-1-srivasam@codeaurora.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/06/2021 14:30, Srinivasa Rao Mandadapu wrote: > Add four speaker support on MI2S secondary block > by using I2S SD1 line on gpio52 pin, and add channel map > control support in the lpass-cpu audio driver. > > Signed-off-by: Srinivasa Rao Mandadapu > --- LGTM, Reviewed-by: Srinivas Kandagatla --srini > Changes Since V2: > -- Added empty entry at the end of channel maps array. > Changes Since V1: > -- removed set_channel_map/get_channel_map implementation as default kcontrols > added in pcm_new API. > sound/soc/qcom/lpass-cpu.c | 33 +++++++++++++++++++++++++++++++++ > sound/soc/qcom/lpass-sc7180.c | 1 + > sound/soc/qcom/lpass.h | 2 ++ > 3 files changed, 36 insertions(+) > > diff --git a/sound/soc/qcom/lpass-cpu.c b/sound/soc/qcom/lpass-cpu.c > index c62d2612e8f5..aff39c9f6326 100644 > --- a/sound/soc/qcom/lpass-cpu.c > +++ b/sound/soc/qcom/lpass-cpu.c > @@ -29,6 +29,15 @@ > #define LPASS_CPU_I2S_SD0_1_2_MASK GENMASK(2, 0) > #define LPASS_CPU_I2S_SD0_1_2_3_MASK GENMASK(3, 0) > > +/* > + * Channel maps for Quad channel playbacks on MI2S Secondary > + */ > +static struct snd_pcm_chmap_elem lpass_quad_chmaps[] = { > + { .channels = 4, > + .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_RL, > + SNDRV_CHMAP_FR, SNDRV_CHMAP_RR } }, > + { } > +}; > static int lpass_cpu_init_i2sctl_bitfields(struct device *dev, > struct lpaif_i2sctl *i2sctl, struct regmap *map) > { > @@ -324,6 +333,25 @@ const struct snd_soc_dai_ops asoc_qcom_lpass_cpu_dai_ops = { > }; > EXPORT_SYMBOL_GPL(asoc_qcom_lpass_cpu_dai_ops); > > +int lpass_cpu_pcm_new(struct snd_soc_pcm_runtime *rtd, > + struct snd_soc_dai *dai) > +{ > + int ret; > + struct snd_soc_dai_driver *drv = dai->driver; > + struct lpass_data *drvdata = snd_soc_dai_get_drvdata(dai); > + > + if (drvdata->mi2s_playback_sd_mode[dai->id] == LPAIF_I2SCTL_MODE_QUAD01) { > + ret = snd_pcm_add_chmap_ctls(rtd->pcm, SNDRV_PCM_STREAM_PLAYBACK, > + lpass_quad_chmaps, drv->playback.channels_max, 0, > + NULL); > + if (ret < 0) > + return ret; > + } > + > + return 0; > +} > +EXPORT_SYMBOL_GPL(lpass_cpu_pcm_new); > + > int asoc_qcom_lpass_cpu_dai_probe(struct snd_soc_dai *dai) > { > struct lpass_data *drvdata = snd_soc_dai_get_drvdata(dai); > @@ -856,6 +884,11 @@ int asoc_qcom_lpass_cpu_platform_probe(struct platform_device *pdev) > PTR_ERR(drvdata->mi2s_bit_clk[dai_id])); > return PTR_ERR(drvdata->mi2s_bit_clk[dai_id]); > } > + if (drvdata->mi2s_playback_sd_mode[dai_id] == > + LPAIF_I2SCTL_MODE_QUAD01) { > + variant->dai_driver[dai_id].playback.channels_min = 4; > + variant->dai_driver[dai_id].playback.channels_max = 4; > + } > } > > /* Allocation for i2sctl regmap fields */ > diff --git a/sound/soc/qcom/lpass-sc7180.c b/sound/soc/qcom/lpass-sc7180.c > index 8c168d3c589e..77a556b27cf0 100644 > --- a/sound/soc/qcom/lpass-sc7180.c > +++ b/sound/soc/qcom/lpass-sc7180.c > @@ -58,6 +58,7 @@ static struct snd_soc_dai_driver sc7180_lpass_cpu_dai_driver[] = { > }, > .probe = &asoc_qcom_lpass_cpu_dai_probe, > .ops = &asoc_qcom_lpass_cpu_dai_ops, > + .pcm_new = lpass_cpu_pcm_new, > }, { > .id = LPASS_DP_RX, > .name = "Hdmi", > diff --git a/sound/soc/qcom/lpass.h b/sound/soc/qcom/lpass.h > index 83b2e08ade06..623ddccdafff 100644 > --- a/sound/soc/qcom/lpass.h > +++ b/sound/soc/qcom/lpass.h > @@ -259,5 +259,7 @@ void asoc_qcom_lpass_cpu_platform_shutdown(struct platform_device *pdev); > int asoc_qcom_lpass_cpu_platform_probe(struct platform_device *pdev); > int asoc_qcom_lpass_cpu_dai_probe(struct snd_soc_dai *dai); > extern const struct snd_soc_dai_ops asoc_qcom_lpass_cpu_dai_ops; > +int lpass_cpu_pcm_new(struct snd_soc_pcm_runtime *rtd, > + struct snd_soc_dai *dai); > > #endif /* __LPASS_H__ */ >