mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Cc: bst@pengutronix.de
Subject: [PATCH] pbl/pmic.h: rename pmic_reg_write() to pmic_reg_write8()
Date: Tue,  2 Jan 2024 12:21:13 +0100	[thread overview]
Message-ID: <20240102112113.282609-1-s.hauer@pengutronix.de> (raw)

pmic_reg_write() does 8 bit writes, so rename the function accordingly.

When adding 16/32 bit writes there is no point in abstracting the
register width in pmic_reg_write(), because the caller actually must
know the register width to make useful register changes. This means
we better add pmic_reg_write16/32 when need arises.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/boards/mnt-reform/lowlevel.c | 2 +-
 include/pbl/pmic.h                    | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm/boards/mnt-reform/lowlevel.c b/arch/arm/boards/mnt-reform/lowlevel.c
index 01a50fac56..9f951508df 100644
--- a/arch/arm/boards/mnt-reform/lowlevel.c
+++ b/arch/arm/boards/mnt-reform/lowlevel.c
@@ -59,7 +59,7 @@ static void i2c_mux_set(struct pbl_i2c *i2c, u8 channel)
 
 static void i2c_regulator_set_voltage(struct pbl_i2c *i2c, u8 reg, u8 voffs)
 {
-	pmic_reg_write(i2c, 0x60, reg, 0x80 + voffs);
+	pmic_reg_write8(i2c, 0x60, reg, 0x80 + voffs);
 }
 
 #define I2C_PAD_CTRL	MUX_PAD_CTRL(MX8MQ_PAD_CTL_DSE_45R | \
diff --git a/include/pbl/pmic.h b/include/pbl/pmic.h
index 0f882c5649..695e47a564 100644
--- a/include/pbl/pmic.h
+++ b/include/pbl/pmic.h
@@ -9,7 +9,7 @@ struct pmic_config {
 	u8 val;
 };
 
-static void pmic_reg_write(struct pbl_i2c *i2c, int addr, u8 reg, u8 val)
+static void pmic_reg_write8(struct pbl_i2c *i2c, int addr, u8 reg, u8 val)
 {
 	int ret;
 	u8 buf[32];
@@ -35,7 +35,7 @@ static inline void pmic_configure(struct pbl_i2c *i2c, u8 addr,
 				  size_t config_len)
 {
 	for (; config_len--; config++)
-		pmic_reg_write(i2c, addr, config->reg, config->val);
+		pmic_reg_write8(i2c, addr, config->reg, config->val);
 }
 
 #endif
-- 
2.39.2




                 reply	other threads:[~2024-01-02 11:22 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20240102112113.282609-1-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=bst@pengutronix.de \
    /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