From nobody Fri Jul 24 21:53:35 2026 Received: from mail-m49234.qiye.163.com (mail-m49234.qiye.163.com [45.254.49.234]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 445C33F5BFA; Thu, 23 Jul 2026 08:30:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.254.49.234 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784795431; cv=none; b=AbOPU3L9YFQyZGHX3Q1wPU+8mspdbJGcSXR1Hf8jHzJRGSWMzI7xv26Ahgl9CDL0/NNY3ioNZdPqvwmGvYV76SgX8pLTTtgEhxpw+H24XMVv4zHxwoiEMQdrwys90Eup1TcCEIDlhD3JL5z2JGmQvHdk0MxIgTBJAevFS0Jc3XI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784795431; c=relaxed/simple; bh=JEoccDb8nSXcL2JmQ9CO0lERWR1sAzHWgDDgksFjDb8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=SVDb9kQQ8CBpx9Gd4khg3Z2xiaMzco1wc3rCf74xdKtR00JBcvEoadf5hlxanv1F1fwsINxYXL66Zkf4MKP5xohBPsNb1flO+JababNNvwRHf8uTIRQ2hTl63X/nxLckXaAwN3tmtUHFxIE91+wxNAROT79bJliH/WK0l8bGWxk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=thundersoft.com; spf=pass smtp.mailfrom=thundersoft.com; dkim=pass (1024-bit key) header.d=thundersoft.com header.i=@thundersoft.com header.b=H6abypm/; arc=none smtp.client-ip=45.254.49.234 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=thundersoft.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=thundersoft.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=thundersoft.com header.i=@thundersoft.com header.b="H6abypm/" Received: from [127.0.1.1] (unknown [36.129.139.90]) by smtp.qiye.163.com (Hmail) with ESMTP id 474a1d1cc; Thu, 23 Jul 2026 15:54:39 +0800 (GMT+08:00) From: Hongyang Zhao Date: Thu, 23 Jul 2026 15:54:29 +0800 Subject: [PATCH 1/2] ASoC: dt-bindings: es8316: Add regulator supplies Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260723-es8316-regulator-next-20260722-v1-1-721f757879a0@thundersoft.com> References: <20260723-es8316-regulator-next-20260722-v1-0-721f757879a0@thundersoft.com> In-Reply-To: <20260723-es8316-regulator-next-20260722-v1-0-721f757879a0@thundersoft.com> To: Liam Girdwood , Mark Brown , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Daniel Drake , Katsuhiro Suzuki , Matteo Martelli , Binbin Zhou , Jaroslav Kysela , Takashi Iwai Cc: Konrad Dybcio , Roger Shimizu , linux-sound@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Hongyang Zhao X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1784793277; l=1677; i=hongyang.zhao@thundersoft.com; s=20260127; h=from:subject:message-id; bh=JEoccDb8nSXcL2JmQ9CO0lERWR1sAzHWgDDgksFjDb8=; b=XKUpH68Tm2rqMxfPTbH4p8YM6XMkuPqWfA1tlCKPhqk0vBn1HdrZpyuVP0aAOEZx8l+OT6tfJ 2JuudrFREBoCN/hyzSkT9bgH5K+f08QLVk+b7p+YmjA/yyFohkWQLAM X-Developer-Key: i=hongyang.zhao@thundersoft.com; a=ed25519; pk=D9yL5W9Zj0lPBDAq9gzY++1849VlXuTWAkROzZ88J/4= X-HM-Tid: 0a9f8df82c0a09d5kunmc0741ac25143f5 X-HM-MType: 1 X-HM-Spam-Status: e1kfGhgUHx5ZQUpXWQgPGg8OCBgUHx5ZQUlOS1dZFg8aDwILHllBWSg2Ly tZV1koWUFITzdXWRgWCB1ZQUpXWS1ZQUlXWQ8JGhUIEh9ZQVlDSkMdVh9PH0tLGEJKSRlDGVYVFA kWGhdVEwETFhoSFyQUDg9ZV1kYEgtZQVlITVVKSUJVSkhCVUJLWVdZFhoPEhUdFFlBWU9LSFVKS0 lCQ0NMVUpLS1VLWQY+ DKIM-Signature: a=rsa-sha256; b=H6abypm/mIcuUZIzdDlEzK7kOGui+JLuXQAzG/8QheKNGcbLjsMUZDQmnErMXVJ+704ieCmdm1gYnkLRYKS43G7RdG5hqqHNPFPTJ1l0Q1/bDYbO8F0o7123q5vrjkwlheLm+ewxFGK/anegaOWbyxpUzMGSRdnTANkpkNQJh84=; c=relaxed/relaxed; s=default; d=thundersoft.com; v=1; bh=bCzvgz3PNErKzP0ve8Ty5UtFs2OsEDqhcUvEDyz3eBo=; h=date:mime-version:subject:message-id:from; The ES8316 has separate AVDD, CPVDD, DVDD and PVDD supply inputs for its analog, charge pump, digital core and digital I/O domains. Describe all four inputs so boards can model the codec power topology. Keep the properties optional for compatibility with existing descriptions. Signed-off-by: Hongyang Zhao --- .../devicetree/bindings/sound/everest,es8316.yaml | 16 ++++++++++++= ++++ 1 file changed, 16 insertions(+) diff --git a/Documentation/devicetree/bindings/sound/everest,es8316.yaml b/= Documentation/devicetree/bindings/sound/everest,es8316.yaml index fe5d938ca310..f45f59b7b070 100644 --- a/Documentation/devicetree/bindings/sound/everest,es8316.yaml +++ b/Documentation/devicetree/bindings/sound/everest,es8316.yaml @@ -49,6 +49,18 @@ properties: items: - const: mclk =20 + avdd-supply: + description: Regulator providing the analog supply, from 2.0 V to 3.6 V + + cpvdd-supply: + description: Regulator providing the charge pump supply, from 1.6 V to= 2.0 V + + dvdd-supply: + description: Regulator providing the digital core supply, from 1.6 V t= o 3.6 V + + pvdd-supply: + description: Regulator providing the digital I/O supply, from 1.6 V to= 3.6 V + interrupts: maxItems: 1 description: Headphone detect interrupt @@ -77,6 +89,10 @@ examples: reg =3D <0x11>; clocks =3D <&clks 10>; clock-names =3D "mclk"; + avdd-supply =3D <®_3p3v>; + cpvdd-supply =3D <®_1p8v>; + dvdd-supply =3D <®_1p8v>; + pvdd-supply =3D <®_1p8v>; #sound-dai-cells =3D <0>; }; }; --=20 2.43.0 From nobody Fri Jul 24 21:53:35 2026 Received: from mail-m49214.qiye.163.com (mail-m49214.qiye.163.com [45.254.49.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3164A3F076F; Thu, 23 Jul 2026 08:00:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.254.49.214 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784793612; cv=none; b=dNTjVVcNF4Rq2cwiqqdoeeoXM4nKnBoYnPqmj1/HGB12YBsf8lCZ3xaoIhzEyFOT8faNLhgTeAPc5uR4aYjh4NBHnMt/ef+phXf4UgRJN2lvYnu/izqNvyWQlbmMb2qqle5F/IpLEFNNGsodYjFT+gA4G8CiYdBu9vGkZQpsd7g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784793612; c=relaxed/simple; bh=LuqhCsNyxUrYZUh5Hoa7wGXUuZGQ24rqFskxb0mg5JA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=pTiWwOXpRkBAi5TZDPI44D+7tU3/X3e7bDzxxgGJG3cUHTVime/tOeX23FuGtAk8rgaJkNaK4zB4r5/MuOMYewUlRq7udh61gKjYrZnufWb1LByWDvh0mi2RZjZgeCuFjqLB0qXA4PacATgsfvTSZ66rtW1Hu0X2BXOLALvDTZA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=thundersoft.com; spf=pass smtp.mailfrom=thundersoft.com; dkim=pass (1024-bit key) header.d=thundersoft.com header.i=@thundersoft.com header.b=OoMEAjWO; arc=none smtp.client-ip=45.254.49.214 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=thundersoft.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=thundersoft.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=thundersoft.com header.i=@thundersoft.com header.b="OoMEAjWO" Received: from [127.0.1.1] (unknown [36.129.139.90]) by smtp.qiye.163.com (Hmail) with ESMTP id 474a1d1d3; Thu, 23 Jul 2026 15:54:41 +0800 (GMT+08:00) From: Hongyang Zhao Date: Thu, 23 Jul 2026 15:54:30 +0800 Subject: [PATCH 2/2] ASoC: codecs: es8316: Add regulator support Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260723-es8316-regulator-next-20260722-v1-2-721f757879a0@thundersoft.com> References: <20260723-es8316-regulator-next-20260722-v1-0-721f757879a0@thundersoft.com> In-Reply-To: <20260723-es8316-regulator-next-20260722-v1-0-721f757879a0@thundersoft.com> To: Liam Girdwood , Mark Brown , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Daniel Drake , Katsuhiro Suzuki , Matteo Martelli , Binbin Zhou , Jaroslav Kysela , Takashi Iwai Cc: Konrad Dybcio , Roger Shimizu , linux-sound@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Hongyang Zhao X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1784793277; l=3659; i=hongyang.zhao@thundersoft.com; s=20260127; h=from:subject:message-id; bh=LuqhCsNyxUrYZUh5Hoa7wGXUuZGQ24rqFskxb0mg5JA=; b=7py00nEVc0bFrryUkx2Q6AG+HiqbAx8ONG+eQxAPSN6tLvFAQRk+0Q8v3D8BW1OqKyxPDkxmE ++ghRBjw/msDH4wXMMo+Gk091NSVmZOD6h1oO1pRKGkleHfgRl7K47e X-Developer-Key: i=hongyang.zhao@thundersoft.com; a=ed25519; pk=D9yL5W9Zj0lPBDAq9gzY++1849VlXuTWAkROzZ88J/4= X-HM-Tid: 0a9f8df8330409d5kunmc0741ac2514408 X-HM-MType: 1 X-HM-Spam-Status: e1kfGhgUHx5ZQUpXWQgPGg8OCBgUHx5ZQUlOS1dZFg8aDwILHllBWSg2Ly tZV1koWUFITzdXWRgWCB1ZQUpXWS1ZQUlXWQ8JGhUIEh9ZQVkaTUtKVkNPHxgeGB5JGE9PS1YVFA kWGhdVEwETFhoSFyQUDg9ZV1kYEgtZQVlITVVKSUJVSkhCVUJLWVdZFhoPEhUdFFlBWU9LSFVKS0 lPT09IVUpLS1VKQktLWQY+ DKIM-Signature: a=rsa-sha256; b=OoMEAjWOWe309MFTgwcR3//Yol/bSRAONUvoQbArsyAbif8ff12yYLWiZnlV5vyK3u/OZ3eo9LO+6xyA4d4Vo4dfeAGgpb5zageIVa2OegCNdcmxSynwiefFM1/YQtKP+IrIjBXcLONXPkAnI5goWv/cpkLZFE+xoPj4RvDbYm0=; c=relaxed/relaxed; s=default; d=thundersoft.com; v=1; bh=47DM7+/yHuFdec2gHIvXTXebWAIZAtBrKbuRpP84YZ4=; h=date:mime-version:subject:message-id:from; ES8316 has separate AVDD, CPVDD, DVDD and PVDD supply inputs. Request the supplies during I2C probe. Enable them before enabling MCLK and accessing the device registers, and disable them on probe failure and component removal. Leave the supplies enabled during system suspend because the existing suspend and resume callbacks do not handle a complete power loss. Powering the codec down would require separate reset and reinitialization support. Signed-off-by: Hongyang Zhao --- sound/soc/codecs/es8316.c | 35 +++++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/sound/soc/codecs/es8316.c b/sound/soc/codecs/es8316.c index 3abe77423f29..904056b2569a 100644 --- a/sound/soc/codecs/es8316.c +++ b/sound/soc/codecs/es8316.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -30,10 +31,20 @@ static const unsigned int supported_mclk_lrck_ratios[] = =3D { 256, 384, 400, 500, 512, 768, 1024 }; =20 +static const char * const es8316_supply_names[] =3D { + "avdd", + "cpvdd", + "dvdd", + "pvdd", +}; + +#define ES8316_NUM_SUPPLIES ARRAY_SIZE(es8316_supply_names) + struct es8316_priv { struct mutex lock; struct clk *mclk; struct regmap *regmap; + struct regulator_bulk_data supplies[ES8316_NUM_SUPPLIES]; struct snd_soc_component *component; struct snd_soc_jack *jack; int irq; @@ -767,10 +778,16 @@ static int es8316_probe(struct snd_soc_component *com= ponent) if (!es8316->mclk) dev_warn(component->dev, "assuming static mclk\n"); =20 + ret =3D regulator_bulk_enable(ES8316_NUM_SUPPLIES, es8316->supplies); + if (ret) { + dev_err(component->dev, "unable to enable supplies\n"); + return ret; + } + ret =3D clk_prepare_enable(es8316->mclk); if (ret) { dev_err(component->dev, "unable to enable mclk\n"); - return ret; + goto err_disable_supplies; } =20 /* Reset codec and enable current state machine */ @@ -793,6 +810,11 @@ static int es8316_probe(struct snd_soc_component *comp= onent) snd_soc_component_write(component, ES8316_CLKMGR_ADCOSR, 0x32); =20 return 0; + +err_disable_supplies: + regulator_bulk_disable(ES8316_NUM_SUPPLIES, es8316->supplies); + + return ret; } =20 static void es8316_remove(struct snd_soc_component *component) @@ -800,6 +822,7 @@ static void es8316_remove(struct snd_soc_component *com= ponent) struct es8316_priv *es8316 =3D snd_soc_component_get_drvdata(component); =20 clk_disable_unprepare(es8316->mclk); + regulator_bulk_disable(ES8316_NUM_SUPPLIES, es8316->supplies); } =20 static int es8316_resume(struct snd_soc_component *component) @@ -862,7 +885,7 @@ static int es8316_i2c_probe(struct i2c_client *i2c_clie= nt) { struct device *dev =3D &i2c_client->dev; struct es8316_priv *es8316; - int ret; + int i, ret; =20 es8316 =3D devm_kzalloc(&i2c_client->dev, sizeof(struct es8316_priv), GFP_KERNEL); @@ -871,6 +894,14 @@ static int es8316_i2c_probe(struct i2c_client *i2c_cli= ent) =20 i2c_set_clientdata(i2c_client, es8316); =20 + for (i =3D 0; i < ES8316_NUM_SUPPLIES; i++) + es8316->supplies[i].supply =3D es8316_supply_names[i]; + + ret =3D devm_regulator_bulk_get(dev, ES8316_NUM_SUPPLIES, + es8316->supplies); + if (ret) + return dev_err_probe(dev, ret, "unable to get supplies\n"); + es8316->regmap =3D devm_regmap_init_i2c(i2c_client, &es8316_regmap); if (IS_ERR(es8316->regmap)) return PTR_ERR(es8316->regmap); --=20 2.43.0