linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iio: base: Adding flags to regmap_i2c
@ 2015-08-11 14:32 Crt Mori
  2015-08-15 20:32 ` Jonathan Cameron
  0 siblings, 1 reply; 4+ messages in thread
From: Crt Mori @ 2015-08-11 14:32 UTC (permalink / raw)
  To: Mark Brown, Jonathan Cameron; +Cc: linux-iio, Crt Mori

Providing access to i2c flags within regmap i2c functions.

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;
 
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-08-15 20:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 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).