From nobody Mon Dec 1 22:37:25 2025 Received: from out-188.mta0.migadu.com (out-188.mta0.migadu.com [91.218.175.188]) (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 CB4B332D0F9 for ; Thu, 27 Nov 2025 11:19:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.188 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764242368; cv=none; b=o0eDq3POto6zXzf9lg17L2rxwJYVxOHiukZ1MlO0yiXkFYuyGJ581R1S52xMzoGeEUQtHPQfLY+pszCkiqL4Faz5w7r4AQcfXEfryOnuqht1COPna2nW6JkzD0mB4YEDWkxuhlUJRO3zpSHb245xCPGErgRu5tORmc45OkbD9I4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764242368; c=relaxed/simple; bh=BK6s+TrtkFDpRwMTW+/uwC13+Rd5w1wOHlV3TC577tk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=TL8KC07fn12NvvpFKiLaOhyfKSGpMixYPN1JalZhohogfzQ2DA5kiHiPe5d/zS0FI9rHje33iCZXG9jlWzhBE7DDNEAMCc3C3FEaa2JpiPrhi7W4wK2vhTjBjI8oqBkj1qyeubSAqgarhSjVy5FMjVuvZyk30Me/CDc1YjODJ3w= 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=o4fevRC8; arc=none smtp.client-ip=91.218.175.188 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="o4fevRC8" Date: Thu, 27 Nov 2025 13:19:17 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1764242363; 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=MSycXunlNfjdeCvDelVmF+fu02mSCye4XnBDJLyst8g=; b=o4fevRC8Aw3Mcj7RTMlAcd4nHJoyZNDEw/pdo4WrUwbuIJq/3UpM9gZhuiWqBu5EX1Gihd Q8IVVJLgFFl/ZaFlHsW9TEZ0Mi53xARPbeG91YojXN1Oxq7Xa2QBCthMVlsVaOaXd46Y1t rWRE4bCBihfK5fvG+9KDqqRr+Z7fCDs= 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 v6 10/17] regulator: bd71828: rename IC specific entities Message-ID: <9f97e7a953f01cedc9298f546079f4e7bb899281.1764241265.git.mazziesaccount@gmail.com> 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="Qi75VkgeuiR5cq3P" Content-Disposition: inline In-Reply-To: X-Migadu-Flow: FLOW_OUT --Qi75VkgeuiR5cq3P 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.52.0 --Qi75VkgeuiR5cq3P Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEIx+f8wZb28fLKEhTeFA3/03aocUFAmkoM7UACgkQeFA3/03a ocXcgggAqGO6ZwRyHzbgIOrybC98owuBD8ys5Ucqn9Kv4UUFYvVDKnP4PkPys/6J 8ERaGXiRiL3I9nb5PY5chL339NNd7L5ikPiqaS7a4gLkxqFdic2WW3J3CrMh17Gc 4uaD+9mZOCfeCN9eYKw0tu/8n3UOetFVNdlQiJtWDhWTEe55Oj41BZlDI+FGMo2V RlOyeVC61sdJGHCOLzbZpmLKQ7AjDmoCEd/wjl8XOh0QGMMnGwtXjNM1/nQzquf2 6Lzji6QCrNCSDW4y0xTUWu5r6TjFXd0Ay3x+QHbfTLfVafDcFXxk2voyMxzo/zx5 XqCZZTRCZJ9uhu9l/oC9QgymFFCEvw== =m9Ou -----END PGP SIGNATURE----- --Qi75VkgeuiR5cq3P--