Commit ed455954 authored by Gerd Knorr's avatar Gerd Knorr Committed by Linus Torvalds

[PATCH] v4l: cx88 driver update

This is a update for the cx88 tv card driver.  Changes:

* finally make it build with gcc 2.95 ;)

* add new tv cards.

* plenty of fixes for the TV sound code.

* use v4l2 API for communication with tuner + tda9887

* misc other minor stuff.
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 940a9e4a
...@@ -99,6 +99,10 @@ struct cx88_board cx88_boards[] = { ...@@ -99,6 +99,10 @@ struct cx88_board cx88_boards[] = {
.input = {{ .input = {{
.type = CX88_VMUX_TELEVISION, .type = CX88_VMUX_TELEVISION,
.vmux = 0, .vmux = 0,
.gpio0 = 0x000003ff,
.gpio1 = 0x000000ff,
.gpio2 = 0x000000ff,
.gpio3 = 0x00000000,
},{ },{
.type = CX88_VMUX_COMPOSITE1, .type = CX88_VMUX_COMPOSITE1,
.vmux = 1, .vmux = 1,
...@@ -111,6 +115,7 @@ struct cx88_board cx88_boards[] = { ...@@ -111,6 +115,7 @@ struct cx88_board cx88_boards[] = {
[CX88_BOARD_WINFAST2000XP] = { [CX88_BOARD_WINFAST2000XP] = {
.name = "Leadtek Winfast 2000XP Expert", .name = "Leadtek Winfast 2000XP Expert",
.tuner_type = 44, .tuner_type = 44,
.needs_tda9887 = 1,
.input = {{ .input = {{
.type = CX88_VMUX_TELEVISION, .type = CX88_VMUX_TELEVISION,
.vmux = 0, .vmux = 0,
...@@ -149,22 +154,33 @@ struct cx88_board cx88_boards[] = { ...@@ -149,22 +154,33 @@ struct cx88_board cx88_boards[] = {
.vmux = 0, .vmux = 0,
}}, }},
}, },
[CX88_BOARD_MSI_TVANYWHERE] = { [CX88_BOARD_MSI_TVANYWHERE_MASTER] = {
//added gpio values thanks to Torsten Seeboth
//values for PAL from DScaler
.name = "MSI TV-@nywhere Master", .name = "MSI TV-@nywhere Master",
.tuner_type = 33, .tuner_type = 33,
.needs_tda9887 = 1,
.input = {{ .input = {{
.type = CX88_VMUX_TELEVISION, .type = CX88_VMUX_TELEVISION,
.vmux = 0, .vmux = 0,
.gpio0 = 0x000040bf,
.gpio1 = 0x000080c0,
.gpio2 = 0x0000ff40,
.gpio3 = 0x00000000,
},{ },{
.type = CX88_VMUX_COMPOSITE1, .type = CX88_VMUX_COMPOSITE1,
.vmux = 1, .vmux = 1,
},{ .gpio0 = 0x000040bf,
// temporarly for testing ... .gpio1 = 0x000080c0,
.type = CX88_VMUX_COMPOSITE2, .gpio2 = 0x0000ff40,
.vmux = 2, .gpio3 = 0x00000000,
},{ },{
.type = CX88_VMUX_SVIDEO, .type = CX88_VMUX_SVIDEO,
.vmux = 2, .vmux = 2,
.gpio0 = 0x000040bf,
.gpio1 = 0x000080c0,
.gpio2 = 0x0000ff40,
.gpio3 = 0x00000000,
}}, }},
.radio = { .radio = {
.type = CX88_RADIO, .type = CX88_RADIO,
...@@ -199,8 +215,97 @@ struct cx88_board cx88_boards[] = { ...@@ -199,8 +215,97 @@ struct cx88_board cx88_boards[] = {
.type = CX88_RADIO, .type = CX88_RADIO,
}, },
}, },
[CX88_BOARD_IODATA_GVVCP3PCI] = {
.name = "IODATA GV-VCP3/PCI",
.tuner_type = TUNER_ABSENT,
.needs_tda9887 = 0,
.input = {{
.type = CX88_VMUX_COMPOSITE1,
.vmux = 0,
},{
.type = CX88_VMUX_COMPOSITE2,
.vmux = 1,
},{
.type = CX88_VMUX_SVIDEO,
.vmux = 2,
}},
},
[CX88_BOARD_PROLINK_PLAYTVPVR] = {
.name = "Prolink PlayTV PVR",
.tuner_type = 43,
.needs_tda9887 = 1,
.input = {{
.type = CX88_VMUX_TELEVISION,
.vmux = 0,
.gpio0 = 0xff00,
},{
.type = CX88_VMUX_COMPOSITE1,
.vmux = 1,
.gpio0 = 0xff03,
},{
.type = CX88_VMUX_SVIDEO,
.vmux = 2,
.gpio0 = 0xff03,
}},
.radio = {
.type = CX88_RADIO,
.gpio0 = 0xff00,
},
},
[CX88_BOARD_ASUS_PVR_416] = {
.name = "ASUS PVR-416",
.tuner_type = 43,
.needs_tda9887 = 1,
.input = {{
.type = CX88_VMUX_TELEVISION,
.vmux = 0,
.gpio0 = 0x0000fde6,
.gpio1 = 0x00000000, // possibly for mpeg data
.gpio2 = 0x000000e9,
.gpio3 = 0x00000000,
},{
.type = CX88_VMUX_SVIDEO,
.vmux = 2,
.gpio0 = 0x0000fde6, // 0x0000fda6 L,R RCA audio in?
.gpio1 = 0x00000000, // possibly for mpeg data
.gpio2 = 0x000000e9,
.gpio3 = 0x00000000,
}},
.radio = {
.type = CX88_RADIO,
.gpio0 = 0x0000fde2,
.gpio1 = 0x00000000,
.gpio2 = 0x000000e9,
.gpio3 = 0x00000000,
},
},
[CX88_BOARD_MSI_TVANYWHERE] = {
.name = "MSI TV-@nywhere",
.tuner_type = 33,
.needs_tda9887 = 1,
.input = {{
.type = CX88_VMUX_TELEVISION,
.vmux = 0,
.gpio0 = 0x00000fbf,
.gpio1 = 0x000000c0,
.gpio2 = 0x0000fc08,
.gpio3 = 0x00000000,
},{
.type = CX88_VMUX_COMPOSITE1,
.vmux = 1,
.gpio0 = 0x00000fbf,
.gpio1 = 0x000000c0,
.gpio2 = 0x0000fc68,
.gpio3 = 0x00000000,
},{
.type = CX88_VMUX_SVIDEO,
.vmux = 2,
.gpio0 = 0x00000fbf,
.gpio1 = 0x000000c0,
.gpio2 = 0x0000fc68,
.gpio3 = 0x00000000,
}},
},
}; };
const unsigned int cx88_bcount = ARRAY_SIZE(cx88_boards); const unsigned int cx88_bcount = ARRAY_SIZE(cx88_boards);
...@@ -240,6 +345,10 @@ struct cx88_subid cx88_subids[] = { ...@@ -240,6 +345,10 @@ struct cx88_subid cx88_subids[] = {
.subvendor = 0x107d, .subvendor = 0x107d,
.subdevice = 0x6620, .subdevice = 0x6620,
.card = CX88_BOARD_WINFAST_DV2000, .card = CX88_BOARD_WINFAST_DV2000,
},{
.subvendor = 0x107d,
.subdevice = 0x663b,
.card = CX88_BOARD_LEADTEK_PVR2000,
},{ },{
.subvendor = 0x107d, .subvendor = 0x107d,
.subdevice = 0x663C, .subdevice = 0x663C,
...@@ -251,12 +360,19 @@ struct cx88_subid cx88_subids[] = { ...@@ -251,12 +360,19 @@ struct cx88_subid cx88_subids[] = {
},{ },{
.subvendor = 0x1462, .subvendor = 0x1462,
.subdevice = 0x8606, .subdevice = 0x8606,
.card = CX88_BOARD_MSI_TVANYWHERE, .card = CX88_BOARD_MSI_TVANYWHERE_MASTER,
} },{
.subvendor = 0x10fc,
.subdevice = 0xd003,
.card = CX88_BOARD_IODATA_GVVCP3PCI,
},{
.subvendor = 0x1043,
.subdevice = 0x4823, /* with mpeg encoder */
.card = CX88_BOARD_ASUS_PVR_416,
}
}; };
const unsigned int cx88_idcount = ARRAY_SIZE(cx88_subids); const unsigned int cx88_idcount = ARRAY_SIZE(cx88_subids);
/* ----------------------------------------------------------------------- */ /* ----------------------------------------------------------------------- */
/* some leadtek specific stuff */ /* some leadtek specific stuff */
...@@ -386,20 +502,22 @@ static struct { ...@@ -386,20 +502,22 @@ static struct {
[ 0x02 ] = { .id = TUNER_ABSENT, [ 0x02 ] = { .id = TUNER_ABSENT,
.name = "PAL_B" }, .name = "PAL_B" },
[ 0x03 ] = { .id = TUNER_ABSENT, [ 0x03 ] = { .id = TUNER_ABSENT,
.name = "BAL_I" }, .name = "PAL_I" },
[ 0x04 ] = { .id = TUNER_ABSENT, [ 0x04 ] = { .id = TUNER_ABSENT,
.name = "PAL_D" }, .name = "PAL_D" },
[ 0x05 ] = { .id = TUNER_ABSENT, [ 0x05 ] = { .id = TUNER_ABSENT,
.name = "SECAM" }, .name = "SECAM" },
[ 0x10 ] = { .id = TUNER_ABSENT, .fm = 1, [ 0x10 ] = { .id = TUNER_ABSENT,
.fm = 1,
.name = "TEMIC_4049" }, .name = "TEMIC_4049" },
[ 0x11 ] = { .id = TUNER_TEMIC_4136FY5, [ 0x11 ] = { .id = TUNER_TEMIC_4136FY5,
.name = "TEMIC_4136" }, .name = "TEMIC_4136" },
[ 0x12 ] = { .id = TUNER_ABSENT, [ 0x12 ] = { .id = TUNER_ABSENT,
.name = "TEMIC_4146" }, .name = "TEMIC_4146" },
[ 0x20 ] = { .id = TUNER_PHILIPS_FQ1216ME, .fm = 1, [ 0x20 ] = { .id = TUNER_PHILIPS_FQ1216ME,
.fm = 1,
.name = "PHILIPS_FQ1216_MK3" }, .name = "PHILIPS_FQ1216_MK3" },
[ 0x21 ] = { .id = TUNER_ABSENT, .fm = 1, [ 0x21 ] = { .id = TUNER_ABSENT, .fm = 1,
.name = "PHILIPS_FQ1236_MK3" }, .name = "PHILIPS_FQ1236_MK3" },
...@@ -454,7 +572,33 @@ i2c_eeprom(struct i2c_client *c, unsigned char *eedata, int len) ...@@ -454,7 +572,33 @@ i2c_eeprom(struct i2c_client *c, unsigned char *eedata, int len)
return 0; return 0;
} }
void __devinit cx88_card_setup(struct cx8800_dev *dev) void cx88_card_list(struct cx8800_dev *dev)
{
int i;
if (0 == dev->pci->subsystem_vendor &&
0 == dev->pci->subsystem_device) {
printk("%s: Your board has no valid PCI Subsystem ID and thus can't\n"
"%s: be autodetected. Please pass card=<n> insmod option to\n"
"%s: workaround that. Redirect complaints to the vendor of\n"
"%s: the TV card. Best regards,\n"
"%s: -- tux\n",
dev->name,dev->name,dev->name,dev->name,dev->name);
} else {
printk("%s: Your board isn't known (yet) to the driver. You can\n"
"%s: try to pick one of the existing card configs via\n"
"%s: card=<n> insmod option. Updating to the latest\n"
"%s: version might help as well.\n",
dev->name,dev->name,dev->name,dev->name);
}
printk("%s: Here is a list of valid choices for the card=<n> insmod option:\n",
dev->name);
for (i = 0; i < cx88_bcount; i++)
printk("%s: card=%d -> %s\n",
dev->name, i, cx88_boards[i].name);
}
void cx88_card_setup(struct cx8800_dev *dev)
{ {
static u8 eeprom[128]; static u8 eeprom[128];
...@@ -474,6 +618,9 @@ void __devinit cx88_card_setup(struct cx8800_dev *dev) ...@@ -474,6 +618,9 @@ void __devinit cx88_card_setup(struct cx8800_dev *dev)
i2c_eeprom(&dev->i2c_client,eeprom,sizeof(eeprom)); i2c_eeprom(&dev->i2c_client,eeprom,sizeof(eeprom));
leadtek_eeprom(dev,eeprom); leadtek_eeprom(dev,eeprom);
break; break;
case CX88_BOARD_ASUS_PVR_416:
dev->has_radio = 1;
break;
} }
} }
...@@ -483,6 +630,7 @@ EXPORT_SYMBOL(cx88_boards); ...@@ -483,6 +630,7 @@ EXPORT_SYMBOL(cx88_boards);
EXPORT_SYMBOL(cx88_bcount); EXPORT_SYMBOL(cx88_bcount);
EXPORT_SYMBOL(cx88_subids); EXPORT_SYMBOL(cx88_subids);
EXPORT_SYMBOL(cx88_idcount); EXPORT_SYMBOL(cx88_idcount);
EXPORT_SYMBOL(cx88_card_list);
EXPORT_SYMBOL(cx88_card_setup); EXPORT_SYMBOL(cx88_card_setup);
/* /*
......
...@@ -22,8 +22,6 @@ ...@@ -22,8 +22,6 @@
*/ */
#define __NO_VERSION__ 1
#include <linux/module.h> #include <linux/module.h>
#include <linux/init.h> #include <linux/init.h>
......
...@@ -599,10 +599,20 @@ ...@@ -599,10 +599,20 @@
#define EN_I2SIN_STR2DAC 0x00004000 #define EN_I2SIN_STR2DAC 0x00004000
#define EN_I2SIN_ENABLE 0x00008000 #define EN_I2SIN_ENABLE 0x00008000
#if 0
/* old */
#define EN_DMTRX_SUMDIFF 0x00000800 #define EN_DMTRX_SUMDIFF 0x00000800
#define EN_DMTRX_SUMR 0x00000880 #define EN_DMTRX_SUMR 0x00000880
#define EN_DMTRX_LR 0x00000900 #define EN_DMTRX_LR 0x00000900
#define EN_DMTRX_MONO 0x00000980 #define EN_DMTRX_MONO 0x00000980
#else
/* dscaler cvs */
#define EN_DMTRX_SUMDIFF (0 << 7)
#define EN_DMTRX_SUMR (1 << 7)
#define EN_DMTRX_LR (2 << 7)
#define EN_DMTRX_MONO (3 << 7)
#define EN_DMTRX_BYPASS (1 << 11)
#endif
// Video // Video
#define VID_CAPTURE_CONTROL 0x310180 #define VID_CAPTURE_CONTROL 0x310180
......
This diff is collapsed.
...@@ -28,17 +28,14 @@ void cx8800_vbi_fmt(struct cx8800_dev *dev, struct v4l2_format *f) ...@@ -28,17 +28,14 @@ void cx8800_vbi_fmt(struct cx8800_dev *dev, struct v4l2_format *f)
f->fmt.vbi.count[0] = VBI_LINE_COUNT; f->fmt.vbi.count[0] = VBI_LINE_COUNT;
f->fmt.vbi.count[1] = VBI_LINE_COUNT; f->fmt.vbi.count[1] = VBI_LINE_COUNT;
switch (dev->tvnorm->id) { if (dev->tvnorm->id & V4L2_STD_525_60) {
case V4L2_STD_NTSC_M: /* ntsc */
case V4L2_STD_NTSC_M_JP:
f->fmt.vbi.sampling_rate = 28636363; f->fmt.vbi.sampling_rate = 28636363;
f->fmt.vbi.start[0] = 10 -1; f->fmt.vbi.start[0] = 10 -1;
f->fmt.vbi.start[1] = 273 -1; f->fmt.vbi.start[1] = 273 -1;
break;
case V4L2_STD_PAL_BG: } else if (V4L2_STD_625_50) {
case V4L2_STD_PAL_DK: /* pal */
case V4L2_STD_PAL_I:
case V4L2_STD_SECAM:
f->fmt.vbi.sampling_rate = 35468950; f->fmt.vbi.sampling_rate = 35468950;
f->fmt.vbi.start[0] = 7 -1; f->fmt.vbi.start[0] = 7 -1;
f->fmt.vbi.start[1] = 319 -1; f->fmt.vbi.start[1] = 319 -1;
......
This diff is collapsed.
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
#include "cx88-reg.h" #include "cx88-reg.h"
#include <linux/version.h> #include <linux/version.h>
#define CX88_VERSION_CODE KERNEL_VERSION(0,0,3) #define CX88_VERSION_CODE KERNEL_VERSION(0,0,4)
#ifndef TRUE #ifndef TRUE
# define TRUE (1==1) # define TRUE (1==1)
...@@ -114,17 +114,20 @@ extern struct sram_channel cx88_sram_channels[]; ...@@ -114,17 +114,20 @@ extern struct sram_channel cx88_sram_channels[];
/* card configuration */ /* card configuration */
#define CX88_BOARD_NOAUTO UNSET #define CX88_BOARD_NOAUTO UNSET
#define CX88_BOARD_UNKNOWN 0 #define CX88_BOARD_UNKNOWN 0
#define CX88_BOARD_HAUPPAUGE 1 #define CX88_BOARD_HAUPPAUGE 1
#define CX88_BOARD_GDI 2 #define CX88_BOARD_GDI 2
#define CX88_BOARD_PIXELVIEW 3 #define CX88_BOARD_PIXELVIEW 3
#define CX88_BOARD_ATI_WONDER_PRO 4 #define CX88_BOARD_ATI_WONDER_PRO 4
#define CX88_BOARD_WINFAST2000XP 5 #define CX88_BOARD_WINFAST2000XP 5
#define CX88_BOARD_AVERTV_303 6 #define CX88_BOARD_AVERTV_303 6
#define CX88_BOARD_MSI_TVANYWHERE 7 #define CX88_BOARD_MSI_TVANYWHERE_MASTER 7
#define CX88_BOARD_WINFAST_DV2000 8 #define CX88_BOARD_WINFAST_DV2000 8
#define CX88_BOARD_LEADTEK_PVR2000 9 #define CX88_BOARD_LEADTEK_PVR2000 9
#define CX88_BOARD_IODATA_GVVCP3PCI 10
#define CX88_BOARD_PROLINK_PLAYTVPVR 11
#define CX88_BOARD_ASUS_PVR_416 12
#define CX88_BOARD_MSI_TVANYWHERE 13
enum cx88_itype { enum cx88_itype {
CX88_VMUX_COMPOSITE1 = 1, CX88_VMUX_COMPOSITE1 = 1,
...@@ -263,6 +266,9 @@ struct cx8800_dev { ...@@ -263,6 +266,9 @@ struct cx8800_dev {
/* other global state info */ /* other global state info */
u32 shadow[SHADOW_MAX]; u32 shadow[SHADOW_MAX];
int shutdown;
pid_t tpid;
struct completion texit;
struct cx8800_suspend_state state; struct cx8800_suspend_state state;
}; };
...@@ -351,7 +357,8 @@ extern const unsigned int cx88_bcount; ...@@ -351,7 +357,8 @@ extern const unsigned int cx88_bcount;
extern struct cx88_subid cx88_subids[]; extern struct cx88_subid cx88_subids[];
extern const unsigned int cx88_idcount; extern const unsigned int cx88_idcount;
extern void __devinit cx88_card_setup(struct cx8800_dev *dev); extern void cx88_card_list(struct cx8800_dev *dev);
extern void cx88_card_setup(struct cx8800_dev *dev);
/* ----------------------------------------------------------- */ /* ----------------------------------------------------------- */
/* cx88-tvaudio.c */ /* cx88-tvaudio.c */
...@@ -372,6 +379,7 @@ extern void __devinit cx88_card_setup(struct cx8800_dev *dev); ...@@ -372,6 +379,7 @@ extern void __devinit cx88_card_setup(struct cx8800_dev *dev);
void cx88_set_tvaudio(struct cx8800_dev *dev); void cx88_set_tvaudio(struct cx8800_dev *dev);
void cx88_get_stereo(struct cx8800_dev *dev, struct v4l2_tuner *t); void cx88_get_stereo(struct cx8800_dev *dev, struct v4l2_tuner *t);
void cx88_set_stereo(struct cx8800_dev *dev, u32 mode); void cx88_set_stereo(struct cx8800_dev *dev, u32 mode);
int cx88_audio_thread(void *data);
/* /*
* Local variables: * Local variables:
......
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