All of lore.kernel.org
 help / color / mirror / Atom feed
* Trying to support for HAUPPAUGE HVR-930C
@ 2011-07-28  8:53 Eddi De Pieri
  2011-07-28 12:13 ` Benjamin Larsson
  0 siblings, 1 reply; 7+ messages in thread
From: Eddi De Pieri @ 2011-07-28  8:53 UTC (permalink / raw)
  To: linux-media; +Cc: devin.heitmueller, mchehab, o.endriss

[-- Attachment #1: Type: text/plain, Size: 943 bytes --]

Hi,

I'd like to share my work to get hvr 930c.

I had to apply some change to drxk structure too!

The patch is created with git diff at with these latest 3 commit:
commit 9bc5f6fa12c9e3e1e73e66bfabe9d463ea779b08
commit a65ea1e0dba7df0f3b6d55098162cf0125164c6c
commit e5d993e5423ea4b81ccdbe2fa157ca5a75176d68

I cloned the work done for Terratec H5 devices.

- I fixed the firmware extraction I already posted
- The driver load the firmware to drxk
- The xc5000 firmware upload works and reset too.
- The if_khz should be ok (I dumped the value from usbsnoop)

- added chunk_size to drx_config since it seems hvr930c needs a custom
chunksize for firmware upload (please check since my patch may add
regression other devices)

- I temporary applied the patch
https://patchwork.kernel.org/patch/790352/mbox/ too

Actually the device don't work yet.

Please someone can review my work?


Signed-off-by: Eddi De Pieri <eddi@depieri.net>

regards

[-- Attachment #2: hauppauge-hvr930c_r0.patch --]
[-- Type: application/octet-stream, Size: 11810 bytes --]

diff --git a/Documentation/dvb/get_dvb_firmware b/Documentation/dvb/get_dvb_firmware
index c466f58..503d70f 100755
--- a/Documentation/dvb/get_dvb_firmware
+++ b/Documentation/dvb/get_dvb_firmware
@@ -27,7 +27,7 @@ use IO::Handle;
 		"or51211", "or51132_qam", "or51132_vsb", "bluebird",
 		"opera1", "cx231xx", "cx18", "cx23885", "pvrusb2", "mpc718",
 		"af9015", "ngene", "az6027", "lme2510_lg", "lme2510c_s7395",
-		"lme2510c_s7395_old", "drxk", "drxk_terratec_h5");
+		"lme2510c_s7395_old", "drxk", "drxk_hauppauge_hvr930c", "drxk_terratec_h5");
 
 # Check args
 syntax() if (scalar(@ARGV) != 1);
@@ -652,6 +652,24 @@ sub drxk {
     "$fwfile"
 }
 
+sub drxk_hauppauge_hvr930c {
+    my $url = "http://www.wintvcd.co.uk/drivers/";
+    my $zipfile = "HVR-9x0_5_10_325_28153_SIGNED.zip";
+    my $hash = "83ab82e7e9480ec8bf1ae0155ca63c88";
+    my $tmpdir = tempdir(DIR => "/tmp", CLEANUP => 1);
+    my $drvfile = "HVR-900/emOEM.sys";
+    my $fwfile = "dvb-usb-hauppauge-hvr930c-drxk.fw";
+
+    checkstandard();
+
+    wgetfile($zipfile, $url . $zipfile);
+    verify($zipfile, $hash);
+    unzip($zipfile, $tmpdir);
+    extract("$tmpdir/$drvfile", 0x117b0, 42692, "$fwfile");
+
+    "$fwfile"
+}
+
 sub drxk_terratec_h5 {
     my $url = "http://www.linuxtv.org/downloads/firmware/";
     my $hash = "19000dada8e2741162ccc50cc91fa7f1";
diff --git a/drivers/media/common/tuners/xc5000.c b/drivers/media/common/tuners/xc5000.c
index aa1b2e8..a491a5b 100644
--- a/drivers/media/common/tuners/xc5000.c
+++ b/drivers/media/common/tuners/xc5000.c
@@ -996,6 +996,8 @@ static int xc_load_fw_and_init_tuner(struct dvb_frontend *fe)
 	struct xc5000_priv *priv = fe->tuner_priv;
 	int ret = 0;
 
+	mutex_lock(&xc5000_list_mutex);
+
 	if (xc5000_is_firmware_loaded(fe) != XC_RESULT_SUCCESS) {
 		ret = xc5000_fwupload(fe);
 		if (ret != XC_RESULT_SUCCESS)
@@ -1015,6 +1017,8 @@ static int xc_load_fw_and_init_tuner(struct dvb_frontend *fe)
 	/* Default to "CABLE" mode */
 	ret |= xc_write_reg(priv, XREG_SIGNALSOURCE, XC_RF_MODE_CABLE);
 
+	mutex_unlock(&xc5000_list_mutex);
+
 	return ret;
 }
 
diff --git a/drivers/media/dvb/frontends/drxk.h b/drivers/media/dvb/frontends/drxk.h
index 58baf41..0dc9883 100644
--- a/drivers/media/dvb/frontends/drxk.h
+++ b/drivers/media/dvb/frontends/drxk.h
@@ -25,6 +25,8 @@ struct drxk_config {
 
 	bool	antenna_dvbt;
 	u16	antenna_gpio;
+	
+	int    chunk_size;
 
 	const char *microcode_name;
 };
diff --git a/drivers/media/dvb/frontends/drxk_hard.c b/drivers/media/dvb/frontends/drxk_hard.c
index 5694955..9a59f29 100644
--- a/drivers/media/dvb/frontends/drxk_hard.c
+++ b/drivers/media/dvb/frontends/drxk_hard.c
@@ -684,7 +684,8 @@ static int init_state(struct drxk_state *state)
 	state->m_hasOOB = false;
 	state->m_hasAudio = false;
 
-	state->m_ChunkSize = 124;
+	if (!state->m_ChunkSize)
+	    state->m_ChunkSize = 124;
 
 	state->m_oscClockFreq = 0;
 	state->m_smartAntInverted = false;
@@ -6422,6 +6423,7 @@ struct dvb_frontend *drxk_attach(const struct drxk_config *config,
 	state->no_i2c_bridge = config->no_i2c_bridge;
 	state->antenna_gpio = config->antenna_gpio;
 	state->antenna_dvbt = config->antenna_dvbt;
+	state->m_ChunkSize = config->chunk_size;
 
 	/* NOTE: as more UIO bits will be used, add them to the mask */
 	state->UIO_mask = config->antenna_gpio;
diff --git a/drivers/media/video/em28xx/em28xx-cards.c b/drivers/media/video/em28xx/em28xx-cards.c
index 3e3959f..538bc91 100644
--- a/drivers/media/video/em28xx/em28xx-cards.c
+++ b/drivers/media/video/em28xx/em28xx-cards.c
@@ -317,6 +317,24 @@ static struct em28xx_reg_seq terratec_h5_digital[] = {
 };
 #endif
 
+static struct em28xx_reg_seq hauppauge_930c_gpio[] = {
+// xc5000 reset
+	{EM2874_R80_GPIO,	0x6f,	0xff,	10},
+	{EM2874_R80_GPIO,	0x4f,	0xff,	10},
+	{EM2874_R80_GPIO,	0x6f,	0xff,	10},
+	{EM2874_R80_GPIO,	0x4f,	0xff,	10},
+	{ -1,			-1,	-1,	-1},
+};
+
+#if 0
+static struct em28xx_reg_seq hauppauge_930c_digital[] = {
+	{EM2874_R80_GPIO,	0xf6,	0xff,	10},
+	{EM2874_R80_GPIO,	0xe6,	0xff,	100},
+	{EM2874_R80_GPIO,	0xa6,	0xff,	10},
+	{ -1,			-1,	-1,	-1},
+};
+#endif
+
 /*
  *  Board definitions
  */
@@ -873,6 +891,19 @@ struct em28xx_board em28xx_boards[] = {
 				EM28XX_I2C_CLK_WAIT_ENABLE |
 				EM28XX_I2C_FREQ_400_KHZ,
 	},
+	[EM2884_BOARD_HAUPPAUGE_WINTV_HVR_930C] = {
+		.name         = "Hauppauge WinTV HVR 930C",
+		.has_dvb      = 1,
+//#if 0
+//		.tuner_type   = TUNER_XC5000,
+//		.tuner_addr   = 0x41,
+//		.dvb_gpio     = hauppauge_930c_digital, /* FIXME: probably wrong */
+		.tuner_gpio   = hauppauge_930c_gpio,
+//#endif
+		.i2c_speed    = EM2874_I2C_SECONDARY_BUS_SELECT |
+				EM28XX_I2C_CLK_WAIT_ENABLE |
+				EM28XX_I2C_FREQ_400_KHZ,
+	},
 	[EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900] = {
 		.name         = "Hauppauge WinTV HVR 900",
 		.tda9887_conf = TDA9887_PRESENT,
@@ -1941,6 +1972,8 @@ struct usb_device_id em28xx_id_table[] = {
 			.driver_info = EM2870_BOARD_KWORLD_A340 },
 	{ USB_DEVICE(0x2013, 0x024f),
 			.driver_info = EM28174_BOARD_PCTV_290E },
+	{ USB_DEVICE(0x2040, 0x1605),
+			.driver_info = EM2884_BOARD_HAUPPAUGE_WINTV_HVR_930C },
 	{ },
 };
 MODULE_DEVICE_TABLE(usb, em28xx_id_table);
@@ -1994,10 +2027,10 @@ int em28xx_tuner_callback(void *ptr, int component, int command, int arg)
 	int rc = 0;
 	struct em28xx *dev = ptr;
 
-	if (dev->tuner_type != TUNER_XC2028)
+	if (dev->tuner_type != TUNER_XC2028 && dev->tuner_type != TUNER_XC5000)
 		return 0;
 
-	if (command != XC2028_TUNER_RESET)
+	if (command != XC2028_TUNER_RESET && command != XC5000_TUNER_RESET)
 		return 0;
 
 	rc = em28xx_gpio_set(dev, dev->board.tuner_gpio);
diff --git a/drivers/media/video/em28xx/em28xx-dvb.c b/drivers/media/video/em28xx/em28xx-dvb.c
index ab8a740..c5f3e78 100644
--- a/drivers/media/video/em28xx/em28xx-dvb.c
+++ b/drivers/media/video/em28xx/em28xx-dvb.c
@@ -1,4 +1,4 @@
-/*
+/*6
  DVB device driver for em28xx
 
  (c) 2008-2011 Mauro Carvalho Chehab <mchehab@infradead.org>
@@ -309,6 +309,14 @@ struct drxk_config terratec_h5_drxk = {
 	.microcode_name = "dvb-usb-terratec-h5-drxk.fw",
 };
 
+struct drxk_config hauppauge_930c_drxk = {
+	.adr = 0x29,
+	.single_master = 1,
+	.no_i2c_bridge = 1,
+	.microcode_name = "dvb-usb-hauppauge-hvr930c-drxk.fw",
+	.chunk_size = 56,
+};
+
 static int drxk_gate_ctrl(struct dvb_frontend *fe, int enable)
 {
 	struct em28xx_dvb *dvb = fe->sec_priv;
@@ -327,6 +335,91 @@ static int drxk_gate_ctrl(struct dvb_frontend *fe, int enable)
 	return status;
 }
 
+static void hauppauge_hvr930c_init(struct em28xx *dev)
+{
+	int i;
+	
+
+	struct em28xx_reg_seq hauppauge_hvr930c_init[] = {
+		{EM2874_R80_GPIO,	0xff,	0xff,	101},  //11111111
+//		{0xd            ,	0xff,	0xff,	101},  //11111111
+		{EM2874_R80_GPIO,	0xfb,	0xff,	50},   //11111011  init bit 3
+		{EM2874_R80_GPIO,	0xff,	0xff,	184},  //11111111
+		{ -1,                   -1,     -1,     -1},
+	};
+	struct em28xx_reg_seq hauppauge_hvr930c_end[] = {
+		{EM2874_R80_GPIO,	0xef,	0xff,	1},    //11101111
+		{EM2874_R80_GPIO,	0xaf,	0xff,	101},  //10101111  init bit 7
+		{EM2874_R80_GPIO,	0xef,	0xff,	118},   //11101111
+
+
+//per il tuner?
+		{EM2874_R80_GPIO,	0xef,	0xff,	1},  //11101111
+		{EM2874_R80_GPIO,	0xcf,	0xff,	11},    //11001111  init bit 6
+		{EM2874_R80_GPIO,	0xef,	0xff,	64},  //11101111
+
+		{EM2874_R80_GPIO,	0xcf,	0xff,	101},  //11001111  init bit 6
+		{EM2874_R80_GPIO,	0xef,	0xff,	101},  //11101111
+		{EM2874_R80_GPIO,	0xcf,	0xff,	11},  //11001111  init bit 6
+		{EM2874_R80_GPIO,	0xef,	0xff,	101},  //11101111
+
+//		{EM2874_R80_GPIO,	0x6f,	0xff,	10},    //01101111
+//		{EM2874_R80_GPIO,	0x6d,	0xff,	100},  //01101101  init bit 2
+		{ -1,                   -1,     -1,     -1},
+	};
+
+	struct em28xx_reg_seq hauppauge_hvr930c_end2[] = {
+//		{EM2874_R80_GPIO,	0x6f,	0xff,	124},  //01101111
+//		{EM2874_R80_GPIO,	0x4f,	0xff,	11},   //01001111  init bit 6
+//		{EM2874_R80_GPIO,	0x6f,	0xff,	1},    //01101111
+//		{EM2874_R80_GPIO,	0x4f,	0xff,	10},   //01001111  init bit 6
+//		{EM2874_R80_GPIO,	0x6f,	0xff,	100},  //01101111
+//		{0xd            ,	0x42,	0xff,	101},  //11111111
+		{ -1,                   -1,     -1,     -1},
+	};
+	struct {
+		unsigned char r[4];
+		int len;
+	} regs[] = {
+		{{ 0x06, 0x02, 0x00, 0x31 }, 4},
+		{{ 0x01, 0x02 }, 2},
+		{{ 0x01, 0x02, 0x00, 0xc6 }, 4},
+		{{ 0x01, 0x00 }, 2},
+		{{ 0x01, 0x00, 0xff, 0xaf }, 4},
+		{{ 0x01, 0x00, 0x03, 0xa0 }, 4},
+		{{ 0x01, 0x00 }, 2},
+		{{ 0x01, 0x00, 0x73, 0xaf }, 4},
+		{{ 0x04, 0x00 }, 2},
+		{{ 0x00, 0x04 }, 2},
+		{{ 0x00, 0x04, 0x00, 0x0a }, 4},
+		{{ 0x04, 0x14 }, 2},
+		{{ 0x04, 0x14, 0x00, 0x00 }, 4},
+	};
+
+	em28xx_gpio_set(dev, hauppauge_hvr930c_init);
+	em28xx_write_reg(dev, EM28XX_R06_I2C_CLK, 0x40);
+	msleep(10);
+	em28xx_write_reg(dev, EM28XX_R06_I2C_CLK, 0x44);
+	msleep(10);
+
+	dev->i2c_client.addr = 0x82 >> 1;
+
+	for (i = 0; i < ARRAY_SIZE(regs); i++)
+		i2c_master_send(&dev->i2c_client, regs[i].r, regs[i].len);
+	em28xx_gpio_set(dev, hauppauge_hvr930c_end);
+
+	msleep(100);
+
+	em28xx_write_reg(dev, EM28XX_R06_I2C_CLK, 0x44);
+	msleep(30);
+
+	em28xx_gpio_set(dev, hauppauge_hvr930c_end2);
+	msleep(10);
+	em28xx_write_reg(dev, EM28XX_R06_I2C_CLK, 0x45);
+	msleep(10);
+
+}
+
 static void terratec_h5_init(struct em28xx *dev)
 {
 	int i;
@@ -769,6 +862,47 @@ static int dvb_init(struct em28xx *dev)
 			}
 		}
 		break;
+	case EM2884_BOARD_HAUPPAUGE_WINTV_HVR_930C:
+		hauppauge_hvr930c_init(dev);
+
+		dvb->dont_attach_fe1 = 1;
+
+		dvb->fe[0] = dvb_attach(drxk_attach, &hauppauge_930c_drxk, &dev->i2c_adap, &dvb->fe[1]);
+		if (!dvb->fe[0]) {
+			result = -EINVAL;
+			goto out_free;
+		}
+		/* FIXME: do we need a pll semaphore? */
+		dvb->fe[0]->sec_priv = dvb;
+		sema_init(&dvb->pll_mutex, 1);
+		dvb->gate_ctrl = dvb->fe[0]->ops.i2c_gate_ctrl;
+		dvb->fe[0]->ops.i2c_gate_ctrl = drxk_gate_ctrl;
+		dvb->fe[1]->id = 1;
+
+		/* Attach xc5000 */
+		struct xc5000_config cfg;
+		memset(&cfg, 0, sizeof(cfg));
+		cfg.i2c_address  = 0x61;
+		//cfg.if_khz = 4570; //FIXME
+		cfg.if_khz = 4000; //FIXME (should be ok) read from i2c traffic
+
+		if (dvb->fe[0]->ops.i2c_gate_ctrl)
+			dvb->fe[0]->ops.i2c_gate_ctrl(dvb->fe[0], 1);
+		if (!dvb_attach(xc5000_attach, dvb->fe[0], &dev->i2c_adap, &cfg)) {
+			result = -EINVAL;
+			goto out_free;
+		}
+
+		if (dvb->fe[0]->ops.i2c_gate_ctrl)
+			dvb->fe[0]->ops.i2c_gate_ctrl(dvb->fe[0], 0);
+
+		/* Hack - needed by drxk/tda18271c2dd */
+		dvb->fe[1]->tuner_priv = dvb->fe[0]->tuner_priv;
+		memcpy(&dvb->fe[1]->ops.tuner_ops,
+		       &dvb->fe[0]->ops.tuner_ops,
+		       sizeof(dvb->fe[0]->ops.tuner_ops));
+
+		break;
 	case EM2884_BOARD_TERRATEC_H5:
 		terratec_h5_init(dev);
 
@@ -779,7 +913,6 @@ static int dvb_init(struct em28xx *dev)
 			result = -EINVAL;
 			goto out_free;
 		}
-
 		/* FIXME: do we need a pll semaphore? */
 		dvb->fe[0]->sec_priv = dvb;
 		sema_init(&dvb->pll_mutex, 1);
@@ -816,7 +949,9 @@ static int dvb_init(struct em28xx *dev)
 	}
 	/* define general-purpose callback pointer */
 	dvb->fe[0]->callback = em28xx_tuner_callback;
-
+	if (dvb->fe[1])
+	    dvb->fe[1]->callback = em28xx_tuner_callback;
+	
 	/* register everything */
 	result = register_dvb(dvb, THIS_MODULE, dev, &dev->udev->dev);
 
diff --git a/drivers/media/video/em28xx/em28xx.h b/drivers/media/video/em28xx/em28xx.h
index d80658b..cf44396 100644
--- a/drivers/media/video/em28xx/em28xx.h
+++ b/drivers/media/video/em28xx/em28xx.h
@@ -38,6 +38,7 @@
 #include <media/videobuf-dvb.h>
 #endif
 #include "tuner-xc2028.h"
+#include "xc5000.h"
 #include "em28xx-reg.h"
 
 /* Boards supported by driver */
@@ -120,6 +121,7 @@
 #define EM2874_BOARD_LEADERSHIP_ISDBT		  77
 #define EM28174_BOARD_PCTV_290E                   78
 #define EM2884_BOARD_TERRATEC_H5		  79
+#define EM2884_BOARD_HAUPPAUGE_WINTV_HVR_930C	  80
 
 /* Limits minimum and default number of buffers */
 #define EM28XX_MIN_BUF 4

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

* Re: Trying to support for HAUPPAUGE HVR-930C
  2011-07-28  8:53 Trying to support for HAUPPAUGE HVR-930C Eddi De Pieri
@ 2011-07-28 12:13 ` Benjamin Larsson
  2011-07-29 11:15   ` Eddi De Pieri
  0 siblings, 1 reply; 7+ messages in thread
From: Benjamin Larsson @ 2011-07-28 12:13 UTC (permalink / raw)
  To: Eddi De Pieri, linux-media


On 07/28/2011 10:53 AM, Eddi De Pieri wrote:
> Hi,
> 
> I'd like to share my work to get hvr 930c.
> 
> 
> Actually the device don't work yet.
> 
> Please someone can review my work?
> 

[ ...]

> +	struct {
> +		unsigned char r[4];
> +		int len;
> +	} regs[] = {
> +		{{ 0x06, 0x02, 0x00, 0x31 }, 4},
> +		{{ 0x01, 0x02 }, 2},
> +		{{ 0x01, 0x02, 0x00, 0xc6 }, 4},
> +		{{ 0x01, 0x00 }, 2},
> +		{{ 0x01, 0x00, 0xff, 0xaf }, 4},
> +		{{ 0x01, 0x00, 0x03, 0xa0 }, 4},
> +		{{ 0x01, 0x00 }, 2},
> +		{{ 0x01, 0x00, 0x73, 0xaf }, 4},
> +		{{ 0x04, 0x00 }, 2},
> +		{{ 0x00, 0x04 }, 2},
> +		{{ 0x00, 0x04, 0x00, 0x0a }, 4},
> +		{{ 0x04, 0x14 }, 2},
> +		{{ 0x04, 0x14, 0x00, 0x00 }, 4},
> +	};
> +
> +	em28xx_gpio_set(dev, hauppauge_hvr930c_init);
> +	em28xx_write_reg(dev, EM28XX_R06_I2C_CLK, 0x40);
> +	msleep(10);
> +	em28xx_write_reg(dev, EM28XX_R06_I2C_CLK, 0x44);
> +	msleep(10);
> +
> +	dev->i2c_client.addr = 0x82 >> 1;
> +	for (i = 0; i < ARRAY_SIZE(regs); i++)
> +		i2c_master_send(&dev->i2c_client, regs[i].r, regs[i].len);
> +	em28xx_gpio_set(dev, hauppauge_hvr930c_end);

0x82 is the address of the chip handling the analog signals(?) Micronas
AVF 4910BA1 maybe. So change the names so it is clear that this part
sends commands to that chip.

I'm not sure I understand the I2C addressing but my tuner is at 0xc2 and
the demod at 0x52.

MvH
Benjamin Larsson


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

* Re: Trying to support for HAUPPAUGE HVR-930C
  2011-07-28 12:13 ` Benjamin Larsson
@ 2011-07-29 11:15   ` Eddi De Pieri
  2011-07-29 13:03     ` Antti Palosaari
  2011-07-29 18:10     ` Devin Heitmueller
  0 siblings, 2 replies; 7+ messages in thread
From: Eddi De Pieri @ 2011-07-29 11:15 UTC (permalink / raw)
  To: linux-media; +Cc: Benjamin Larsson

2011/7/28 Benjamin Larsson <benjamin@southpole.se>:
> 0x82 is the address of the chip handling the analog signals(?) Micronas
> AVF 4910BA1 maybe.

I don't have the schematic of hauppauge card, so I can't say you if
082 is the AVF 4910

> So change the names so it is clear that this part
> sends commands to that chip.

As I already told my patch is a derivate work of Terratec H5 Patch.
Mauro's patch should have the same issue

> I'm not sure I understand the I2C addressing but my tuner is at 0xc2 and
> the demod at 0x52.

I hate binary operation however if you shift the address you should
get same value...
0x52 = 0x29 << 1
0x29 = 0x52 >> 1


Eddi

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

* Re: Trying to support for HAUPPAUGE HVR-930C
  2011-07-29 11:15   ` Eddi De Pieri
@ 2011-07-29 13:03     ` Antti Palosaari
  2011-07-29 18:10     ` Devin Heitmueller
  1 sibling, 0 replies; 7+ messages in thread
