From: Jonathan Cameron <jic23@kernel.org>
To: Crt Mori <cmo@melexis.com>
Cc: Mark Brown <broonie@kernel.org>, linux-iio@vger.kernel.org
Subject: Re: [PATCH] iio: base: Adding flags to regmap_i2c
Date: Sat, 15 Aug 2015 21:44:56 +0100 [thread overview]
Message-ID: <55CFA4C8.20000@kernel.org> (raw)
In-Reply-To: <CAKv63uvi0xosNfUe+gfF1kD+LHZYP3ewbGT1DtsAikjU2YGHug@mail.gmail.com>
On 15/08/15 21:35, Crt Mori wrote:
> On 15 August 2015 at 22:32, Jonathan Cameron <jic23@kernel.org> wrote:
>> 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?
> Most notably in our case PEC, otherwise yes a 10-bit addressing
> was also on my mind.
Makes sense to me. Thanks for the clarification.
>>>
>>> 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;
>>>
>>>
>>
prev parent reply other threads:[~2015-08-15 20:44 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
2015-08-15 20:35 ` Crt Mori
2015-08-15 20:44 ` Jonathan Cameron [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=55CFA4C8.20000@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).