iio: base: Adding flags to regmap_i2c
Subsystems (3)
PATCH 1/1 iio: base: Adding flags to regmap_i2c
Providing access to i2c flags within regmap i2c functions.
--- drivers/base/regmap/regmap-i2c.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/base/regmap/regmap-i2c.c +4 -4
@@ -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;
Signature · 1 line
2.1.4
Jonathan Cameron
maintainerQuoted 1 line · Crt Mori
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?
Quoted 41 lines
Signed-off-by Crt Mori <[email protected]>--- drivers/base/regmap/regmap-i2c.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)drivers/base/regmap/regmap-i2c.c +4
-4@@ -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;
Quoted 7 lines · Jonathan Cameron
Quoted 1 line · Crt Mori
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.
Quoted 42 lines
Quoted 41 lines
Signed-off-by Crt Mori <[email protected]>--- drivers/base/regmap/regmap-i2c.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)drivers/base/regmap/regmap-i2c.c +4
-4@@ -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;
Jonathan Cameron
maintainerQuoted 10 lines · Crt Mori
Quoted 7 lines · Jonathan Cameron
Quoted 1 line · Crt Mori
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.
Quoted 42 lines
Quoted 42 lines
Quoted 41 lines
Signed-off-by Crt Mori <[email protected]>--- drivers/base/regmap/regmap-i2c.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)drivers/base/regmap/regmap-i2c.c +4
-4@@ -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;