From patchwork Fri Oct 28 20:55:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= X-Patchwork-Id: 13024310 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4E058C38A02 for ; Fri, 28 Oct 2022 20:58:30 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 79E831637; Fri, 28 Oct 2022 22:57:38 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 79E831637 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1666990708; bh=fWR6lgaHeOPHW1FSsPg4QG/1KgRcjLHEyF+Wsu51etk=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=PpJ1s9unYHbmwuKed+ldN49tMo9dQFO7UprwOI3c1nO9skZ+JNXwqsKGrdTQqtmKC dIRdbM2WVfC9qiJDO7drqRwva/f14IgSrqE6n9aN8d6vB56ZJSnuHT6qdrhl7WwSy9 Jb3guwH7pQaidcKIsmI9p4WfsKfqrHY3ZW+leyu4= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id DC2E1F80578; Fri, 28 Oct 2022 22:56:07 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id BAEFEF8016A; Fri, 28 Oct 2022 22:56:04 +0200 (CEST) Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 996A2F8016A for ; Fri, 28 Oct 2022 22:55:58 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 996A2F8016A Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="UrmysWN2" Received: from notapiano.myfiosgateway.com (zone.collabora.co.uk [167.235.23.81]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: nfraprado) by madras.collabora.co.uk (Postfix) with ESMTPSA id B45B7660294B; Fri, 28 Oct 2022 21:55:55 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1666990557; bh=fWR6lgaHeOPHW1FSsPg4QG/1KgRcjLHEyF+Wsu51etk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UrmysWN2I9Qqpva8V2G9/hL5C9jyElZSwIVdheQjvOtBk3gQCViqJgDYmils7P/pZ eOWqWMsy2u2qZ/kU8sKUykuSbFvINlb1MgLt+qy0rx0njLcGBNxdic9cGyX1zzYe1W WWiZU+htGxfrXsql80TI6Vx+TUyljCwi1ysLqfm159j9awR5ENR17JpW6ICMdiAh53 bponcNnEUG+c/bCRIQ42WjekH5YQgEn9JLJDz0biUcGsLcB0KhSBN5Qnp8P8qF78WQ 6Wj8FC3Hq2N0DZRFiKk0zRShwOhwXL9xV+plvKI7i5zZiFIt8YhZndIZXF1lVh/V+R xEKm5UboxXncg== From: =?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= To: Mark Brown , Bjorn Andersson Subject: [PATCH 5/8] ASoC: rt5682s: Support dbvdd and ldo1-in supplies Date: Fri, 28 Oct 2022 16:55:37 -0400 Message-Id: <20221028205540.3197304-6-nfraprado@collabora.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221028205540.3197304-1-nfraprado@collabora.com> References: <20221028205540.3197304-1-nfraprado@collabora.com> MIME-Version: 1.0 Cc: Oder Chiou , alsa-devel@alsa-project.org, =?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= , linux-kernel@vger.kernel.org, Takashi Iwai , Liam Girdwood , kernel@collabora.com, AngeloGioacchino Del Regno X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Add support for the dbvdd and ldo1-in supplies. Signed-off-by: NĂ­colas F. R. A. Prado Reviewed-by: AngeloGioacchino Del Regno --- sound/soc/codecs/rt5682s.c | 22 ++++++++++++++++++++++ sound/soc/codecs/rt5682s.h | 2 ++ 2 files changed, 24 insertions(+) diff --git a/sound/soc/codecs/rt5682s.c b/sound/soc/codecs/rt5682s.c index 80c673aa14db..de686004e504 100644 --- a/sound/soc/codecs/rt5682s.c +++ b/sound/soc/codecs/rt5682s.c @@ -44,6 +44,8 @@ static const struct rt5682s_platform_data i2s_default_platform_data = { static const char *rt5682s_supply_names[RT5682S_NUM_SUPPLIES] = { [RT5682S_SUPPLY_AVDD] = "AVDD", [RT5682S_SUPPLY_MICVDD] = "MICVDD", + [RT5682S_SUPPLY_DBVDD] = "dbvdd", + [RT5682S_SUPPLY_LDO1_IN] = "ldo1-in", }; static const struct reg_sequence patch_list[] = { @@ -3089,6 +3091,14 @@ static void rt5682s_i2c_disable_regulators(void *data) if (ret) dev_err(dev, "Failed to disable supply AVDD: %d\n", ret); + ret = regulator_disable(rt5682s->supplies[RT5682S_SUPPLY_DBVDD].consumer); + if (ret) + dev_err(dev, "Failed to disable supply dbvdd: %d\n", ret); + + ret = regulator_disable(rt5682s->supplies[RT5682S_SUPPLY_LDO1_IN].consumer); + if (ret) + dev_err(dev, "Failed to disable supply ldo1-in: %d\n", ret); + usleep_range(1000, 1500); ret = regulator_disable(rt5682s->supplies[RT5682S_SUPPLY_MICVDD].consumer); @@ -3150,6 +3160,18 @@ static int rt5682s_i2c_probe(struct i2c_client *i2c) return ret; } + ret = regulator_enable(rt5682s->supplies[RT5682S_SUPPLY_DBVDD].consumer); + if (ret) { + dev_err(&i2c->dev, "Failed to enable supply dbvdd: %d\n", ret); + return ret; + } + + ret = regulator_enable(rt5682s->supplies[RT5682S_SUPPLY_LDO1_IN].consumer); + if (ret) { + dev_err(&i2c->dev, "Failed to enable supply ldo1-in: %d\n", ret); + return ret; + } + if (gpio_is_valid(rt5682s->pdata.ldo1_en)) { if (devm_gpio_request_one(&i2c->dev, rt5682s->pdata.ldo1_en, GPIOF_OUT_INIT_HIGH, "rt5682s")) diff --git a/sound/soc/codecs/rt5682s.h b/sound/soc/codecs/rt5682s.h index 45464a041765..67f86a38a1cc 100644 --- a/sound/soc/codecs/rt5682s.h +++ b/sound/soc/codecs/rt5682s.h @@ -1438,6 +1438,8 @@ struct pll_calc_map { enum { RT5682S_SUPPLY_AVDD, RT5682S_SUPPLY_MICVDD, + RT5682S_SUPPLY_DBVDD, + RT5682S_SUPPLY_LDO1_IN, RT5682S_NUM_SUPPLIES, };