linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Seth Heasley <seth.heasley@linux.intel.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Neil Horman <nhorman@tuxdriver.com>,
	linux-i2c@vger.kernel.org, Wolfram Sang <wsa@kernel.org>
Cc: mario.posso.escobar@intel.com, seth.heasley@intel.com
Subject: Re: [PATCH v1] i2c: ismt: Adding support for I2C_SMBUS_BLOCK_PROC_CALL
Date: Thu, 03 Dec 2020 00:51:02 -0800	[thread overview]
Message-ID: <989a41d4e72610c8ddf36372e9a84de48f27c246.camel@linux.intel.com> (raw)
In-Reply-To: <20201116153245.24083-1-andriy.shevchenko () linux ! intel ! com>

On Mon, 2020-11-16 at 15:32 +0000, Andy Shevchenko wrote:
> From: Mario Alejandro Posso Escobar <mario.posso.escobar@intel.com>
> 
> Expand the driver to support I2C_SMBUS_BLOCK_PROC_CALL since
> HW supports it already.
> 
> Co-developed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Signed-off-by: Mario Alejandro Posso Escobar 
> mario.posso.escobar@intel.com>
 Reviewed-by: Seth Heasley <seth.heasley@linux.intel.com>

> ---
>  drivers/i2c/busses/i2c-ismt.c | 19 +++++++++++++++++--
>  1 file changed, 17 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-ismt.c b/drivers/i2c/busses/i2c-
> ismt.c
> index a35a27c320e7..a6187cbec2c9 100644
> --- a/drivers/i2c/busses/i2c-ismt.c
> +++ b/drivers/i2c/busses/i2c-ismt.c
> @@ -53,7 +53,7 @@
>   *  Features supported by this driver:
>   *  Hardware PEC                     yes
>   *  Block buffer                     yes
> - *  Block process call transaction   no
> + *  Block process call transaction   yes
>   *  Slave mode                       no
>   */
>  
> @@ -332,7 +332,8 @@ static int ismt_process_desc(const struct
> ismt_desc *desc,
>  
>  	if (desc->status & ISMT_DESC_SCS) {
>  		if (read_write == I2C_SMBUS_WRITE &&
> -		    size != I2C_SMBUS_PROC_CALL)
> +		    size != I2C_SMBUS_PROC_CALL &&
> +		    size != I2C_SMBUS_BLOCK_PROC_CALL)
>  			return 0;
>  
>  		switch (size) {
> @@ -345,6 +346,7 @@ static int ismt_process_desc(const struct
> ismt_desc *desc,
>  			data->word = dma_buffer[0] | (dma_buffer[1] <<
> 8);
>  			break;
>  		case I2C_SMBUS_BLOCK_DATA:
> +		case I2C_SMBUS_BLOCK_PROC_CALL:
>  			if (desc->rxbytes != dma_buffer[0] + 1)
>  				return -EMSGSIZE;
>  
> @@ -518,6 +520,18 @@ static int ismt_access(struct i2c_adapter *adap,
> u16 addr,
>  		}
>  		break;
>  
> +	case I2C_SMBUS_BLOCK_PROC_CALL:
> +		dev_dbg(dev, "I2C_SMBUS_BLOCK_PROC_CALL\n");
> +		dma_size = I2C_SMBUS_BLOCK_MAX;
> +		desc->tgtaddr_rw = ISMT_DESC_ADDR_RW(addr, 1);
> +		desc->wr_len_cmd = data->block[0] + 1;
> +		desc->rd_len = dma_size;
> +		desc->control |= ISMT_DESC_BLK;
> +		dma_direction = DMA_BIDIRECTIONAL;
> +		dma_buffer[0] = command;
> +		memcpy(&dma_buffer[1], &data->block[1], data-
> >block[0]);
> +		break;
> +
>  	case I2C_SMBUS_I2C_BLOCK_DATA:
>  		/* Make sure the length is valid */
>  		if (data->block[0] < 1)
> @@ -624,6 +638,7 @@ static u32 ismt_func(struct i2c_adapter *adap)
>  	       I2C_FUNC_SMBUS_BYTE_DATA		|
>  	       I2C_FUNC_SMBUS_WORD_DATA		|
>  	       I2C_FUNC_SMBUS_PROC_CALL		|
> +	       I2C_FUNC_SMBUS_BLOCK_PROC_CALL	|
>  	       I2C_FUNC_SMBUS_BLOCK_DATA	|
>  	       I2C_FUNC_SMBUS_I2C_BLOCK		|
>  	       I2C_FUNC_SMBUS_PEC;


       reply	other threads:[~2020-12-03 15:55 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20201116153245.24083-1-andriy.shevchenko () linux ! intel ! com>
2020-12-03  8:51 ` Seth Heasley [this message]
2020-12-03 20:21   ` [PATCH v1] i2c: ismt: Adding support for I2C_SMBUS_BLOCK_PROC_CALL Wolfram Sang
2020-11-16 15:32 Andy Shevchenko
2020-12-02 15:45 ` Wolfram Sang
2020-12-02 16:00   ` Wolfram Sang
2020-12-02 16:24     ` Andy Shevchenko
2020-12-02 16:23   ` Andy Shevchenko
2020-12-02 16:25     ` Wolfram Sang

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=989a41d4e72610c8ddf36372e9a84de48f27c246.camel@linux.intel.com \
    --to=seth.heasley@linux.intel.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=linux-i2c@vger.kernel.org \
    --cc=mario.posso.escobar@intel.com \
    --cc=nhorman@tuxdriver.com \
    --cc=seth.heasley@intel.com \
    --cc=wsa@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).