mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Axel Lin <axel.lin@ingics.com>
To: Mark Brown <broonie@kernel.org>
Cc: Joseph Chen <chenjh@rock-chips.com>,
	Ezequiel Garcia <ezequiel@collabora.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	linux-kernel@vger.kernel.org, Axel Lin <axel.lin@ingics.com>
Subject: [PATCH RFT] regulator: fan53555: Fix off-by-one for TCS4525_NVOLTAGES
Date: Tue, 27 Apr 2021 21:45:29 +0800	[thread overview]
Message-ID: <20210427134529.818784-1-axel.lin@ingics.com> (raw)

While at it, also remove unused TCS_VSEL_NSEL_MASK.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
Hi Joseph & Ezequiel,
The TCS4525_NVOLTAGES is unlikely to be 127 because if it's 127 the
rdesc->vsel_mask will be 126 (i.e. 0b1111110, which only allows 64 different selectors).
I don't have the hw to verify (I just read the code and I might be wrong),
please check if this patch is correct or not.
Thanks,
Axel
 drivers/regulator/fan53555.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/regulator/fan53555.c b/drivers/regulator/fan53555.c
index f3918f03aaf3..aa963435d2b2 100644
--- a/drivers/regulator/fan53555.c
+++ b/drivers/regulator/fan53555.c
@@ -55,9 +55,8 @@
 
 #define FAN53555_NVOLTAGES	64	/* Numbers of voltages */
 #define FAN53526_NVOLTAGES	128
-#define TCS4525_NVOLTAGES	127	/* Numbers of voltages */
+#define TCS4525_NVOLTAGES	128	/* Numbers of voltages */
 
-#define TCS_VSEL_NSEL_MASK	0x7f
 #define TCS_VSEL0_MODE		(1 << 7)
 #define TCS_VSEL1_MODE		(1 << 6)
 
-- 
2.25.1


             reply	other threads:[~2021-04-27 13:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-27 13:45 Axel Lin [this message]
2021-05-14 15:35 ` Mark Brown

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=20210427134529.818784-1-axel.lin@ingics.com \
    --to=axel.lin@ingics.com \
    --cc=broonie@kernel.org \
    --cc=chenjh@rock-chips.com \
    --cc=ezequiel@collabora.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.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

all inboxes | Powered by JetHome®