From nobody Tue Dec 16 08:59:33 2025 Received: from out-186.mta1.migadu.com (out-186.mta1.migadu.com [95.215.58.186]) (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 B9D30314A7D for ; Mon, 15 Dec 2025 13:20:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.186 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765804804; cv=none; b=PdmQL2PQRSSqShpXtSVK4SLZm8Wy22OxN7Ufr3OsTLdlHvUaY8zc/TaldBeWUTVbQr4RbW+ZZMZdUzPvJr/tV7ZW4I3h3F23VqYHhgtSfFffjTvtYrRdgBbH3tFTbvb/bJ8LoOCk4IVIc1tn0x6YNG6D2d0KvvOdT+mTsuTD0kQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765804804; c=relaxed/simple; bh=MQxz/VVrQOno5+xWQBjl3n9rZ9fpWrdNpYf6+2hU0Ks=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=YN6+Z/v4gwYFQrAX77UMRpLRjbbEHj15HRm8lub1ZxrE2kedjA4KeTstazwQjY1mNEf1Pw7QOTgr4YbUjZDfJxMHJNlNY+kvTAjPDoYs39ng8Egan/JBTxXTnUS/B6t/g8lwo9WfR/I9zqTEl8duJg77XhSqYiPgrBkER1j0KwE= 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=r3yt0s1Z; arc=none smtp.client-ip=95.215.58.186 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="r3yt0s1Z" Date: Mon, 15 Dec 2025 15:19:53 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1765804801; 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=8beh+1As4+/yiHzHXQqoA2vA0JOyCQuirQ/FqKxbaHM=; b=r3yt0s1ZQxFUvo5dH3WqcbVgQGJEs7fAcaCtBBZJmdlyVJZzgqI6xOSh6Fh2dPdG6HasEb y6CBkGVkHo+ETahnqSIbVoqZSrds7LNqceyym4kVz8pAronAQl2QhBlZK4eZ7fW1I2KhFE YDsXRmMBa607K3KSjKHPxOZR5rKkey0= 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 RESEND v6 10/17] 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="v8ZCz3Tats+MR36x" Content-Disposition: inline In-Reply-To: X-Migadu-Flow: FLOW_OUT --v8ZCz3Tats+MR36x 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 87de87793fa1..8c006bff89a8 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 --v8ZCz3Tats+MR36x Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEIx+f8wZb28fLKEhTeFA3/03aocUFAmlACvkACgkQeFA3/03a ocW85Qf/SetuLvOuUw80xqEqOrs9A2S2YJPCLc9vvJcRUycTl50tFQkXfMGooS8f /BBmvjBbBBAv6t8dbOvUb8rJ/bsPYokvQi79Co9y9hX55VjsJ6y204wOM7Hom17n P87fFmb2WYhPmbjUImRKWm/Sjp51QgZE5ci1LDBwDBKd0FF5z6cp7lb+9pyxkWRQ 9QUOqvMXSf8HXKIRl7AUAhz5X/C/wR39+BgFoPIQiZoHYpb2rkeFDWYYsrM5rydj wLjB6xuZY0a9nRT9yx8pB3UapWV0uxsRJeVc0pqmkUorHQeiEQHwEQKOj2+koSra O6aAYVu/LVbf6urLCbioec53aWAR7A== =QvcH -----END PGP SIGNATURE----- --v8ZCz3Tats+MR36x--