public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 01/11] xc2028: tm6000: bugfix firmware xc3028L-v36.fw used with Zarlink and DTV78 or DTV8 no shift
@ 2010-02-15 17:37 stefan.ringel
  2010-02-15 17:37 ` [PATCH 02/11] tm6000: add i2c bus id for tm6000 stefan.ringel
  2010-02-15 18:36 ` [PATCH 01/11] xc2028: tm6000: bugfix firmware xc3028L-v36.fw used with Zarlink and DTV78 or DTV8 no shift Devin Heitmueller
  0 siblings, 2 replies; 17+ messages in thread
From: stefan.ringel @ 2010-02-15 17:37 UTC (permalink / raw)
  To: linux-media; +Cc: mchehab, dheitmueller, Stefan Ringel

From: Stefan Ringel <stefan.ringel@arcor.de>

Signed-off-by: Stefan Ringel <stefan.ringel@arcor.de>

diff --git a/drivers/media/common/tuners/tuner-xc2028.c b/drivers/media/common/tuners/tuner-xc2028.c
index ed50168..e051caa 100644
--- a/drivers/media/common/tuners/tuner-xc2028.c
+++ b/drivers/media/common/tuners/tuner-xc2028.c
@@ -1114,7 +1114,12 @@ static int xc2028_set_params(struct dvb_frontend *fe,
 
 	/* All S-code tables need a 200kHz shift */
 	if (priv->ctrl.demod) {
-		demod = priv->ctrl.demod + 200;
+		if ((priv->firm_version == 0x0306) && 
+			(priv->ctrl.demod == XC3028_FE_ZARLINK456) &&
+				((type & DTV78) || (type & DTV8)))
+			demod = priv->ctrl.demod;
+		else
+			demod = priv->ctrl.demod + 200;
 		/*
 		 * The DTV7 S-code table needs a 700 kHz shift.
 		 * Thanks to Terry Wu <terrywu2009@gmail.com> for reporting this
-- 
1.6.6.1


^ permalink raw reply related	[flat|nested] 17+ messages in thread
* [PATCH 07/11] tm6000: add i2c send recv functions
@ 2010-02-18 21:11 stefan.ringel
  0 siblings, 0 replies; 17+ messages in thread
From: stefan.ringel @ 2010-02-18 21:11 UTC (permalink / raw)
  To: linux-media; +Cc: mchehab, dheitmueller, Stefan Ringel

From: Stefan Ringel <stefan.ringel@arcor.de>

Signed-off-by: Stefan Ringel <stefan.ringel@arcor.de>

diff --git a/drivers/staging/tm6000/tm6000-i2c.c b/drivers/staging/tm6000/tm6000-i2c.c
index 6b17d0b..9d02674 100644
--- a/drivers/staging/tm6000/tm6000-i2c.c
+++ b/drivers/staging/tm6000/tm6000-i2c.c
@@ -42,6 +42,32 @@ MODULE_PARM_DESC(i2c_debug, "enable debug messages [i2c]");
 			printk(KERN_DEBUG "%s at %s: " fmt, \
 			dev->name, __FUNCTION__ , ##args); } while (0)
 
+int tm6000_i2c_send_byte (struct tm6000_core *dev, unsigned char addr, __u8 reg, char *buf, int len)
+{
+	return tm6000_read_write_usb (dev, USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
+		REQ_16_SET_GET_I2C_WR1_RDN, addr | reg << 8, 0, buf, len);
+}
+
+int tm6000_i2c_recv_byte (struct tm6000_core *dev, unsigned char addr, __u8 reg, char *buf, int len)
+{
+	int rc:
+
+	rc = tm6000_read_write_usb (dev, USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
+		REQ_16_SET_GET_I2C_WR1_RDN, addr | reg << 8, 0, buf, len);
+
+	return rc;
+}
+
+int tm6000_i2c_recv_word (struct tm6000_core *dev, unsigned char addr, __u16 reg, char *buf , int len)
+{
+	int rc;
+
+	rc = tm6000_read_write_usb (dev, USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
+		REQ_14_SET_GET_I2C_WR2_RDN, addr, reg, buf, len);
+
+	return rc;
+}
+
 static int tm6000_i2c_xfer(struct i2c_adapter *i2c_adap,
 			   struct i2c_msg msgs[], int num)
 {
@@ -76,13 +102,14 @@ static int tm6000_i2c_xfer(struct i2c_adapter *i2c_adap,
 			i2c_dprintk(2, "; joined to read %s len=%d:",
 				    i == num - 2 ? "stop" : "nonstop",
 				    msgs[i + 1].len);
-			rc = tm6000_read_write_usb (dev,
-				USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
-				msgs[i].len == 1 ? REQ_16_SET_GET_I2C_WR1_RDN
-						 : REQ_14_SET_GET_I2C_WR2_RDN,
-				addr | msgs[i].buf[0] << 8,
-				msgs[i].len == 1 ? 0 : msgs[i].buf[1],
-				msgs[i + 1].buf, msgs[i + 1].len);
+
+			if (msgs[i].len == 1) {
+				rc = tm6000_i2c_recv_byte (dev, addr, msgs[i].buf[0],
+					msgs[i + 1].buf, msgs[i + 1].len);
+			} else {
+				rc = tm6000_i2c_recv_word (dev, addr, msgs[i].buf[0] << 8 | msgs[i].buf[1],
+					msgs[i + 1].buf, msgs[i + 1].len);
+			}
 			i++;
 
 			if ((dev->dev_type == TM6010) && (addr == 0xc2)) {
@@ -97,10 +124,8 @@ static int tm6000_i2c_xfer(struct i2c_adapter *i2c_adap,
 			if (i2c_debug >= 2)
 				for (byte = 0; byte < msgs[i].len; byte++)
 					printk(" %02x", msgs[i].buf[byte]);
-			rc = tm6000_read_write_usb(dev,
-				USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
-				REQ_16_SET_GET_I2C_WR1_RDN,
-				addr | msgs[i].buf[0] << 8, 0,
+
+			rc = tm6000_i2c_send_byte(dev, addr, msgs[i].buf[0],
 				msgs[i].buf + 1, msgs[i].len - 1);
 
 			if ((dev->dev_type == TM6010) && (addr == 0xc2)) {
-- 
1.6.6.1


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

end of thread, other threads:[~2010-02-18 21:11 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-15 17:37 [PATCH 01/11] xc2028: tm6000: bugfix firmware xc3028L-v36.fw used with Zarlink and DTV78 or DTV8 no shift stefan.ringel
2010-02-15 17:37 ` [PATCH 02/11] tm6000: add i2c bus id for tm6000 stefan.ringel
2010-02-15 17:37   ` [PATCH 03/11] tm6000: add additional init register stefan.ringel
2010-02-15 17:37     ` [PATCH 04/11] tm6000: add different tuner reset for terratec stefan.ringel
2010-02-15 17:37       ` [PATCH 05/11] tm6000: add card setup for terratec cinergy hybrid stefan.ringel
2010-02-15 17:37         ` [PATCH 06/11] tm6000: reset the numbers of feeds to 8 stefan.ringel
2010-02-15 17:37           ` [PATCH 07/11] tm6000: add i2c send recv functions stefan.ringel
2010-02-15 17:37             ` [PATCH 08/11] tm6000: special request for all tuner stefan.ringel
2010-02-15 17:37               ` [PATCH 09/11] zl10353: tm6000: bugfix reading problems with tm6000 i2c host stefan.ringel
2010-02-15 17:37                 ` [PATCH 10/11] tm6000: remove hack.c hack.h, switch to zl10353 module stefan.ringel
2010-02-15 17:37                   ` [PATCH 11/11] tm6000: change version to 0.0.2 stefan.ringel
2010-02-18 20:20                 ` [PATCH 09/11] zl10353: tm6000: bugfix reading problems with tm6000 i2c host Mauro Carvalho Chehab
2010-02-18 20:28             ` [PATCH 07/11] tm6000: add i2c send recv functions Mauro Carvalho Chehab
2010-02-15 18:36 ` [PATCH 01/11] xc2028: tm6000: bugfix firmware xc3028L-v36.fw used with Zarlink and DTV78 or DTV8 no shift Devin Heitmueller
2010-02-15 19:19   ` Stefan Ringel
2010-02-15 20:29     ` Stefan Ringel
  -- strict thread matches above, loose matches on Subject: below --
2010-02-18 21:11 [PATCH 07/11] tm6000: add i2c send recv functions stefan.ringel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox