Skip to content

Commit

Permalink
V4L/DVB (6898): cx23885: add support for Hauppauge WinTV HVR-1500
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
  • Loading branch information
Michael Krufky authored and Mauro Carvalho Chehab committed Jan 25, 2008
1 parent ef207fe commit 07b4a83
Show file tree
Hide file tree
Showing 4 changed files with 90 additions and 1 deletion.
1 change: 1 addition & 0 deletions Documentation/video4linux/CARDLIST.cx23885
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
3 -> Hauppauge WinTV-HVR1250 [0070:7911]
4 -> DViCO FusionHDTV5 Express [18ac:d500]
5 -> Hauppauge WinTV-HVR1500Q [0070:7797]
6 -> Hauppauge WinTV-HVR1500 [0070:7717]
24 changes: 23 additions & 1 deletion drivers/media/video/cx23885/cx23885-cards.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,10 @@ struct cx23885_board cx23885_boards[] = {
.name = "Hauppauge WinTV-HVR1500Q",
.portc = CX23885_MPEG_DVB,
},

[CX23885_BOARD_HAUPPAUGE_HVR1500] = {
.name = "Hauppauge WinTV-HVR1500",
.portc = CX23885_MPEG_DVB,
},
};
const unsigned int cx23885_bcount = ARRAY_SIZE(cx23885_boards);

Expand Down Expand Up @@ -153,6 +156,10 @@ struct cx23885_subid cx23885_subids[] = {
.subvendor = 0x0070,
.subdevice = 0x7797,
.card = CX23885_BOARD_HAUPPAUGE_HVR1500Q,
},{
.subvendor = 0x0070,
.subdevice = 0x7717,
.card = CX23885_BOARD_HAUPPAUGE_HVR1500,
},
};
const unsigned int cx23885_idcount = ARRAY_SIZE(cx23885_subids);
Expand Down Expand Up @@ -214,6 +221,18 @@ void cx23885_gpio_setup(struct cx23885_dev *dev)
/* GPIO-0 cx24227 demodulator reset */
cx_set(GP0_IO, 0x00010001); /* Bring the part out of reset */
break;
case CX23885_BOARD_HAUPPAUGE_HVR1500:
/* GPIO-0 cx24227 demodulator */
/* GPIO-2 xc3028 tuner */

/* Put the parts into reset */
cx_set(GP0_IO, 0x00050000);
cx_clear(GP0_IO, 0x00000005);
msleep(5);

