From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796113915; b=HDgEoNBJdKfPtgJJ5EPDsDsusFC4h9CG305HNFtEQ3EF4QmW/cOQmhH96lelpA1PQsdg LdbsmRzTtnBofU63tMj4SU5XCnJvAcZ9upKOoOKnPE+Adnocwyjfet1lYtX7LGagJ2ca5 8BSSgOWE+x+ojjwOlI/Ast5LYq+0P5cogiSqlrinNjBxw/jy4b6H1JWdpKhRgggdvmuAY FZ6Rgicn2i7DROEtg7qLfo4Ar5b75C14gow7x5sL0kyD4RFZ+mQTFLVNDnwBMUC73RZg4 o79Y23xf8E/sYVcZSxNJj1uaDyWSdqF6k4cMDwrfqhV/KSZ8wr3CZqadGqWdg/fzsTQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796113915; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=M6Uc8Wd+BTkmuXu+k+I+5SY8NbLdO6kwPP19FcdWC68=; b=Rlo6ykWA3f2rcSHmiE6+AQqM4a40oyojejJljnA/e2A76lMe06+J06gbvDAo3AZ2n1yB 9iF1ZJLxlFqD3AYABqMo7WykFX7k87UHAU0z+n9v85EyC/m7JaczmAmRuCD5RHmT0YhfH rPJkArnEuDjHjtUOtzq0p8eFsh/ED2cYY7ED/g5uUtnUeVRiYU02VLhRO7TKa4WoU+Vsv 0Zgdio9qfKDVUKyUJErnh6OsYgbxyA3I+CHdUP/nJNyNK2PIa6gLeZIx0nc2r7l+BSIqN +IdIrea1OGPniqivbpU5haRRcdqmZyKccnc+ZMjvbbkByRXDwQ0XvxP4XCC0NB9Ww3A== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b="EZGL/+LA"; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 57BBB606A31A for ; Tue, 1 Dec 2026 08:31:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=EZGL/+LA Received: by smtp.kernel.org (Postfix) with ESMTPSA id B1C091F0089B; Tue, 1 Dec 2026 08:31:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796113914; bh=M6Uc8Wd+BTkmuXu+k+I+5SY8NbLdO6kwPP19FcdWC68=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=EZGL/+LA1MyCxkoNWLUwi0EvGU2p2QqNr6bUGcHO6ovQHwPJuW6jYZcvqQi3ECsxF utwJqGC1Dw3fFSl5DMpwP5Nhp49r2mLu8raXPF5V7xBrWqC+abWCXsPea2FAZ6WR8Z /DPi10fU5Q//TD7BUUe/8C9ZMwSD5NSdBpg6kil3PJpbhX5z5o5To7uStXw74KbtSn mjQBHMNYDXku91gHbVpTEnXhUFcuYZTvOFHf3obxY502tobG1xH/+EkR++6EVgy+d+ v06hiH7j+yx69vCcBQg3kAF66i9vfsRokV+UVfeFihWRQS9pY+4qD0XC5RxPqMOd/E mb5R48qWitJdQ== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH] ASoC: codecs: nau8822: add support for speaker gain boost setting Reply-To: sashiko-reviews@lists.linux.dev To: "Alexey Charkov" Cc: linux-sound@vger.kernel.org In-Reply-To: <20261201-nau8822-gain-boost-v1-1-963846584511@flipper.net> References: <20261201-nau8822-gain-boost-v1-1-963846584511@flipper.net> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Tue, 01 Dec 2026 08:31:54 +0000 X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 4 potential issues to consider: - [High] ASoC: nau8822: unshifted value 0x7 in nau8822_i2c_probe() boost update - [High] ASoC: nau8822: probe failure in nau8822_i2c_probe() on dummy VDDSPK supply - [Medium] ASoC: nau8822: unbalanced regulator enable in nau8822_i2c_probe() error path - [Low] ASoC: nau8822: duplicate linux/regulator/consumer.h include in nau8822.c -- commit 7be433b1cfde07c405213d2c8857611f51145778 Author: Alexey Charkov ASoC: codecs: nau8822: add support for speaker gain boost setting This commit queries the VDDSPK regulator voltage during probe and enables the speaker and AUX gain boost bits when the supply exceeds 3.6V. > diff --git a/sound/soc/codecs/nau8822.c b/sound/soc/codecs/nau8822.c > index 17b8ee0ab22c3..1e90e00c99f22 100644 > --- a/sound/soc/codecs/nau8822.c > +++ b/sound/soc/codecs/nau8822.c > @@ -10,6 +10,7 @@ > // > // Based on WM8974.c > =20 > +#include "linux/regulator/consumer.h" > #include > #include > #include [Severity: Low] is already included a few lines below, so this duplicate include can be dropped. > @@ -1189,7 +1190,7 @@ static int nau8822_i2c_probe(struct i2c_client *i2c) > { > struct device *dev =3D &i2c->dev; > struct nau8822 *nau8822 =3D dev_get_platdata(dev); > - int ret, i; > + int ret, i, vddspk; > =20 > if (!nau8822) { > nau8822 =3D devm_kzalloc_obj(dev, *nau8822); > @@ -1210,6 +1211,11 @@ static int nau8822_i2c_probe(struct i2c_client *i2= c) > if (ret) > return dev_err_probe(dev, ret, "Failed to get regulators\n"); > =20 > + vddspk =3D regulator_get_voltage(nau8822->supplies[SUPPLY_VDDSPK].consu= mer); > + if (vddspk < 0 && vddspk !=3D -ENODEV) > + return dev_err_probe(dev, vddspk, > + "Failed to get VDDSPK voltage\n"); [Severity: High] Does this cause nau8822_i2c_probe() to fail with -EINVAL when vddspk-supply is omitted from the device tree? devm_regulator_bulk_get() substitutes the dummy regulator when an optional supply is absent, and regulator_get_voltage() returns -EINVAL (not -ENODEV) for regulators without voltage query operations or a fixed voltage. > nau8822->regmap =3D devm_regmap_init_i2c(i2c, &nau8822_regmap_config); > if (IS_ERR(nau8822->regmap)) { > ret =3D PTR_ERR(nau8822->regmap); > @@ -1231,6 +1237,17 @@ static int nau8822_i2c_probe(struct i2c_client *i2= c) > goto err_reg; > } > =20 > + if (vddspk > 3600000) { > + ret =3D regmap_update_bits(nau8822->regmap, > + NAU8822_REG_OUTPUT_CONTROL, > + NAU8822_SPKBST | > + NAU8822_AUX2BST | > + NAU8822_AUX1BST, 0x7); [Severity: High] Does passing 0x7 to regmap_update_bits() leave NAU8822_AUX2BST and NAU8822_AUX1BST cleared? NAU8822_SPKBST, NAU8822_AUX2BST, and NAU8822_AUX1BST are defined at bits 2..4 (mask 0x1c), and regmap_update_bits() does not shift val to the mask position, so (0x7 & 0x1c) only sets bit 2 (NAU8822_SPKBST). Passing the combined bitmask as val (or using regmap_set_bits()) would set all three bits. > + if (ret !=3D 0) > + return dev_err_probe(dev, ret, > + "Failed to update gain boost control\n"); > + } [Severity: Medium] Does this error return leak the regulator enable reference counts from regulator_bulk_enable() earlier in nau8822_i2c_probe()? Jumping to err_reg would disable the bulk supplies on failure. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261201-nau8822-ga= in-boost-v1-1-963846584511@flipper.net?part=3D1