All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeremy Kerr <jk@codeconstruct.com.au>
To: linux-i3c@lists.infradead.org
Cc: Matt Johnston <matt@codeconstruct.com.au>,
	Joel Stanley <joel@jms.id.au>,
	Alexandre Belloni <alexandre.belloni@bootlin.com>,
	Lukwinski Zbigniew <zbigniew.lukwinski@linux.intel.com>
Subject: [PATCH] i3c: ast2600: fix register setting for 545 ohm pullups
Date: Fri, 28 Apr 2023 08:18:49 +0800	[thread overview]
Message-ID: <20230428001849.1775559-1-jk@codeconstruct.com.au> (raw)

The 2k register setting is zero, OR-ing it in doesn't parallel the 2k
and 750 ohm pullups. We need a separate value for the 545 ohm setting.

Reported-by: Lukwinski Zbigniew <zbigniew.lukwinski@linux.intel.com>
Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>

---
 drivers/i3c/master/ast2600-i3c-master.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/i3c/master/ast2600-i3c-master.c b/drivers/i3c/master/ast2600-i3c-master.c
index b3f0fe1e63c3..d9af7b1cf878 100644
--- a/drivers/i3c/master/ast2600-i3c-master.c
+++ b/drivers/i3c/master/ast2600-i3c-master.c
@@ -21,6 +21,7 @@
 #define AST2600_I3CG_REG0_SDA_PULLUP_EN_MASK	GENMASK(29, 28)
 #define AST2600_I3CG_REG0_SDA_PULLUP_EN_2K	(0x0 << 28)
 #define AST2600_I3CG_REG0_SDA_PULLUP_EN_750	(0x2 << 28)
+#define AST2600_I3CG_REG0_SDA_PULLUP_EN_545	(0x3 << 28)
 
 #define AST2600_I3CG_REG1_I2C_MODE		BIT(0)
 #define AST2600_I3CG_REG1_TEST_MODE		BIT(1)
@@ -60,8 +61,7 @@ static int ast2600_i3c_pullup_to_reg(unsigned int ohms, u32 *regp)
 		reg = AST2600_I3CG_REG0_SDA_PULLUP_EN_750;
 		break;
 	case 545:
-		reg = AST2600_I3CG_REG0_SDA_PULLUP_EN_2K |
-			AST2600_I3CG_REG0_SDA_PULLUP_EN_750;
+		reg = AST2600_I3CG_REG0_SDA_PULLUP_EN_545;
 		break;
 	default:
 		return -EINVAL;
-- 
2.39.1


-- 
linux-i3c mailing list
linux-i3c@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-i3c

                 reply	other threads:[~2023-04-28  0:19 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=20230428001849.1775559-1-jk@codeconstruct.com.au \
    --to=jk@codeconstruct.com.au \
    --cc=alexandre.belloni@bootlin.com \
    --cc=joel@jms.id.au \
    --cc=linux-i3c@lists.infradead.org \
    --cc=matt@codeconstruct.com.au \
    --cc=zbigniew.lukwinski@linux.intel.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.