Received: by 2002:ac0:e34a:0:0:0:0:0 with SMTP id g10csp292520imn; Thu, 28 Jul 2022 00:15:34 -0700 (PDT) X-Google-Smtp-Source: AGRyM1ui6Z9mBENPF1y8NwLb+6dG3SPwytV0mfSm4rWBQ2Tw2/GoX+vzkfGp5JDTPAz/LLsMcXGZ X-Received: by 2002:a17:902:d4c2:b0:16d:798a:51c2 with SMTP id o2-20020a170902d4c200b0016d798a51c2mr17109247plg.15.1658992533842; Thu, 28 Jul 2022 00:15:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658992533; cv=none; d=google.com; s=arc-20160816; b=U3Yk6S3Uon4WpnBCCa5OgQopEI1e4R7gTNIz4rgmqyXnlQJZdfhVEXf5mclajJNu6w qQ4CZALLjyANHNb7mFRaOp2XhH9rJyIYRLDxGwHbY1nCAheehbgIsSTzVu14aW//jQW2 3UXwG9SJQ06dFWyzaZxmySi8XACEK5XxugjHckNGivRnDh70Nej0P/SHs0PQQ86Bf1ax gicrmjFfvuRrSrXv8MVPTXZrz09xCZEm/QMZWtBJgKNS3dUBFGOasx96zGFZ8Lql2DzI ZD5SHQpixXQ4EprW1fpPRpDGrcywfiMsI8Zoeo/fJZMKZzQxvHk4ePf/9bGr3bcUGXpZ KFKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from :dkim-signature; bh=R4lt1h/LtXD8XZCgX0MqvcNhHlPUrXLCVf+2J1eJ5RA=; b=XwTu611X6SDWNlHZT0iohHI/7B7wgSQMKP8ytExry7BtCC0HLzFaVq/vHiOsNLesh9 E+TCQS6Q9kYD0WYJD03fNTMbCk5eO0txjtGQoA9+WRYLu6lFBHKvUvDu+/mD4F9gYV46 CQ5bgNTt6ixydYpKRXD97XXcGo19JTWnvg3K4IJjWAdGl6ymcj5AGY6EoapfTAqwGcNj MAt7KJt+1AqwKq4C1RIUDKmBp6cZadNRJjkJAxFJWa3nxI0C3MYFxgifD7urAB6anJe9 OIpQXAh+MiJWbpfSygzSNHR9SDJJdTYGWYx0uF/pB23n+LogH65GN8dn8VvyCk2rS09d xuJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=LUl4HB7a; 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=quicinc.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h185-20020a6383c2000000b0041b3478da69si333902pge.160.2022.07.28.00.15.15; Thu, 28 Jul 2022 00:15:33 -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=@quicinc.com header.s=qcdkim header.b=LUl4HB7a; 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=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233059AbiG1HLD (ORCPT + 99 others); Thu, 28 Jul 2022 03:11:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41402 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231701AbiG1HK6 (ORCPT ); Thu, 28 Jul 2022 03:10:58 -0400 Received: from alexa-out-sd-02.qualcomm.com (alexa-out-sd-02.qualcomm.com [199.106.114.39]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8781DD132; Thu, 28 Jul 2022 00:10:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1658992257; x=1690528257; h=from:to:cc:subject:date:message-id:mime-version; bh=R4lt1h/LtXD8XZCgX0MqvcNhHlPUrXLCVf+2J1eJ5RA=; b=LUl4HB7awGDJO7ZT3dM+uFHqZqZhXyvs8bFO2qZfgODoMVUVv84Vv2F1 NB6HxFc5Sfxm8Qb/Xg+5kJevT+3FQMbKgP/msxqtt3a5TSDB9v1V9MLOE XxysGtHps01KqlPSHpxZRWmrWMuuMZM9yO0ucXEziyEKDEmH/+80Bke4O Y=; Received: from unknown (HELO ironmsg03-sd.qualcomm.com) ([10.53.140.143]) by alexa-out-sd-02.qualcomm.com with ESMTP; 28 Jul 2022 00:10:57 -0700 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg03-sd.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Jul 2022 00:10:56 -0700 Received: from nalasex01a.na.qualcomm.com (10.47.209.196) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Thu, 28 Jul 2022 00:10:55 -0700 Received: from hu-srivasam-hyd.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Thu, 28 Jul 2022 00:10:50 -0700 From: Srinivasa Rao Mandadapu To: , , , , , , , , , , , , , , , , CC: Srinivasa Rao Mandadapu Subject: [PATCH] ASoC: qcom: SC7280: Add support for external DMIC bias supply Date: Thu, 28 Jul 2022 12:40:33 +0530 Message-ID: <1658992233-28372-1-git-send-email-quic_srivasam@quicinc.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=ham 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 Update SC7280 machine driver for enabling external mic bias supply, Which is required for villager rev boards. Signed-off-by: Srinivasa Rao Mandadapu --- sound/soc/qcom/sc7280.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/sound/soc/qcom/sc7280.c b/sound/soc/qcom/sc7280.c index da7469a..6404e94 100644 --- a/sound/soc/qcom/sc7280.c +++ b/sound/soc/qcom/sc7280.c @@ -33,6 +33,7 @@ struct sc7280_snd_data { struct snd_soc_jack hdmi_jack; bool jack_setup; bool stream_prepared[LPASS_MAX_PORTS]; + struct regulator *vdd_supply; }; static void sc7280_jack_free(struct snd_jack *jack) @@ -345,6 +346,24 @@ static int sc7280_snd_startup(struct snd_pcm_substream *substream) return ret; } +static int sc7280_dmic_micbias(struct snd_soc_dapm_widget *w, + struct snd_kcontrol *kcontrol, int event) +{ + struct snd_soc_card *card = w->dapm->card; + struct sc7280_snd_data *data = snd_soc_card_get_drvdata(card); + int ret = 0; + + switch (event) { + case SND_SOC_DAPM_PRE_PMU: + ret = regulator_enable(data->vdd_supply); + break; + case SND_SOC_DAPM_POST_PMD: + ret = regulator_disable(data->vdd_supply); + break; + } + return ret; +} + static const struct snd_soc_ops sc7280_ops = { .startup = sc7280_snd_startup, .hw_params = sc7280_snd_hw_params, @@ -356,6 +375,7 @@ static const struct snd_soc_ops sc7280_ops = { static const struct snd_soc_dapm_widget sc7280_snd_widgets[] = { SND_SOC_DAPM_HP("Headphone Jack", NULL), SND_SOC_DAPM_MIC("Headset Mic", NULL), + SND_SOC_DAPM_MIC("PMIC BIAS", sc7280_dmic_micbias), }; static int sc7280_snd_platform_probe(struct platform_device *pdev) @@ -389,6 +409,10 @@ static int sc7280_snd_platform_probe(struct platform_device *pdev) link->ops = &sc7280_ops; } + data->vdd_supply = devm_regulator_get(dev, "vdd-dmic-bias"); + if (IS_ERR(data->vdd_supply) + return PTR_ERR(data->vdd_supply); + return devm_snd_soc_register_card(dev, card); } -- 2.7.4