From: Antti Palosaari @ 2011-07-29 13:03 UTC (permalink / raw)
  To: Eddi De Pieri; +Cc: linux-media, Benjamin Larsson

On 07/29/2011 02:15 PM, Eddi De Pieri wrote:
> 2011/7/28 Benjamin Larsson <benjamin@southpole.se>:
>> 0x82 is the address of the chip handling the analog signals(?) Micronas
>> AVF 4910BA1 maybe.
> 
> I don't have the schematic of hauppauge card, so I can't say you if
> 082 is the AVF 4910

Rather few Linux devels have those but generally it is rather easy to guess. Just look addresses from sniff, then you have driver working you can read and write to chip and try to see what happens.

>> I'm not sure I understand the I2C addressing but my tuner is at 0xc2 and
>> the demod at 0x52.
> 
> I hate binary operation however if you shift the address you should
> get same value...
> 0x52 = 0x29 << 1
> 0x29 = 0x52 >> 1

I2C uses 7 bit addressing and thus 0x29 is correct. Many times address like 0x52 is called as 8 bit I2C address even in chip documents. Anyhow, 0x29 is correct, also (0x52 >> 1) can be used.

I encourage to use

.i2c_addr = 0x29; /* 0x52 >> 1 */

to make clear which is 8 bit since 8bit is almost always seen in usb logs.

