Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp676015rwn; Thu, 8 Sep 2022 07:20:12 -0700 (PDT) X-Google-Smtp-Source: AA6agR7e8RTmpnpVFCh0DTq0Wfuilmwm9H+8YpYDQKiLhy6J8fpmjJ+I7z3uT9NNDuD8t0/nnbfV X-Received: by 2002:a17:90b:3b8a:b0:1f5:56c3:54ac with SMTP id pc10-20020a17090b3b8a00b001f556c354acmr4604348pjb.2.1662646812383; Thu, 08 Sep 2022 07:20:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662646812; cv=none; d=google.com; s=arc-20160816; b=BUOs7phdpYmr0Gt7BaNszKj3+R7FOCnFbMp3KjDMZUfB2M+yVVI1W0C7Mc7XwW/qQr 3FgFKDsHoRMXzzBTyl4tDfzJorbVa9u99TIkEMwIMXeTS/jW08pErYtKQ7iY7uAt8g8S 4RiX2qB0TU/PUu2OB/wmJksJU5QKhuyEQR06rTrRsoTZgh0rdlR1d7bF5eFhFablbd97 zkDu/oRyveI56Snb+L3L4W3LVfjtMVkcimjaJp3imNTRRTD+HlEftG9yxUjvDUMpcJEj vND4NCJtdyeHmuhuQfHzGLzADKC5URQz8xe73L4gNBMWAauQ8mJB6IcaNWipjRFXzLLC bjCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=doeIJUD+jbYQvgjjpe7u4ffnL59KvvLjqzzYR74mkK4=; b=tMBoOpzHqMs9co9CwkzSaQUOX2Mw16lG2sj9RTyDF2Hbtla1SmK19DC/LSFP37tnKH wBVADSTEeEye1quo/8iviAd27dZcPNK3e2qltSnuftkKqzun/CCWx6B7huHlleNFZkZc 4RRY7jsvWdK29fOmzQjVLDeErsTFLS4EjVGIdhr15yzJQg1nS+urIAwQ2LmTNemMfmmN U3LwLqOmGML/BxpkLaYW6vSFYNtN4zs/ssj2G9KJ3Dd7qAtSvKQCCN4ygR3lH8ngBBxg WlD2x2fGZutUNAk28HCMKcBKRWZTaPPdA9l114fZGwTzG8XUA2yCAaJpvh0EBeQXTBe7 j1vQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=avEu5zd4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i4-20020a1709026ac400b00176b7e66c9asi10175548plt.155.2022.09.08.07.20.00; Thu, 08 Sep 2022 07:20:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=avEu5zd4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S232566AbiIHN3O (ORCPT + 99 others); Thu, 8 Sep 2022 09:29:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58064 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232301AbiIHN2y (ORCPT ); Thu, 8 Sep 2022 09:28:54 -0400 Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com [IPv6:2a00:1450:4864:20::134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1245E11CD49 for ; Thu, 8 Sep 2022 06:28:49 -0700 (PDT) Received: by mail-lf1-x134.google.com with SMTP id u18so15423198lfo.8 for ; Thu, 08 Sep 2022 06:28:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date; bh=doeIJUD+jbYQvgjjpe7u4ffnL59KvvLjqzzYR74mkK4=; b=avEu5zd48R1MzFTlnzPIqcMco2yUpeclIORdLdB1h6dIPhw3W9n3hIfKj4vBe6WgX8 5rFJnL2HA5mXPxj0if1BujlwcgQd4J7FrrDPBDE91rBor7br/WgDZEmg4sUbIkQb72Ja HW2OhkohN88xbyNgAY7NUrGdrtn7TtrjWAAOSExKah0Bc79IrkB2/XTPNYCrYS33DHMN SBGEcEbqWoVvhcClDYrvxkjV0c/V9exuqZlBI5Vskm4qvQtBX7m15dHQYAykeFmpENNJ 6q+A2s6G+DaqfzXswG+tvbPl9V/UAae1UcQwJg7YQnmGxyruIttoaSAEINsWLWWCVsXS sMYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date; bh=doeIJUD+jbYQvgjjpe7u4ffnL59KvvLjqzzYR74mkK4=; b=hh6myIlyPD5cmEt8SAty1mnA8KtTK8amO0QfIFgesqebM48wj5qJ1H0sSOp12xEUtV h53GHV0ggk3hj0VRK0LFPeHHg6tMwQKTeqaRLiACOAlkrJxl1gEilAXk8T3cMDwvR7Tg i2i4bD54goPXid17E+PUxHQviBmYb9tI7VyZcocLvqn5JAVaFfGz5lnDDLI4XwPQnFsE uGMxEfRaZ8oVNsJ5pf++/TM2XiMhiOHVb2mXt0l9ZlLtjDnEdMHqrby8Cid93zf7hodP Yarm7xjrFFiSsCg7JsS4nsXIzgkhD6mVCn+0Q54kVk1K3C9bM9IdmubQ9OJdUZgLo9MF afxA== X-Gm-Message-State: ACgBeo2/uezgI3sH5I4uQUZQ/ggSJCKw2UDGqdQp9oLFPloLbT8xc+e9 uqr3Is6Ex3KDR7ykGzFBcGOkcA== X-Received: by 2002:a05:6512:a8e:b0:492:b3e5:adcd with SMTP id m14-20020a0565120a8e00b00492b3e5adcdmr2723240lfu.374.1662643728120; Thu, 08 Sep 2022 06:28:48 -0700 (PDT) Received: from [192.168.0.21] (78-11-189-27.static.ip.netia.com.pl. [78.11.189.27]) by smtp.gmail.com with ESMTPSA id r7-20020ac25f87000000b00492c017de43sm3036675lfe.127.2022.09.08.06.28.47 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 08 Sep 2022 06:28:47 -0700 (PDT) Message-ID: <7206917a-1250-8669-0b25-fe5c18bbc98f@linaro.org> Date: Thu, 8 Sep 2022 15:28:46 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.13.0 Subject: Re: [PATCH v2 4/4] ASoC: qcom: add machine driver for sc8280xp Content-Language: en-US To: Srinivas Kandagatla , broonie@kernel.org Cc: lgirdwood@gmail.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, bgoswami@quicinc.com, perex@perex.cz, tiwai@suse.com, linux-arm-msm@vger.kernel.org, alsa-devel@alsa-project.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org References: <20220906165508.30801-1-srinivas.kandagatla@linaro.org> <20220906165508.30801-5-srinivas.kandagatla@linaro.org> From: Krzysztof Kozlowski In-Reply-To: <20220906165508.30801-5-srinivas.kandagatla@linaro.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/09/2022 18:55, Srinivas Kandagatla wrote: > Add machine driver for sc8280xp SoC. > > This intial supports only includes WSA883x Speakers and WCD938x based headset. > > Signed-off-by: Srinivas Kandagatla > --- > sound/soc/qcom/Kconfig | 11 +++ > sound/soc/qcom/Makefile | 2 + > sound/soc/qcom/sc8280xp.c | 157 ++++++++++++++++++++++++++++++++++++++ > 3 files changed, 170 insertions(+) > create mode 100644 sound/soc/qcom/sc8280xp.c > > diff --git a/sound/soc/qcom/Kconfig b/sound/soc/qcom/Kconfig > index 750653404ba3..d0e59e07b1fc 100644 > --- a/sound/soc/qcom/Kconfig > +++ b/sound/soc/qcom/Kconfig > @@ -173,6 +173,17 @@ config SND_SOC_SM8250 > SM8250 SoC-based systems. > Say Y if you want to use audio device on this SoCs. > > +config SND_SOC_SC8280XP > + tristate "SoC Machine driver for SC8280XP boards" > + depends on QCOM_APR && SOUNDWIRE I think APR is not build time dependency, so: depends on QCOM_APR || COMPILE_TEST depends on SOUNDWIRE > + depends on COMMON_CLK > + select SND_SOC_QDSP6 > + select SND_SOC_QCOM_COMMON > + help > + To add support for audio on Qualcomm Technologies Inc. > + SC8280XP SoC-based systems. > + Say Y if you want to use audio device on this SoCs. > + > config SND_SOC_SC7180 > tristate "SoC Machine driver for SC7180 boards" > depends on I2C && GPIOLIB > diff --git a/sound/soc/qcom/Makefile b/sound/soc/qcom/Makefile > index 8b7b876899a8..8b97172cf990 100644 > --- a/sound/soc/qcom/Makefile > +++ b/sound/soc/qcom/Makefile > @@ -26,6 +26,7 @@ snd-soc-sc7180-objs := sc7180.o > snd-soc-sc7280-objs := sc7280.o > snd-soc-sdm845-objs := sdm845.o > snd-soc-sm8250-objs := sm8250.o > +snd-soc-sc8280xp-objs := sc8280xp.o > snd-soc-qcom-common-objs := common.o > > obj-$(CONFIG_SND_SOC_STORM) += snd-soc-storm.o > @@ -33,6 +34,7 @@ obj-$(CONFIG_SND_SOC_APQ8016_SBC) += snd-soc-apq8016-sbc.o > obj-$(CONFIG_SND_SOC_MSM8996) += snd-soc-apq8096.o > obj-$(CONFIG_SND_SOC_SC7180) += snd-soc-sc7180.o > obj-$(CONFIG_SND_SOC_SC7280) += snd-soc-sc7280.o > +obj-$(CONFIG_SND_SOC_SC8280XP) += snd-soc-sc8280xp.o > obj-$(CONFIG_SND_SOC_SDM845) += snd-soc-sdm845.o > obj-$(CONFIG_SND_SOC_SM8250) += snd-soc-sm8250.o > obj-$(CONFIG_SND_SOC_QCOM_COMMON) += snd-soc-qcom-common.o > diff --git a/sound/soc/qcom/sc8280xp.c b/sound/soc/qcom/sc8280xp.c > new file mode 100644 > index 000000000000..ade44ad7c585 > --- /dev/null > +++ b/sound/soc/qcom/sc8280xp.c > @@ -0,0 +1,157 @@ > +// SPDX-License-Identifier: GPL-2.0 > +// Copyright (c) 2022, Linaro Limited > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include "qdsp6/q6afe.h" > +#include "common.h" > + > +#define DRIVER_NAME "sc8280xp" > + > +struct sc8280xp_snd_data { > + bool stream_prepared[AFE_PORT_MAX]; > + struct snd_soc_card *card; > + struct sdw_stream_runtime *sruntime[AFE_PORT_MAX]; > + struct snd_soc_jack jack; > + bool jack_setup; > +}; > + > +static int sc8280xp_snd_init(struct snd_soc_pcm_runtime *rtd) > +{ > + struct sc8280xp_snd_data *data = snd_soc_card_get_drvdata(rtd->card); > + > + return qcom_snd_wcd_jack_setup(rtd, &data->jack, &data->jack_setup); > +} > + > +static int sc8280xp_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, > + struct snd_pcm_hw_params *params) > +{ > + struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0); > + 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 = 2; > + channels->max = 2; > + switch (cpu_dai->id) { > + case TX_CODEC_DMA_TX_0: > + case TX_CODEC_DMA_TX_1: > + case TX_CODEC_DMA_TX_2: > + case TX_CODEC_DMA_TX_3: > + channels->min = 1; > + break; > + default: > + break; > + } > + > + Just one blank line. Best regards, Krzysztof