Commit a6a3f140 authored by Steven Toth's avatar Steven Toth Committed by Mauro Carvalho Chehab

V4L/DVB (6199): cx23885: Changes to allow demodulators on each transport bus

cx23885: Changes to allow demodulators on each transport bus.
Signed-off-by: default avatarSteven Toth <stoth@hauppauge.com>
Reviewed-by: default avatarMichael Krufky <mkrufky@linuxtv.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@infradead.org>
parent 15e90839
......@@ -111,7 +111,7 @@ struct cx23885_board cx23885_boards[] = {
},
[CX23885_BOARD_DVICO_FUSIONHDTV_5_EXP] = {
.name = "DViCO FusionHDTV5 Express",
.portc = CX23885_MPEG_DVB,
.portb = CX23885_MPEG_DVB,
},
};
const unsigned int cx23885_bcount = ARRAY_SIZE(cx23885_boards);
......@@ -197,8 +197,43 @@ static void hauppauge_eeprom(struct cx23885_dev *dev, u8 *eeprom_data)
dev->name, tv.model);
}
void cx23885_gpio_setup(struct cx23885_dev *dev)
{
switch(dev->board) {
case CX23885_BOARD_HAUPPAUGE_HVR1250:
/* GPIO-0 cx24227 demodulator reset */
cx_set(GP0_IO, 0x00010001); /* Bring the part out of reset */
break;
case CX23885_BOARD_HAUPPAUGE_HVR1800:
/* GPIO-0 656_CLK */
/* GPIO-1 656_D0 */
/* GPIO-2 8295A Reset */
/* GPIO-3-10 cx23417 data0-7 */
/* GPIO-11-14 cx23417 addr0-3 */
/* GPIO-15-18 cx23417 READY, CS, RD, WR */
/* GPIO-19 IR_RX */
// FIXME: Analog requires the tuner is brought out of reset
break;
}
}
int cx23885_ir_init(struct cx23885_dev *dev)
{
switch (dev->board) {
case CX23885_BOARD_HAUPPAUGE_HVR1250:
case CX23885_BOARD_HAUPPAUGE_HVR1800:
/* FIXME: Implement me */
break;
}
return 0;
}
void cx23885_card_setup(struct cx23885_dev *dev)
{
struct cx23885_tsport *ts1 = &dev->ts1;
struct cx23885_tsport *ts2 = &dev->ts2;
static u8 eeprom[256];
if (dev->i2c_bus[0].i2c_rc == 0) {
......@@ -215,6 +250,22 @@ void cx23885_card_setup(struct cx23885_dev *dev)
hauppauge_eeprom(dev, eeprom+0x80);
break;
}
switch (dev->board) {
case CX23885_BOARD_DVICO_FUSIONHDTV_5_EXP:
ts1->gen_ctrl_val = 0xc; /* Serial bus + punctured clock */
ts1->ts_clk_en_val = 0x1; /* Enable TS_CLK */
ts1->src_sel_val = CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO;
break;
case CX23885_BOARD_HAUPPAUGE_HVR1250:
case CX23885_BOARD_HAUPPAUGE_HVR1800:
case CX23885_BOARD_HAUPPAUGE_HVR1800lp:
default:
ts2->gen_ctrl_val = 0xc; /* Serial bus + punctured clock */
ts2->ts_clk_en_val = 0x1; /* Enable TS_CLK */
ts2->src_sel_val = CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO;
}
}
/* ------------------------------------------------------------------ */
......
This diff is collapsed.
......@@ -160,6 +160,7 @@ static int dvb_register(struct cx23885_tsport *port)
}
/* Put the analog decoder in standby to keep it quiet */
/* Assumption here: analog decoder is only on i2c bus 0 */
cx23885_call_i2c_clients (&dev->i2c_bus[0], TUNER_SET_STANDBY, NULL);
/* register everything */
......@@ -180,8 +181,6 @@ int cx23885_dvb_register(struct cx23885_tsport *port)
dev->pci_slot);
err = -ENODEV;
if (!(cx23885_boards[dev->board].portc & CX23885_MPEG_DVB))
goto fail_core;
/* dvb stuff */
printk("%s: cx23885 based dvb card\n", dev->name);
......@@ -192,7 +191,6 @@ int cx23885_dvb_register(struct cx23885_tsport *port)
if (err != 0)
printk("%s() dvb_register failed err = %d\n", __FUNCTION__, err);
fail_core:
return err;
}
......
......@@ -250,14 +250,16 @@ Channel manager Data Structure entry = 20 DWORD
#define VID_C_MSK_OF (1 << 8)
#define VID_C_MSK_RISCI2 (1 << 4)
#define VID_C_MSK_RISCI1 1
#define VID_C_INT_MSK 0x00040040
#define VID_C_MSK_BAD_PKT (1 << 20)
#define VID_C_MSK_OPC_ERR (1 << 16)
#define VID_C_MSK_SYNC (1 << 12)
#define VID_C_MSK_OF (1 << 8)
#define VID_C_MSK_RISCI2 (1 << 4)
#define VID_C_MSK_RISCI1 1
/* A superset for testing purposes */
#define VID_BC_MSK_BAD_PKT (1 << 20)
#define VID_BC_MSK_OPC_ERR (1 << 16)
#define VID_BC_MSK_SYNC (1 << 12)
#define VID_BC_MSK_OF (1 << 8)
#define VID_BC_MSK_RISCI2 (1 << 4)
#define VID_BC_MSK_RISCI1 1
#define VID_C_INT_MSK 0x00040040
#define VID_C_INT_STAT 0x00040044
#define VID_C_INT_MSTAT 0x00040048
#define VID_C_INT_SSTAT 0x0004004C
......
......@@ -168,6 +168,7 @@ struct cx23885_tsport {
u32 reg_vld_misc;
u32 reg_ts_clk_en;
u32 reg_ts_int_msk;
u32 reg_ts_int_stat;
u32 reg_src_sel;
/* Default register vals */
......@@ -201,7 +202,7 @@ struct cx23885_dev {
unsigned int board;
char name[32];
struct cx23885_tsport ts2;
struct cx23885_tsport ts1, ts2;
/* sram configuration */
struct sram_channel *sram_channels;
......@@ -269,6 +270,8 @@ extern struct cx23885_subid cx23885_subids[];
extern const unsigned int cx23885_idcount;
extern void cx23885_card_list(struct cx23885_dev *dev);
extern int cx23885_ir_init(struct cx23885_dev *dev);
extern void cx23885_gpio_setup(struct cx23885_dev *dev);
extern void cx23885_card_setup(struct cx23885_dev *dev);
extern void cx23885_card_setup_pre_i2c(struct cx23885_dev *dev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment