All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/5] saa7164: add support for i2c read
@ 2015-03-27 11:57 Olli Salonen
  2015-03-27 11:57 ` [PATCH 2/5] si2168: add support for gapped clock Olli Salonen
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Olli Salonen @ 2015-03-27 11:57 UTC (permalink / raw)
  To: linux-media; +Cc: Olli Salonen

Add support for pure I2C reads. Needed by si2157 tuner driver.

Signed-off-by: Olli Salonen <olli.salonen@iki.fi>
---
 drivers/media/pci/saa7164/saa7164-i2c.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/media/pci/saa7164/saa7164-i2c.c b/drivers/media/pci/saa7164/saa7164-i2c.c
index 4f7e3b4..e30e206 100644
--- a/drivers/media/pci/saa7164/saa7164-i2c.c
+++ b/drivers/media/pci/saa7164/saa7164-i2c.c
@@ -39,9 +39,12 @@ static int i2c_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg *msgs, int num)
 		dprintk(DBGLVL_I2C, "%s(num = %d) addr = 0x%02x  len = 0x%x\n",
 			__func__, num, msgs[i].addr, msgs[i].len);
 		if (msgs[i].flags & I2C_M_RD) {
-			/* Unsupported - Yet*/
-			printk(KERN_ERR "%s() Unsupported - Yet\n", __func__);
-			continue;
+			/* dummy write before read */
+			retval = saa7164_api_i2c_read(bus, msgs[i].addr,
+				0, NULL, msgs[i].len, msgs[i].buf);
+
+			if (retval < 0)
+				goto err;
 		} else if (i + 1 < num && (msgs[i + 1].flags & I2C_M_RD) &&
 			   msgs[i].addr == msgs[i + 1].addr) {
 			/* write then read from same address */
-- 
1.9.1


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

end of thread, other threads:[~2015-03-27 12:39 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-27 11:57 [PATCH 1/5] saa7164: add support for i2c read Olli Salonen
2015-03-27 11:57 ` [PATCH 2/5] si2168: add support for gapped clock Olli Salonen
2015-03-27 11:57 ` [PATCH 3/5] saa7164: store i2c_client for demod and tuner in state Olli Salonen
2015-03-27 11:57 ` [PATCH 4/5] dvbsky: use si2168 config option ts_clock_gapped Olli Salonen
2015-03-27 11:57 ` [PATCH 5/5] saa7164: Hauppauge HVR-2205 and HVR-2215 DVB-C/T/T2 tuners Olli Salonen
2015-03-27 12:08   ` Steven Toth
2015-03-27 12:13     ` Antti Palosaari
2015-03-27 12:16       ` Steven Toth
2015-03-27 12:31     ` Olli Salonen
2015-03-27 12:39       ` Steven Toth

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.