From: Matti Vaittinen <matti.vaittinen@linux.dev>
To: Matti Vaittinen <mazziesaccount@gmail.com>,
Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
Cc: Lee Jones <lee@kernel.org>, Pavel Machek <pavel@kernel.org>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Sebastian Reichel <sre@kernel.org>,
Liam Girdwood <lgirdwood@gmail.com>,
Mark Brown <broonie@kernel.org>,
Michael Turquette <mturquette@baylibre.com>,
Stephen Boyd <sboyd@kernel.org>,
Matti Vaittinen <mazziesaccount@gmail.com>,
Linus Walleij <linusw@kernel.org>,
Bartosz Golaszewski <brgl@kernel.org>,
Alexandre Belloni <alexandre.belloni@bootlin.com>,
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 <andreas@kemnade.info>
Subject: [PATCH RESEND v6 07/17] mfd: rohm-bd71828: Use regmap_reg_range()
Date: Mon, 15 Dec 2025 15:19:00 +0200 [thread overview]
Message-ID: <49607e65ca117b096a50c5784b760bf62553e29a.1765804226.git.mazziesaccount@gmail.com> (raw)
In-Reply-To: <cover.1765804226.git.mazziesaccount@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 3326 bytes --]
From: Matti Vaittinen <mazziesaccount@gmail.com>
The regmap range tables tend to be somewhat verbose. Using the
regmap_reg_range() can make the definitions slightly mode compact.
Tidy the regmap range tables by using the regmap_reg_range().
Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>
---
Revision history:
v2 => :
- no changes
RFCv1 => v2:
- New patch
---
drivers/mfd/rohm-bd71828.c | 64 +++++++++++---------------------------
1 file changed, 18 insertions(+), 46 deletions(-)
diff --git a/drivers/mfd/rohm-bd71828.c b/drivers/mfd/rohm-bd71828.c
index 84a64c3b9c9f..2a43005b67ee 100644
--- a/drivers/mfd/rohm-bd71828.c
+++ b/drivers/mfd/rohm-bd71828.c
@@ -157,55 +157,27 @@ static struct mfd_cell bd71828_mfd_cells[] = {
};
static const struct regmap_range bd71815_volatile_ranges[] = {
- {
- .range_min = BD71815_REG_SEC,
- .range_max = BD71815_REG_YEAR,
- }, {
- .range_min = BD71815_REG_CONF,
- .range_max = BD71815_REG_BAT_TEMP,
- }, {
- .range_min = BD71815_REG_VM_IBAT_U,
- .range_max = BD71815_REG_CC_CTRL,
- }, {
- .range_min = BD71815_REG_CC_STAT,
- .range_max = BD71815_REG_CC_CURCD_L,
- }, {
- .range_min = BD71815_REG_VM_BTMP_MON,
- .range_max = BD71815_REG_VM_BTMP_MON,
- }, {
- .range_min = BD71815_REG_INT_STAT,
- .range_max = BD71815_REG_INT_UPDATE,
- }, {
- .range_min = BD71815_REG_VM_VSYS_U,
- .range_max = BD71815_REG_REX_CTRL_1,
- }, {
- .range_min = BD71815_REG_FULL_CCNTD_3,
- .range_max = BD71815_REG_CCNTD_CHG_2,
- },
+ regmap_reg_range(BD71815_REG_SEC, BD71815_REG_YEAR),
+ regmap_reg_range(BD71815_REG_CONF, BD71815_REG_BAT_TEMP),
+ regmap_reg_range(BD71815_REG_VM_IBAT_U, BD71815_REG_CC_CTRL),
+ regmap_reg_range(BD71815_REG_CC_STAT, BD71815_REG_CC_CURCD_L),
+ regmap_reg_range(BD71815_REG_VM_BTMP_MON, BD71815_REG_VM_BTMP_MON),
+ regmap_reg_range(BD71815_REG_INT_STAT, BD71815_REG_INT_UPDATE),
+ regmap_reg_range(BD71815_REG_VM_VSYS_U, BD71815_REG_REX_CTRL_1),
+ regmap_reg_range(BD71815_REG_FULL_CCNTD_3, BD71815_REG_CCNTD_CHG_2),
};
static const struct regmap_range bd71828_volatile_ranges[] = {
- {
- .range_min = BD71828_REG_PS_CTRL_1,
- .range_max = BD71828_REG_PS_CTRL_1,
- }, {
- .range_min = BD71828_REG_PS_CTRL_3,
- .range_max = BD71828_REG_PS_CTRL_3,
- }, {
- .range_min = BD71828_REG_RTC_SEC,
- .range_max = BD71828_REG_RTC_YEAR,
- }, {
- /*
- * For now make all charger registers volatile because many
- * needs to be and because the charger block is not that
- * performance critical.
- */
- .range_min = BD71828_REG_CHG_STATE,
- .range_max = BD71828_REG_CHG_FULL,
- }, {
- .range_min = BD71828_REG_INT_MAIN,
- .range_max = BD71828_REG_IO_STAT,
- },
+ regmap_reg_range(BD71828_REG_PS_CTRL_1, BD71828_REG_PS_CTRL_1),
+ regmap_reg_range(BD71828_REG_PS_CTRL_3, BD71828_REG_PS_CTRL_3),
+ regmap_reg_range(BD71828_REG_RTC_SEC, BD71828_REG_RTC_YEAR),
+ /*
+ * For now make all charger registers volatile because many
+ * needs to be and because the charger block is not that
+ * performance critical.
+ */
+ regmap_reg_range(BD71828_REG_CHG_STATE, BD71828_REG_CHG_FULL),
+ regmap_reg_range(BD71828_REG_INT_MAIN, BD71828_REG_IO_STAT),
};
static const struct regmap_access_table bd71815_volatile_regs = {
--
2.52.0
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2025-12-15 13:19 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-15 13:16 [PATCH RESEND v6 00/17] Support ROHM BD72720 PMIC Matti Vaittinen
2025-12-15 13:17 ` [PATCH RESEND v6 01/17] dt-bindings: regulator: ROHM BD72720 Matti Vaittinen
2025-12-15 13:17 ` [PATCH RESEND v6 02/17] dt-bindings: battery: Clarify trickle-charge Matti Vaittinen
2025-12-15 13:17 ` [PATCH RESEND v6 03/17] dt-bindings: battery: Add trickle-charge upper limit Matti Vaittinen
2025-12-15 13:18 ` [PATCH RESEND v6 04/17] dt-bindings: battery: Voltage drop properties Matti Vaittinen
2025-12-15 13:18 ` [PATCH RESEND v6 05/17] dt-bindings: mfd: ROHM BD72720 Matti Vaittinen
2025-12-15 13:18 ` [PATCH RESEND v6 06/17] dt-bindings: leds: bd72720: Add BD72720 Matti Vaittinen
2025-12-15 13:19 ` Matti Vaittinen [this message]
2025-12-15 13:19 ` [PATCH RESEND v6 08/17] mfd: rohm-bd71828: Use standard file header format Matti Vaittinen
2025-12-15 13:19 ` [PATCH RESEND v6 09/17] mfd: rohm-bd71828: Support ROHM BD72720 Matti Vaittinen
2025-12-15 13:19 ` [PATCH RESEND v6 10/17] regulator: bd71828: rename IC specific entities Matti Vaittinen
2025-12-15 13:20 ` [PATCH RESEND v6 11/17] regulator: bd71828: Support ROHM BD72720 Matti Vaittinen
2025-12-15 13:20 ` [PATCH RESEND v6 12/17] gpio: Support ROHM BD72720 gpios Matti Vaittinen
2025-12-15 13:20 ` [PATCH RESEND v6 13/17] clk: clk-bd718x7: Support BD72720 clk gate Matti Vaittinen
2025-12-15 13:20 ` [PATCH RESEND v6 14/17] rtc: bd70528: Support BD72720 rtc Matti Vaittinen
2025-12-15 13:21 ` [PATCH RESEND v6 15/17] power: supply: bd71828: Support wider register addresses Matti Vaittinen
2025-12-15 13:21 ` [PATCH RESEND v6 16/17] power: supply: bd71828-power: Support ROHM BD72720 Matti Vaittinen
2025-12-15 13:21 ` [PATCH RESEND v6 17/17] MAINTAINERS: Add ROHM BD72720 PMIC Matti Vaittinen
2025-12-15 13:27 ` [PATCH RESEND v6 00/17] Support " Matti Vaittinen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=49607e65ca117b096a50c5784b760bf62553e29a.1765804226.git.mazziesaccount@gmail.com \
--to=matti.vaittinen@linux.dev \
--cc=alexandre.belloni@bootlin.com \
--cc=andreas@kemnade.info \
--cc=brgl@kernel.org \
--cc=broonie@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=krzk+dt@kernel.org \
--cc=lee@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linusw@kernel.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-leds@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-rtc@vger.kernel.org \
--cc=matti.vaittinen@fi.rohmeurope.com \
--cc=mazziesaccount@gmail.com \
--cc=mturquette@baylibre.com \
--cc=pavel@kernel.org \
--cc=robh@kernel.org \
--cc=sboyd@kernel.org \
--cc=sre@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).