Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp2405196pxb; Fri, 8 Oct 2021 07:11:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxGRt6I2F/9K5XVcrJe7xxFmEMd2aFDji1sdzXLdn+i1hcHawMlNqcR1hOS0GcOzCe89R8N X-Received: by 2002:a17:90a:9912:: with SMTP id b18mr12760433pjp.46.1633702295343; Fri, 08 Oct 2021 07:11:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633702295; cv=none; d=google.com; s=arc-20160816; b=em6jcGQuRmuyLX8X02Y1Q3Z7NHv38fbZaurrkZRE/SIk8++K37hPdvYXePkMiT0dWy NUyQUdtLu+6tgBmllSYox5iRrLPGSFvYybwyF53httrkiDc5jpe9yUvsWbEV6pIHwnac WlWLUCPJI8T3DQuHq3L81oJICacQVXcOxZ2F7NMwTn1D0XYZAOQtHMe1m7QZF/R5J9aC 1OAGcd4LyHqPDCi9aqD1pYSfvlQj7rRKJHQ6CjZbnKDG5NvW/cWgcJ3YjyVq+55G1d9C MoRUyr4IGkHSQoTt7wUIL/KOU6xBQJBESJUUB+x0n+P2dkg10IhzycufbA57lXjCdhVH /xjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dmarc-filter:sender:dkim-signature; bh=/8EcjMMg1fXDPDLBOc9wW9+H+ReFOyGTBHlYqRbS+uA=; b=RfjEhqvKcRnWxeZYGxvgFrsm0nsEvFMAmNrEhpaGrnVSN/dVDsAD7pe8Cbv8pC2WUH koPAfpJwd0QpCa3qSOZAEYgi7qptPZyGctnFG8PIn4RFyO++8xYHRPJKkqMGTYCTZlpi DRUA08jAsbZbm8i0d3zUOfbCgx6HxC1gzVJfnG2LmHN8yWy1Xvhc9VWJQ8EpwwGhi5gu LvQuZeATBvXrb2lUh7hyrZ2Vy4E7YYfzTXr4umfq1wGpFInCuXMpV/dG9ar58JjYLURM ROzHHMGbKrenOmLNGxIGuhmQ39juTM1CpjgY1FzSPnnPZWVtUkC49j8WVPDZ51eVUqy7 ftmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=bPKsXgAQ; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d27si3826105pgd.98.2021.10.08.07.11.21; Fri, 08 Oct 2021 07:11:35 -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=@mg.codeaurora.org header.s=smtp header.b=bPKsXgAQ; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237929AbhJHOLn (ORCPT + 99 others); Fri, 8 Oct 2021 10:11:43 -0400 Received: from m43-7.mailgun.net ([69.72.43.7]:17218 "EHLO m43-7.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238060AbhJHOLm (ORCPT ); Fri, 8 Oct 2021 10:11:42 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1633702187; h=References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=/8EcjMMg1fXDPDLBOc9wW9+H+ReFOyGTBHlYqRbS+uA=; b=bPKsXgAQZkN+r/nC03L7u27QTKO2E9Q5EDU5clwS/JDkYmFz1RcY3cSrWpQPdSeUOIT7jhPr bEpm8hNrsoG8fbYlWhDRQKWq+1QalaMA9l4IRyoUS9Cgq9Az4yfTaz01QsG3x+KpM8dSVH6m JbQEjrTIBYk2fxy6GvwCu9NLUZs= X-Mailgun-Sending-Ip: 69.72.43.7 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n07.prod.us-west-2.postgun.com with SMTP id 6160512aff0285fb0a48a20a (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Fri, 08 Oct 2021 14:09:46 GMT Sender: srivasam=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 38215C4361C; Fri, 8 Oct 2021 14:09:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=ALL_TRUSTED,BAYES_00,SPF_FAIL, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from hu-srivasam-hyd.qualcomm.com (unknown [202.46.22.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: srivasam) by smtp.codeaurora.org (Postfix) with ESMTPSA id 3EAD4C43618; Fri, 8 Oct 2021 14:09:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 smtp.codeaurora.org 3EAD4C43618 Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=fail smtp.mailfrom=codeaurora.org From: Srinivasa Rao Mandadapu To: 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, srinivas.kandagatla@linaro.org, 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 Cc: Srinivasa Rao Mandadapu , Venkata Prasad Potturu Subject: [PATCH v3 4/5] ASoC: codecs: tx-macro: Update tx default values Date: Fri, 8 Oct 2021 19:39:03 +0530 Message-Id: <1633702144-19017-5-git-send-email-srivasam@codeaurora.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1633702144-19017-1-git-send-email-srivasam@codeaurora.org> References: <1633702144-19017-1-git-send-email-srivasam@codeaurora.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Update mic control register default values to hardware reset values lpass sc7280. Fixes: c39667ddcfc5 (ASoC: codecs: lpass-tx-macro: add support for lpass tx macro) Signed-off-by: Venkata Prasad Potturu Signed-off-by: Srinivasa Rao Mandadapu --- sound/soc/codecs/lpass-tx-macro.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/sound/soc/codecs/lpass-tx-macro.c b/sound/soc/codecs/lpass-tx-macro.c index d472af1..6742405 100644 --- a/sound/soc/codecs/lpass-tx-macro.c +++ b/sound/soc/codecs/lpass-tx-macro.c @@ -272,7 +272,7 @@ struct tx_macro { static const DECLARE_TLV_DB_SCALE(digital_gain, -8400, 100, -8400); -static const struct reg_default tx_defaults[] = { +static struct reg_default tx_defaults[] = { /* TX Macro */ { CDC_TX_CLK_RST_CTRL_MCLK_CONTROL, 0x00 }, { CDC_TX_CLK_RST_CTRL_FS_CNT_CONTROL, 0x00 }, @@ -1781,9 +1781,10 @@ static const struct snd_soc_component_driver tx_macro_component_drv = { static int tx_macro_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; + struct device_node *np = dev->of_node; struct tx_macro *tx; void __iomem *base; - int ret; + int ret, reg; tx = devm_kzalloc(dev, sizeof(*tx), GFP_KERNEL); if (!tx) @@ -1805,6 +1806,20 @@ static int tx_macro_probe(struct platform_device *pdev) if (IS_ERR(base)) return PTR_ERR(base); + /* Update defaults for lpass sc7280 */ + if (of_device_is_compatible(np, "qcom,sc7280-lpass-tx-macro")) { + for (reg = 0; reg < ARRAY_SIZE(tx_defaults); reg++) { + switch (tx_defaults[reg].reg) { + case CDC_TX_TOP_CSR_SWR_AMIC0_CTL: + case CDC_TX_TOP_CSR_SWR_AMIC1_CTL: + tx_defaults[reg].def = 0x0E; + break; + default: + break; + } + } + } + tx->regmap = devm_regmap_init_mmio(dev, base, &tx_regmap_config); dev_set_drvdata(dev, tx); -- Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc., is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.