regards
Antti

-- 
http://palosaari.fi/

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

* Re: Trying to support for HAUPPAUGE HVR-930C
  2011-07-29 11:15   ` Eddi De Pieri
  2011-07-29 13:03     ` Antti Palosaari
@ 2011-07-29 18:10     ` Devin Heitmueller
  2011-07-29 20:17       ` Daniel Glöckner
  1 sibling, 1 reply; 7+ messages in thread
From: Devin Heitmueller @ 2011-07-29 18:10 UTC (permalink / raw)
  To: Eddi De Pieri; +Cc: linux-media, Benjamin Larsson

On Fri, Jul 29, 2011 at 7:15 AM, Eddi De Pieri <eddi@depieri.net> wrote:
> 2011/7/28 Benjamin Larsson <benjamin@southpole.se>:
>> 0x82 is the address of the chip handling the analog signals(?) Micronas
>> AVF 4910BA1 maybe.
>
> I don't have the schematic of hauppauge card, so I can't say you if
> 082 is the AVF 4910

Yes, it's an avf4910b.  I did a Linux driver for the AVFA for the
Viewcast boards, but there isn't a driver for the AFVB at this time.
Should be pretty easy for you to whip one up though just by capturing
the register sets under Windows and then replaying them for each of
the three inputs.

