Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp2986571rwi; Fri, 28 Oct 2022 14:07:48 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5GTBOsWMGdCx5tiA+Sb7nsH7LCjmkjGv/20BA35Jski86qAUgLQ2fLJ6jDB0aMDtQ+N5Hw X-Received: by 2002:a17:907:a422:b0:7a6:c4cb:dd42 with SMTP id sg34-20020a170907a42200b007a6c4cbdd42mr1075353ejc.735.1666991268450; Fri, 28 Oct 2022 14:07:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666991268; cv=none; d=google.com; s=arc-20160816; b=SRi0SjLmHh2UaP8fsDBXRz9PYjVk0/jyBPX9X9WKSqgZ9kFgfeDxLcDnBDOTu7GKiz +VzWxDeI0AIapX6OMkR+OUpYl6rLMmV3lARS6Vs1IamHpiCDDfJ3rbjnQW2sf9xrqGBg gDEaDdYHO3biNV69kiMs0sy/F3WTUSVxYZ1404M3KVn8s5X9NLqJw0fc8bT81/M/mGfk dVbLEeRoKo9WZ3mazoec07LbLpB0opxOZmr/GV9klhp17bP440TxrdWDkvb+YG0+ImVO BlmMJw0Eau8ACBMQOPRl6LALOUAXhuSyF6uECXfLKHdwd6oBcLLZIEmGaks8K0ERANvg g2/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=dsS6x0E2QIMkEbRYZ7+ZzXlZ7OVLfgu4GHpnI9OwK+k=; b=XpeyRBigqP3j2KNBAUvcwYZd8ViWHge++oiB4C+H6klzck/tn4MH0WkzVQ0JWjMww8 +gLoSSqbi2M5AzCvzlP4xROQQI5vwVePwE6sMoi49eAwfDltNiZYWdbl3vwUqYmok7AG afUtjYige9MdnW0Xm1300lspBLfy+wB12TWNZI0TDdyD5upuI8exyuPBzJwpJ1lr4E4U 1cHBsL5bNEuhS4s7mKVyJLDZV7g9RoST05YV7mLKYLf5mt+13fHf7yW8QfbyntWJgt8S YITBXdVwYxQnaIZ2//5TCo6racVzrknUW1gdo5oZ/MuJ/EUGdwk3qJopsdqi4F1LUuwn qr0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=UrmysWN2; 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=collabora.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id js18-20020a17090797d200b0078df2f22f80si5731640ejc.647.2022.10.28.14.07.22; Fri, 28 Oct 2022 14:07:48 -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=@collabora.com header.s=mail header.b=UrmysWN2; 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=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230133AbiJ1U4N (ORCPT + 99 others); Fri, 28 Oct 2022 16:56:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35542 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230055AbiJ1U4C (ORCPT ); Fri, 28 Oct 2022 16:56:02 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BADF5226E7E for ; Fri, 28 Oct 2022 13:55:58 -0700 (PDT) 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?q?N=C3=ADcolas=20F=2E=20R=2E=20A=2E=20Prado?= To: Mark Brown , Bjorn Andersson Cc: kernel@collabora.com, AngeloGioacchino Del Regno , =?UTF-8?q?N=C3=ADcolas=20F=2E=20R=2E=20A=2E=20Prado?= , Jaroslav Kysela , Liam Girdwood , Oder Chiou , Takashi Iwai , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org 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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 Add support for the dbvdd and ldo1-in supplies. Signed-off-by: NĂ­colas F. R. A. Prado --- 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, }; -- 2.38.1