/* Bring the parts out of reset */
cx_set(GP0_IO, 0x00050005);
break;
case CX23885_BOARD_HAUPPAUGE_HVR1500Q:
/* GPIO-0 cx24227 demodulator reset */
/* GPIO-2 xc5000 tuner reset */
Expand All @@ -236,6 +255,7 @@ int cx23885_ir_init(struct cx23885_dev *dev)
{
switch (dev->board) {
case CX23885_BOARD_HAUPPAUGE_HVR1250:
case CX23885_BOARD_HAUPPAUGE_HVR1500:
case CX23885_BOARD_HAUPPAUGE_HVR1500Q:
case CX23885_BOARD_HAUPPAUGE_HVR1800:
/* FIXME: Implement me */
Expand All @@ -260,6 +280,7 @@ void cx23885_card_setup(struct cx23885_dev *dev)

switch (dev->board) {
case CX23885_BOARD_HAUPPAUGE_HVR1250:
case CX23885_BOARD_HAUPPAUGE_HVR1500:
case CX23885_BOARD_HAUPPAUGE_HVR1500Q:
case CX23885_BOARD_HAUPPAUGE_HVR1800:
case CX23885_BOARD_HAUPPAUGE_HVR1800lp:
Expand All @@ -275,6 +296,7 @@ void cx23885_card_setup(struct cx23885_dev *dev)
ts1->src_sel_val = CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO;
break;
case CX23885_BOARD_HAUPPAUGE_HVR1250:
case CX23885_BOARD_HAUPPAUGE_HVR1500:
case CX23885_BOARD_HAUPPAUGE_HVR1500Q:
case CX23885_BOARD_HAUPPAUGE_HVR1800:
case CX23885_BOARD_HAUPPAUGE_HVR1800lp:
Expand Down
65 changes: 65 additions & 0 deletions drivers/media/video/cx23885/cx23885-dvb.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
#include "lgdt330x.h"
#include "xc5000.h"
#include "dvb-pll.h"
#include "tuner-xc2028.h"
#include "tuner-xc2028-types.h"

static unsigned int debug = 0;

Expand Down Expand Up @@ -126,6 +128,14 @@ static struct s5h1409_config hauppauge_hvr1800lp_config = {
.status_mode = S5H1409_DEMODLOCKING
};

static struct s5h1409_config hauppauge_hvr1500_config = {
.demod_address = 0x32 >> 1,
.output_mode = S5H1409_SERIAL_OUTPUT,
.gpio = S5H1409_GPIO_OFF,
.inversion = S5H1409_INVERSION_OFF,
.status_mode = S5H1409_DEMODLOCKING
};

static struct mt2131_config hauppauge_generic_tunerconfig = {
0x61
};
Expand All @@ -152,6 +162,36 @@ static struct xc5000_config hauppauge_hvr1500q_tunerconfig = {
.tuner_reset = hauppauge_hvr1500q_tuner_reset
};

static int cx23885_hvr1500_xc3028_callback(void *ptr, int command, int arg)
{
struct cx23885_tsport *port = ptr;
struct cx23885_dev *dev = port->dev;

switch (command) {
case XC2028_TUNER_RESET:
/* Send the tuner in then out of reset */
/* GPIO-2 xc3028 tuner */
dprintk(1, "%s: XC2028_TUNER_RESET %d\n", __FUNCTION__, arg);

cx_set(GP0_IO, 0x00040000);
cx_clear(GP0_IO, 0x00000004);
msleep(5);

cx_set(GP0_IO, 0x00040004);
msleep(5);
break;
case XC2028_RESET_CLK:
dprintk(1, "%s: XC2028_RESET_CLK %d\n", __FUNCTION__, arg);
break;
default:
dprintk(1, "%s: unknown command %d, arg %d\n", __FUNCTION__,
command, arg);
return -EINVAL;
}

return 0;
}

static int dvb_register(struct cx23885_tsport *port)
{
struct cx23885_dev *dev = port->dev;
Expand Down Expand Up @@ -206,6 +246,31 @@ static int dvb_register(struct cx23885_tsport *port)
&hauppauge_hvr1500q_tunerconfig);
}
break;
case CX23885_BOARD_HAUPPAUGE_HVR1500:
i2c_bus = &dev->i2c_bus[1];
port->dvb.frontend = dvb_attach(s5h1409_attach,
&hauppauge_hvr1500_config,
&dev->i2c_bus[0].i2c_adap);
if (port->dvb.frontend != NULL) {
struct dvb_frontend *fe;
struct xc2028_config cfg = {
.i2c_adap = &i2c_bus->i2c_adap,
.i2c_addr = 0x61,
.video_dev = port,
.callback = cx23885_hvr1500_xc3028_callback,
};
static struct xc2028_ctrl ctl = {
.fname = "xc3028-v27.fw",
.max_len = 64,
.scode_table = OREN538,
};

fe = dvb_attach(xc2028_attach,
port->dvb.frontend, &cfg);
if (fe != NULL && fe->ops.tuner_ops.set_config != NULL)
fe->ops.tuner_ops.set_config(fe, &ctl);
}
break;
default:
printk("%s: The frontend of your DVB/ATSC card isn't supported yet\n",
dev->name);
Expand Down
1 change: 1 addition & 0 deletions drivers/media/video/cx23885/cx23885.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
#define CX23885_BOARD_HAUPPAUGE_HVR1250 3
#define CX23885_BOARD_DVICO_FUSIONHDTV_5_EXP 4
#define CX23885_BOARD_HAUPPAUGE_HVR1500Q 5
#define CX23885_BOARD_HAUPPAUGE_HVR1500 6

enum cx23885_itype {
CX23885_VMUX_COMPOSITE1 = 1,
Expand Down

0 comments on commit 07b4a83

Please sign in to comment.