Devin

>> So change the names so it is clear that this part
>> sends commands to that chip.
>
> As I already told my patch is a derivate work of Terratec H5 Patch.
> Mauro's patch should have the same issue
>
>> I'm not sure I understand the I2C addressing but my tuner is at 0xc2 and
>> the demod at 0x52.

Correct: the xc5000 is at 0xc2, the avf4910b is at 0x82 and the drx-k
is at 0x52.

Devin

-- 
Devin J. Heitmueller - Kernel Labs
http://www.kernellabs.com

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

* Re: Trying to support for HAUPPAUGE HVR-930C
  2011-07-29 18:10     ` Devin Heitmueller
@ 2011-07-29 20:17       ` Daniel Glöckner
  2011-08-04  6:36         ` Devin Heitmueller
  0 siblings, 1 reply; 7+ messages in thread
From: Daniel Glöckner @ 2011-07-29 20:17 UTC (permalink / raw)
  To: Devin Heitmueller; +Cc: Eddi De Pieri, linux-media, Benjamin Larsson

On Fri, Jul 29, 2011 at 02:10:25PM -0400, Devin Heitmueller wrote:
> Yes, it's an avf4910b.  I did a Linux driver for the AVFA for the
> Viewcast boards, but there isn't a driver for the AFVB at this time.

Do you have a contact at Trident I can ask to get access to that
data sheet? I have been looking for it for some time now as well.

And do you know if there are significant differences between the
avf4910a and the avf4910b?

  Daniel

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

* Re: Trying to support for HAUPPAUGE HVR-930C
  2011-07-29 20:17       ` Daniel Glöckner
