Skip to content

Commit

Permalink
[PATCH] v4l: cx88 update
Browse files Browse the repository at this point in the history
- Add support for ADS Tech Instant TV DVB-T PCI.
- Remove obsoleted config options.
- Fix DViCO Board names
- Remove CABLE type setting from DViCO FusionHDTV3 Gold-T.
- Fix compilation with gcc4.0.
- V4L2_TUNER_CAP_LOW implemented according with V4L2 API for Radio.
- radio range is now defined on tuner-core.c. Cleaning up.
- Fix a bug on frequency report for cx88 based cards.
- Added support for changing radio mode stereo/mono.
- Add remove for MSI TV@nywhere.

Signed-off-by: Jorik Jonker <[email protected]>.
Signed-off-by: Didier Caillaud <[email protected]>
Signed-off-by: Benoit Laniel <[email protected]>.
Signed-off-by: Nickolay V Shmyrev <[email protected]>
Signed-off-by: Michael Krufky <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Mauro Carvalho Chehab authored and Linus Torvalds committed Jul 8, 2005
1 parent a2f552f commit a82decf
Show file tree
Hide file tree
Showing 6 changed files with 169 additions and 65 deletions.
50 changes: 36 additions & 14 deletions drivers/media/video/cx88/cx88-cards.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* $Id: cx88-cards.c,v 1.76 2005/06/08 01:28:09 mchehab Exp $
* $Id: cx88-cards.c,v 1.82 2005/06/28 04:33:53 mkrufky Exp $
*
* device driver for Conexant 2388x based TV cards
* card-specific stuff.
Expand Down Expand Up @@ -401,7 +401,7 @@ struct cx88_board cx88_boards[] = {
.dvb = 1,
},
[CX88_BOARD_DVICO_FUSIONHDTV_DVB_T1] = {
.name = "DVICO FusionHDTV DVB-T1",
.name = "DViCO FusionHDTV DVB-T1",
.tuner_type = TUNER_ABSENT, /* No analog tuner */
.radio_type = UNSET,
.tuner_addr = ADDR_UNSET,
Expand Down Expand Up @@ -445,8 +445,8 @@ struct cx88_board cx88_boards[] = {
.gpio0 = 0x000007f8,
},
},
[CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD] = {
.name = "DViCO - FusionHDTV 3 Gold",
[CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_Q] = {
.name = "DViCO FusionHDTV 3 Gold-Q",
.tuner_type = TUNER_MICROTUNE_4042FI5,
.radio_type = UNSET,
.tuner_addr = ADDR_UNSET,
Expand All @@ -464,6 +464,9 @@ struct cx88_board cx88_boards[] = {
GPIO[3] selects RF input connector on tuner module
0 - RF connector labeled CABLE
1 - RF connector labeled ANT
GPIO[4] selects high RF for QAM256 mode
0 - normal RF
1 - high RF
*/
.input = {{
.type = CX88_VMUX_TELEVISION,
Expand Down Expand Up @@ -520,7 +523,7 @@ struct cx88_board cx88_boards[] = {
.blackbird = 1,
},
[CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PLUS] = {
.name = "DVICO FusionHDTV DVB-T Plus",
.name = "DViCO FusionHDTV DVB-T Plus",
.tuner_type = TUNER_ABSENT, /* No analog tuner */
.radio_type = UNSET,
.tuner_addr = ADDR_UNSET,
Expand Down Expand Up @@ -700,20 +703,16 @@ struct cx88_board cx88_boards[] = {
},
},
[CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_T] = {
.name = "DViCO - FusionHDTV 3 Gold-T",
.name = "DViCO FusionHDTV 3 Gold-T",
.tuner_type = TUNER_THOMSON_DTT7611,
.radio_type = UNSET,
.tuner_addr = ADDR_UNSET,
.radio_addr = ADDR_UNSET,
/* See DViCO FusionHDTV 3 Gold for GPIO documentation. */
.input = {{
/* See DViCO FusionHDTV 3 Gold-Q for GPIO documentation. */
.input = {{
.type = CX88_VMUX_TELEVISION,
.vmux = 0,
.gpio0 = 0x0f0d,
},{
.type = CX88_VMUX_CABLE,
.vmux = 0,
.gpio0 = 0x0f05,
},{
.type = CX88_VMUX_COMPOSITE1,
.vmux = 1,
Expand All @@ -724,6 +723,25 @@ struct cx88_board cx88_boards[] = {
.gpio0 = 0x0f00,
}},
},
[CX88_BOARD_ADSTECH_DVB_T_PCI] = {
.name = "ADS Tech Instant TV DVB-T PCI",
.tuner_type = TUNER_ABSENT,
.radio_type = UNSET,
.tuner_addr = ADDR_UNSET,
.radio_addr = ADDR_UNSET,
.input = {{
.type = CX88_VMUX_COMPOSITE1,
.vmux = 1,
.gpio0 = 0x0700,
.gpio2 = 0x0101,
},{
.type = CX88_VMUX_SVIDEO,
.vmux = 2,
.gpio0 = 0x0700,
.gpio2 = 0x0101,
}},
.dvb = 1,
},
};
const unsigned int cx88_bcount = ARRAY_SIZE(cx88_boards);

Expand Down Expand Up @@ -794,7 +812,7 @@ struct cx88_subid cx88_subids[] = {
},{
.subvendor = 0x18ac,
.subdevice = 0xd810,
.card = CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD,
.card = CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_Q,
},{
.subvendor = 0x18ac,
.subdevice = 0xd820,
Expand Down Expand Up @@ -843,7 +861,11 @@ struct cx88_subid cx88_subids[] = {
.subvendor = 0x10fc,
.subdevice = 0xd035,
.card = CX88_BOARD_IODATA_GVBCTV7E,
}
},{
.subvendor = 0x1421,
.subdevice = 0x0334,
.card = CX88_BOARD_ADSTECH_DVB_T_PCI,
},
};
const unsigned int cx88_idcount = ARRAY_SIZE(cx88_subids);

Expand Down
19 changes: 4 additions & 15 deletions drivers/media/video/cx88/cx88-core.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* $Id: cx88-core.c,v 1.28 2005/06/12 04:19:19 mchehab Exp $
* $Id: cx88-core.c,v 1.31 2005/06/22 22:58:04 mchehab Exp $
*
* device driver for Conexant 2388x based TV cards
* driver core
Expand Down Expand Up @@ -545,19 +545,22 @@ void cx88_sram_channel_dump(struct cx88_core *core,
core->name,cx_read(ch->cnt2_reg));
}

/* Used only on cx88-core */
static char *cx88_pci_irqs[32] = {
"vid", "aud", "ts", "vip", "hst", "5", "6", "tm1",
"src_dma", "dst_dma", "risc_rd_err", "risc_wr_err",
"brdg_err", "src_dma_err", "dst_dma_err", "ipb_dma_err",
"i2c", "i2c_rack", "ir_smp", "gpio0", "gpio1"
};
/* Used only on cx88-video */
char *cx88_vid_irqs[32] = {
"y_risci1", "u_risci1", "v_risci1", "vbi_risc1",
"y_risci2", "u_risci2", "v_risci2", "vbi_risc2",
"y_oflow", "u_oflow", "v_oflow", "vbi_oflow",
"y_sync", "u_sync", "v_sync", "vbi_sync",
"opc_err", "par_err", "rip_err", "pci_abort",
};
/* Used only on cx88-mpeg */
char *cx88_mpeg_irqs[32] = {
"ts_risci1", NULL, NULL, NULL,
"ts_risci2", NULL, NULL, NULL,
Expand Down Expand Up @@ -1006,21 +1009,7 @@ int cx88_set_tvnorm(struct cx88_core *core, struct cx88_tvnorm *norm)
set_tvaudio(core);

// tell i2c chips
#ifdef V4L2_I2C_CLIENTS
cx88_call_i2c_clients(core,VIDIOC_S_STD,&norm->id);
#else
{
struct video_channel c;
memset(&c,0,sizeof(c));
c.channel = core->input;
c.norm = VIDEO_MODE_PAL;
if ((norm->id & (V4L2_STD_NTSC_M|V4L2_STD_NTSC_M_JP)))
c.norm = VIDEO_MODE_NTSC;
if (norm->id & V4L2_STD_SECAM)
c.norm = VIDEO_MODE_SECAM;
cx88_call_i2c_clients(core,VIDIOCSCHAN,&c);
}
#endif

// done
return 0;
Expand Down
3 changes: 2 additions & 1 deletion drivers/media/video/cx88/cx88-dvb.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* $Id: cx88-dvb.c,v 1.33 2005/06/12 04:19:19 mchehab Exp $
* $Id: cx88-dvb.c,v 1.36 2005/06/21 06:08:12 mkrufky Exp $
*
* device driver for Conexant 2388x based TV cards
* MPEG Transport Stream (DVB) routines
Expand Down Expand Up @@ -231,6 +231,7 @@ static int dvb_register(struct cx8802_dev *dev)
break;
case CX88_BOARD_KWORLD_DVB_T:
case CX88_BOARD_DNTV_LIVE_DVB_T:
case CX88_BOARD_ADSTECH_DVB_T_PCI:
dev->core->pll_addr = 0x61;
dev->core->pll_desc = &dvb_pll_unknown_1;
dev->dvb.frontend = mt352_attach(&dntv_live_dvbt_config,
Expand Down
96 changes: 95 additions & 1 deletion drivers/media/video/cx88/cx88-input.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* $Id: cx88-input.c,v 1.11 2005/05/22 20:57:56 nsh Exp $
* $Id: cx88-input.c,v 1.13 2005/06/13 16:07:46 nsh Exp $
*
* Device driver for GPIO attached remote control interfaces
* on Conexant 2388x based TV/DVB cards.
Expand Down Expand Up @@ -125,6 +125,86 @@ static IR_KEYTAB_TYPE ir_codes_iodata_bctv7e[IR_KEYTAB_SIZE] = {

/* ---------------------------------------------------------------------- */

/* ADS Tech Instant TV DVB-T PCI Remote */
static IR_KEYTAB_TYPE ir_codes_adstech_dvb_t_pci[IR_KEYTAB_SIZE] = {
[ 0x5b ] = KEY_POWER,
[ 0x5f ] = KEY_MUTE,
[ 0x57 ] = KEY_1,
[ 0x4f ] = KEY_2,
[ 0x53 ] = KEY_3,
[ 0x56 ] = KEY_4,
[ 0x4e ] = KEY_5,
[ 0x5e ] = KEY_6,
[ 0x54 ] = KEY_7,
[ 0x4c ] = KEY_8,
[ 0x5c ] = KEY_9,
[ 0x4d ] = KEY_0,
[ 0x55 ] = KEY_GOTO,
[ 0x5d ] = KEY_SEARCH,
[ 0x17 ] = KEY_EPG, // Guide
[ 0x1f ] = KEY_MENU,
[ 0x0f ] = KEY_UP,
[ 0x46 ] = KEY_DOWN,
[ 0x16 ] = KEY_LEFT,
[ 0x1e ] = KEY_RIGHT,
[ 0x0e ] = KEY_SELECT, // Enter
[ 0x5a ] = KEY_INFO,
[ 0x52 ] = KEY_EXIT,
[ 0x59 ] = KEY_PREVIOUS,
[ 0x51 ] = KEY_NEXT,
[ 0x58 ] = KEY_REWIND,
[ 0x50 ] = KEY_FORWARD,
[ 0x44 ] = KEY_PLAYPAUSE,
[ 0x07 ] = KEY_STOP,
[ 0x1b ] = KEY_RECORD,
[ 0x13 ] = KEY_TUNER, // Live
[ 0x0a ] = KEY_A,
[ 0x12 ] = KEY_B,
[ 0x03 ] = KEY_PROG1, // 1
[ 0x01 ] = KEY_PROG2, // 2
[ 0x00 ] = KEY_PROG3, // 3
[ 0x06 ] = KEY_DVD,
[ 0x48 ] = KEY_AUX, // Photo
[ 0x40 ] = KEY_VIDEO,
[ 0x19 ] = KEY_AUDIO, // Music
[ 0x0b ] = KEY_CHANNELUP,
[ 0x08 ] = KEY_CHANNELDOWN,
[ 0x15 ] = KEY_VOLUMEUP,
[ 0x1c ] = KEY_VOLUMEDOWN,
};

/* ---------------------------------------------------------------------- */

/* MSI TV@nywhere remote */
static IR_KEYTAB_TYPE ir_codes_msi_tvanywhere[IR_KEYTAB_SIZE] = {
[ 0x00 ] = KEY_0, /* '0' */
[ 0x01 ] = KEY_1, /* '1' */
[ 0x02 ] = KEY_2, /* '2' */
[ 0x03 ] = KEY_3, /* '3' */
[ 0x04 ] = KEY_4, /* '4' */
[ 0x05 ] = KEY_5, /* '5' */
[ 0x06 ] = KEY_6, /* '6' */
[ 0x07 ] = KEY_7, /* '7' */
[ 0x08 ] = KEY_8, /* '8' */
[ 0x09 ] = KEY_9, /* '9' */
[ 0x0c ] = KEY_MUTE, /* 'Mute' */
[ 0x0f ] = KEY_SCREEN, /* 'Full Screen' */
[ 0x10 ] = KEY_F, /* 'Funtion' */
[ 0x11 ] = KEY_T, /* 'Time shift' */
[ 0x12 ] = KEY_POWER, /* 'Power' */
[ 0x13 ] = KEY_MEDIA, /* 'MTS' */
[ 0x14 ] = KEY_SLOW, /* 'Slow' */
[ 0x16 ] = KEY_REWIND, /* 'backward <<' */
[ 0x17 ] = KEY_ENTER, /* 'Return' */
[ 0x18 ] = KEY_FASTFORWARD, /* 'forward >>' */
[ 0x1a ] = KEY_CHANNELUP, /* 'Channel+' */
[ 0x1b ] = KEY_VOLUMEUP, /* 'Volume+' */
[ 0x1e ] = KEY_CHANNELDOWN, /* 'Channel-' */
[ 0x1f ] = KEY_VOLUMEDOWN, /* 'Volume-' */
};

/* ---------------------------------------------------------------------- */

struct cx88_IR {
struct cx88_core *core;
struct input_dev input;
Expand Down Expand Up @@ -269,6 +349,20 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci)
ir->mask_keyup = 0x80;
ir->polling = 1; // ms
break;
case CX88_BOARD_ADSTECH_DVB_T_PCI:
ir_codes = ir_codes_adstech_dvb_t_pci;
ir->gpio_addr = MO_GP1_IO;
ir->mask_keycode = 0xbf;
ir->mask_keyup = 0x40;
ir->polling = 50; // ms
break;
case CX88_BOARD_MSI_TVANYWHERE_MASTER:
ir_codes = ir_codes_msi_tvanywhere;
ir->gpio_addr = MO_GP1_IO;
ir->mask_keycode = 0x1f;
ir->mask_keyup = 0x40;
ir->polling = 1;
break;
}

if (NULL == ir_codes) {
Expand Down
Loading

0 comments on commit a82decf

Please sign in to comment.