linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matt Johnston <matt@codeconstruct.com.au>
To: unlisted-recipients:; (no To-header on input)
Cc: linux-i2c@vger.kernel.org, Daniel Stodden <dns@arista.com>,
	Jean Delvare <jdelvare@suse.de>,
	Jeremy Kerr <jk@codeconstruct.com.au>,
	Tali Perry <tali.perry1@gmail.com>,
	Patrick Venture <venture@google.com>
Subject: [PATCH v2 4/4] i2c: npcm7xx: Allow 255 byte block SMBus transfers
Date: Mon, 24 Jan 2022 16:31:31 +0800	[thread overview]
Message-ID: <20220124083131.417420-5-matt@codeconstruct.com.au> (raw)
In-Reply-To: <20220124083131.417420-1-matt@codeconstruct.com.au>

255 byte support has been tested on a npcm750 board

Signed-off-by: Matt Johnston <matt@codeconstruct.com.au>
Reviewed-by: Tali Perry <tali.perry1@gmail.com>
Reviewed-by: Patrick Venture <venture@google.com>
---
 drivers/i2c/busses/i2c-npcm7xx.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-npcm7xx.c b/drivers/i2c/busses/i2c-npcm7xx.c
index 2ad166355ec9..01a1e96be4ba 100644
--- a/drivers/i2c/busses/i2c-npcm7xx.c
+++ b/drivers/i2c/busses/i2c-npcm7xx.c
@@ -1399,7 +1399,7 @@ static void npcm_i2c_irq_master_handler_read(struct npcm_i2c *bus)
 		if (bus->read_block_use) {
 			/* first byte in block protocol is the size: */
 			data = npcm_i2c_rd_byte(bus);
-			data = clamp_val(data, 1, I2C_SMBUS_BLOCK_MAX);
+			data = clamp_val(data, 1, I2C_SMBUS3_BLOCK_MAX);
 			bus->rd_size = data + block_extra_bytes_size;
 			bus->rd_buf[bus->rd_ind++] = data;
 
@@ -2187,6 +2187,7 @@ static u32 npcm_i2c_functionality(struct i2c_adapter *adap)
 	       I2C_FUNC_SMBUS_EMUL |
 	       I2C_FUNC_SMBUS_BLOCK_DATA |
 	       I2C_FUNC_SMBUS_PEC |
+	       I2C_FUNC_SMBUS3_BLOCKSIZE |
 	       I2C_FUNC_SLAVE;
 }
 
-- 
2.32.0


      parent reply	other threads:[~2022-01-24  8:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-24  8:31 [PATCH v2 0/4] Increase SMBus max block size to 255 Matt Johnston
2022-01-24  8:31 ` [PATCH v2 1/4] i2c: core: Allow 255 byte transfers for SMBus 3.x Matt Johnston
2022-01-24  8:31 ` [PATCH v2 2/4] i2c: dev: Support smbus3 block size of 255 bytes Matt Johnston
2022-01-24  8:31 ` [PATCH v2 3/4] i2c: aspeed: Allow 255 byte block transfers Matt Johnston
2022-01-24  8:31 ` Matt Johnston [this message]

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=20220124083131.417420-5-matt@codeconstruct.com.au \
    --to=matt@codeconstruct.com.au \
    --cc=dns@arista.com \
    --cc=jdelvare@suse.de \
    --cc=jk@codeconstruct.com.au \
    --cc=linux-i2c@vger.kernel.org \
    --cc=tali.perry1@gmail.com \
    --cc=venture@google.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 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).