@ 2011-08-04  6:36         ` Devin Heitmueller
  0 siblings, 0 replies; 7+ messages in thread
From: Devin Heitmueller @ 2011-08-04  6:36 UTC (permalink / raw)
  To: Devin Heitmueller, Eddi De Pieri, linux-media, Benjamin Larsson

Hi Daniel,

Sorry for the delayed reply.  I actually did reply five days ago but
the message got dropped by the ML filter because my phone apparently
formatted it into HTML content.  Resending here...

> Do you have a contact at Trident I can ask to get access to that
> data sheet? I have been looking for it for some time now as well.

Nope.  I had access to them under NDA but do not anymore.

> And do you know if there are significant differences between the
> avf4910a and the avf4910b?

They're completely different.  I wouldn't even try to glean anything
about the avfb by looking at the avfa driver.

Devin

-- 
Devin J. Heitmueller - Kernel Labs
http://www.kernellabs.com

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

end of thread, other threads:[~2011-08-04  6:36 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-28  8:53 Trying to support for HAUPPAUGE HVR-930C Eddi De Pieri
2011-07-28 12:13 ` Benjamin Larsson
2011-07-29 11:15   ` Eddi De Pieri
2011-07-29 13:03     ` Antti Palosaari
2011-07-29 18:10     ` Devin Heitmueller
2011-07-29 20:17       ` Daniel Glöckner
2011-08-04  6:36         ` Devin Heitmueller

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.