linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Crt Mori <cmo@melexis.com>, Mark Brown <broonie@kernel.org>
Cc: linux-iio@vger.kernel.org
Subject: Re: [PATCH] iio: base: Adding flags to regmap_i2c
Date: Sat, 15 Aug 2015 21:32:07 +0100	[thread overview]
Message-ID: <55CFA1C7.70706@kernel.org> (raw)
In-Reply-To: <1439303524-30801-1-git-send-email-cmo@melexis.com>

On 11/08/15 15:32, Crt Mori wrote:
> Providing access to i2c flags within regmap i2c functions.
The patch may be fine, but I'd like to see a more detailed description.
Why would one want to do this?  What exactly is the use case?

Presumably either 10 bit addressing or PEC?  Or are we dealing
with a new flag working it's way through?
> 
> Signed-off-by: Crt Mori <cmo@melexis.com>
> ---
>  drivers/base/regmap/regmap-i2c.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/base/regmap/regmap-i2c.c b/drivers/base/regmap/regmap-i2c.c
> index fa6bf52..33e5229 100644
> --- a/drivers/base/regmap/regmap-i2c.c
> +++ b/drivers/base/regmap/regmap-i2c.c
> @@ -46,12 +46,12 @@ static int regmap_i2c_gather_write(void *context,
>  		return -ENOTSUPP;
>  
>  	xfer[0].addr = i2c->addr;
> -	xfer[0].flags = 0;
> +	xfer[0].flags = i2c->flags;
>  	xfer[0].len = reg_size;
>  	xfer[0].buf = (void *)reg;
>  
>  	xfer[1].addr = i2c->addr;
> -	xfer[1].flags = I2C_M_NOSTART;
> +	xfer[1].flags = i2c->flags | I2C_M_NOSTART;
>  	xfer[1].len = val_size;
>  	xfer[1].buf = (void *)val;
>  
> @@ -74,12 +74,12 @@ static int regmap_i2c_read(void *context,
>  	int ret;
>  
>  	xfer[0].addr = i2c->addr;
> -	xfer[0].flags = 0;
> +	xfer[0].flags = i2c->flags;
>  	xfer[0].len = reg_size;
>  	xfer[0].buf = (void *)reg;
>  
>  	xfer[1].addr = i2c->addr;
> -	xfer[1].flags = I2C_M_RD;
> +	xfer[1].flags = i2c->flags | I2C_M_RD;
>  	xfer[1].len = val_size;
>  	xfer[1].buf = val;
>  
> 


  reply	other threads:[~2015-08-15 20:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-11 14:32 [PATCH] iio: base: Adding flags to regmap_i2c Crt Mori
2015-08-15 20:32 ` Jonathan Cameron [this message]
2015-08-15 20:35   ` Crt Mori
2015-08-15 20:44     ` Jonathan Cameron

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=55CFA1C7.70706@kernel.org \
    --to=jic23@kernel.org \
    --cc=broonie@kernel.org \
    --cc=cmo@melexis.com \
    --cc=linux-iio@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;
as well as URLs for NNTP newsgroup(s).