Re: [PATCH] iio: base: Adding flags to regmap_i2c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 15/08/15 21:35, Crt Mori wrote:
> On 15 August 2015 at 22:32, Jonathan Cameron <jic23@xxxxxxxxxx> 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@xxxxxxxxxxx>
>>> ---
>>>  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;
>>>
>>>
>>

--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux