From nobody Sun Feb 8 18:44:50 2026 Received: from out-173.mta1.migadu.com (out-173.mta1.migadu.com [95.215.58.173]) (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 6E12B2D6E49 for ; Wed, 5 Nov 2025 07:38:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762328307; cv=none; b=DdsvmYV6YNPgDVUCDwpFPmUdZCCfgdByZcVXrXE4JYB5xx+wUKsdOIUigES45nZyRkqUsXKuXPxO9PY5IXUzQzAsgPTkdHJIMEDgRl0zswtSJ1WMJEShvVlY9rFTL9yEa2rkCGbt0eaKVIPr+pfpnlkIywaHz0DQW8dLKa/ZR/A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762328307; c=relaxed/simple; bh=CrSVLsFQ2g4Vp8qYJ/d+JrzOW9SlRqmsxIUiQJQBEEE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=e048YVdBfhdXcnNKgvm0H50m8BEnQO2ztBOVSYf87QMtua2bb0xiwXQhmcwM9A1MPqBpEy6WM/DSjBIFq8BQR6VTQ5sgMWp3gpFMh662PuIYRjjNa3uYkckIYwgZx24Zshuesd817KWzJQwZcVqFf/unTxoqrEWhNybAvGmVYpk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=nqsj1XZD; arc=none smtp.client-ip=95.215.58.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="nqsj1XZD" Date: Wed, 5 Nov 2025 09:38:14 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1762328303; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references; bh=h9I7knpHT4J14uzYxcuabcbNMvDFhzFTPEqjgekU/SM=; b=nqsj1XZD5x0jJQRAlWgl3u3/wZIaWq8Xbi3xPBJRGkI7wD96ru5bwsTGSnuLlKy5wOvIFt DCPyEbupk3crI/sS/R9naQtADCgflYc+RpnoTKpkp5TqLJoZO8dz7vqjRVbbOS4TjDqwmx ax3WG2pe09GDseb5X8u6isX4hVs5Lxk= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Matti Vaittinen To: Matti Vaittinen , Matti Vaittinen Cc: Lee Jones , Pavel Machek , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Sebastian Reichel , Liam Girdwood , Mark Brown , Michael Turquette , Stephen Boyd , Matti Vaittinen , Linus Walleij , Bartosz Golaszewski , Alexandre Belloni , linux-leds@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, linux-clk@vger.kernel.org, linux-gpio@vger.kernel.org, linux-rtc@vger.kernel.org, Andreas Kemnade Subject: [PATCH v3 09/16] regulator: bd71828: rename IC specific entities Message-ID: Reply-To: Matti Vaittinen References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="y0oeG/X9+ICE50D1" Content-Disposition: inline In-Reply-To: X-Migadu-Flow: FLOW_OUT --y0oeG/X9+ICE50D1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Matti Vaittinen The new ROHM BD72720 PMIC has similarities with the BD71828. It makes sense to support the regulator control for both PMICs using the same driver. It is often more clear to have the IC specific functions and globals named starting with the chip-name. So, as a preparatory step, prefix the BD71828 specific functions and globals with the bd71828. It would be tempting to try also removing the chip ID from those functions which will be common for both PMICs. I have bad experiences on this as it tends to lead to problems when yet another IC is being supported with the same driver, and we will have some functions used for all, some for two of the three, and some for just one. At this point I used to start inventing wildcards like BD718XX or BD7272X. This approach is pretty much always failing as we tend to eventually have something like BD73900 - where all the wildcard stuff will break down. So, my approach these days is to: - keep the original chip-id prefix for anything that had it already (and avoid the churn). - use same prefix for all things that are used by multiple ICs - typically the chip-ID of the first chip. This typically matches also the driver and file names. - use specific chip-ID as a prefix for anything which is specific to just one chip. As a preparatory step to adding the BD72720, add bd71828 prefix to all commonly usable functions and globals. Signed-off-by: Matti Vaittinen Acked-by: Mark Brown --- Revision history: RFCv1 =3D>: - No changes No functional changes intended. --- drivers/regulator/bd71828-regulator.c | 32 +++++++++++++-------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/drivers/regulator/bd71828-regulator.c b/drivers/regulator/bd71= 828-regulator.c index dd871ffe979c..3d18dbfdb84e 100644 --- a/drivers/regulator/bd71828-regulator.c +++ b/drivers/regulator/bd71828-regulator.c @@ -28,7 +28,7 @@ struct bd71828_regulator_data { int reg_init_amnt; }; =20 -static const struct reg_init buck1_inits[] =3D { +static const struct reg_init bd71828_buck1_inits[] =3D { /* * DVS Buck voltages can be changed by register values or via GPIO. * Use register accesses by default. @@ -40,7 +40,7 @@ static const struct reg_init buck1_inits[] =3D { }, }; =20 -static const struct reg_init buck2_inits[] =3D { +static const struct reg_init bd71828_buck2_inits[] =3D { { .reg =3D BD71828_REG_PS_CTRL_1, .mask =3D BD71828_MASK_DVS_BUCK2_CTRL, @@ -48,7 +48,7 @@ static const struct reg_init buck2_inits[] =3D { }, }; =20 -static const struct reg_init buck6_inits[] =3D { +static const struct reg_init bd71828_buck6_inits[] =3D { { .reg =3D BD71828_REG_PS_CTRL_1, .mask =3D BD71828_MASK_DVS_BUCK6_CTRL, @@ -56,7 +56,7 @@ static const struct reg_init buck6_inits[] =3D { }, }; =20 -static const struct reg_init buck7_inits[] =3D { +static const struct reg_init bd71828_buck7_inits[] =3D { { .reg =3D BD71828_REG_PS_CTRL_1, .mask =3D BD71828_MASK_DVS_BUCK7_CTRL, @@ -102,9 +102,9 @@ static int buck_set_hw_dvs_levels(struct device_node *n= p, return rohm_regulator_set_dvs_levels(&data->dvs, np, desc, cfg->regmap); } =20 -static int ldo6_parse_dt(struct device_node *np, - const struct regulator_desc *desc, - struct regulator_config *cfg) +static int bd71828_ldo6_parse_dt(struct device_node *np, + const struct regulator_desc *desc, + struct regulator_config *cfg) { int ret, i; uint32_t uv =3D 0; @@ -212,8 +212,8 @@ static const struct bd71828_regulator_data bd71828_rdat= a[] =3D { */ .lpsr_on_mask =3D BD71828_MASK_LPSR_EN, }, - .reg_inits =3D buck1_inits, - .reg_init_amnt =3D ARRAY_SIZE(buck1_inits), + .reg_inits =3D bd71828_buck1_inits, + .reg_init_amnt =3D ARRAY_SIZE(bd71828_buck1_inits), }, { .desc =3D { @@ -253,8 +253,8 @@ static const struct bd71828_regulator_data bd71828_rdat= a[] =3D { .lpsr_reg =3D BD71828_REG_BUCK2_SUSP_VOLT, .lpsr_mask =3D BD71828_MASK_BUCK1267_VOLT, }, - .reg_inits =3D buck2_inits, - .reg_init_amnt =3D ARRAY_SIZE(buck2_inits), + .reg_inits =3D bd71828_buck2_inits, + .reg_init_amnt =3D ARRAY_SIZE(bd71828_buck2_inits), }, { .desc =3D { @@ -399,8 +399,8 @@ static const struct bd71828_regulator_data bd71828_rdat= a[] =3D { .lpsr_reg =3D BD71828_REG_BUCK6_SUSP_VOLT, .lpsr_mask =3D BD71828_MASK_BUCK1267_VOLT, }, - .reg_inits =3D buck6_inits, - .reg_init_amnt =3D ARRAY_SIZE(buck6_inits), + .reg_inits =3D bd71828_buck6_inits, + .reg_init_amnt =3D ARRAY_SIZE(bd71828_buck6_inits), }, { .desc =3D { @@ -440,8 +440,8 @@ static const struct bd71828_regulator_data bd71828_rdat= a[] =3D { .lpsr_reg =3D BD71828_REG_BUCK7_SUSP_VOLT, .lpsr_mask =3D BD71828_MASK_BUCK1267_VOLT, }, - .reg_inits =3D buck7_inits, - .reg_init_amnt =3D ARRAY_SIZE(buck7_inits), + .reg_inits =3D bd71828_buck7_inits, + .reg_init_amnt =3D ARRAY_SIZE(bd71828_buck7_inits), }, { .desc =3D { @@ -633,7 +633,7 @@ static const struct bd71828_regulator_data bd71828_rdat= a[] =3D { * LDO6 only supports enable/disable for all states. * Voltage for LDO6 is fixed. */ - .of_parse_cb =3D ldo6_parse_dt, + .of_parse_cb =3D bd71828_ldo6_parse_dt, }, }, { .desc =3D { --=20 2.51.0 --y0oeG/X9+ICE50D1 Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEIx+f8wZb28fLKEhTeFA3/03aocUFAmkK/uYACgkQeFA3/03a ocVqpggAl9cKMSv9gw4L+j09KH0F4p+9l3STEjL3w7IfE89o5Z/Tl+UBwubA6+qe +nVlRUtQ+Zr7osv45zO2frllXBB+FkFqW/ZHUhByaOJ2caHJ7JvDrBgDGUvv8obq u3oteVdet+uTYJL2wd+7oxewlKgHzHKcK0qoNwzYZyDRUSTcL9EZbPfOJVvrjMa+ P7+/2NG9IRIhnnYlwhVQRR2000QWD+5bTmPBQgQeB1eGeK2kjwk7cRgYr1cr5zHY KrK1XOSu0LA6okeILlckqgF93sntRUNwZximfhPr5qbYgwRpqIvdBT53xH4bpKdh fvy+v1uwdL2EAS/fafMLS3zv1TYkJg== =cC19 -----END PGP SIGNATURE----- --y0oeG/X9+ICE50D1--