From ff699e6bd02eb1c6d02c7c2b576c2ee6caab201c Mon Sep 17 00:00:00 2001 From: Douglas Schilling Landgraf Date: Tue, 22 Apr 2008 14:41:48 -0300 Subject: V4L/DVB (7094): static memory - Static memory is always initialized with 0. - Replaced in some cases C99 comments for /* */ Signed-off-by: Douglas Schilling Landgraf Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/cx88/cx88-blackbird.c | 2 +- drivers/media/video/cx88/cx88-core.c | 6 +++--- drivers/media/video/cx88/cx88-dvb.c | 2 +- drivers/media/video/cx88/cx88-i2c.c | 4 ++-- drivers/media/video/cx88/cx88-input.c | 2 +- drivers/media/video/cx88/cx88-mpeg.c | 2 +- drivers/media/video/cx88/cx88-tvaudio.c | 6 +++--- drivers/media/video/cx88/cx88-vbi.c | 2 +- drivers/media/video/cx88/cx88-video.c | 4 ++-- 9 files changed, 15 insertions(+), 15 deletions(-) (limited to 'drivers/media/video/cx88') diff --git a/drivers/media/video/cx88/cx88-blackbird.c b/drivers/media/video/cx88/cx88-blackbird.c index a99e9d5950a..c3726907452 100644 --- a/drivers/media/video/cx88/cx88-blackbird.c +++ b/drivers/media/video/cx88/cx88-blackbird.c @@ -45,7 +45,7 @@ static unsigned int mpegbufs = 32; module_param(mpegbufs,int,0644); MODULE_PARM_DESC(mpegbufs,"number of mpeg buffers, range 2-32"); -static unsigned int debug = 0; +static unsigned int debug; module_param(debug,int,0644); MODULE_PARM_DESC(debug,"enable debug messages [blackbird]"); diff --git a/drivers/media/video/cx88/cx88-core.c b/drivers/media/video/cx88/cx88-core.c index 01e2ac98970..12440b91e4b 100644 --- a/drivers/media/video/cx88/cx88-core.c +++ b/drivers/media/video/cx88/cx88-core.c @@ -47,15 +47,15 @@ MODULE_LICENSE("GPL"); /* ------------------------------------------------------------------ */ -static unsigned int core_debug = 0; +static unsigned int core_debug; module_param(core_debug,int,0644); MODULE_PARM_DESC(core_debug,"enable debug messages [core]"); -static unsigned int nicam = 0; +static unsigned int nicam; module_param(nicam,int,0644); MODULE_PARM_DESC(nicam,"tv audio is nicam"); -static unsigned int nocomb = 0; +static unsigned int nocomb; module_param(nocomb,int,0644); MODULE_PARM_DESC(nocomb,"disable comb filter"); diff --git a/drivers/media/video/cx88/cx88-dvb.c b/drivers/media/video/cx88/cx88-dvb.c index f7b41eb1bb5..7586fe31f64 100644 --- a/drivers/media/video/cx88/cx88-dvb.c +++ b/drivers/media/video/cx88/cx88-dvb.c @@ -51,7 +51,7 @@ MODULE_AUTHOR("Chris Pascoe "); MODULE_AUTHOR("Gerd Knorr [SuSE Labs]"); MODULE_LICENSE("GPL"); -static unsigned int debug = 0; +static unsigned int debug; module_param(debug, int, 0644); MODULE_PARM_DESC(debug,"enable debug messages [dvb]"); diff --git a/drivers/media/video/cx88/cx88-i2c.c b/drivers/media/video/cx88/cx88-i2c.c index 566b26af523..c6b44732a08 100644 --- a/drivers/media/video/cx88/cx88-i2c.c +++ b/drivers/media/video/cx88/cx88-i2c.c @@ -35,11 +35,11 @@ #include "cx88.h" #include -static unsigned int i2c_debug = 0; +static unsigned int i2c_debug; module_param(i2c_debug, int, 0644); MODULE_PARM_DESC(i2c_debug,"enable debug messages [i2c]"); -static unsigned int i2c_scan = 0; +static unsigned int i2c_scan; module_param(i2c_scan, int, 0444); MODULE_PARM_DESC(i2c_scan,"scan i2c bus at insmod time"); diff --git a/drivers/media/video/cx88/cx88-input.c b/drivers/media/video/cx88/cx88-input.c index bb0911b4d2f..d2e42c77b5a 100644 --- a/drivers/media/video/cx88/cx88-input.c +++ b/drivers/media/video/cx88/cx88-input.c @@ -57,7 +57,7 @@ struct cx88_IR { u32 mask_keyup; }; -static int ir_debug = 0; +static int ir_debug; module_param(ir_debug, int, 0644); /* debug level [IR] */ MODULE_PARM_DESC(ir_debug, "enable debug messages [IR]"); diff --git a/drivers/media/video/cx88/cx88-mpeg.c b/drivers/media/video/cx88/cx88-mpeg.c index e357f415db0..a02cabbab77 100644 --- a/drivers/media/video/cx88/cx88-mpeg.c +++ b/drivers/media/video/cx88/cx88-mpeg.c @@ -39,7 +39,7 @@ MODULE_AUTHOR("Chris Pascoe "); MODULE_AUTHOR("Gerd Knorr [SuSE Labs]"); MODULE_LICENSE("GPL"); -static unsigned int debug = 0; +static unsigned int debug; module_param(debug,int,0644); MODULE_PARM_DESC(debug,"enable debug messages [mpeg]"); diff --git a/drivers/media/video/cx88/cx88-tvaudio.c b/drivers/media/video/cx88/cx88-tvaudio.c index 76e5c78d8ae..c574f450498 100644 --- a/drivers/media/video/cx88/cx88-tvaudio.c +++ b/drivers/media/video/cx88/cx88-tvaudio.c @@ -53,15 +53,15 @@ #include "cx88.h" -static unsigned int audio_debug = 0; +static unsigned int audio_debug; module_param(audio_debug, int, 0644); MODULE_PARM_DESC(audio_debug, "enable debug messages [audio]"); -static unsigned int always_analog = 0; +static unsigned int always_analog; module_param(always_analog,int,0644); MODULE_PARM_DESC(always_analog,"force analog audio out"); -static unsigned int radio_deemphasis = 0; +static unsigned int radio_deemphasis; module_param(radio_deemphasis,int,0644); MODULE_PARM_DESC(radio_deemphasis, "Radio deemphasis time constant, " "0=None, 1=50us (elsewhere), 2=75us (USA)"); diff --git a/drivers/media/video/cx88/cx88-vbi.c b/drivers/media/video/cx88/cx88-vbi.c index d96ecfcf393..0943060682b 100644 --- a/drivers/media/video/cx88/cx88-vbi.c +++ b/drivers/media/video/cx88/cx88-vbi.c @@ -11,7 +11,7 @@ static unsigned int vbibufs = 4; module_param(vbibufs,int,0644); MODULE_PARM_DESC(vbibufs,"number of vbi buffers, range 2-32"); -static unsigned int vbi_debug = 0; +static unsigned int vbi_debug; module_param(vbi_debug,int,0644); MODULE_PARM_DESC(vbi_debug,"enable debug messages [vbi]"); diff --git a/drivers/media/video/cx88/cx88-video.c b/drivers/media/video/cx88/cx88-video.c index 227179620d1..8b293a3357b 100644 --- a/drivers/media/video/cx88/cx88-video.c +++ b/drivers/media/video/cx88/cx88-video.c @@ -63,11 +63,11 @@ MODULE_PARM_DESC(video_nr,"video device numbers"); MODULE_PARM_DESC(vbi_nr,"vbi device numbers"); MODULE_PARM_DESC(radio_nr,"radio device numbers"); -static unsigned int video_debug = 0; +static unsigned int video_debug; module_param(video_debug,int,0644); MODULE_PARM_DESC(video_debug,"enable debug messages [video]"); -static unsigned int irq_debug = 0; +static unsigned int irq_debug; module_param(irq_debug,int,0644); MODULE_PARM_DESC(irq_debug,"enable debug messages [IRQ handler]"); -- cgit From 0705135e59f8503e4dade4b3580fed77b1743b7c Mon Sep 17 00:00:00 2001 From: Guennadi Liakhovetski Date: Tue, 22 Apr 2008 14:42:13 -0300 Subject: V4L/DVB (7237): Convert videobuf-dma-sg to generic DMA API videobuf-dma-sg does not need to depend on PCI. Switch it to using generic DMA API, convert all affected drivers, relax Kconfig restriction, improve compile-time type checking, fix some Coding Style violations while at it. Signed-off-by: Guennadi Liakhovetski Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/cx88/cx88-alsa.c | 8 ++++---- drivers/media/video/cx88/cx88-blackbird.c | 4 ++-- drivers/media/video/cx88/cx88-dvb.c | 4 ++-- drivers/media/video/cx88/cx88-video.c | 8 ++++---- 4 files changed, 12 insertions(+), 12 deletions(-) (limited to 'drivers/media/video/cx88') diff --git a/drivers/media/video/cx88/cx88-alsa.c b/drivers/media/video/cx88/cx88-alsa.c index 316b106c351..2f5a4a4ba40 100644 --- a/drivers/media/video/cx88/cx88-alsa.c +++ b/drivers/media/video/cx88/cx88-alsa.c @@ -283,7 +283,7 @@ static int dsp_buffer_free(snd_cx88_card_t *chip) BUG_ON(!chip->dma_size); dprintk(2,"Freeing buffer\n"); - videobuf_pci_dma_unmap(chip->pci, chip->dma_risc); + videobuf_sg_dma_unmap(&chip->pci->dev, chip->dma_risc); videobuf_dma_free(chip->dma_risc); btcx_riscmem_free(chip->pci,&chip->buf->risc); kfree(chip->buf); @@ -385,7 +385,7 @@ static int snd_cx88_hw_params(struct snd_pcm_substream * substream, BUG_ON(!chip->dma_size); BUG_ON(chip->num_periods & (chip->num_periods-1)); - buf = videobuf_pci_alloc(sizeof(*buf)); + buf = videobuf_sg_alloc(sizeof(*buf)); if (NULL == buf) return -ENOMEM; @@ -396,14 +396,14 @@ static int snd_cx88_hw_params(struct snd_pcm_substream * substream, buf->vb.height = chip->num_periods; buf->vb.size = chip->dma_size; - dma=videobuf_to_dma(&buf->vb); + dma = videobuf_to_dma(&buf->vb); videobuf_dma_init(dma); ret = videobuf_dma_init_kernel(dma, PCI_DMA_FROMDEVICE, (PAGE_ALIGN(buf->vb.size) >> PAGE_SHIFT)); if (ret < 0) goto error; - ret = videobuf_pci_dma_map(chip->pci,dma); + ret = videobuf_sg_dma_map(&chip->pci->dev, dma); if (ret < 0) goto error; diff --git a/drivers/media/video/cx88/cx88-blackbird.c b/drivers/media/video/cx88/cx88-blackbird.c index c3726907452..d582395805d 100644 --- a/drivers/media/video/cx88/cx88-blackbird.c +++ b/drivers/media/video/cx88/cx88-blackbird.c @@ -1087,8 +1087,8 @@ static int mpeg_open(struct inode *inode, struct file *file) file->private_data = fh; fh->dev = dev; - videobuf_queue_pci_init(&fh->mpegq, &blackbird_qops, - dev->pci, &dev->slock, + videobuf_queue_sg_init(&fh->mpegq, &blackbird_qops, + &dev->pci->dev, &dev->slock, V4L2_BUF_TYPE_VIDEO_CAPTURE, V4L2_FIELD_INTERLACED, sizeof(struct cx88_buffer), diff --git a/drivers/media/video/cx88/cx88-dvb.c b/drivers/media/video/cx88/cx88-dvb.c index 7586fe31f64..fa21666966e 100644 --- a/drivers/media/video/cx88/cx88-dvb.c +++ b/drivers/media/video/cx88/cx88-dvb.c @@ -744,8 +744,8 @@ static int cx8802_dvb_probe(struct cx8802_driver *drv) /* dvb stuff */ printk(KERN_INFO "%s/2: cx2388x based DVB/ATSC card\n", core->name); - videobuf_queue_pci_init(&dev->dvb.dvbq, &dvb_qops, - dev->pci, &dev->slock, + videobuf_queue_sg_init(&dev->dvb.dvbq, &dvb_qops, + &dev->pci->dev, &dev->slock, V4L2_BUF_TYPE_VIDEO_CAPTURE, V4L2_FIELD_TOP, sizeof(struct cx88_buffer), diff --git a/drivers/media/video/cx88/cx88-video.c b/drivers/media/video/cx88/cx88-video.c index 8b293a3357b..c30356bb35e 100644 --- a/drivers/media/video/cx88/cx88-video.c +++ b/drivers/media/video/cx88/cx88-video.c @@ -776,14 +776,14 @@ static int video_open(struct inode *inode, struct file *file) fh->height = 240; fh->fmt = format_by_fourcc(V4L2_PIX_FMT_BGR24); - videobuf_queue_pci_init(&fh->vidq, &cx8800_video_qops, - dev->pci, &dev->slock, + videobuf_queue_sg_init(&fh->vidq, &cx8800_video_qops, + &dev->pci->dev, &dev->slock, V4L2_BUF_TYPE_VIDEO_CAPTURE, V4L2_FIELD_INTERLACED, sizeof(struct cx88_buffer), fh); - videobuf_queue_pci_init(&fh->vbiq, &cx8800_vbi_qops, - dev->pci, &dev->slock, + videobuf_queue_sg_init(&fh->vbiq, &cx8800_vbi_qops, + &dev->pci->dev, &dev->slock, V4L2_BUF_TYPE_VBI_CAPTURE, V4L2_FIELD_SEQ_TB, sizeof(struct cx88_buffer), -- cgit From 5c00fac0bab95a378e60c1a67e3d3c5ac44df412 Mon Sep 17 00:00:00 2001 From: Steven Toth Date: Tue, 22 Apr 2008 14:45:14 -0300 Subject: V4L/DVB (7252): cx88: Add support for the Dvico PCI Nano ATSC is known to work. SVideo / Composite should work (I have no cable to test). Analog tuner support does not work. Signed-off-by: Steven Toth Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/cx88/cx88-cards.c | 27 ++++++++++++++ drivers/media/video/cx88/cx88-dvb.c | 69 +++++++++++++++++++++++++++++++++++ drivers/media/video/cx88/cx88.h | 1 + 3 files changed, 97 insertions(+) (limited to 'drivers/media/video/cx88') diff --git a/drivers/media/video/cx88/cx88-cards.c b/drivers/media/video/cx88/cx88-cards.c index 8c9a8adf52d..23b58bc9cf2 100644 --- a/drivers/media/video/cx88/cx88-cards.c +++ b/drivers/media/video/cx88/cx88-cards.c @@ -1401,6 +1401,29 @@ static const struct cx88_board cx88_boards[] = { }}, .mpeg = CX88_MPEG_DVB, }, + [CX88_BOARD_DVICO_FUSIONHDTV_5_PCI_NANO] = { + .name = "DVICO HDTV5 PCI Nano", + .tuner_type = TUNER_ABSENT, + .radio_type = UNSET, + .tuner_addr = ADDR_UNSET, + .radio_addr = ADDR_UNSET, + .input = {{ + .type = CX88_VMUX_TELEVISION, + .vmux = 0, + .gpio0 = 0x000027df, /* Unconfirmed */ + }, { + .type = CX88_VMUX_COMPOSITE1, + .vmux = 1, + .gpio0 = 0x000027df, /* Unconfirmed */ + .audioroute = 1, + }, { + .type = CX88_VMUX_SVIDEO, + .vmux = 2, + .gpio0 = 0x000027df, /* Unconfirmed */ + .audioroute = 1, + } }, + .mpeg = CX88_MPEG_DVB, + }, }; /* ------------------------------------------------------------------ */ @@ -1714,6 +1737,10 @@ static const struct cx88_subid cx88_subids[] = { .subvendor = 0x11bd, .subdevice = 0x0051, .card = CX88_BOARD_PINNACLE_PCTV_HD_800i, + }, { + .subvendor = 0x18ac, + .subdevice = 0xd530, + .card = CX88_BOARD_DVICO_FUSIONHDTV_5_PCI_NANO, }, }; diff --git a/drivers/media/video/cx88/cx88-dvb.c b/drivers/media/video/cx88/cx88-dvb.c index fa21666966e..735376060df 100644 --- a/drivers/media/video/cx88/cx88-dvb.c +++ b/drivers/media/video/cx88/cx88-dvb.c @@ -45,6 +45,8 @@ #include "nxt200x.h" #include "cx24123.h" #include "isl6421.h" +#include "tuner-xc2028.h" +#include "tuner-xc2028-types.h" MODULE_DESCRIPTION("driver for cx2388x based DVB cards"); MODULE_AUTHOR("Chris Pascoe "); @@ -357,6 +359,40 @@ static int geniatech_dvbs_set_voltage(struct dvb_frontend *fe, return 0; } +static int cx88_xc3028_callback(void *ptr, int command, int arg) +{ + struct cx88_core *core = ptr; + + switch (command) { + case XC2028_TUNER_RESET: + /* Send the tuner in then out of reset */ + dprintk(1, "%s: XC2028_TUNER_RESET %d\n", __FUNCTION__, arg); + + switch (core->boardnr) { + case CX88_BOARD_DVICO_FUSIONHDTV_5_PCI_NANO: + /* GPIO-4 xc3028 tuner */ + + cx_set(MO_GP0_IO, 0x00001000); + cx_clear(MO_GP0_IO, 0x00000010); + msleep(100); + cx_set(MO_GP0_IO, 0x00000010); + msleep(100); + break; + } + + 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 struct cx24123_config geniatech_dvbs_config = { .demod_address = 0x55, .set_ts_params = cx24123_set_ts_param, @@ -383,6 +419,15 @@ static struct s5h1409_config pinnacle_pctv_hd_800i_config = { .mpeg_timing = S5H1409_MPEGTIMING_NONCONTINOUS_NONINVERTING_CLOCK, }; +static struct s5h1409_config dvico_hdtv5_pci_nano_config = { + .demod_address = 0x32 >> 1, + .output_mode = S5H1409_SERIAL_OUTPUT, + .gpio = S5H1409_GPIO_OFF, + .inversion = S5H1409_INVERSION_OFF, + .status_mode = S5H1409_DEMODLOCKING, + .mpeg_timing = S5H1409_MPEGTIMING_CONTINOUS_NONINVERTING_CLOCK, +}; + static struct xc5000_config pinnacle_pctv_hd_800i_tuner_config = { .i2c_address = 0x64, .if_khz = 5380, @@ -658,6 +703,30 @@ static int dvb_register(struct cx8802_dev *dev) &pinnacle_pctv_hd_800i_tuner_config); } break; + case CX88_BOARD_DVICO_FUSIONHDTV_5_PCI_NANO: + dev->dvb.frontend = dvb_attach(s5h1409_attach, + &dvico_hdtv5_pci_nano_config, + &dev->core->i2c_adap); + if (dev->dvb.frontend != NULL) { + struct dvb_frontend *fe; + struct xc2028_config cfg = { + .i2c_adap = &dev->core->i2c_adap, + .i2c_addr = 0x61, + .video_dev = dev->core, + .callback = cx88_xc3028_callback, + }; + static struct xc2028_ctrl ctl = { + .fname = "xc3028-v27.fw", + .max_len = 64, + .scode_table = OREN538, + }; + + fe = dvb_attach(xc2028_attach, + dev->dvb.frontend, &cfg); + if (fe != NULL && fe->ops.tuner_ops.set_config != NULL) + fe->ops.tuner_ops.set_config(fe, &ctl); + } + break; default: printk(KERN_ERR "%s/2: The frontend of your DVB/ATSC card isn't supported yet\n", dev->core->name); diff --git a/drivers/media/video/cx88/cx88.h b/drivers/media/video/cx88/cx88.h index 37e6d2e4002..8121bd07a88 100644 --- a/drivers/media/video/cx88/cx88.h +++ b/drivers/media/video/cx88/cx88.h @@ -211,6 +211,7 @@ extern struct sram_channel cx88_sram_channels[]; #define CX88_BOARD_HAUPPAUGE_HVR1300 56 #define CX88_BOARD_ADSTECH_PTV_390 57 #define CX88_BOARD_PINNACLE_PCTV_HD_800i 58 +#define CX88_BOARD_DVICO_FUSIONHDTV_5_PCI_NANO 59 enum cx88_itype { CX88_VMUX_COMPOSITE1 = 1, -- cgit From 8efd2e28265ca031072d8d94cdbdd53904ce9b2d Mon Sep 17 00:00:00 2001 From: Michael Krufky Date: Tue, 22 Apr 2008 14:45:14 -0300 Subject: V4L/DVB (7254): cx88: fix FusionHDTV 5 PCI nano name and enable IR support load ir-kbd-i2c for IR remote control support on DViCO FusionHDTV 5 PCI nano Signed-off-by: Michael Krufky Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/cx88/cx88-cards.c | 3 ++- drivers/media/video/cx88/cx88-video.c | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'drivers/media/video/cx88') diff --git a/drivers/media/video/cx88/cx88-cards.c b/drivers/media/video/cx88/cx88-cards.c index 23b58bc9cf2..a1756c6c6dc 100644 --- a/drivers/media/video/cx88/cx88-cards.c +++ b/drivers/media/video/cx88/cx88-cards.c @@ -1402,7 +1402,8 @@ static const struct cx88_board cx88_boards[] = { .mpeg = CX88_MPEG_DVB, }, [CX88_BOARD_DVICO_FUSIONHDTV_5_PCI_NANO] = { - .name = "DVICO HDTV5 PCI Nano", + .name = "DViCO FusionHDTV 5 PCI nano", + /* xc3008 tuner, digital only for now */ .tuner_type = TUNER_ABSENT, .radio_type = UNSET, .tuner_addr = ADDR_UNSET, diff --git a/drivers/media/video/cx88/cx88-video.c b/drivers/media/video/cx88/cx88-video.c index c30356bb35e..191577d166a 100644 --- a/drivers/media/video/cx88/cx88-video.c +++ b/drivers/media/video/cx88/cx88-video.c @@ -1832,8 +1832,10 @@ static int __devinit cx8800_initdev(struct pci_dev *pci_dev, switch (core->boardnr) { case CX88_BOARD_DVICO_FUSIONHDTV_5_GOLD: - request_module("ir-kbd-i2c"); request_module("rtc-isl1208"); + /* break intentionally omitted */ + case CX88_BOARD_DVICO_FUSIONHDTV_5_PCI_NANO: + request_module("ir-kbd-i2c"); } /* register v4l devices */ -- cgit From c2cb8fcc006ce59255de67e3fe9f65fb79db633b Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Tue, 22 Apr 2008 14:45:14 -0300 Subject: V4L/DVB (7256): cx88: Add support for tuner-xc3028 Callback gpio's based on Markus Rechberger, Christopher Pascoe and Steven Toth patches. Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/cx88/cx88-cards.c | 91 +++++++++++++++++++++++++++++------ drivers/media/video/cx88/cx88-mpeg.c | 2 + 2 files changed, 79 insertions(+), 14 deletions(-) (limited to 'drivers/media/video/cx88') diff --git a/drivers/media/video/cx88/cx88-cards.c b/drivers/media/video/cx88/cx88-cards.c index a1756c6c6dc..3e07fbe4c84 100644 --- a/drivers/media/video/cx88/cx88-cards.c +++ b/drivers/media/video/cx88/cx88-cards.c @@ -27,6 +27,7 @@ #include "cx88.h" #include "tea5767.h" +#include "tuner-xc2028.h" static unsigned int tuner[] = {[0 ... (CX88_MAXBOARDS - 1)] = UNSET }; static unsigned int radio[] = {[0 ... (CX88_MAXBOARDS - 1)] = UNSET }; @@ -1908,26 +1909,63 @@ static void dvico_fusionhdtv_hybrid_init(struct cx88_core *core) } } +static int cx88_xc2028_tuner_callback(void *priv, int command, int arg) +{ + struct i2c_algo_bit_data *i2c_algo = priv; + struct cx88_core *core = i2c_algo->data; + + switch (command) { + case XC2028_TUNER_RESET: + { + switch (INPUT(core->input).type) { + case CX88_RADIO: + printk(KERN_INFO "setting GPIO to radio!\n"); + cx_write(MO_GP0_IO, 0x4ff); + mdelay(250); + cx_write(MO_GP2_IO, 0xff); + mdelay(250); + cx_write(MO_GP1_IO, 0x101010); + mdelay(250); + cx_write(MO_GP1_IO, 0x101000); + mdelay(250); + cx_write(MO_GP1_IO, 0x101010); + mdelay(250); + return 0; + case CX88_VMUX_DVB: /* Digital TV*/ + default: /* Analog TV */ + printk(KERN_INFO "setting GPIO to TV!\n"); + cx_write(MO_GP1_IO, 0x101010); + mdelay(250); + cx_write(MO_GP1_IO, 0x101000); + mdelay(250); + cx_write(MO_GP1_IO, 0x101010); + mdelay(250); + return 0; + } + } + } + return -EINVAL; +} + /* ----------------------------------------------------------------------- */ /* Tuner callback function. Currently only needed for the Pinnacle * * PCTV HD 800i with an xc5000 sillicon tuner. This is used for both * * analog tuner attach (tuner-core.c) and dvb tuner attach (cx88-dvb.c) */ -int cx88_tuner_callback(void *priv, int command, int arg) +static int cx88_xc5000_tuner_callback(void *priv, int command, int arg) { struct i2c_algo_bit_data *i2c_algo = priv; struct cx88_core *core = i2c_algo->data; - switch(core->boardnr) { + switch (core->boardnr) { case CX88_BOARD_PINNACLE_PCTV_HD_800i: - if(command == 0) { /* This is the reset command from xc5000 */ + if (command == 0) { /* This is the reset command from xc5000 */ /* Reset XC5000 tuner via SYS_RSTO_pin */ cx_write(MO_SRST_IO, 0); msleep(10); cx_write(MO_SRST_IO, 1); return 0; - } - else { + } else { printk(KERN_ERR "xc5000: unknown tuner callback command.\n"); return -EINVAL; @@ -1936,6 +1974,20 @@ int cx88_tuner_callback(void *priv, int command, int arg) } return 0; /* Should never be here */ } + +int cx88_tuner_callback(void *priv, int command, int arg) +{ + struct i2c_algo_bit_data *i2c_algo = priv; + struct cx88_core *core = i2c_algo->data; + + switch (core->board.tuner_type) { + case TUNER_XC2028: + return cx88_xc2028_tuner_callback(priv, command, arg); + case TUNER_XC5000: + return cx88_xc5000_tuner_callback(priv, command, arg); + } + return -EINVAL; +} EXPORT_SYMBOL(cx88_tuner_callback); /* ----------------------------------------------------------------------- */ @@ -2090,6 +2142,26 @@ static void cx88_card_setup(struct cx88_core *core) cx88_call_i2c_clients(core, TUNER_SET_CONFIG, &tea5767_cfg); } } + + if (core->board.tuner_type == TUNER_XC2028) { + struct v4l2_priv_tun_config xc2028_cfg; + struct xc2028_ctrl ctl; + + memset(&xc2028_cfg, 0, sizeof(ctl)); + memset(&ctl, 0, sizeof(ctl)); + + ctl.fname = XC2028_DEFAULT_FIRMWARE; + ctl.max_len = 64; + /* FIXME: Those should be device-dependent */ + ctl.demod = XC3028_FE_OREN538; + ctl.mts = 1; + + xc2028_cfg.tuner = TUNER_XC2028; + xc2028_cfg.priv = &ctl; + + cx88_call_i2c_clients(core, TUNER_SET_CONFIG, &xc2028_cfg); + } + } /* ------------------------------------------------------------------ */ @@ -2235,12 +2307,3 @@ struct cx88_core *cx88_core_create(struct pci_dev *pci, int nr) return core; } - -/* ------------------------------------------------------------------ */ - -/* - * Local variables: - * c-basic-offset: 8 - * End: - * kate: eol "unix"; indent-width 3; remove-trailing-space on; replace-trailing-space-save on; tab-width 8; replace-tabs off; space-indent off; mixed-indent off - */ diff --git a/drivers/media/video/cx88/cx88-mpeg.c b/drivers/media/video/cx88/cx88-mpeg.c index a02cabbab77..6467ca33614 100644 --- a/drivers/media/video/cx88/cx88-mpeg.c +++ b/drivers/media/video/cx88/cx88-mpeg.c @@ -613,6 +613,8 @@ static int cx8802_request_acquire(struct cx8802_driver *drv) core->active_type_id != drv->type_id) return -EBUSY; + core->input = CX88_VMUX_DVB; + if (drv->advise_acquire) { mutex_lock(&drv->core->lock); -- cgit From 9507901ef329b2dd3417372c7c9b2abcfd5c1885 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Tue, 22 Apr 2008 14:45:15 -0300 Subject: V4L/DVB (7257): cx88: Add xc2028/3028 boards This patch ports a patch from Markus Rechberger to work with tuner-xc2028. It adds entries for several cx88 boards with xc2038/3028 tuners. Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/cx88/cx88-cards.c | 188 +++++++++++++++++++++++++++++++++- drivers/media/video/cx88/cx88-dvb.c | 44 +++++++- drivers/media/video/cx88/cx88.h | 4 + 3 files changed, 234 insertions(+), 2 deletions(-) (limited to 'drivers/media/video/cx88') diff --git a/drivers/media/video/cx88/cx88-cards.c b/drivers/media/video/cx88/cx88-cards.c index 3e07fbe4c84..d07286fa21f 100644 --- a/drivers/media/video/cx88/cx88-cards.c +++ b/drivers/media/video/cx88/cx88-cards.c @@ -1426,6 +1426,124 @@ static const struct cx88_board cx88_boards[] = { } }, .mpeg = CX88_MPEG_DVB, }, + [CX88_BOARD_PINNACLE_HYBRID_PCTV] = { + .name = "Pinnacle Hybrid PCTV", + .tuner_type = TUNER_XC2028, + .tuner_addr = 0x61, + .input = { { + .type = CX88_VMUX_TELEVISION, + .vmux = 0, + }, { + .type = CX88_VMUX_COMPOSITE1, + .vmux = 1, + }, { + .type = CX88_VMUX_SVIDEO, + .vmux = 2, + } }, + .radio = { + .type = CX88_RADIO, + .gpio0 = 0x004ff, + .gpio1 = 0x010ff, + .gpio2 = 0x0ff, + }, + }, + [CX88_BOARD_WINFAST_TV2000_XP_GLOBAL] = { + .name = "Winfast TV2000 XP Global", + .tuner_type = TUNER_XC2028, + .tuner_addr = 0x61, + .input = { { + .type = CX88_VMUX_TELEVISION, + .vmux = 0, + .gpio0 = 0x0400, /* pin 2:mute = 0 (off?) */ + .gpio1 = 0x0000, + .gpio2 = 0x0800, /* pin 19:audio = 0 (tv) */ + + }, { + .type = CX88_VMUX_COMPOSITE1, + .vmux = 1, + .gpio0 = 0x0400, /* probably? or 0x0404 to turn mute on */ + .gpio1 = 0x0000, + .gpio2 = 0x0808, /* pin 19:audio = 1 (line) */ + + }, { + .type = CX88_VMUX_SVIDEO, + .vmux = 2, + } }, + .radio = { + .type = CX88_RADIO, + .gpio0 = 0x004ff, + .gpio1 = 0x010ff, + .gpio2 = 0x0ff, + }, + }, + [CX88_BOARD_POWERCOLOR_REAL_ANGEL] = { + .name = "PowerColor Real Angel 330", + .tuner_type = TUNER_XC2028, + .tuner_addr = 0x61, + .input = { { + .type = CX88_VMUX_TELEVISION, + .vmux = 0, + .gpio0 = 0x0400, /* pin 2:mute = 0 (off?) */ + .gpio1 = 0x0000, + .gpio2 = 0x0800, /* pin 19:audio = 0 (tv) */ + }, { + .type = CX88_VMUX_COMPOSITE1, + .vmux = 1, + .gpio0 = 0x0400, /* probably? or 0x0404 to turn mute on */ + .gpio1 = 0x0000, + .gpio2 = 0x0808, /* pin 19:audio = 1 (line) */ + }, { + .type = CX88_VMUX_SVIDEO, + .vmux = 2, + .gpio0 = 0x000ff, + .gpio1 = 0x0f37d, + .gpio2 = 0x00019, + .gpio3 = 0x00000, + } }, + .radio = { + .type = CX88_RADIO, + .gpio0 = 0x000ff, + .gpio1 = 0x0f35d, + .gpio2 = 0x00019, + .gpio3 = 0x00000, + }, + }, + [CX88_BOARD_GENIATECH_X8000_MT] = { + /* Also PowerColor Real Angel 330 and Geniatech X800 OEM */ + .name = "Geniatech X8000-MT DVBT", + .tuner_type = TUNER_XC2028, + .tuner_addr = 0x61, + .input = { { + .type = CX88_VMUX_TELEVISION, + .vmux = 0, + .gpio0 = 0x00000000, + .gpio1 = 0x00e3e341, + .gpio2 = 0x00000000, + .gpio3 = 0x00000000, + }, { + .type = CX88_VMUX_COMPOSITE1, + .vmux = 1, + .gpio0 = 0x00000000, + .gpio1 = 0x00e3e361, + .gpio2 = 0x00000000, + .gpio3 = 0x00000000, + }, { + .type = CX88_VMUX_SVIDEO, + .vmux = 2, + .gpio0 = 0x00000000, + .gpio1 = 0x00e3e361, + .gpio2 = 0x00000000, + .gpio3 = 0x00000000, + } }, + .radio = { + .type = CX88_RADIO, + .gpio0 = 0x00000000, + .gpio1 = 0x00e3e341, + .gpio2 = 0x00000000, + .gpio3 = 0x00000000, + }, + .mpeg = CX88_MPEG_DVB, + } }; /* ------------------------------------------------------------------ */ @@ -1743,7 +1861,23 @@ static const struct cx88_subid cx88_subids[] = { .subvendor = 0x18ac, .subdevice = 0xd530, .card = CX88_BOARD_DVICO_FUSIONHDTV_5_PCI_NANO, - }, + }, { + .subvendor = 0x12ab, + .subdevice = 0x1788, + .card = CX88_BOARD_PINNACLE_HYBRID_PCTV, + }, { + .subvendor = 0x14f1, + .subdevice = 0xea3d, + .card = CX88_BOARD_POWERCOLOR_REAL_ANGEL, + }, { + .subvendor = 0x107d, + .subdevice = 0x6f18, + .card = CX88_BOARD_WINFAST_TV2000_XP_GLOBAL, + }, { + .subvendor = 0x14f1, + .subdevice = 0x8852, + .card = CX88_BOARD_GENIATECH_X8000_MT, + } }; /* ----------------------------------------------------------------------- */ @@ -1875,6 +2009,50 @@ static void gdi_eeprom(struct cx88_core *core, u8 *eeprom_data) CX88_RADIO : 0; } +/* ----------------------------------------------------------------------- */ +/* some Geniatech specific stuff */ + +static int cx88_xc3028_geniatech_tuner_callback(void *priv, int command, int mode) +{ + struct i2c_algo_bit_data *i2c_algo = priv; + struct cx88_core *core = i2c_algo->data; + + switch (command) { + case XC2028_TUNER_RESET: + switch (INPUT(core->input).type) { + case CX88_RADIO: + cx_write(MO_GP1_IO, 0x101010); + mdelay(50); + cx_write(MO_GP1_IO, 0x101000); + mdelay(50); + cx_write(MO_GP1_IO, 0x101010); + mdelay(50); + return 0; + case CX88_VMUX_DVB: + cx_write(MO_GP1_IO, 0x030302); + mdelay(50); + cx_write(MO_GP1_IO, 0x101010); + mdelay(50); + cx_write(MO_GP1_IO, 0x101000); + mdelay(50); + cx_write(MO_GP1_IO, 0x101010); + mdelay(50); + return 0; + default: + cx_write(MO_GP1_IO, 0x030301); + mdelay(50); + cx_write(MO_GP1_IO, 0x101010); + mdelay(50); + cx_write(MO_GP1_IO, 0x101000); + mdelay(50); + cx_write(MO_GP1_IO, 0x101010); + mdelay(50); + return 0; + } + } + return -EINVAL; +} + /* ----------------------------------------------------------------------- */ /* some DViCO specific stuff */ @@ -1914,6 +2092,14 @@ static int cx88_xc2028_tuner_callback(void *priv, int command, int arg) struct i2c_algo_bit_data *i2c_algo = priv; struct cx88_core *core = i2c_algo->data; + /* Board-specific callbacks */ + switch (core->boardnr) { + case CX88_BOARD_WINFAST_TV2000_XP_GLOBAL: + case CX88_BOARD_POWERCOLOR_REAL_ANGEL: + case CX88_BOARD_GENIATECH_X8000_MT: + return cx88_xc3028_geniatech_tuner_callback(priv, command, arg); + } + switch (command) { case XC2028_TUNER_RESET: { diff --git a/drivers/media/video/cx88/cx88-dvb.c b/drivers/media/video/cx88/cx88-dvb.c index 735376060df..c786d951a04 100644 --- a/drivers/media/video/cx88/cx88-dvb.c +++ b/drivers/media/video/cx88/cx88-dvb.c @@ -434,8 +434,16 @@ static struct xc5000_config pinnacle_pctv_hd_800i_tuner_config = { .tuner_callback = cx88_tuner_callback, }; +static struct zl10353_config cx88_geniatech_x8000_mt = { + .demod_address = (0x1e >> 1), + .no_tuner = 1, +}; + + static int dvb_register(struct cx8802_dev *dev) { + int attach_xc3028 = 0; + /* init struct videobuf_dvb */ dev->dvb.name = dev->core->name; dev->ts_gen_cntrl = 0x0c; @@ -727,16 +735,50 @@ static int dvb_register(struct cx8802_dev *dev) fe->ops.tuner_ops.set_config(fe, &ctl); } break; + case CX88_BOARD_PINNACLE_HYBRID_PCTV: + dev->dvb.frontend = dvb_attach(zl10353_attach, + &cx88_geniatech_x8000_mt, + &dev->core->i2c_adap); + attach_xc3028 = 1; + break; + case CX88_BOARD_GENIATECH_X8000_MT: + dev->ts_gen_cntrl = 0x00; + + dev->dvb.frontend = dvb_attach(zl10353_attach, + &cx88_geniatech_x8000_mt, + &dev->core->i2c_adap); + attach_xc3028 = 1; + break; default: printk(KERN_ERR "%s/2: The frontend of your DVB/ATSC card isn't supported yet\n", dev->core->name); break; } if (NULL == dev->dvb.frontend) { - printk(KERN_ERR "%s/2: frontend initialization failed\n", dev->core->name); + printk(KERN_ERR + "%s/2: frontend initialization failed\n", + dev->core->name); return -1; } + if (attach_xc3028) { + struct dvb_frontend *fe; + struct xc2028_config cfg = { + .i2c_adap = &dev->core->i2c_adap, + .i2c_addr = 0x61, + .video_dev = dev->core, + }; + fe = dvb_attach(xc2028_attach, dev->dvb.frontend, &cfg); + if (!fe) { + printk(KERN_ERR "%s/2: xc3028 attach failed\n", + dev->core->name); + dvb_frontend_detach(dev->dvb.frontend); + dvb_unregister_frontend(dev->dvb.frontend); + dev->dvb.frontend = NULL; + return -1; + } + } + /* Ensure all frontends negotiate bus access */ dev->dvb.frontend->ops.ts_bus_ctrl = cx88_dvb_bus_ctrl; diff --git a/drivers/media/video/cx88/cx88.h b/drivers/media/video/cx88/cx88.h index 8121bd07a88..5145bf2f555 100644 --- a/drivers/media/video/cx88/cx88.h +++ b/drivers/media/video/cx88/cx88.h @@ -212,6 +212,10 @@ extern struct sram_channel cx88_sram_channels[]; #define CX88_BOARD_ADSTECH_PTV_390 57 #define CX88_BOARD_PINNACLE_PCTV_HD_800i 58 #define CX88_BOARD_DVICO_FUSIONHDTV_5_PCI_NANO 59 +#define CX88_BOARD_PINNACLE_HYBRID_PCTV 60 +#define CX88_BOARD_WINFAST_TV2000_XP_GLOBAL 61 +#define CX88_BOARD_POWERCOLOR_REAL_ANGEL 62 +#define CX88_BOARD_GENIATECH_X8000_MT 63 enum cx88_itype { CX88_VMUX_COMPOSITE1 = 1, -- cgit From b3fb91d20ca111316854a166ff88b0c8c0f2388b Mon Sep 17 00:00:00 2001 From: Chris Pascoe Date: Tue, 22 Apr 2008 14:45:15 -0300 Subject: V4L/DVB (7258): Support DVB-T tuning on the DViCO FusionHDTV DVB-T Pro Add support for tuning DVB-T channels on DViCO's FusionHDTV DVB-T Pro board. The IR remote and analog tuner are not supported at this time. Some changes made by Mauro Chehab to allow merging it with some other xc3028 patches. Signed-off-by: Chris Pascoe Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/cx88/cx88-cards.c | 65 ++++++++++++++++++++++++++++++++--- drivers/media/video/cx88/cx88-dvb.c | 23 +++++++++++++ drivers/media/video/cx88/cx88.h | 1 + 3 files changed, 84 insertions(+), 5 deletions(-) (limited to 'drivers/media/video/cx88') diff --git a/drivers/media/video/cx88/cx88-cards.c b/drivers/media/video/cx88/cx88-cards.c index d07286fa21f..1dc70f27f7f 100644 --- a/drivers/media/video/cx88/cx88-cards.c +++ b/drivers/media/video/cx88/cx88-cards.c @@ -1543,7 +1543,24 @@ static const struct cx88_board cx88_boards[] = { .gpio3 = 0x00000000, }, .mpeg = CX88_MPEG_DVB, - } + }, + [CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PRO] = { + .name = "DViCO FusionHDTV DVB-T PRO", + .tuner_type = TUNER_ABSENT, /* XXX: Has XC3028 */ + .radio_type = UNSET, + .tuner_addr = ADDR_UNSET, + .radio_addr = ADDR_UNSET, + .input = { { + .type = CX88_VMUX_COMPOSITE1, + .vmux = 1, + .gpio0 = 0x000067df, + }, { + .type = CX88_VMUX_SVIDEO, + .vmux = 2, + .gpio0 = 0x000067df, + } }, + .mpeg = CX88_MPEG_DVB, + }, }; /* ------------------------------------------------------------------ */ @@ -1748,7 +1765,11 @@ static const struct cx88_subid cx88_subids[] = { .subdevice = 0xdb11, .card = CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PLUS, /* Re-branded DViCO: UltraView DVB-T Plus */ - },{ + }, { + .subvendor = 0x18ac, + .subdevice = 0xdb30, + .card = CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PRO, + }, { .subvendor = 0x17de, .subdevice = 0x0840, .card = CX88_BOARD_KWORLD_HARDWARE_MPEG_TV_XPERT, @@ -2009,6 +2030,28 @@ static void gdi_eeprom(struct cx88_core *core, u8 *eeprom_data) CX88_RADIO : 0; } +/* ------------------------------------------------------------------- */ +/* some Divco specific stuff */ +static int cx88_dvico_xc2028_callback(void *ptr, int command, int arg) +{ + struct cx88_core *core = ptr; + + switch (command) { + case XC2028_TUNER_RESET: + cx_set(MO_GP0_IO, 0x0200); + cx_clear(MO_GP0_IO, 0x02); + mdelay(100); + cx_set(MO_GP0_IO, 0x02); + mdelay(100); + break; + default: + return -EINVAL; + } + + return 0; +} + + /* ----------------------------------------------------------------------- */ /* some Geniatech specific stuff */ @@ -2098,6 +2141,8 @@ static int cx88_xc2028_tuner_callback(void *priv, int command, int arg) case CX88_BOARD_POWERCOLOR_REAL_ANGEL: case CX88_BOARD_GENIATECH_X8000_MT: return cx88_xc3028_geniatech_tuner_callback(priv, command, arg); + case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PRO: + return cx88_dvico_xc2028_callback(priv, command, arg); } switch (command) { @@ -2267,6 +2312,7 @@ static void cx88_card_setup(struct cx88_core *core) case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T1: case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PLUS: case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_HYBRID: + case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PRO: /* GPIO0:0 is hooked to mt352 reset pin */ cx_set(MO_GP0_IO, 0x00000101); cx_clear(MO_GP0_IO, 0x00000001); @@ -2338,9 +2384,18 @@ static void cx88_card_setup(struct cx88_core *core) ctl.fname = XC2028_DEFAULT_FIRMWARE; ctl.max_len = 64; - /* FIXME: Those should be device-dependent */ - ctl.demod = XC3028_FE_OREN538; - ctl.mts = 1; + + switch (core->boardnr) { + case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PRO: + ctl.scode_table = XC3028_FE_ZARLINK456; + break; + case CX88_BOARD_DVICO_FUSIONHDTV_5_PCI_NANO: + ctl.demod = XC3028_FE_OREN538; + break; + default: + ctl.demod = XC3028_FE_OREN538; + ctl.mts = 1; + } xc2028_cfg.tuner = TUNER_XC2028; xc2028_cfg.priv = &ctl; diff --git a/drivers/media/video/cx88/cx88-dvb.c b/drivers/media/video/cx88/cx88-dvb.c index c786d951a04..591037d8d14 100644 --- a/drivers/media/video/cx88/cx88-dvb.c +++ b/drivers/media/video/cx88/cx88-dvb.c @@ -237,6 +237,19 @@ static struct zl10353_config dvico_fusionhdtv_hybrid = { .no_tuner = 1, }; +static struct zl10353_config dvico_fusionhdtv_xc3028 = { + .demod_address = 0x0f, + .if2 = 45600, + .no_tuner = 1, +}; + +static struct mt352_config dvico_fusionhdtv_mt352_xc3028 = { + .demod_address = 0x0f, + .if2 = 4560, + .no_tuner = 1, + .demod_init = dvico_fusionhdtv_demod_init, +}; + static struct zl10353_config dvico_fusionhdtv_plus_v1_1 = { .demod_address = 0x0f, }; @@ -567,6 +580,16 @@ static int dvb_register(struct cx8802_dev *dev) DVB_PLL_THOMSON_FE6600); } break; + case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PRO: + dev->dvb.frontend = dvb_attach(zl10353_attach, + &dvico_fusionhdtv_xc3028, + &dev->core->i2c_adap); + if (dev->dvb.frontend == NULL) + dev->dvb.frontend = dvb_attach(mt352_attach, + &dvico_fusionhdtv_mt352_xc3028, + &dev->core->i2c_adap); + attach_xc3028 = 1; + break; case CX88_BOARD_PCHDTV_HD3000: dev->dvb.frontend = dvb_attach(or51132_attach, &pchdtv_hd3000, &dev->core->i2c_adap); diff --git a/drivers/media/video/cx88/cx88.h b/drivers/media/video/cx88/cx88.h index 5145bf2f555..9df3f198a4d 100644 --- a/drivers/media/video/cx88/cx88.h +++ b/drivers/media/video/cx88/cx88.h @@ -216,6 +216,7 @@ extern struct sram_channel cx88_sram_channels[]; #define CX88_BOARD_WINFAST_TV2000_XP_GLOBAL 61 #define CX88_BOARD_POWERCOLOR_REAL_ANGEL 62 #define CX88_BOARD_GENIATECH_X8000_MT 63 +#define CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PRO 64 enum cx88_itype { CX88_VMUX_COMPOSITE1 = 1, -- cgit From 8765561fc88131bbc9a6246010c15b63595ec35e Mon Sep 17 00:00:00 2001 From: Chris Pascoe Date: Tue, 22 Apr 2008 14:45:15 -0300 Subject: V4L/DVB (7259): FusionHDTV DVB-T Pro tuning problem fixes It seems that on this board, the demodulator provides the pullup on the I2C bus, which means that calling i2c_gate_ctrl crashes the bus. Turn this off and the xc3028 can talk OK. Also fix some GPIO related settings that became more clear through working on this. Some changes made by Mauro Chehab to allow merging it with some other xc3028 patches. Signed-off-by: Chris Pascoe Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/cx88/cx88-cards.c | 16 ++++++++++------ drivers/media/video/cx88/cx88-dvb.c | 8 ++++++++ 2 files changed, 18 insertions(+), 6 deletions(-) (limited to 'drivers/media/video/cx88') diff --git a/drivers/media/video/cx88/cx88-cards.c b/drivers/media/video/cx88/cx88-cards.c index 1dc70f27f7f..1fe6b9da981 100644 --- a/drivers/media/video/cx88/cx88-cards.c +++ b/drivers/media/video/cx88/cx88-cards.c @@ -2038,11 +2038,9 @@ static int cx88_dvico_xc2028_callback(void *ptr, int command, int arg) switch (command) { case XC2028_TUNER_RESET: - cx_set(MO_GP0_IO, 0x0200); - cx_clear(MO_GP0_IO, 0x02); - mdelay(100); - cx_set(MO_GP0_IO, 0x02); - mdelay(100); + cx_write(MO_GP0_IO, 0x101000); + mdelay(5); + cx_set(MO_GP0_IO, 0x101010); break; default: return -EINVAL; @@ -2302,6 +2300,13 @@ static void cx88_card_setup(struct cx88_core *core) cx_write(MO_GP0_IO, 0x000007f8); cx_write(MO_GP1_IO, 0x00000001); break; + case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PRO: + /* GPIO0:0 is hooked to demod reset */ + /* GPIO0:4 is hooked to xc3028 reset */ + cx_write(MO_GP0_IO, 0x00111100); + msleep(1); + cx_write(MO_GP0_IO, 0x00111111); + break; case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL: /* GPIO0:6 is hooked to FX2 reset pin */ cx_set(MO_GP0_IO, 0x00004040); @@ -2312,7 +2317,6 @@ static void cx88_card_setup(struct cx88_core *core) case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T1: case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PLUS: case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_HYBRID: - case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PRO: /* GPIO0:0 is hooked to mt352 reset pin */ cx_set(MO_GP0_IO, 0x00000101); cx_clear(MO_GP0_IO, 0x00000001); diff --git a/drivers/media/video/cx88/cx88-dvb.c b/drivers/media/video/cx88/cx88-dvb.c index 591037d8d14..ae2a0f5f080 100644 --- a/drivers/media/video/cx88/cx88-dvb.c +++ b/drivers/media/video/cx88/cx88-dvb.c @@ -588,6 +588,14 @@ static int dvb_register(struct cx8802_dev *dev) dev->dvb.frontend = dvb_attach(mt352_attach, &dvico_fusionhdtv_mt352_xc3028, &dev->core->i2c_adap); + /* + * On this board, the demod provides the I2C bus pullup. + * We must not permit gate_ctrl to be performed, or + * the xc3028 cannot communicate on the bus. + */ + if (dev->dvb.frontend) + dev->dvb.frontend->ops.i2c_gate_ctrl = NULL; + attach_xc3028 = 1; break; case CX88_BOARD_PCHDTV_HD3000: -- cgit From c450e50e8d6a0876431a744f1df9fdd5c2732b07 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Tue, 22 Apr 2008 14:45:28 -0300 Subject: V4L/DVB (7263): Some cleanups at cx88 callback methods Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/cx88/cx88-cards.c | 57 ++++++++++++----------------------- 1 file changed, 19 insertions(+), 38 deletions(-) (limited to 'drivers/media/video/cx88') diff --git a/drivers/media/video/cx88/cx88-cards.c b/drivers/media/video/cx88/cx88-cards.c index 1fe6b9da981..fc870882ffe 100644 --- a/drivers/media/video/cx88/cx88-cards.c +++ b/drivers/media/video/cx88/cx88-cards.c @@ -2062,34 +2062,22 @@ static int cx88_xc3028_geniatech_tuner_callback(void *priv, int command, int mod case XC2028_TUNER_RESET: switch (INPUT(core->input).type) { case CX88_RADIO: - cx_write(MO_GP1_IO, 0x101010); - mdelay(50); - cx_write(MO_GP1_IO, 0x101000); - mdelay(50); - cx_write(MO_GP1_IO, 0x101010); - mdelay(50); - return 0; + break; case CX88_VMUX_DVB: cx_write(MO_GP1_IO, 0x030302); mdelay(50); - cx_write(MO_GP1_IO, 0x101010); - mdelay(50); - cx_write(MO_GP1_IO, 0x101000); - mdelay(50); - cx_write(MO_GP1_IO, 0x101010); - mdelay(50); - return 0; + break; default: cx_write(MO_GP1_IO, 0x030301); mdelay(50); - cx_write(MO_GP1_IO, 0x101010); - mdelay(50); - cx_write(MO_GP1_IO, 0x101000); - mdelay(50); - cx_write(MO_GP1_IO, 0x101010); - mdelay(50); - return 0; - } + } + cx_write(MO_GP1_IO, 0x101010); + mdelay(50); + cx_write(MO_GP1_IO, 0x101000); + mdelay(50); + cx_write(MO_GP1_IO, 0x101010); + mdelay(50); + return 0; } return -EINVAL; } @@ -2145,7 +2133,6 @@ static int cx88_xc2028_tuner_callback(void *priv, int command, int arg) switch (command) { case XC2028_TUNER_RESET: - { switch (INPUT(core->input).type) { case CX88_RADIO: printk(KERN_INFO "setting GPIO to radio!\n"); @@ -2153,25 +2140,19 @@ static int cx88_xc2028_tuner_callback(void *priv, int command, int arg) mdelay(250); cx_write(MO_GP2_IO, 0xff); mdelay(250); - cx_write(MO_GP1_IO, 0x101010); - mdelay(250); - cx_write(MO_GP1_IO, 0x101000); - mdelay(250); - cx_write(MO_GP1_IO, 0x101010); - mdelay(250); - return 0; + break; case CX88_VMUX_DVB: /* Digital TV*/ default: /* Analog TV */ printk(KERN_INFO "setting GPIO to TV!\n"); - cx_write(MO_GP1_IO, 0x101010); - mdelay(250); - cx_write(MO_GP1_IO, 0x101000); - mdelay(250); - cx_write(MO_GP1_IO, 0x101010); - mdelay(250); - return 0; + break; } - } + cx_write(MO_GP1_IO, 0x101010); + mdelay(250); + cx_write(MO_GP1_IO, 0x101000); + mdelay(250); + cx_write(MO_GP1_IO, 0x101010); + mdelay(250); + return 0; } return -EINVAL; } -- cgit From 0f19e65bc5dcd30f1c5d72f56f6a9a2dc01698f3 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Tue, 22 Apr 2008 14:45:29 -0300 Subject: V4L/DVB (7264): cx88-cards: always use a level on printk messages Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/cx88/cx88-cards.c | 71 ++++++++++++++++++++--------------- 1 file changed, 41 insertions(+), 30 deletions(-) (limited to 'drivers/media/video/cx88') diff --git a/drivers/media/video/cx88/cx88-cards.c b/drivers/media/video/cx88/cx88-cards.c index fc870882ffe..2429cfe3155 100644 --- a/drivers/media/video/cx88/cx88-cards.c +++ b/drivers/media/video/cx88/cx88-cards.c @@ -45,6 +45,16 @@ static unsigned int latency = UNSET; module_param(latency,int,0444); MODULE_PARM_DESC(latency,"pci latency timer"); +#define info_printk(core, fmt, arg...) \ + printk(KERN_INFO "%s: " fmt, core->name , ## arg) + +#define warn_printk(core, fmt, arg...) \ + printk(KERN_WARNING "%s: " fmt, core->name , ## arg) + +#define err_printk(core, fmt, arg...) \ + printk(KERN_ERR "%s: " fmt, core->name , ## arg) + + /* ------------------------------------------------------------------ */ /* board config info */ @@ -1915,17 +1925,16 @@ static void leadtek_eeprom(struct cx88_core *core, u8 *eeprom_data) if (eeprom_data[4] != 0x7d || eeprom_data[5] != 0x10 || eeprom_data[7] != 0x66) { - printk(KERN_WARNING "%s: Leadtek eeprom invalid.\n", - core->name); + warn_printk(core, "Leadtek eeprom invalid.\n"); return; } core->board.tuner_type = (eeprom_data[6] == 0x13) ? TUNER_PHILIPS_FM1236_MK3 : TUNER_PHILIPS_FM1216ME_MK3; - printk(KERN_INFO "%s: Leadtek Winfast 2000XP Expert config: " - "tuner=%d, eeprom[0]=0x%02x\n", - core->name, core->board.tuner_type, eeprom_data[0]); + info_printk(core, "Leadtek Winfast 2000XP Expert config: " + "tuner=%d, eeprom[0]=0x%02x\n", + core->board.tuner_type, eeprom_data[0]); } static void hauppauge_eeprom(struct cx88_core *core, u8 *eeprom_data) @@ -1969,13 +1978,12 @@ static void hauppauge_eeprom(struct cx88_core *core, u8 *eeprom_data) /* known */ break; default: - printk("%s: warning: unknown hauppauge model #%d\n", - core->name, tv.model); + warn_printk(core, "warning: unknown hauppauge model #%d\n", + tv.model); break; } - printk(KERN_INFO "%s: hauppauge eeprom: model=%d\n", - core->name, tv.model); + info_printk(core, "hauppauge eeprom: model=%d\n", tv.model); } /* ----------------------------------------------------------------------- */ @@ -2021,8 +2029,7 @@ static void gdi_eeprom(struct cx88_core *core, u8 *eeprom_data) char *name = (eeprom_data[0x0d] < ARRAY_SIZE(gdi_tuner)) ? gdi_tuner[eeprom_data[0x0d]].name : NULL; - printk(KERN_INFO "%s: GDI: tuner=%s\n", core->name, - name ? name : "unknown"); + info_printk(core, "GDI: tuner=%s\n", name ? name : "unknown"); if (NULL == name) return; core->board.tuner_type = gdi_tuner[eeprom_data[0x0d]].id; @@ -2110,7 +2117,8 @@ static void dvico_fusionhdtv_hybrid_init(struct cx88_core *core) msg.len = (i != 12 ? 5 : 2); err = i2c_transfer(&core->i2c_adap, &msg, 1); if (err != 1) { - printk("dvico_fusionhdtv_hybrid_init buf %d failed (err = %d)!\n", i, err); + warn_printk(core, "dvico_fusionhdtv_hybrid_init buf %d " + "failed (err = %d)!\n", i, err); return; } } @@ -2135,7 +2143,7 @@ static int cx88_xc2028_tuner_callback(void *priv, int command, int arg) case XC2028_TUNER_RESET: switch (INPUT(core->input).type) { case CX88_RADIO: - printk(KERN_INFO "setting GPIO to radio!\n"); + info_printk(core, "setting GPIO to radio!\n"); cx_write(MO_GP0_IO, 0x4ff); mdelay(250); cx_write(MO_GP2_IO, 0xff); @@ -2143,7 +2151,7 @@ static int cx88_xc2028_tuner_callback(void *priv, int command, int arg) break; case CX88_VMUX_DVB: /* Digital TV*/ default: /* Analog TV */ - printk(KERN_INFO "setting GPIO to TV!\n"); + info_printk(core, "setting GPIO to TV!\n"); break; } cx_write(MO_GP1_IO, 0x101010); @@ -2176,8 +2184,8 @@ static int cx88_xc5000_tuner_callback(void *priv, int command, int arg) cx_write(MO_SRST_IO, 1); return 0; } else { - printk(KERN_ERR - "xc5000: unknown tuner callback command.\n"); + err_printk(core, "xc5000: unknown tuner " + "callback command.\n"); return -EINVAL; } break; @@ -2192,10 +2200,14 @@ int cx88_tuner_callback(void *priv, int command, int arg) switch (core->board.tuner_type) { case TUNER_XC2028: + info_printk(core, "Calling XC2028/3028 callback\n"); return cx88_xc2028_tuner_callback(priv, command, arg); case TUNER_XC5000: + info_printk(core, "Calling XC5000 callback\n"); return cx88_xc5000_tuner_callback(priv, command, arg); } + err_printk(core, "Error: Calling callback for tuner %d\n", + core->board.tuner_type); return -EINVAL; } EXPORT_SYMBOL(cx88_tuner_callback); @@ -2208,23 +2220,25 @@ static void cx88_card_list(struct cx88_core *core, struct pci_dev *pci) if (0 == pci->subsystem_vendor && 0 == pci->subsystem_device) { - printk("%s: Your board has no valid PCI Subsystem ID and thus can't\n" + printk(KERN_ERR + "%s: Your board has no valid PCI Subsystem ID and thus can't\n" "%s: be autodetected. Please pass card= insmod option to\n" "%s: workaround that. Redirect complaints to the vendor of\n" "%s: the TV card. Best regards,\n" "%s: -- tux\n", core->name,core->name,core->name,core->name,core->name); } else { - printk("%s: Your board isn't known (yet) to the driver. You can\n" + printk(KERN_ERR + "%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= insmod option. Updating to the latest\n" "%s: version might help as well.\n", core->name,core->name,core->name,core->name); } - printk("%s: Here is a list of valid choices for the card= insmod option:\n", - core->name); + err_printk(core, "Here is a list of valid choices for the card= " + "insmod option:\n"); for (i = 0; i < ARRAY_SIZE(cx88_boards); i++) - printk("%s: card=%d -> %s\n", + printk(KERN_ERR "%s: card=%d -> %s\n", core->name, i, cx88_boards[i].name); } @@ -2335,10 +2349,8 @@ static void cx88_card_setup(struct cx88_core *core) for (i = 0; i < ARRAY_SIZE(buffer); i++) if (2 != i2c_master_send(&core->i2c_client, buffer[i],2)) - printk(KERN_WARNING - "%s: Unable to enable " - "tuner(%i).\n", - core->name, i); + warn_printk(core, "Unable to enable " + "tuner(%i).\n", i); } break; case CX88_BOARD_MSI_TVANYWHERE_MASTER: @@ -2504,9 +2516,8 @@ struct cx88_core *cx88_core_create(struct pci_dev *pci, int nr) memcpy(&core->board, &cx88_boards[core->boardnr], sizeof(core->board)); - printk(KERN_INFO "%s: subsystem: %04x:%04x, board: %s [card=%d,%s]\n", - core->name,pci->subsystem_vendor, - pci->subsystem_device, core->board.name, + info_printk(core, "subsystem: %04x:%04x, board: %s [card=%d,%s]\n", + pci->subsystem_vendor, pci->subsystem_device, core->board.name, core->boardnr, card[core->nr] == core->boardnr ? "insmod option" : "autodetected"); @@ -2515,8 +2526,8 @@ struct cx88_core *cx88_core_create(struct pci_dev *pci, int nr) if (radio[core->nr] != UNSET) core->board.radio_type = radio[core->nr]; - printk(KERN_INFO "%s: TV tuner type %d, Radio tuner type %d\n", - core->name, core->board.tuner_type, core->board.radio_type); + info_printk(core, "TV tuner type %d, Radio tuner type %d\n", + core->board.tuner_type, core->board.radio_type); /* init hardware */ cx88_reset(core); -- cgit From 64016330b60e44db1383122a11611073fe98f261 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Tue, 22 Apr 2008 14:45:30 -0300 Subject: V4L/DVB (7265): cx88: prints an info when xc2028 is set or is attached Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/cx88/cx88-cards.c | 3 ++- drivers/media/video/cx88/cx88-dvb.c | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'drivers/media/video/cx88') diff --git a/drivers/media/video/cx88/cx88-cards.c b/drivers/media/video/cx88/cx88-cards.c index 2429cfe3155..350c402920e 100644 --- a/drivers/media/video/cx88/cx88-cards.c +++ b/drivers/media/video/cx88/cx88-cards.c @@ -2397,9 +2397,10 @@ static void cx88_card_setup(struct cx88_core *core) xc2028_cfg.tuner = TUNER_XC2028; xc2028_cfg.priv = &ctl; + info_printk(core, "Asking xc2028/3028 to load firmware %s\n", + ctl.fname); cx88_call_i2c_clients(core, TUNER_SET_CONFIG, &xc2028_cfg); } - } /* ------------------------------------------------------------------ */ diff --git a/drivers/media/video/cx88/cx88-dvb.c b/drivers/media/video/cx88/cx88-dvb.c index ae2a0f5f080..ef83dab7241 100644 --- a/drivers/media/video/cx88/cx88-dvb.c +++ b/drivers/media/video/cx88/cx88-dvb.c @@ -808,6 +808,8 @@ static int dvb_register(struct cx8802_dev *dev) dev->dvb.frontend = NULL; return -1; } + printk(KERN_INFO "%s/2: xc3028 attached\n", + dev->core->name); } /* Ensure all frontends negotiate bus access */ -- cgit From 23fb348d00da9c1558b4a9b234b9ac941091b0f1 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Tue, 22 Apr 2008 14:45:30 -0300 Subject: V4L/DVB (7266): cx88-dvb: convert attach_xc3028 into a function Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/cx88/cx88-dvb.c | 58 ++++++++++++++++++++----------------- 1 file changed, 31 insertions(+), 27 deletions(-) (limited to 'drivers/media/video/cx88') diff --git a/drivers/media/video/cx88/cx88-dvb.c b/drivers/media/video/cx88/cx88-dvb.c index ef83dab7241..59180cab0a8 100644 --- a/drivers/media/video/cx88/cx88-dvb.c +++ b/drivers/media/video/cx88/cx88-dvb.c @@ -452,11 +452,33 @@ static struct zl10353_config cx88_geniatech_x8000_mt = { .no_tuner = 1, }; +static int attach_xc3028(u8 addr, struct cx8802_dev *dev) +{ + struct dvb_frontend *fe; + struct xc2028_config cfg = { + .i2c_adap = &dev->core->i2c_adap, + .i2c_addr = addr, + .video_dev = dev->core, + }; + + fe = dvb_attach(xc2028_attach, dev->dvb.frontend, &cfg); + if (!fe) { + printk(KERN_ERR "%s/2: xc3028 attach failed\n", + dev->core->name); + dvb_frontend_detach(dev->dvb.frontend); + dvb_unregister_frontend(dev->dvb.frontend); + dev->dvb.frontend = NULL; + return -EINVAL; + } + + printk(KERN_INFO "%s/2: xc3028 attached\n", + dev->core->name); + + return 0; +} static int dvb_register(struct cx8802_dev *dev) { - int attach_xc3028 = 0; - /* init struct videobuf_dvb */ dev->dvb.name = dev->core->name; dev->ts_gen_cntrl = 0x0c; @@ -595,8 +617,8 @@ static int dvb_register(struct cx8802_dev *dev) */ if (dev->dvb.frontend) dev->dvb.frontend->ops.i2c_gate_ctrl = NULL; - - attach_xc3028 = 1; + if (attach_xc3028(0x61, dev) < 0) + return -EINVAL; break; case CX88_BOARD_PCHDTV_HD3000: dev->dvb.frontend = dvb_attach(or51132_attach, &pchdtv_hd3000, @@ -770,7 +792,8 @@ static int dvb_register(struct cx8802_dev *dev) dev->dvb.frontend = dvb_attach(zl10353_attach, &cx88_geniatech_x8000_mt, &dev->core->i2c_adap); - attach_xc3028 = 1; + if (attach_xc3028(0x61, dev) < 0) + return -EINVAL; break; case CX88_BOARD_GENIATECH_X8000_MT: dev->ts_gen_cntrl = 0x00; @@ -778,7 +801,8 @@ static int dvb_register(struct cx8802_dev *dev) dev->dvb.frontend = dvb_attach(zl10353_attach, &cx88_geniatech_x8000_mt, &dev->core->i2c_adap); - attach_xc3028 = 1; + if (attach_xc3028(0x61, dev) < 0) + return -EINVAL; break; default: printk(KERN_ERR "%s/2: The frontend of your DVB/ATSC card isn't supported yet\n", @@ -789,27 +813,7 @@ static int dvb_register(struct cx8802_dev *dev) printk(KERN_ERR "%s/2: frontend initialization failed\n", dev->core->name); - return -1; - } - - if (attach_xc3028) { - struct dvb_frontend *fe; - struct xc2028_config cfg = { - .i2c_adap = &dev->core->i2c_adap, - .i2c_addr = 0x61, - .video_dev = dev->core, - }; - fe = dvb_attach(xc2028_attach, dev->dvb.frontend, &cfg); - if (!fe) { - printk(KERN_ERR "%s/2: xc3028 attach failed\n", - dev->core->name); - dvb_frontend_detach(dev->dvb.frontend); - dvb_unregister_frontend(dev->dvb.frontend); - dev->dvb.frontend = NULL; - return -1; - } - printk(KERN_INFO "%s/2: xc3028 attached\n", - dev->core->name); + return -EINVAL; } /* Ensure all frontends negotiate bus access */ -- cgit From 8cd7bf333671196e191bda62907b3b26e21da395 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Tue, 22 Apr 2008 14:45:30 -0300 Subject: V4L/DVB (7269): cx88: Powercolor Angel works only with firmware version 2.5 Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/cx88/cx88-cards.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'drivers/media/video/cx88') diff --git a/drivers/media/video/cx88/cx88-cards.c b/drivers/media/video/cx88/cx88-cards.c index 350c402920e..dbfaabb3e2e 100644 --- a/drivers/media/video/cx88/cx88-cards.c +++ b/drivers/media/video/cx88/cx88-cards.c @@ -2383,6 +2383,10 @@ static void cx88_card_setup(struct cx88_core *core) ctl.max_len = 64; switch (core->boardnr) { + case CX88_BOARD_POWERCOLOR_REAL_ANGEL: + /* Doesn't work with firmware version 2.7 */ + ctl.fname = "xc3028-v25.fw"; + break; case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PRO: ctl.scode_table = XC3028_FE_ZARLINK456; break; -- cgit From c4a3ce1cd0c0ac394d1d56d8e0980b6836661341 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Tue, 22 Apr 2008 14:45:31 -0300 Subject: V4L/DVB (7270): cx88-dvb: Renames pci_nano callback This callback is specific to pci_nano, since supports only dvb. Renames it to avoid future mistakes. Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/cx88/cx88-dvb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/media/video/cx88') diff --git a/drivers/media/video/cx88/cx88-dvb.c b/drivers/media/video/cx88/cx88-dvb.c index 59180cab0a8..cf6b9b05f49 100644 --- a/drivers/media/video/cx88/cx88-dvb.c +++ b/drivers/media/video/cx88/cx88-dvb.c @@ -372,7 +372,7 @@ static int geniatech_dvbs_set_voltage(struct dvb_frontend *fe, return 0; } -static int cx88_xc3028_callback(void *ptr, int command, int arg) +static int cx88_pci_nano_callback(void *ptr, int command, int arg) { struct cx88_core *core = ptr; @@ -774,7 +774,7 @@ static int dvb_register(struct cx8802_dev *dev) .i2c_adap = &dev->core->i2c_adap, .i2c_addr = 0x61, .video_dev = dev->core, - .callback = cx88_xc3028_callback, + .callback = cx88_pci_nano_callback, }; static struct xc2028_ctrl ctl = { .fname = "xc3028-v27.fw", -- cgit From b573ea0a936eb2a7c6c57cdacb0d02bd358495a7 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Tue, 22 Apr 2008 14:45:31 -0300 Subject: V4L/DVB (7271): cx88-cards: Fix powerangel gpio1 With this gpio, audio works properly. Thanks to Daniel Fraga for helping on fixing the code for Powerangel Real board. Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/cx88/cx88-cards.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/media/video/cx88') diff --git a/drivers/media/video/cx88/cx88-cards.c b/drivers/media/video/cx88/cx88-cards.c index dbfaabb3e2e..bf58f350e26 100644 --- a/drivers/media/video/cx88/cx88-cards.c +++ b/drivers/media/video/cx88/cx88-cards.c @@ -1494,7 +1494,7 @@ static const struct cx88_board cx88_boards[] = { .type = CX88_VMUX_TELEVISION, .vmux = 0, .gpio0 = 0x0400, /* pin 2:mute = 0 (off?) */ - .gpio1 = 0x0000, + .gpio1 = 0xf35d, .gpio2 = 0x0800, /* pin 19:audio = 0 (tv) */ }, { .type = CX88_VMUX_COMPOSITE1, -- cgit From 1117d6ba1313b8821b10403de114c38764008c45 Mon Sep 17 00:00:00 2001 From: Steven Toth Date: Tue, 22 Apr 2008 14:45:34 -0300 Subject: V4L/DVB (7287): cx88: add analog support for DVICO FusionHDTV7 Gold Signed-off-by: Steven Toth Signed-off-by: Michael Krufky Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/cx88/cx88-cards.c | 40 +++++++++++++++++++++++++++++++++++ drivers/media/video/cx88/cx88.h | 1 + 2 files changed, 41 insertions(+) (limited to 'drivers/media/video/cx88') diff --git a/drivers/media/video/cx88/cx88-cards.c b/drivers/media/video/cx88/cx88-cards.c index bf58f350e26..8e29e48a86f 100644 --- a/drivers/media/video/cx88/cx88-cards.c +++ b/drivers/media/video/cx88/cx88-cards.c @@ -1571,6 +1571,26 @@ static const struct cx88_board cx88_boards[] = { } }, .mpeg = CX88_MPEG_DVB, }, + [CX88_BOARD_DVICO_FUSIONHDTV_7_GOLD] = { + .name = "DVICO FusionHDTV7 Gold", + .tuner_type = TUNER_XC5000, + .radio_type = UNSET, + .tuner_addr = ADDR_UNSET, + .radio_addr = ADDR_UNSET, + .input = {{ + .type = CX88_VMUX_TELEVISION, + .vmux = 0, + .gpio0 = 0x37df, + },{ + .type = CX88_VMUX_COMPOSITE1, + .vmux = 1, + .gpio0 = 0x37df, + },{ + .type = CX88_VMUX_SVIDEO, + .vmux = 2, + .gpio0 = 0x37df, + }}, + }, }; /* ------------------------------------------------------------------ */ @@ -1908,6 +1928,10 @@ static const struct cx88_subid cx88_subids[] = { .subvendor = 0x14f1, .subdevice = 0x8852, .card = CX88_BOARD_GENIATECH_X8000_MT, + },{ + .subvendor = 0x18ac, + .subdevice = 0xd610, + .card = CX88_BOARD_DVICO_FUSIONHDTV_7_GOLD, } }; @@ -2189,6 +2213,18 @@ static int cx88_xc5000_tuner_callback(void *priv, int command, int arg) return -EINVAL; } break; + case CX88_BOARD_DVICO_FUSIONHDTV_7_GOLD: + if (command == 0) { /* This is the reset command from xc5000 */ + cx_clear(MO_GP0_IO, 0x00000010); + msleep(10); + cx_set(MO_GP0_IO, 0x00000010); + return 0; + } else { + printk(KERN_ERR + "xc5000: unknown tuner callback command.\n"); + return -EINVAL; + } + break; } return 0; /* Should never be here */ } @@ -2255,6 +2291,10 @@ static void cx88_card_setup_pre_i2c(struct cx88_core *core) cx_set(MO_GP0_IO, 0x00000080); /* 702 out of reset */ udelay(1000); break; + case CX88_BOARD_DVICO_FUSIONHDTV_7_GOLD: + /* Enable the xc5000 tuner */ + cx_set(MO_GP0_IO, 0x00001010); + break; } } diff --git a/drivers/media/video/cx88/cx88.h b/drivers/media/video/cx88/cx88.h index 9df3f198a4d..85a95a0a94d 100644 --- a/drivers/media/video/cx88/cx88.h +++ b/drivers/media/video/cx88/cx88.h @@ -217,6 +217,7 @@ extern struct sram_channel cx88_sram_channels[]; #define CX88_BOARD_POWERCOLOR_REAL_ANGEL 62 #define CX88_BOARD_GENIATECH_X8000_MT 63 #define CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PRO 64 +#define CX88_BOARD_DVICO_FUSIONHDTV_7_GOLD 65 enum cx88_itype { CX88_VMUX_COMPOSITE1 = 1, -- cgit From 76464d412a5a51633881078d4109212e4463e8d4 Mon Sep 17 00:00:00 2001 From: Michael Krufky Date: Tue, 22 Apr 2008 14:45:35 -0300 Subject: V4L/DVB (7288): cx88: fix GPIO for FusionHDTV 7 Gold input selection Fix GPIO for FusionHDTV 7 Gold tv / s-video / composite input selection. Fix card textual name to match other FusionHDTV device names. Signed-off-by: Michael Krufky Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/cx88/cx88-cards.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'drivers/media/video/cx88') diff --git a/drivers/media/video/cx88/cx88-cards.c b/drivers/media/video/cx88/cx88-cards.c index 8e29e48a86f..7a2b0f26921 100644 --- a/drivers/media/video/cx88/cx88-cards.c +++ b/drivers/media/video/cx88/cx88-cards.c @@ -1572,7 +1572,7 @@ static const struct cx88_board cx88_boards[] = { .mpeg = CX88_MPEG_DVB, }, [CX88_BOARD_DVICO_FUSIONHDTV_7_GOLD] = { - .name = "DVICO FusionHDTV7 Gold", + .name = "DViCO FusionHDTV 7 Gold", .tuner_type = TUNER_XC5000, .radio_type = UNSET, .tuner_addr = ADDR_UNSET, @@ -1580,15 +1580,15 @@ static const struct cx88_board cx88_boards[] = { .input = {{ .type = CX88_VMUX_TELEVISION, .vmux = 0, - .gpio0 = 0x37df, + .gpio0 = 0x10df, },{ .type = CX88_VMUX_COMPOSITE1, .vmux = 1, - .gpio0 = 0x37df, + .gpio0 = 0x16d9, },{ .type = CX88_VMUX_SVIDEO, .vmux = 2, - .gpio0 = 0x37df, + .gpio0 = 0x16d9, }}, }, }; -- cgit From 3c66e4e18b250f4524f24fd5b4ccdcd12bef9cc2 Mon Sep 17 00:00:00 2001 From: Michael Krufky Date: Tue, 22 Apr 2008 14:45:35 -0300 Subject: V4L/DVB (7289): cx88: enable IR receiver and real time clock on FusionHDTV7 Gold Signed-off-by: Michael Krufky Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/cx88/cx88-video.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/media/video/cx88') diff --git a/drivers/media/video/cx88/cx88-video.c b/drivers/media/video/cx88/cx88-video.c index 191577d166a..327c0a87c08 100644 --- a/drivers/media/video/cx88/cx88-video.c +++ b/drivers/media/video/cx88/cx88-video.c @@ -1832,6 +1832,7 @@ static int __devinit cx8800_initdev(struct pci_dev *pci_dev, switch (core->boardnr) { case CX88_BOARD_DVICO_FUSIONHDTV_5_GOLD: + case CX88_BOARD_DVICO_FUSIONHDTV_7_GOLD: request_module("rtc-isl1208"); /* break intentionally omitted */ case CX88_BOARD_DVICO_FUSIONHDTV_5_PCI_NANO: -- cgit From ddd5441df4127d5af45f6b2c58c2020b60bd52de Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Tue, 22 Apr 2008 14:45:46 -0300 Subject: V4L/DVB (7325): cx88-dvb: fix an OOPS for xc3028 devices, when dvb_attach fails If dvb_attach fails, dev->dvb.frontend is NULL. This will produce an OOPS, as reported. Thanks to Vanessa Ezekowitz Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/cx88/cx88-dvb.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'drivers/media/video/cx88') diff --git a/drivers/media/video/cx88/cx88-dvb.c b/drivers/media/video/cx88/cx88-dvb.c index cf6b9b05f49..d72b817bf88 100644 --- a/drivers/media/video/cx88/cx88-dvb.c +++ b/drivers/media/video/cx88/cx88-dvb.c @@ -461,6 +461,13 @@ static int attach_xc3028(u8 addr, struct cx8802_dev *dev) .video_dev = dev->core, }; + if (!dev->dvb.frontend) { + printk(KERN_ERR "%s/2: dvb frontend not attached. " + "Can't attach xc3028\n", + dev->core->name); + return -EINVAL; + } + fe = dvb_attach(xc2028_attach, dev->dvb.frontend, &cfg); if (!fe) { printk(KERN_ERR "%s/2: xc3028 attach failed\n", -- cgit From 000e27a639f16e2df70a3b0bec7edfab79e5e717 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Tue, 22 Apr 2008 14:45:46 -0300 Subject: V4L/DVB (7326): Fix bad whitespaces Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/cx88/cx88-cards.c | 264 +++++++++++++++++----------------- 1 file changed, 132 insertions(+), 132 deletions(-) (limited to 'drivers/media/video/cx88') diff --git a/drivers/media/video/cx88/cx88-cards.c b/drivers/media/video/cx88/cx88-cards.c index 7a2b0f26921..3e7ddee9aba 100644 --- a/drivers/media/video/cx88/cx88-cards.c +++ b/drivers/media/video/cx88/cx88-cards.c @@ -1437,140 +1437,140 @@ static const struct cx88_board cx88_boards[] = { .mpeg = CX88_MPEG_DVB, }, [CX88_BOARD_PINNACLE_HYBRID_PCTV] = { - .name = "Pinnacle Hybrid PCTV", - .tuner_type = TUNER_XC2028, - .tuner_addr = 0x61, - .input = { { - .type = CX88_VMUX_TELEVISION, - .vmux = 0, - }, { - .type = CX88_VMUX_COMPOSITE1, - .vmux = 1, - }, { - .type = CX88_VMUX_SVIDEO, - .vmux = 2, - } }, - .radio = { - .type = CX88_RADIO, - .gpio0 = 0x004ff, - .gpio1 = 0x010ff, - .gpio2 = 0x0ff, - }, - }, - [CX88_BOARD_WINFAST_TV2000_XP_GLOBAL] = { - .name = "Winfast TV2000 XP Global", - .tuner_type = TUNER_XC2028, - .tuner_addr = 0x61, - .input = { { - .type = CX88_VMUX_TELEVISION, - .vmux = 0, - .gpio0 = 0x0400, /* pin 2:mute = 0 (off?) */ - .gpio1 = 0x0000, - .gpio2 = 0x0800, /* pin 19:audio = 0 (tv) */ - - }, { - .type = CX88_VMUX_COMPOSITE1, - .vmux = 1, - .gpio0 = 0x0400, /* probably? or 0x0404 to turn mute on */ - .gpio1 = 0x0000, - .gpio2 = 0x0808, /* pin 19:audio = 1 (line) */ - - }, { - .type = CX88_VMUX_SVIDEO, - .vmux = 2, - } }, - .radio = { - .type = CX88_RADIO, - .gpio0 = 0x004ff, - .gpio1 = 0x010ff, - .gpio2 = 0x0ff, - }, - }, - [CX88_BOARD_POWERCOLOR_REAL_ANGEL] = { - .name = "PowerColor Real Angel 330", - .tuner_type = TUNER_XC2028, - .tuner_addr = 0x61, - .input = { { - .type = CX88_VMUX_TELEVISION, - .vmux = 0, - .gpio0 = 0x0400, /* pin 2:mute = 0 (off?) */ - .gpio1 = 0xf35d, - .gpio2 = 0x0800, /* pin 19:audio = 0 (tv) */ - }, { - .type = CX88_VMUX_COMPOSITE1, - .vmux = 1, - .gpio0 = 0x0400, /* probably? or 0x0404 to turn mute on */ - .gpio1 = 0x0000, - .gpio2 = 0x0808, /* pin 19:audio = 1 (line) */ - }, { - .type = CX88_VMUX_SVIDEO, - .vmux = 2, - .gpio0 = 0x000ff, - .gpio1 = 0x0f37d, - .gpio2 = 0x00019, - .gpio3 = 0x00000, - } }, - .radio = { - .type = CX88_RADIO, - .gpio0 = 0x000ff, - .gpio1 = 0x0f35d, - .gpio2 = 0x00019, - .gpio3 = 0x00000, - }, - }, - [CX88_BOARD_GENIATECH_X8000_MT] = { + .name = "Pinnacle Hybrid PCTV", + .tuner_type = TUNER_XC2028, + .tuner_addr = 0x61, + .input = { { + .type = CX88_VMUX_TELEVISION, + .vmux = 0, + }, { + .type = CX88_VMUX_COMPOSITE1, + .vmux = 1, + }, { + .type = CX88_VMUX_SVIDEO, + .vmux = 2, + } }, + .radio = { + .type = CX88_RADIO, + .gpio0 = 0x004ff, + .gpio1 = 0x010ff, + .gpio2 = 0x0ff, + }, + }, + [CX88_BOARD_WINFAST_TV2000_XP_GLOBAL] = { + .name = "Winfast TV2000 XP Global", + .tuner_type = TUNER_XC2028, + .tuner_addr = 0x61, + .input = { { + .type = CX88_VMUX_TELEVISION, + .vmux = 0, + .gpio0 = 0x0400, /* pin 2:mute = 0 (off?) */ + .gpio1 = 0x0000, + .gpio2 = 0x0800, /* pin 19:audio = 0 (tv) */ + + }, { + .type = CX88_VMUX_COMPOSITE1, + .vmux = 1, + .gpio0 = 0x0400, /* probably? or 0x0404 to turn mute on */ + .gpio1 = 0x0000, + .gpio2 = 0x0808, /* pin 19:audio = 1 (line) */ + + }, { + .type = CX88_VMUX_SVIDEO, + .vmux = 2, + } }, + .radio = { + .type = CX88_RADIO, + .gpio0 = 0x004ff, + .gpio1 = 0x010ff, + .gpio2 = 0x0ff, + }, + }, + [CX88_BOARD_POWERCOLOR_REAL_ANGEL] = { + .name = "PowerColor Real Angel 330", + .tuner_type = TUNER_XC2028, + .tuner_addr = 0x61, + .input = { { + .type = CX88_VMUX_TELEVISION, + .vmux = 0, + .gpio0 = 0x0400, /* pin 2:mute = 0 (off?) */ + .gpio1 = 0xf35d, + .gpio2 = 0x0800, /* pin 19:audio = 0 (tv) */ + }, { + .type = CX88_VMUX_COMPOSITE1, + .vmux = 1, + .gpio0 = 0x0400, /* probably? or 0x0404 to turn mute on */ + .gpio1 = 0x0000, + .gpio2 = 0x0808, /* pin 19:audio = 1 (line) */ + }, { + .type = CX88_VMUX_SVIDEO, + .vmux = 2, + .gpio0 = 0x000ff, + .gpio1 = 0x0f37d, + .gpio2 = 0x00019, + .gpio3 = 0x00000, + } }, + .radio = { + .type = CX88_RADIO, + .gpio0 = 0x000ff, + .gpio1 = 0x0f35d, + .gpio2 = 0x00019, + .gpio3 = 0x00000, + }, + }, + [CX88_BOARD_GENIATECH_X8000_MT] = { /* Also PowerColor Real Angel 330 and Geniatech X800 OEM */ - .name = "Geniatech X8000-MT DVBT", - .tuner_type = TUNER_XC2028, - .tuner_addr = 0x61, - .input = { { - .type = CX88_VMUX_TELEVISION, - .vmux = 0, - .gpio0 = 0x00000000, - .gpio1 = 0x00e3e341, - .gpio2 = 0x00000000, - .gpio3 = 0x00000000, - }, { - .type = CX88_VMUX_COMPOSITE1, - .vmux = 1, - .gpio0 = 0x00000000, - .gpio1 = 0x00e3e361, - .gpio2 = 0x00000000, - .gpio3 = 0x00000000, - }, { - .type = CX88_VMUX_SVIDEO, - .vmux = 2, - .gpio0 = 0x00000000, - .gpio1 = 0x00e3e361, - .gpio2 = 0x00000000, - .gpio3 = 0x00000000, - } }, - .radio = { - .type = CX88_RADIO, - .gpio0 = 0x00000000, - .gpio1 = 0x00e3e341, - .gpio2 = 0x00000000, - .gpio3 = 0x00000000, - }, - .mpeg = CX88_MPEG_DVB, - }, - [CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PRO] = { - .name = "DViCO FusionHDTV DVB-T PRO", - .tuner_type = TUNER_ABSENT, /* XXX: Has XC3028 */ - .radio_type = UNSET, - .tuner_addr = ADDR_UNSET, - .radio_addr = ADDR_UNSET, - .input = { { - .type = CX88_VMUX_COMPOSITE1, - .vmux = 1, - .gpio0 = 0x000067df, + .name = "Geniatech X8000-MT DVBT", + .tuner_type = TUNER_XC2028, + .tuner_addr = 0x61, + .input = { { + .type = CX88_VMUX_TELEVISION, + .vmux = 0, + .gpio0 = 0x00000000, + .gpio1 = 0x00e3e341, + .gpio2 = 0x00000000, + .gpio3 = 0x00000000, + }, { + .type = CX88_VMUX_COMPOSITE1, + .vmux = 1, + .gpio0 = 0x00000000, + .gpio1 = 0x00e3e361, + .gpio2 = 0x00000000, + .gpio3 = 0x00000000, }, { - .type = CX88_VMUX_SVIDEO, - .vmux = 2, - .gpio0 = 0x000067df, - } }, - .mpeg = CX88_MPEG_DVB, - }, + .type = CX88_VMUX_SVIDEO, + .vmux = 2, + .gpio0 = 0x00000000, + .gpio1 = 0x00e3e361, + .gpio2 = 0x00000000, + .gpio3 = 0x00000000, + } }, + .radio = { + .type = CX88_RADIO, + .gpio0 = 0x00000000, + .gpio1 = 0x00e3e341, + .gpio2 = 0x00000000, + .gpio3 = 0x00000000, + }, + .mpeg = CX88_MPEG_DVB, + }, + [CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PRO] = { + .name = "DViCO FusionHDTV DVB-T PRO", + .tuner_type = TUNER_ABSENT, /* XXX: Has XC3028 */ + .radio_type = UNSET, + .tuner_addr = ADDR_UNSET, + .radio_addr = ADDR_UNSET, + .input = { { + .type = CX88_VMUX_COMPOSITE1, + .vmux = 1, + .gpio0 = 0x000067df, + }, { + .type = CX88_VMUX_SVIDEO, + .vmux = 2, + .gpio0 = 0x000067df, + } }, + .mpeg = CX88_MPEG_DVB, + }, [CX88_BOARD_DVICO_FUSIONHDTV_7_GOLD] = { .name = "DViCO FusionHDTV 7 Gold", .tuner_type = TUNER_XC5000, -- cgit From a9317abfba0850b006aed000e2acc4bee150410a Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Tue, 22 Apr 2008 14:45:46 -0300 Subject: V4L/DVB (7327): cx88: Fix memset for tuner-xc3028 control Fix a cut-and-paste error Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/cx88/cx88-cards.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/media/video/cx88') diff --git a/drivers/media/video/cx88/cx88-cards.c b/drivers/media/video/cx88/cx88-cards.c index 3e7ddee9aba..4c1e876a923 100644 --- a/drivers/media/video/cx88/cx88-cards.c +++ b/drivers/media/video/cx88/cx88-cards.c @@ -2416,7 +2416,7 @@ static void cx88_card_setup(struct cx88_core *core) struct v4l2_priv_tun_config xc2028_cfg; struct xc2028_ctrl ctl; - memset(&xc2028_cfg, 0, sizeof(ctl)); + memset(&xc2028_cfg, 0, sizeof(xc2028_cfg)); memset(&ctl, 0, sizeof(ctl)); ctl.fname = XC2028_DEFAULT_FIRMWARE; -- cgit From 2422a9b3f47c75d3915e6af78ebe25b7d2540262 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Tue, 22 Apr 2008 14:46:00 -0300 Subject: V4L/DVB (7370): Add basic support for Prolink Pixelview MPEG 8000GT TV reception ok. S-video and Composite not tested. Audio not tested. IR not implemented yet. Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/cx88/cx88-cards.c | 70 +++++++++++++++++++++++++++++++++-- drivers/media/video/cx88/cx88.h | 1 + 2 files changed, 67 insertions(+), 4 deletions(-) (limited to 'drivers/media/video/cx88') diff --git a/drivers/media/video/cx88/cx88-cards.c b/drivers/media/video/cx88/cx88-cards.c index 4c1e876a923..98d3475a4b3 100644 --- a/drivers/media/video/cx88/cx88-cards.c +++ b/drivers/media/video/cx88/cx88-cards.c @@ -1591,6 +1591,29 @@ static const struct cx88_board cx88_boards[] = { .gpio0 = 0x16d9, }}, }, + [CX88_BOARD_PROLINK_PV_8000GT] = { + .name = "Prolink Pixelview MPEG 8000GT", + .tuner_type = TUNER_XC2028, + .tuner_addr = 0x61, + .input = { { + .type = CX88_VMUX_TELEVISION, + .vmux = 0, + .gpio0 = 0x0ff, + .gpio2 = 0x0cfb, + }, { + .type = CX88_VMUX_COMPOSITE1, + .vmux = 1, + .gpio2 = 0x0cfb, + }, { + .type = CX88_VMUX_SVIDEO, + .vmux = 2, + .gpio2 = 0x0cfb, + } }, + .radio = { + .type = CX88_RADIO, + .gpio2 = 0x0cfb, + }, + }, }; /* ------------------------------------------------------------------ */ @@ -1928,11 +1951,15 @@ static const struct cx88_subid cx88_subids[] = { .subvendor = 0x14f1, .subdevice = 0x8852, .card = CX88_BOARD_GENIATECH_X8000_MT, - },{ + }, { .subvendor = 0x18ac, .subdevice = 0xd610, .card = CX88_BOARD_DVICO_FUSIONHDTV_7_GOLD, - } + }, { + .subvendor = 0x1554, + .subdevice = 0x4935, + .card = CX88_BOARD_PROLINK_PV_8000GT, + }, }; /* ----------------------------------------------------------------------- */ @@ -2063,9 +2090,10 @@ static void gdi_eeprom(struct cx88_core *core, u8 *eeprom_data) /* ------------------------------------------------------------------- */ /* some Divco specific stuff */ -static int cx88_dvico_xc2028_callback(void *ptr, int command, int arg) +static int cx88_dvico_xc2028_callback(void *priv, int command, int arg) { - struct cx88_core *core = ptr; + struct i2c_algo_bit_data *i2c_algo = priv; + struct cx88_core *core = i2c_algo->data; switch (command) { case XC2028_TUNER_RESET: @@ -2113,6 +2141,28 @@ static int cx88_xc3028_geniatech_tuner_callback(void *priv, int command, int mod return -EINVAL; } +/* ------------------------------------------------------------------- */ +/* some Divco specific stuff */ +static int cx88_pv_8000gt_callback(void *priv, int command, int arg) +{ + struct i2c_algo_bit_data *i2c_algo = priv; + struct cx88_core *core = i2c_algo->data; + + switch (command) { + case XC2028_TUNER_RESET: + cx_write(MO_GP2_IO, 0xcf7); + mdelay(50); + cx_write(MO_GP2_IO, 0xef5); + mdelay(50); + cx_write(MO_GP2_IO, 0xcf7); + break; + default: + return -EINVAL; + } + + return 0; +} + /* ----------------------------------------------------------------------- */ /* some DViCO specific stuff */ @@ -2159,6 +2209,8 @@ static int cx88_xc2028_tuner_callback(void *priv, int command, int arg) case CX88_BOARD_POWERCOLOR_REAL_ANGEL: case CX88_BOARD_GENIATECH_X8000_MT: return cx88_xc3028_geniatech_tuner_callback(priv, command, arg); + case CX88_BOARD_PROLINK_PV_8000GT: + return cx88_pv_8000gt_callback(priv, command, arg); case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PRO: return cx88_dvico_xc2028_callback(priv, command, arg); } @@ -2291,6 +2343,16 @@ static void cx88_card_setup_pre_i2c(struct cx88_core *core) cx_set(MO_GP0_IO, 0x00000080); /* 702 out of reset */ udelay(1000); break; + + case CX88_BOARD_PROLINK_PV_8000GT: + cx_write(MO_GP2_IO, 0xcf7); + mdelay(50); + cx_write(MO_GP2_IO, 0xef5); + mdelay(50); + cx_write(MO_GP2_IO, 0xcf7); + msleep(10); + break; + case CX88_BOARD_DVICO_FUSIONHDTV_7_GOLD: /* Enable the xc5000 tuner */ cx_set(MO_GP0_IO, 0x00001010); diff --git a/drivers/media/video/cx88/cx88.h b/drivers/media/video/cx88/cx88.h index 85a95a0a94d..c0f4912793e 100644 --- a/drivers/media/video/cx88/cx88.h +++ b/drivers/media/video/cx88/cx88.h @@ -218,6 +218,7 @@ extern struct sram_channel cx88_sram_channels[]; #define CX88_BOARD_GENIATECH_X8000_MT 63 #define CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PRO 64 #define CX88_BOARD_DVICO_FUSIONHDTV_7_GOLD 65 +#define CX88_BOARD_PROLINK_PV_8000GT 66 enum cx88_itype { CX88_VMUX_COMPOSITE1 = 1, -- cgit From ceb63a4fda646faea60e34fa4c3abf8455add013 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Tue, 22 Apr 2008 14:46:01 -0300 Subject: V4L/DVB (7371): cx88: Fix audio on Prolink Pixelview Mpeg 8000GT This board works only with non-mts firmware Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/cx88/cx88-cards.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'drivers/media/video/cx88') diff --git a/drivers/media/video/cx88/cx88-cards.c b/drivers/media/video/cx88/cx88-cards.c index 98d3475a4b3..603b3664381 100644 --- a/drivers/media/video/cx88/cx88-cards.c +++ b/drivers/media/video/cx88/cx88-cards.c @@ -2495,6 +2495,11 @@ static void cx88_card_setup(struct cx88_core *core) case CX88_BOARD_DVICO_FUSIONHDTV_5_PCI_NANO: ctl.demod = XC3028_FE_OREN538; break; + case CX88_BOARD_PROLINK_PV_8000GT: + /* + * This board uses non-MTS firmware + */ + break; default: ctl.demod = XC3028_FE_OREN538; ctl.mts = 1; -- cgit From 7f0dd17913eda77961fc8213b64cb8af4a155d3e Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Tue, 22 Apr 2008 14:46:01 -0300 Subject: V4L/DVB (7372): cx88: Add IR support for Pixelview MPEG 8000GT Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/cx88/cx88-input.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'drivers/media/video/cx88') diff --git a/drivers/media/video/cx88/cx88-input.c b/drivers/media/video/cx88/cx88-input.c index d2e42c77b5a..6b25b8c9bb6 100644 --- a/drivers/media/video/cx88/cx88-input.c +++ b/drivers/media/video/cx88/cx88-input.c @@ -258,6 +258,13 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci) ir->mask_keyup = 0x80; ir->polling = 1; /* ms */ break; + case CX88_BOARD_PROLINK_PV_8000GT: + ir_codes = ir_codes_pixelview_new; + ir->gpio_addr = MO_GP1_IO; + ir->mask_keycode = 0x3f; + ir->mask_keyup = 0x80; + ir->polling = 1; /* ms */ + break; case CX88_BOARD_KWORLD_LTV883: ir_codes = ir_codes_pixelview; ir->gpio_addr = MO_GP1_IO; -- cgit From a920e42f61bdfe9974f3e2f3715d3a6d319eeaba Mon Sep 17 00:00:00 2001 From: Guennadi Liakhovetski Date: Tue, 22 Apr 2008 14:46:02 -0300 Subject: V4L/DVB (7374): Fix left-overs from the videobuf-dma-sg.c conversion to generic DMA The dev element of the struct videobuf_queue is now of type struct device implicitly. Fix left-over casts. Signed-off-by: Guennadi Liakhovetski Reviewed-by: Michael Krufky Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/cx88/cx88-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/media/video/cx88') diff --git a/drivers/media/video/cx88/cx88-core.c b/drivers/media/video/cx88/cx88-core.c index 12440b91e4b..75b581048f6 100644 --- a/drivers/media/video/cx88/cx88-core.c +++ b/drivers/media/video/cx88/cx88-core.c @@ -219,7 +219,7 @@ cx88_free_buffer(struct videobuf_queue *q, struct cx88_buffer *buf) videobuf_waiton(&buf->vb,0,0); videobuf_dma_unmap(q, dma); videobuf_dma_free(dma); - btcx_riscmem_free((struct pci_dev *)q->dev, &buf->risc); + btcx_riscmem_free(to_pci_dev(q->dev), &buf->risc); buf->vb.state = VIDEOBUF_NEEDS_INIT; } -- cgit From 50407f99a1fd7fcca74e53b1852dc70deb5114db Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Tue, 22 Apr 2008 14:46:02 -0300 Subject: V4L/DVB (7375): cx88/saa7134: fix magic number for xc3028 reusage detection tuner-xc2028 needs to know when a DVB module is sharing the same analog tuner. This is done by comparing a magic number that needs to be the same on analog and on digital. To make easier, this magic number is a pointer to some data struct. With the previous code, two different pointers were using, causing a miss-detection. Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/cx88/cx88-dvb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/media/video/cx88') diff --git a/drivers/media/video/cx88/cx88-dvb.c b/drivers/media/video/cx88/cx88-dvb.c index d72b817bf88..37ebfcc6be5 100644 --- a/drivers/media/video/cx88/cx88-dvb.c +++ b/drivers/media/video/cx88/cx88-dvb.c @@ -458,7 +458,7 @@ static int attach_xc3028(u8 addr, struct cx8802_dev *dev) struct xc2028_config cfg = { .i2c_adap = &dev->core->i2c_adap, .i2c_addr = addr, - .video_dev = dev->core, + .video_dev = dev->core->i2c_adap.algo_data, }; if (!dev->dvb.frontend) { -- cgit From 0be51b4671b3ae3ae544a0bb3d15b55478b55e72 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Tue, 22 Apr 2008 14:46:10 -0300 Subject: V4L/DVB (7398): Adds an error if priv argument of tuner_callback is NULL Adds a consistency check to avoid OOPS, if tuner_callback priv argument is NULL. Also, simplifies callback codes on cx88. Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/cx88/cx88-cards.c | 55 ++++++++++++++++++----------------- 1 file changed, 29 insertions(+), 26 deletions(-) (limited to 'drivers/media/video/cx88') diff --git a/drivers/media/video/cx88/cx88-cards.c b/drivers/media/video/cx88/cx88-cards.c index 603b3664381..6b83e3457b7 100644 --- a/drivers/media/video/cx88/cx88-cards.c +++ b/drivers/media/video/cx88/cx88-cards.c @@ -2090,11 +2090,9 @@ static void gdi_eeprom(struct cx88_core *core, u8 *eeprom_data) /* ------------------------------------------------------------------- */ /* some Divco specific stuff */ -static int cx88_dvico_xc2028_callback(void *priv, int command, int arg) +static int cx88_dvico_xc2028_callback(struct cx88_core *core, + int command, int arg) { - struct i2c_algo_bit_data *i2c_algo = priv; - struct cx88_core *core = i2c_algo->data; - switch (command) { case XC2028_TUNER_RESET: cx_write(MO_GP0_IO, 0x101000); @@ -2112,11 +2110,9 @@ static int cx88_dvico_xc2028_callback(void *priv, int command, int arg) /* ----------------------------------------------------------------------- */ /* some Geniatech specific stuff */ -static int cx88_xc3028_geniatech_tuner_callback(void *priv, int command, int mode) +static int cx88_xc3028_geniatech_tuner_callback(struct cx88_core *core, + int command, int mode) { - struct i2c_algo_bit_data *i2c_algo = priv; - struct cx88_core *core = i2c_algo->data; - switch (command) { case XC2028_TUNER_RESET: switch (INPUT(core->input).type) { @@ -2143,11 +2139,9 @@ static int cx88_xc3028_geniatech_tuner_callback(void *priv, int command, int mod /* ------------------------------------------------------------------- */ /* some Divco specific stuff */ -static int cx88_pv_8000gt_callback(void *priv, int command, int arg) +static int cx88_pv_8000gt_callback(struct cx88_core *core, + int command, int arg) { - struct i2c_algo_bit_data *i2c_algo = priv; - struct cx88_core *core = i2c_algo->data; - switch (command) { case XC2028_TUNER_RESET: cx_write(MO_GP2_IO, 0xcf7); @@ -2198,21 +2192,20 @@ static void dvico_fusionhdtv_hybrid_init(struct cx88_core *core) } } -static int cx88_xc2028_tuner_callback(void *priv, int command, int arg) +static int cx88_xc2028_tuner_callback(struct cx88_core *core, + int command, int arg) { - struct i2c_algo_bit_data *i2c_algo = priv; - struct cx88_core *core = i2c_algo->data; - /* Board-specific callbacks */ switch (core->boardnr) { case CX88_BOARD_WINFAST_TV2000_XP_GLOBAL: case CX88_BOARD_POWERCOLOR_REAL_ANGEL: case CX88_BOARD_GENIATECH_X8000_MT: - return cx88_xc3028_geniatech_tuner_callback(priv, command, arg); + return cx88_xc3028_geniatech_tuner_callback(core, + command, arg); case CX88_BOARD_PROLINK_PV_8000GT: - return cx88_pv_8000gt_callback(priv, command, arg); + return cx88_pv_8000gt_callback(core, command, arg); case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PRO: - return cx88_dvico_xc2028_callback(priv, command, arg); + return cx88_dvico_xc2028_callback(core, command, arg); } switch (command) { @@ -2246,11 +2239,9 @@ static int cx88_xc2028_tuner_callback(void *priv, int command, int arg) * PCTV HD 800i with an xc5000 sillicon tuner. This is used for both * * analog tuner attach (tuner-core.c) and dvb tuner attach (cx88-dvb.c) */ -static int cx88_xc5000_tuner_callback(void *priv, int command, int arg) +static int cx88_xc5000_tuner_callback(struct cx88_core *core, + int command, int arg) { - struct i2c_algo_bit_data *i2c_algo = priv; - struct cx88_core *core = i2c_algo->data; - switch (core->boardnr) { case CX88_BOARD_PINNACLE_PCTV_HD_800i: if (command == 0) { /* This is the reset command from xc5000 */ @@ -2284,15 +2275,27 @@ static int cx88_xc5000_tuner_callback(void *priv, int command, int arg) int cx88_tuner_callback(void *priv, int command, int arg) { struct i2c_algo_bit_data *i2c_algo = priv; - struct cx88_core *core = i2c_algo->data; + struct cx88_core *core; + + if (!i2c_algo) { + printk(KERN_ERR "cx88: Error - i2c private data undefined.\n"); + return -EINVAL; + } + + core = i2c_algo->data; + + if (!core) { + printk(KERN_ERR "cx88: Error - device struct undefined.\n"); + return -EINVAL; + } switch (core->board.tuner_type) { case TUNER_XC2028: info_printk(core, "Calling XC2028/3028 callback\n"); - return cx88_xc2028_tuner_callback(priv, command, arg); + return cx88_xc2028_tuner_callback(core, command, arg); case TUNER_XC5000: info_printk(core, "Calling XC5000 callback\n"); - return cx88_xc5000_tuner_callback(priv, command, arg); + return cx88_xc5000_tuner_callback(core, command, arg); } err_printk(core, "Error: Calling callback for tuner %d\n", core->board.tuner_type); -- cgit From b412ba781adcb484e8d9b19b30ae1d3a6b8c7d29 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Tue, 22 Apr 2008 14:46:11 -0300 Subject: V4L/DVB (7399): Removes video_dev from tuner-xc2028 config struct The video_dev parameter, on tuner-xc2028 were used to pass i2c private data to tuner_callback. Since the driver already have a pointer to i2c_adap->algo_data, uses this instead. This parameter were used also as a magic number to idenfity if two drivers are trying to register the same xc3028 tuner. This occurs with boards with DVB support, where both DVB and V4L drivers will share the same tuner. Instead of using the algo_data as a private number, after this patch, the driver will use i2c_adap->dev, with seems more consistent. Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/cx88/cx88-dvb.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'drivers/media/video/cx88') diff --git a/drivers/media/video/cx88/cx88-dvb.c b/drivers/media/video/cx88/cx88-dvb.c index 37ebfcc6be5..bbbde6d7dab 100644 --- a/drivers/media/video/cx88/cx88-dvb.c +++ b/drivers/media/video/cx88/cx88-dvb.c @@ -458,7 +458,6 @@ static int attach_xc3028(u8 addr, struct cx8802_dev *dev) struct xc2028_config cfg = { .i2c_adap = &dev->core->i2c_adap, .i2c_addr = addr, - .video_dev = dev->core->i2c_adap.algo_data, }; if (!dev->dvb.frontend) { @@ -780,7 +779,6 @@ static int dvb_register(struct cx8802_dev *dev) struct xc2028_config cfg = { .i2c_adap = &dev->core->i2c_adap, .i2c_addr = 0x61, - .video_dev = dev->core, .callback = cx88_pci_nano_callback, }; static struct xc2028_ctrl ctl = { -- cgit From 0df31f8330bdaebde5411018f0142cca06ca23a3 Mon Sep 17 00:00:00 2001 From: Michael Krufky Date: Tue, 22 Apr 2008 14:46:13 -0300 Subject: V4L/DVB (7408): use tuner-simple for Thomson DTT 761X digital tuning support Convert cx88-dvb to use tuner-simple instead of dvb-pll for Thomson DTT 761X Signed-off-by: Michael Krufky Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/cx88/cx88-dvb.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'drivers/media/video/cx88') diff --git a/drivers/media/video/cx88/cx88-dvb.c b/drivers/media/video/cx88/cx88-dvb.c index bbbde6d7dab..49ada3667d9 100644 --- a/drivers/media/video/cx88/cx88-dvb.c +++ b/drivers/media/video/cx88/cx88-dvb.c @@ -47,6 +47,7 @@ #include "isl6421.h" #include "tuner-xc2028.h" #include "tuner-xc2028-types.h" +#include "tuner-simple.h" MODULE_DESCRIPTION("driver for cx2388x based DVB cards"); MODULE_AUTHOR("Chris Pascoe "); @@ -630,9 +631,9 @@ static int dvb_register(struct cx8802_dev *dev) dev->dvb.frontend = dvb_attach(or51132_attach, &pchdtv_hd3000, &dev->core->i2c_adap); if (dev->dvb.frontend != NULL) { - dvb_attach(dvb_pll_attach, dev->dvb.frontend, 0x61, - &dev->core->i2c_adap, - DVB_PLL_THOMSON_DTT761X); + dvb_attach(simple_tuner_attach, dev->dvb.frontend, + &dev->core->i2c_adap, 0x61, + TUNER_THOMSON_DTT761X); } break; case CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_Q: @@ -672,9 +673,9 @@ static int dvb_register(struct cx8802_dev *dev) &fusionhdtv_3_gold, &dev->core->i2c_adap); if (dev->dvb.frontend != NULL) { - dvb_attach(dvb_pll_attach, dev->dvb.frontend, 0x61, - &dev->core->i2c_adap, - DVB_PLL_THOMSON_DTT761X); + dvb_attach(simple_tuner_attach, dev->dvb.frontend, + &dev->core->i2c_adap, 0x61, + TUNER_THOMSON_DTT761X); } } break; -- cgit From 7e35c9ff1362aa4deb0b0a803d661920dcdd6f48 Mon Sep 17 00:00:00 2001 From: Michael Krufky Date: Tue, 22 Apr 2008 14:46:13 -0300 Subject: V4L/DVB (7409): use tuner-simple for Microtune 4042 FI5 digital tuning support Convert cx88-dvb to use tuner-simple instead of dvb-pll for Microtune 4042 FI5 Signed-off-by: Michael Krufky Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/cx88/cx88-dvb.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers/media/video/cx88') diff --git a/drivers/media/video/cx88/cx88-dvb.c b/drivers/media/video/cx88/cx88-dvb.c index 49ada3667d9..de49de3a41f 100644 --- a/drivers/media/video/cx88/cx88-dvb.c +++ b/drivers/media/video/cx88/cx88-dvb.c @@ -653,9 +653,9 @@ static int dvb_register(struct cx8802_dev *dev) &fusionhdtv_3_gold, &dev->core->i2c_adap); if (dev->dvb.frontend != NULL) { - dvb_attach(dvb_pll_attach, dev->dvb.frontend, 0x61, - &dev->core->i2c_adap, - DVB_PLL_MICROTUNE_4042); + dvb_attach(simple_tuner_attach, dev->dvb.frontend, + &dev->core->i2c_adap, 0x61, + TUNER_MICROTUNE_4042FI5); } } break; -- cgit From 0efad8127ac4b32af780d722258b42cfae02cdf2 Mon Sep 17 00:00:00 2001 From: Michael Krufky Date: Tue, 22 Apr 2008 14:46:13 -0300 Subject: V4L/DVB (7410): use tuner-simple for Thomson FE6600 digital tuning support Convert cx88-dvb to use tuner-simple instead of dvb-pll for Thomson FE6600 Signed-off-by: Michael Krufky Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/cx88/cx88-dvb.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers/media/video/cx88') diff --git a/drivers/media/video/cx88/cx88-dvb.c b/drivers/media/video/cx88/cx88-dvb.c index de49de3a41f..9c0d20aef27 100644 --- a/drivers/media/video/cx88/cx88-dvb.c +++ b/drivers/media/video/cx88/cx88-dvb.c @@ -604,9 +604,9 @@ static int dvb_register(struct cx8802_dev *dev) &dvico_fusionhdtv_hybrid, &dev->core->i2c_adap); if (dev->dvb.frontend != NULL) { - dvb_attach(dvb_pll_attach, dev->dvb.frontend, 0x61, - &dev->core->i2c_adap, - DVB_PLL_THOMSON_FE6600); + dvb_attach(simple_tuner_attach, dev->dvb.frontend, + &dev->core->i2c_adap, 0x61, + TUNER_THOMSON_FE6600); } break; case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PRO: -- cgit From 827855d39761889aecc7c29385d9c4989b43d01d Mon Sep 17 00:00:00 2001 From: Michael Krufky Date: Tue, 22 Apr 2008 14:46:16 -0300 Subject: V4L/DVB (7412): use tuner-simple for LG TDVS-H06xF digital tuning support Convert cx88-dvb, dvb-bt8xx, b2c2-flexcop, cxusb and cx23885 to use tuner-simple instead of dvb-pll for LG TDVS-H06xF Signed-off-by: Michael Krufky Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/cx88/cx88-dvb.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'drivers/media/video/cx88') diff --git a/drivers/media/video/cx88/cx88-dvb.c b/drivers/media/video/cx88/cx88-dvb.c index 9c0d20aef27..0b19384c72f 100644 --- a/drivers/media/video/cx88/cx88-dvb.c +++ b/drivers/media/video/cx88/cx88-dvb.c @@ -48,6 +48,7 @@ #include "tuner-xc2028.h" #include "tuner-xc2028-types.h" #include "tuner-simple.h" +#include "tda9887.h" MODULE_DESCRIPTION("driver for cx2388x based DVB cards"); MODULE_AUTHOR("Chris Pascoe "); @@ -693,9 +694,11 @@ static int dvb_register(struct cx8802_dev *dev) &fusionhdtv_5_gold, &dev->core->i2c_adap); if (dev->dvb.frontend != NULL) { - dvb_attach(dvb_pll_attach, dev->dvb.frontend, 0x61, - &dev->core->i2c_adap, - DVB_PLL_LG_TDVS_H06XF); + dvb_attach(simple_tuner_attach, dev->dvb.frontend, + &dev->core->i2c_adap, 0x61, + TUNER_LG_TDVS_H06XF); + dvb_attach(tda9887_attach, dev->dvb.frontend, + &dev->core->i2c_adap, 0x43); } } break; @@ -713,9 +716,11 @@ static int dvb_register(struct cx8802_dev *dev) &pchdtv_hd5500, &dev->core->i2c_adap); if (dev->dvb.frontend != NULL) { - dvb_attach(dvb_pll_attach, dev->dvb.frontend, 0x61, - &dev->core->i2c_adap, - DVB_PLL_LG_TDVS_H06XF); + dvb_attach(simple_tuner_attach, dev->dvb.frontend, + &dev->core->i2c_adap, 0x61, + TUNER_LG_TDVS_H06XF); + dvb_attach(tda9887_attach, dev->dvb.frontend, + &dev->core->i2c_adap, 0x43); } } break; -- cgit From cb89cd332d2f160623c92473945f729d43a70af0 Mon Sep 17 00:00:00 2001 From: Michael Krufky Date: Tue, 22 Apr 2008 14:46:16 -0300 Subject: V4L/DVB (7413): use tuner-simple for Philips FMD1216ME digital tuning support Convert cxusb, cx88-dvb and saa7134-dvb to use tuner-simple instead of dvb-pll for Philips FMD1216ME Signed-off-by: Michael Krufky Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/cx88/cx88-dvb.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'drivers/media/video/cx88') diff --git a/drivers/media/video/cx88/cx88-dvb.c b/drivers/media/video/cx88/cx88-dvb.c index 0b19384c72f..676cf7ce08f 100644 --- a/drivers/media/video/cx88/cx88-dvb.c +++ b/drivers/media/video/cx88/cx88-dvb.c @@ -525,8 +525,9 @@ static int dvb_register(struct cx8802_dev *dev) &hauppauge_hvr_config, &dev->core->i2c_adap); if (dev->dvb.frontend != NULL) { - dvb_attach(dvb_pll_attach, dev->dvb.frontend, 0x61, - &dev->core->i2c_adap, DVB_PLL_FMD1216ME); + dvb_attach(simple_tuner_attach, dev->dvb.frontend, + &dev->core->i2c_adap, 0x61, + TUNER_PHILIPS_FMD1216ME_MK3); } break; case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PLUS: @@ -593,8 +594,9 @@ static int dvb_register(struct cx8802_dev *dev) dev->dvb.frontend = dvb_attach(mt352_attach, &dntv_live_dvbt_pro_config, &dev->vp3054->adap); if (dev->dvb.frontend != NULL) { - dvb_attach(dvb_pll_attach, dev->dvb.frontend, 0x61, - &dev->core->i2c_adap, DVB_PLL_FMD1216ME); + dvb_attach(simple_tuner_attach, dev->dvb.frontend, + &dev->core->i2c_adap, 0x61, + TUNER_PHILIPS_FMD1216ME_MK3); } #else printk(KERN_ERR "%s/2: built without vp3054 support\n", dev->core->name); -- cgit From 62ff817a04a5a08074c0391bdbf7bab48bdaa80e Mon Sep 17 00:00:00 2001 From: Michael Krufky Date: Tue, 22 Apr 2008 14:46:17 -0300 Subject: V4L/DVB (7415): use tuner-simple for Philips TUV1236D digital tuning support Convert cx88-dvb and saa7134-dvb to use tuner-simple instead of dvb-pll for Philips TUV1236D Signed-off-by: Michael Krufky Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/cx88/cx88-dvb.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'drivers/media/video/cx88') diff --git a/drivers/media/video/cx88/cx88-dvb.c b/drivers/media/video/cx88/cx88-dvb.c index 676cf7ce08f..8dca20b944d 100644 --- a/drivers/media/video/cx88/cx88-dvb.c +++ b/drivers/media/video/cx88/cx88-dvb.c @@ -731,8 +731,9 @@ static int dvb_register(struct cx8802_dev *dev) &ati_hdtvwonder, &dev->core->i2c_adap); if (dev->dvb.frontend != NULL) { - dvb_attach(dvb_pll_attach, dev->dvb.frontend, 0x61, - NULL, DVB_PLL_TUV1236D); + dvb_attach(simple_tuner_attach, dev->dvb.frontend, + &dev->core->i2c_adap, 0x61, + TUNER_PHILIPS_TUV1236D); } break; case CX88_BOARD_HAUPPAUGE_NOVASPLUS_S1: -- cgit From 2c4963d4fb6103c0589db411fccf5e4f8531f173 Mon Sep 17 00:00:00 2001 From: Michael Krufky Date: Tue, 22 Apr 2008 14:46:25 -0300 Subject: V4L/DVB (7441): kconfig fixes for tuner-simple Update Kconfig for the hybrid devices recently converted to use tuner-simple rather than dvb-pll. dvb-bt8xx no longer uses dvb-pll at all, so remove all references to dvb-pll within that driver. Signed-off-by: Michael Krufky Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/cx88/Kconfig | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/media/video/cx88') diff --git a/drivers/media/video/cx88/Kconfig b/drivers/media/video/cx88/Kconfig index 49d3813a9b4..bcf6d9ba063 100644 --- a/drivers/media/video/cx88/Kconfig +++ b/drivers/media/video/cx88/Kconfig @@ -57,6 +57,7 @@ config VIDEO_CX88_DVB select DVB_NXT200X if !DVB_FE_CUSTOMISE select DVB_CX24123 if !DVB_FE_CUSTOMISE select DVB_ISL6421 if !DVB_FE_CUSTOMISE + select TUNER_SIMPLE if !DVB_FE_CUSTOMISE ---help--- This adds support for DVB/ATSC cards based on the Conexant 2388x chip. -- cgit From 99e09eac25f752b25f65392da7bd747b77040fea Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Thu, 27 Mar 2008 23:18:30 -0300 Subject: V4L/DVB (7448): Add support for Kworld ATSC 120 This board has a s5h1409 demod, plus a xc30x8 tuner (probably, xc3018). This patch adds proper support for radio, video, s-video, composite and ATSC. However, support for radio and video depends on having s5h1409 i2c gate open, otherwise, xc30x8 chip won't be visible. For a better support, some rework is needed on cx88 driver, to allow adding xc30x8 to i2c bus without sending i2c 0 byte reading to 0xc2 address. Thanks to Vanessa Ezekowitz for helping to figure out the proper parameters for s5h1409 and the GPIO pins used by each configuration. Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/cx88/cx88-cards.c | 110 +++++++++++++++++++++++++--------- drivers/media/video/cx88/cx88-dvb.c | 30 +++++++++- drivers/media/video/cx88/cx88.h | 3 + 3 files changed, 113 insertions(+), 30 deletions(-) (limited to 'drivers/media/video/cx88') diff --git a/drivers/media/video/cx88/cx88-cards.c b/drivers/media/video/cx88/cx88-cards.c index 6b83e3457b7..70505b4e5b4 100644 --- a/drivers/media/video/cx88/cx88-cards.c +++ b/drivers/media/video/cx88/cx88-cards.c @@ -27,7 +27,6 @@ #include "cx88.h" #include "tea5767.h" -#include "tuner-xc2028.h" static unsigned int tuner[] = {[0 ... (CX88_MAXBOARDS - 1)] = UNSET }; static unsigned int radio[] = {[0 ... (CX88_MAXBOARDS - 1)] = UNSET }; @@ -1614,6 +1613,45 @@ static const struct cx88_board cx88_boards[] = { .gpio2 = 0x0cfb, }, }, + /* Both radio, analog and ATSC work with this board. + However, for analog to work, s5h1409 gate should be open, + otherwise, tuner-xc3028 won't be detected. + A proper fix require using the newer i2c methods to add + tuner-xc3028 without doing an i2c probe. + */ + [CX88_BOARD_KWORLD_ATSC_120] = { + .name = "Kworld PlusTV HD PCI 120 (ATSC 120)", + .tuner_type = TUNER_XC2028, + .radio_type = UNSET, + .tuner_addr = ADDR_UNSET, + .radio_addr = ADDR_UNSET, + .input = { { + .type = CX88_VMUX_TELEVISION, + .vmux = 0, + .gpio0 = 0x000000ff, + .gpio1 = 0x0000f35d, + .gpio2 = 0x00000000, + }, { + .type = CX88_VMUX_COMPOSITE1, + .vmux = 1, + .gpio0 = 0x000000ff, + .gpio1 = 0x0000f37e, + .gpio2 = 0x00000000, + }, { + .type = CX88_VMUX_SVIDEO, + .vmux = 2, + .gpio0 = 0x000000ff, + .gpio1 = 0x0000f37e, + .gpio2 = 0x00000000, + } }, + .radio = { + .type = CX88_RADIO, + .gpio0 = 0x000000ff, + .gpio1 = 0x0000f35d, + .gpio2 = 0x00000000, + }, + .mpeg = CX88_MPEG_DVB, + }, }; /* ------------------------------------------------------------------ */ @@ -1959,6 +1997,10 @@ static const struct cx88_subid cx88_subids[] = { .subvendor = 0x1554, .subdevice = 0x4935, .card = CX88_BOARD_PROLINK_PV_8000GT, + }, { + .subvendor = 0x17de, + .subdevice = 0x08c1, + .card = CX88_BOARD_KWORLD_ATSC_120, }, }; @@ -2200,6 +2242,7 @@ static int cx88_xc2028_tuner_callback(struct cx88_core *core, case CX88_BOARD_WINFAST_TV2000_XP_GLOBAL: case CX88_BOARD_POWERCOLOR_REAL_ANGEL: case CX88_BOARD_GENIATECH_X8000_MT: + case CX88_BOARD_KWORLD_ATSC_120: return cx88_xc3028_geniatech_tuner_callback(core, command, arg); case CX88_BOARD_PROLINK_PV_8000GT: @@ -2363,6 +2406,40 @@ static void cx88_card_setup_pre_i2c(struct cx88_core *core) } } +/* + * Sets board-dependent xc3028 configuration + */ +void cx88_setup_xc3028(struct cx88_core *core, struct xc2028_ctrl *ctl) +{ + memset(ctl, 0, sizeof(*ctl)); + + ctl->fname = XC2028_DEFAULT_FIRMWARE; + ctl->max_len = 64; + + switch (core->boardnr) { + case CX88_BOARD_POWERCOLOR_REAL_ANGEL: + /* Doesn't work with firmware version 2.7 */ + ctl->fname = "xc3028-v25.fw"; + break; + case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PRO: + ctl->scode_table = XC3028_FE_ZARLINK456; + break; + case CX88_BOARD_KWORLD_ATSC_120: + case CX88_BOARD_DVICO_FUSIONHDTV_5_PCI_NANO: + ctl->demod = XC3028_FE_OREN538; + break; + case CX88_BOARD_PROLINK_PV_8000GT: + /* + * This board uses non-MTS firmware + */ + break; + default: + ctl->demod = XC3028_FE_OREN538; + ctl->mts = 1; + } +} +EXPORT_SYMBOL_GPL(cx88_setup_xc3028); + static void cx88_card_setup(struct cx88_core *core) { static u8 eeprom[256]; @@ -2481,36 +2558,13 @@ static void cx88_card_setup(struct cx88_core *core) struct v4l2_priv_tun_config xc2028_cfg; struct xc2028_ctrl ctl; - memset(&xc2028_cfg, 0, sizeof(xc2028_cfg)); - memset(&ctl, 0, sizeof(ctl)); - - ctl.fname = XC2028_DEFAULT_FIRMWARE; - ctl.max_len = 64; - - switch (core->boardnr) { - case CX88_BOARD_POWERCOLOR_REAL_ANGEL: - /* Doesn't work with firmware version 2.7 */ - ctl.fname = "xc3028-v25.fw"; - break; - case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PRO: - ctl.scode_table = XC3028_FE_ZARLINK456; - break; - case CX88_BOARD_DVICO_FUSIONHDTV_5_PCI_NANO: - ctl.demod = XC3028_FE_OREN538; - break; - case CX88_BOARD_PROLINK_PV_8000GT: - /* - * This board uses non-MTS firmware - */ - break; - default: - ctl.demod = XC3028_FE_OREN538; - ctl.mts = 1; - } + /* Fills device-dependent initialization parameters */ + cx88_setup_xc3028(core, &ctl); + /* Sends parameters to xc2028/3028 tuner */ + memset(&xc2028_cfg, 0, sizeof(xc2028_cfg)); xc2028_cfg.tuner = TUNER_XC2028; xc2028_cfg.priv = &ctl; - info_printk(core, "Asking xc2028/3028 to load firmware %s\n", ctl.fname); cx88_call_i2c_clients(core, TUNER_SET_CONFIG, &xc2028_cfg); diff --git a/drivers/media/video/cx88/cx88-dvb.c b/drivers/media/video/cx88/cx88-dvb.c index 8dca20b944d..13cc395ca65 100644 --- a/drivers/media/video/cx88/cx88-dvb.c +++ b/drivers/media/video/cx88/cx88-dvb.c @@ -45,7 +45,6 @@ #include "nxt200x.h" #include "cx24123.h" #include "isl6421.h" -#include "tuner-xc2028.h" #include "tuner-xc2028-types.h" #include "tuner-simple.h" #include "tda9887.h" @@ -443,6 +442,16 @@ static struct s5h1409_config dvico_hdtv5_pci_nano_config = { .mpeg_timing = S5H1409_MPEGTIMING_CONTINOUS_NONINVERTING_CLOCK, }; +static struct s5h1409_config kworld_atsc_120_config = { + .demod_address = 0x32 >> 1, + .qam_if = 44000, + .output_mode = S5H1409_SERIAL_OUTPUT, + .gpio = S5H1409_GPIO_OFF, + .inversion = S5H1409_INVERSION_OFF, + .status_mode = S5H1409_DEMODLOCKING, + .mpeg_timing = S5H1409_MPEGTIMING_CONTINOUS_NONINVERTING_CLOCK, +}; + static struct xc5000_config pinnacle_pctv_hd_800i_tuner_config = { .i2c_address = 0x64, .if_khz = 5380, @@ -457,9 +466,12 @@ static struct zl10353_config cx88_geniatech_x8000_mt = { static int attach_xc3028(u8 addr, struct cx8802_dev *dev) { struct dvb_frontend *fe; + struct xc2028_ctrl ctl; struct xc2028_config cfg = { .i2c_adap = &dev->core->i2c_adap, .i2c_addr = addr, + .ctrl = &ctl, + .callback = cx88_tuner_callback, }; if (!dev->dvb.frontend) { @@ -469,6 +481,13 @@ static int attach_xc3028(u8 addr, struct cx8802_dev *dev) return -EINVAL; } + /* + * Some xc3028 devices may be hidden by an I2C gate. This is known + * to happen with some s5h1409-based devices. + * Now that I2C gate is open, sets up xc3028 configuration + */ + cx88_setup_xc3028(dev->core, &ctl); + fe = dvb_attach(xc2028_attach, dev->dvb.frontend, &cfg); if (!fe) { printk(KERN_ERR "%s/2: xc3028 attach failed\n", @@ -810,7 +829,7 @@ static int dvb_register(struct cx8802_dev *dev) return -EINVAL; break; case CX88_BOARD_GENIATECH_X8000_MT: - dev->ts_gen_cntrl = 0x00; + dev->ts_gen_cntrl = 0x00; dev->dvb.frontend = dvb_attach(zl10353_attach, &cx88_geniatech_x8000_mt, @@ -818,6 +837,13 @@ static int dvb_register(struct cx8802_dev *dev) if (attach_xc3028(0x61, dev) < 0) return -EINVAL; break; + case CX88_BOARD_KWORLD_ATSC_120: + dev->dvb.frontend = dvb_attach(s5h1409_attach, + &kworld_atsc_120_config, + &dev->core->i2c_adap); + if (attach_xc3028(0x61, dev) < 0) + return -EINVAL; + break; default: printk(KERN_ERR "%s/2: The frontend of your DVB/ATSC card isn't supported yet\n", dev->core->name); diff --git a/drivers/media/video/cx88/cx88.h b/drivers/media/video/cx88/cx88.h index c0f4912793e..d17ca71c5d9 100644 --- a/drivers/media/video/cx88/cx88.h +++ b/drivers/media/video/cx88/cx88.h @@ -37,6 +37,7 @@ #include "btcx-risc.h" #include "cx88-reg.h" +#include "tuner-xc2028.h" #include #include @@ -219,6 +220,7 @@ extern struct sram_channel cx88_sram_channels[]; #define CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PRO 64 #define CX88_BOARD_DVICO_FUSIONHDTV_7_GOLD 65 #define CX88_BOARD_PROLINK_PV_8000GT 66 +#define CX88_BOARD_KWORLD_ATSC_120 67 enum cx88_itype { CX88_VMUX_COMPOSITE1 = 1, @@ -603,6 +605,7 @@ extern int cx88_tuner_callback(void *dev, int command, int arg); extern int cx88_get_resources(const struct cx88_core *core, struct pci_dev *pci); extern struct cx88_core *cx88_core_create(struct pci_dev *pci, int nr); +extern void cx88_setup_xc3028(struct cx88_core *core, struct xc2028_ctrl *ctl); /* ----------------------------------------------------------- */ /* cx88-tvaudio.c */ -- cgit From b12203d253732d282dd97909a1424016694183e9 Mon Sep 17 00:00:00 2001 From: Marton Balint Date: Wed, 26 Mar 2008 02:07:35 -0300 Subject: V4L/DVB (7449): cx88: fix oops on module removal caused by IR worker If the IR worker is not stopped before the removal of the cx88xx module, an OOPS may occur, because the worker function cx88_ir_work gets called. So stop the ir worker. Signed-off-by: Marton Balint Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/cx88/cx88-video.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'drivers/media/video/cx88') diff --git a/drivers/media/video/cx88/cx88-video.c b/drivers/media/video/cx88/cx88-video.c index 327c0a87c08..1eea044969a 100644 --- a/drivers/media/video/cx88/cx88-video.c +++ b/drivers/media/video/cx88/cx88-video.c @@ -1920,6 +1920,9 @@ static void __devexit cx8800_finidev(struct pci_dev *pci_dev) core->kthread = NULL; } + if (core->ir) + cx88_ir_stop(core, core->ir); + cx88_shutdown(core); /* FIXME */ pci_disable_device(pci_dev); -- cgit From 6d04203c7f49a4d93304b5754de5457297fa04eb Mon Sep 17 00:00:00 2001 From: Frej Drejhammar Date: Sun, 23 Mar 2008 22:43:21 -0300 Subject: V4L/DVB (7451): cx88: Add user control for chroma AGC The cx2388x family has support for chroma AGC. This patch implements a the V4L2_CID_CHROMA_AGC control for the cx2388x family. By default chroma AGC is disabled, as in previous versions of the driver. Signed-off-by: "Frej Drejhammar " Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/cx88/cx88-blackbird.c | 4 ++-- drivers/media/video/cx88/cx88-core.c | 6 +++++- drivers/media/video/cx88/cx88-video.c | 30 ++++++++++++++++++++++++++++-- drivers/media/video/cx88/cx88.h | 3 ++- 4 files changed, 37 insertions(+), 6 deletions(-) (limited to 'drivers/media/video/cx88') diff --git a/drivers/media/video/cx88/cx88-blackbird.c b/drivers/media/video/cx88/cx88-blackbird.c index d582395805d..8d54e7a90dc 100644 --- a/drivers/media/video/cx88/cx88-blackbird.c +++ b/drivers/media/video/cx88/cx88-blackbird.c @@ -693,7 +693,7 @@ static int blackbird_queryctrl(struct cx8802_dev *dev, struct v4l2_queryctrl *qc return -EINVAL; /* Standard V4L2 controls */ - if (cx8800_ctrl_query(qctrl) == 0) + if (cx8800_ctrl_query(dev->core, qctrl) == 0) return 0; /* MPEG V4L2 controls */ @@ -933,7 +933,7 @@ static int vidioc_queryctrl (struct file *file, void *priv, qctrl->id = v4l2_ctrl_next(ctrl_classes, qctrl->id); if (unlikely(qctrl->id == 0)) return -EINVAL; - return cx8800_ctrl_query(qctrl); + return cx8800_ctrl_query(dev->core, qctrl); } static int vidioc_enum_input (struct file *file, void *priv, diff --git a/drivers/media/video/cx88/cx88-core.c b/drivers/media/video/cx88/cx88-core.c index 75b581048f6..dca9f3ae5fd 100644 --- a/drivers/media/video/cx88/cx88-core.c +++ b/drivers/media/video/cx88/cx88-core.c @@ -929,7 +929,11 @@ int cx88_set_tvnorm(struct cx88_core *core, v4l2_std_id norm) dprintk(1,"set_tvnorm: MO_INPUT_FORMAT 0x%08x [old=0x%08x]\n", cxiformat, cx_read(MO_INPUT_FORMAT) & 0x0f); - cx_andor(MO_INPUT_FORMAT, 0xf, cxiformat); + /* Chroma AGC must be disabled if SECAM is used */ + if (norm & V4L2_STD_SECAM) + cx_andor(MO_INPUT_FORMAT, 0x40f, cxiformat); + else + cx_andor(MO_INPUT_FORMAT, 0xf, cxiformat); // FIXME: as-is from DScaler dprintk(1,"set_tvnorm: MO_OUTPUT_FORMAT 0x%08x [old=0x%08x]\n", diff --git a/drivers/media/video/cx88/cx88-video.c b/drivers/media/video/cx88/cx88-video.c index 1eea044969a..7ec6763f0e7 100644 --- a/drivers/media/video/cx88/cx88-video.c +++ b/drivers/media/video/cx88/cx88-video.c @@ -228,6 +228,18 @@ static struct cx88_ctrl cx8800_ctls[] = { .mask = 0x00ff, .shift = 0, },{ + .v = { + .id = V4L2_CID_CHROMA_AGC, + .name = "Chroma AGC", + .minimum = 0, + .maximum = 1, + .default_value = 0x0, + .type = V4L2_CTRL_TYPE_BOOLEAN, + }, + .reg = MO_INPUT_FORMAT, + .mask = 1 << 10, + .shift = 10, + }, { /* --- audio --- */ .v = { .id = V4L2_CID_AUDIO_MUTE, @@ -282,6 +294,7 @@ const u32 cx88_user_ctrls[] = { V4L2_CID_AUDIO_VOLUME, V4L2_CID_AUDIO_BALANCE, V4L2_CID_AUDIO_MUTE, + V4L2_CID_CHROMA_AGC, 0 }; EXPORT_SYMBOL(cx88_user_ctrls); @@ -291,7 +304,7 @@ static const u32 *ctrl_classes[] = { NULL }; -int cx8800_ctrl_query(struct v4l2_queryctrl *qctrl) +int cx8800_ctrl_query(struct cx88_core *core, struct v4l2_queryctrl *qctrl) { int i; @@ -306,6 +319,11 @@ int cx8800_ctrl_query(struct v4l2_queryctrl *qctrl) return 0; } *qctrl = cx8800_ctls[i].v; + /* Report chroma AGC as inactive when SECAM is selected */ + if (cx8800_ctls[i].v.id == V4L2_CID_CHROMA_AGC && + core->tvnorm & V4L2_STD_SECAM) + qctrl->flags |= V4L2_CTRL_FLAG_INACTIVE; + return 0; } EXPORT_SYMBOL(cx8800_ctrl_query); @@ -976,6 +994,12 @@ int cx88_set_control(struct cx88_core *core, struct v4l2_control *ctl) } mask=0xffff; break; + case V4L2_CID_CHROMA_AGC: + /* Do not allow chroma AGC to be enabled for SECAM */ + value = ((ctl->value - c->off) << c->shift) & c->mask; + if (core->tvnorm & V4L2_STD_SECAM && value) + return -EINVAL; + break; default: value = ((ctl->value - c->off) << c->shift) & c->mask; break; @@ -1268,10 +1292,12 @@ static int vidioc_s_input (struct file *file, void *priv, unsigned int i) static int vidioc_queryctrl (struct file *file, void *priv, struct v4l2_queryctrl *qctrl) { + struct cx88_core *core = ((struct cx8800_fh *)priv)->dev->core; + qctrl->id = v4l2_ctrl_next(ctrl_classes, qctrl->id); if (unlikely(qctrl->id == 0)) return -EINVAL; - return cx8800_ctrl_query(qctrl); + return cx8800_ctrl_query(core, qctrl); } static int vidioc_g_ctrl (struct file *file, void *priv, diff --git a/drivers/media/video/cx88/cx88.h b/drivers/media/video/cx88/cx88.h index d17ca71c5d9..14ac173f407 100644 --- a/drivers/media/video/cx88/cx88.h +++ b/drivers/media/video/cx88/cx88.h @@ -651,7 +651,8 @@ void cx8802_cancel_buffers(struct cx8802_dev *dev); /* ----------------------------------------------------------- */ /* cx88-video.c*/ extern const u32 cx88_user_ctrls[]; -extern int cx8800_ctrl_query(struct v4l2_queryctrl *qctrl); +extern int cx8800_ctrl_query(struct cx88_core *core, + struct v4l2_queryctrl *qctrl); int cx88_enum_input (struct cx88_core *core,struct v4l2_input *i); int cx88_set_freq (struct cx88_core *core,struct v4l2_frequency *f); int cx88_get_control(struct cx88_core *core, struct v4l2_control *ctl); -- cgit From 87a1738919ef028d16c462437e1480fc67338cd3 Mon Sep 17 00:00:00 2001 From: Frej Drejhammar Date: Sun, 23 Mar 2008 22:43:22 -0300 Subject: V4L/DVB (7452): cx88: Enable chroma AGC by default for all non-SECAM modes An enabled chroma AGC will not degrade picture quality if enabled on a color PAL or NTSC signal with nominal signal levels. It will give a significant color reproduction improvement if the chroma signals diverge from nominal levels. Therefore enable chroma AGC by default for PAL and NTSC standards. Signed-off-by: "Frej Drejhammar " Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/cx88/cx88-core.c | 9 ++++----- drivers/media/video/cx88/cx88-video.c | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) (limited to 'drivers/media/video/cx88') diff --git a/drivers/media/video/cx88/cx88-core.c b/drivers/media/video/cx88/cx88-core.c index dca9f3ae5fd..6039a8f57b4 100644 --- a/drivers/media/video/cx88/cx88-core.c +++ b/drivers/media/video/cx88/cx88-core.c @@ -929,11 +929,10 @@ int cx88_set_tvnorm(struct cx88_core *core, v4l2_std_id norm) dprintk(1,"set_tvnorm: MO_INPUT_FORMAT 0x%08x [old=0x%08x]\n", cxiformat, cx_read(MO_INPUT_FORMAT) & 0x0f); - /* Chroma AGC must be disabled if SECAM is used */ - if (norm & V4L2_STD_SECAM) - cx_andor(MO_INPUT_FORMAT, 0x40f, cxiformat); - else - cx_andor(MO_INPUT_FORMAT, 0xf, cxiformat); + /* Chroma AGC must be disabled if SECAM is used, we enable it + by default on PAL and NTSC */ + cx_andor(MO_INPUT_FORMAT, 0x40f, + norm & V4L2_STD_SECAM ? cxiformat : cxiformat | 0x400); // FIXME: as-is from DScaler dprintk(1,"set_tvnorm: MO_OUTPUT_FORMAT 0x%08x [old=0x%08x]\n", diff --git a/drivers/media/video/cx88/cx88-video.c b/drivers/media/video/cx88/cx88-video.c index 7ec6763f0e7..f9bcb9dc858 100644 --- a/drivers/media/video/cx88/cx88-video.c +++ b/drivers/media/video/cx88/cx88-video.c @@ -233,7 +233,7 @@ static struct cx88_ctrl cx8800_ctls[] = { .name = "Chroma AGC", .minimum = 0, .maximum = 1, - .default_value = 0x0, + .default_value = 0x1, .type = V4L2_CTRL_TYPE_BOOLEAN, }, .reg = MO_INPUT_FORMAT, -- cgit From 1b879c43811933514130421548fff7640e84d8e5 Mon Sep 17 00:00:00 2001 From: Frej Drejhammar Date: Sun, 23 Mar 2008 22:43:24 -0300 Subject: V4L/DVB (7454): cx88: Add user control for color killer The cx2388x family has a color killer. This patch implements the V4L2_CID_COLOR_KILLER control for the cx2388x family. By default the color killer is disabled, as in previous versions of the driver. Signed-off-by: "Frej Drejhammar " Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/cx88/cx88-video.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'drivers/media/video/cx88') diff --git a/drivers/media/video/cx88/cx88-video.c b/drivers/media/video/cx88/cx88-video.c index f9bcb9dc858..548ec492c6b 100644 --- a/drivers/media/video/cx88/cx88-video.c +++ b/drivers/media/video/cx88/cx88-video.c @@ -239,6 +239,18 @@ static struct cx88_ctrl cx8800_ctls[] = { .reg = MO_INPUT_FORMAT, .mask = 1 << 10, .shift = 10, + }, { + .v = { + .id = V4L2_CID_COLOR_KILLER, + .name = "Color killer", + .minimum = 0, + .maximum = 1, + .default_value = 0x0, + .type = V4L2_CTRL_TYPE_BOOLEAN, + }, + .reg = MO_INPUT_FORMAT, + .mask = 1 << 9, + .shift = 9, }, { /* --- audio --- */ .v = { @@ -295,6 +307,7 @@ const u32 cx88_user_ctrls[] = { V4L2_CID_AUDIO_BALANCE, V4L2_CID_AUDIO_MUTE, V4L2_CID_CHROMA_AGC, + V4L2_CID_COLOR_KILLER, 0 }; EXPORT_SYMBOL(cx88_user_ctrls); -- cgit From 0b86755f57bd2cc92d05ba3a613ab6ff44f09980 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Fri, 28 Mar 2008 14:21:04 -0300 Subject: V4L/DVB (7455): cx88_dvb: qam doesn't apply on Kword ATSC 120 Thanks to Michael Krufky for pointing this. Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/cx88/cx88-dvb.c | 1 - 1 file changed, 1 deletion(-) (limited to 'drivers/media/video/cx88') diff --git a/drivers/media/video/cx88/cx88-dvb.c b/drivers/media/video/cx88/cx88-dvb.c index 13cc395ca65..5e7c7fdb38a 100644 --- a/drivers/media/video/cx88/cx88-dvb.c +++ b/drivers/media/video/cx88/cx88-dvb.c @@ -444,7 +444,6 @@ static struct s5h1409_config dvico_hdtv5_pci_nano_config = { static struct s5h1409_config kworld_atsc_120_config = { .demod_address = 0x32 >> 1, - .qam_if = 44000, .output_mode = S5H1409_SERIAL_OUTPUT, .gpio = S5H1409_GPIO_OFF, .inversion = S5H1409_INVERSION_OFF, -- cgit From 0b5afdd2ea5f52d260d1e42d43fb0fa09ec0da2f Mon Sep 17 00:00:00 2001 From: Frej Drejhammar Date: Sun, 23 Mar 2008 22:43:25 -0300 Subject: V4L/DVB (7463): cx88: Enable color killer by default An enabled color killer will not degrade picture quality for color input signals, only suppress bogus color information on black-and-white input. Therefore enable it by default. Signed-off-by: Frej Drejhammar Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/cx88/cx88-video.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/media/video/cx88') diff --git a/drivers/media/video/cx88/cx88-video.c b/drivers/media/video/cx88/cx88-video.c index 548ec492c6b..eea23f95edb 100644 --- a/drivers/media/video/cx88/cx88-video.c +++ b/drivers/media/video/cx88/cx88-video.c @@ -245,7 +245,7 @@ static struct cx88_ctrl cx8800_ctls[] = { .name = "Color killer", .minimum = 0, .maximum = 1, - .default_value = 0x0, + .default_value = 0x1, .type = V4L2_CTRL_TYPE_BOOLEAN, }, .reg = MO_INPUT_FORMAT, -- cgit From ab364983087152e53676d914141f30e83ead12ff Mon Sep 17 00:00:00 2001 From: Dâniel Fraga Date: Tue, 8 Apr 2008 19:54:49 -0300 Subject: V4L/DVB (7505): Powercolor Real Angel 330 (fixes gpio references) The attached patch fixes gpio references for Powercolor Real Angel 330. Signed-off-by: Daniel Fraga Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/cx88/cx88-cards.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'drivers/media/video/cx88') diff --git a/drivers/media/video/cx88/cx88-cards.c b/drivers/media/video/cx88/cx88-cards.c index 70505b4e5b4..0534f589c72 100644 --- a/drivers/media/video/cx88/cx88-cards.c +++ b/drivers/media/video/cx88/cx88-cards.c @@ -1492,28 +1492,26 @@ static const struct cx88_board cx88_boards[] = { .input = { { .type = CX88_VMUX_TELEVISION, .vmux = 0, - .gpio0 = 0x0400, /* pin 2:mute = 0 (off?) */ + .gpio0 = 0x00ff, .gpio1 = 0xf35d, - .gpio2 = 0x0800, /* pin 19:audio = 0 (tv) */ + .gpio3 = 0x0000, }, { .type = CX88_VMUX_COMPOSITE1, .vmux = 1, - .gpio0 = 0x0400, /* probably? or 0x0404 to turn mute on */ - .gpio1 = 0x0000, - .gpio2 = 0x0808, /* pin 19:audio = 1 (line) */ + .gpio0 = 0x00ff, + .gpio1 = 0xf37d, + .gpio3 = 0x0000, }, { .type = CX88_VMUX_SVIDEO, .vmux = 2, .gpio0 = 0x000ff, .gpio1 = 0x0f37d, - .gpio2 = 0x00019, .gpio3 = 0x00000, } }, .radio = { .type = CX88_RADIO, .gpio0 = 0x000ff, .gpio1 = 0x0f35d, - .gpio2 = 0x00019, .gpio3 = 0x00000, }, }, -- cgit From ba928034df7e8b603152c896a2f84f9b12e8c290 Mon Sep 17 00:00:00 2001 From: Dâniel Fraga Date: Tue, 8 Apr 2008 19:56:44 -0300 Subject: V4L/DVB (7506): Powercolor Real Angel 330 (remote control support) The attached patch adds complete remote control support for Powercolor Real Angel 330. Signed-off-by: Daniel Fraga Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/cx88/cx88-input.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'drivers/media/video/cx88') diff --git a/drivers/media/video/cx88/cx88-input.c b/drivers/media/video/cx88/cx88-input.c index 6b25b8c9bb6..53526d997a4 100644 --- a/drivers/media/video/cx88/cx88-input.c +++ b/drivers/media/video/cx88/cx88-input.c @@ -317,6 +317,12 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci) ir_type = IR_TYPE_RC5; ir->sampling = 1; break; + case CX88_BOARD_POWERCOLOR_REAL_ANGEL: + ir_codes = ir_codes_powercolor_real_angel; + ir->gpio_addr = MO_GP2_IO; + ir->mask_keycode = 0x7e; + ir->polling = 100; /* ms */ + break; } if (NULL == ir_codes) { -- cgit From 32d83efc1c9e290b3d4627c6ec40529eafa89b46 Mon Sep 17 00:00:00 2001 From: Harvey Harrison Date: Tue, 8 Apr 2008 23:20:00 -0300 Subject: V4L/DVB (7521): media/video/cx88 replace remaining __FUNCTION__ occurrences __FUNCTION__ is gcc-specific, use __func__ Signed-off-by: Harvey Harrison Signed-off-by: Michael Krufky Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/cx88/cx88-alsa.c | 2 +- drivers/media/video/cx88/cx88-blackbird.c | 8 ++++---- drivers/media/video/cx88/cx88-core.c | 4 ++-- drivers/media/video/cx88/cx88-dvb.c | 14 +++++++------- drivers/media/video/cx88/cx88-mpeg.c | 16 ++++++++-------- drivers/media/video/cx88/cx88-tvaudio.c | 24 ++++++++++++------------ 6 files changed, 34 insertions(+), 34 deletions(-) (limited to 'drivers/media/video/cx88') diff --git a/drivers/media/video/cx88/cx88-alsa.c b/drivers/media/video/cx88/cx88-alsa.c index 2f5a4a4ba40..87c751a9a43 100644 --- a/drivers/media/video/cx88/cx88-alsa.c +++ b/drivers/media/video/cx88/cx88-alsa.c @@ -494,7 +494,7 @@ static snd_pcm_uframes_t snd_cx88_pointer(struct snd_pcm_substream *substream) count = atomic_read(&chip->count); -// dprintk(2, "%s - count %d (+%u), period %d, frame %lu\n", __FUNCTION__, +// dprintk(2, "%s - count %d (+%u), period %d, frame %lu\n", __func__, // count, new, count & (runtime->periods-1), // runtime->period_size * (count & (runtime->periods-1))); return runtime->period_size * (count & (runtime->periods-1)); diff --git a/drivers/media/video/cx88/cx88-blackbird.c b/drivers/media/video/cx88/cx88-blackbird.c index 8d54e7a90dc..61c4f72644b 100644 --- a/drivers/media/video/cx88/cx88-blackbird.c +++ b/drivers/media/video/cx88/cx88-blackbird.c @@ -314,7 +314,7 @@ static int blackbird_mbox_func(void *priv, u32 command, int in, int out, u32 dat u32 value, flag, retval; int i; - dprintk(1,"%s: 0x%X\n", __FUNCTION__, command); + dprintk(1,"%s: 0x%X\n", __func__, command); /* this may not be 100% safe if we can't read any memory location without side effects */ @@ -1055,7 +1055,7 @@ static int mpeg_open(struct inode *inode, struct file *file) dev = cx8802_get_device(inode); - dprintk( 1, "%s\n", __FUNCTION__); + dprintk( 1, "%s\n", __func__); if (dev == NULL) return -ENODEV; @@ -1065,7 +1065,7 @@ static int mpeg_open(struct inode *inode, struct file *file) if (drv) { err = drv->request_acquire(drv); if(err != 0) { - dprintk(1,"%s: Unable to acquire hardware, %d\n", __FUNCTION__, err); + dprintk(1,"%s: Unable to acquire hardware, %d\n", __func__, err); return err; } } @@ -1284,7 +1284,7 @@ static int cx8802_blackbird_probe(struct cx8802_driver *drv) struct cx8802_dev *dev = core->dvbdev; int err; - dprintk( 1, "%s\n", __FUNCTION__); + dprintk( 1, "%s\n", __func__); dprintk( 1, " ->being probed by Card=%d Name=%s, PCI %02x:%02x\n", core->boardnr, core->name, diff --git a/drivers/media/video/cx88/cx88-core.c b/drivers/media/video/cx88/cx88-core.c index 6039a8f57b4..c4d1aff1fdb 100644 --- a/drivers/media/video/cx88/cx88-core.c +++ b/drivers/media/video/cx88/cx88-core.c @@ -548,7 +548,7 @@ void cx88_wakeup(struct cx88_core *core, mod_timer(&q->timeout, jiffies+BUFFER_TIMEOUT); } if (bc != 1) - printk("%s: %d buffers handled (should be 1)\n",__FUNCTION__,bc); + printk("%s: %d buffers handled (should be 1)\n",__func__,bc); } void cx88_shutdown(struct cx88_core *core) @@ -577,7 +577,7 @@ void cx88_shutdown(struct cx88_core *core) int cx88_reset(struct cx88_core *core) { - dprintk(1,"%s\n",__FUNCTION__); + dprintk(1,"%s\n",__func__); cx88_shutdown(core); /* clear irq status */ diff --git a/drivers/media/video/cx88/cx88-dvb.c b/drivers/media/video/cx88/cx88-dvb.c index 5e7c7fdb38a..8fc929eb47b 100644 --- a/drivers/media/video/cx88/cx88-dvb.c +++ b/drivers/media/video/cx88/cx88-dvb.c @@ -282,7 +282,7 @@ static int lgdt330x_pll_rf_set(struct dvb_frontend* fe, int index) struct cx8802_dev *dev= fe->dvb->priv; struct cx88_core *core = dev->core; - dprintk(1, "%s: index = %d\n", __FUNCTION__, index); + dprintk(1, "%s: index = %d\n", __func__, index); if (index == 0) cx_clear(MO_GP0_IO, 8); else @@ -380,7 +380,7 @@ static int cx88_pci_nano_callback(void *ptr, int command, int arg) switch (command) { case XC2028_TUNER_RESET: /* Send the tuner in then out of reset */ - dprintk(1, "%s: XC2028_TUNER_RESET %d\n", __FUNCTION__, arg); + dprintk(1, "%s: XC2028_TUNER_RESET %d\n", __func__, arg); switch (core->boardnr) { case CX88_BOARD_DVICO_FUSIONHDTV_5_PCI_NANO: @@ -396,10 +396,10 @@ static int cx88_pci_nano_callback(void *ptr, int command, int arg) break; case XC2028_RESET_CLK: - dprintk(1, "%s: XC2028_RESET_CLK %d\n", __FUNCTION__, arg); + dprintk(1, "%s: XC2028_RESET_CLK %d\n", __func__, arg); break; default: - dprintk(1, "%s: unknown command %d, arg %d\n", __FUNCTION__, + dprintk(1, "%s: unknown command %d, arg %d\n", __func__, command, arg); return -EINVAL; } @@ -872,7 +872,7 @@ static int cx8802_dvb_advise_acquire(struct cx8802_driver *drv) { struct cx88_core *core = drv->core; int err = 0; - dprintk( 1, "%s\n", __FUNCTION__); + dprintk( 1, "%s\n", __func__); switch (core->boardnr) { case CX88_BOARD_HAUPPAUGE_HVR1300: @@ -895,7 +895,7 @@ static int cx8802_dvb_advise_release(struct cx8802_driver *drv) { struct cx88_core *core = drv->core; int err = 0; - dprintk( 1, "%s\n", __FUNCTION__); + dprintk( 1, "%s\n", __func__); switch (core->boardnr) { case CX88_BOARD_HAUPPAUGE_HVR1300: @@ -913,7 +913,7 @@ static int cx8802_dvb_probe(struct cx8802_driver *drv) struct cx8802_dev *dev = drv->core->dvbdev; int err; - dprintk( 1, "%s\n", __FUNCTION__); + dprintk( 1, "%s\n", __func__); dprintk( 1, " ->being probed by Card=%d Name=%s, PCI %02x:%02x\n", core->boardnr, core->name, diff --git a/drivers/media/video/cx88/cx88-mpeg.c b/drivers/media/video/cx88/cx88-mpeg.c index 6467ca33614..a6b061c2644 100644 --- a/drivers/media/video/cx88/cx88-mpeg.c +++ b/drivers/media/video/cx88/cx88-mpeg.c @@ -146,7 +146,7 @@ static int cx8802_start_dma(struct cx8802_dev *dev, cx_write(TS_GEN_CNTRL, 0x06); /* punctured clock TS & posedge driven */ udelay(100); } else { - printk( "%s() Failed. Unsupported value in .mpeg (0x%08x)\n", __FUNCTION__, + printk( "%s() Failed. Unsupported value in .mpeg (0x%08x)\n", __func__, core->board.mpeg ); return -EINVAL; } @@ -247,7 +247,7 @@ int cx8802_buf_prepare(struct videobuf_queue *q, struct cx8802_dev *dev, struct videobuf_dmabuf *dma=videobuf_to_dma(&buf->vb); int rc; - dprintk(1, "%s: %p\n", __FUNCTION__, buf); + dprintk(1, "%s: %p\n", __func__, buf); if (0 != buf->vb.baddr && buf->vb.bsize < size) return -EINVAL; @@ -289,7 +289,7 @@ void cx8802_buf_queue(struct cx8802_dev *dev, struct cx88_buffer *buf) buf->count = cx88q->count++; mod_timer(&cx88q->timeout, jiffies+BUFFER_TIMEOUT); dprintk(1,"[%p/%d] %s - first active\n", - buf, buf->vb.i, __FUNCTION__); + buf, buf->vb.i, __func__); } else { dprintk( 1, "queue is not empty - append to active\n" ); @@ -299,7 +299,7 @@ void cx8802_buf_queue(struct cx8802_dev *dev, struct cx88_buffer *buf) buf->count = cx88q->count++; prev->risc.jmp[1] = cpu_to_le32(buf->risc.dma); dprintk( 1, "[%p/%d] %s - append to active\n", - buf, buf->vb.i, __FUNCTION__); + buf, buf->vb.i, __func__); } } @@ -342,7 +342,7 @@ static void cx8802_timeout(unsigned long data) { struct cx8802_dev *dev = (struct cx8802_dev*)data; - dprintk(1, "%s\n",__FUNCTION__); + dprintk(1, "%s\n",__func__); if (debug) cx88_sram_channel_dump(dev->core, &cx88_sram_channels[SRAM_CH28]); @@ -625,7 +625,7 @@ static int cx8802_request_acquire(struct cx8802_driver *drv) } mutex_unlock(&drv->core->lock); - mpeg_dbg(1,"%s() Post acquire GPIO=%x\n", __FUNCTION__, cx_read(MO_GP0_IO)); + mpeg_dbg(1,"%s() Post acquire GPIO=%x\n", __func__, cx_read(MO_GP0_IO)); } return 0; @@ -641,7 +641,7 @@ static int cx8802_request_release(struct cx8802_driver *drv) { drv->advise_release(drv); core->active_type_id = CX88_BOARD_NONE; - mpeg_dbg(1,"%s() Post release GPIO=%x\n", __FUNCTION__, cx_read(MO_GP0_IO)); + mpeg_dbg(1,"%s() Post release GPIO=%x\n", __func__, cx_read(MO_GP0_IO)); } mutex_unlock(&drv->core->lock); @@ -815,7 +815,7 @@ static void __devexit cx8802_remove(struct pci_dev *pci_dev) dev = pci_get_drvdata(pci_dev); - dprintk( 1, "%s\n", __FUNCTION__); + dprintk( 1, "%s\n", __func__); if (!list_empty(&dev->drvlist)) { struct cx8802_driver *drv, *tmp; diff --git a/drivers/media/video/cx88/cx88-tvaudio.c b/drivers/media/video/cx88/cx88-tvaudio.c index c574f450498..3a1977f41e2 100644 --- a/drivers/media/video/cx88/cx88-tvaudio.c +++ b/drivers/media/video/cx88/cx88-tvaudio.c @@ -265,12 +265,12 @@ static void set_audio_standard_BTSC(struct cx88_core *core, unsigned int sap, mode |= EN_FMRADIO_EN_RDS; if (sap) { - dprintk("%s SAP (status: unknown)\n", __FUNCTION__); + dprintk("%s SAP (status: unknown)\n", __func__); set_audio_start(core, SEL_SAP); set_audio_registers(core, btsc_sap); set_audio_finish(core, mode); } else { - dprintk("%s (status: known-good)\n", __FUNCTION__); + dprintk("%s (status: known-good)\n", __func__); set_audio_start(core, SEL_BTSC); set_audio_registers(core, btsc); set_audio_finish(core, mode); @@ -351,16 +351,16 @@ static void set_audio_standard_NICAM(struct cx88_core *core, u32 mode) set_audio_start(core,SEL_NICAM); switch (core->tvaudio) { case WW_L: - dprintk("%s SECAM-L NICAM (status: devel)\n", __FUNCTION__); + dprintk("%s SECAM-L NICAM (status: devel)\n", __func__); set_audio_registers(core, nicam_l); break; case WW_I: - dprintk("%s PAL-I NICAM (status: known-good)\n", __FUNCTION__); + dprintk("%s PAL-I NICAM (status: known-good)\n", __func__); set_audio_registers(core, nicam_bgdki_common); set_audio_registers(core, nicam_i); break; default: - dprintk("%s PAL-BGDK NICAM (status: known-good)\n", __FUNCTION__); + dprintk("%s PAL-BGDK NICAM (status: known-good)\n", __func__); set_audio_registers(core, nicam_bgdki_common); set_audio_registers(core, nicam_default); break; @@ -600,28 +600,28 @@ static void set_audio_standard_A2(struct cx88_core *core, u32 mode) set_audio_start(core, SEL_A2); switch (core->tvaudio) { case WW_BG: - dprintk("%s PAL-BG A1/2 (status: known-good)\n", __FUNCTION__); + dprintk("%s PAL-BG A1/2 (status: known-good)\n", __func__); set_audio_registers(core, a2_bgdk_common); set_audio_registers(core, a2_bg); set_audio_registers(core, a2_deemph50); break; case WW_DK: - dprintk("%s PAL-DK A1/2 (status: known-good)\n", __FUNCTION__); + dprintk("%s PAL-DK A1/2 (status: known-good)\n", __func__); set_audio_registers(core, a2_bgdk_common); set_audio_registers(core, a2_dk); set_audio_registers(core, a2_deemph50); break; case WW_I: - dprintk("%s PAL-I A1 (status: known-good)\n", __FUNCTION__); + dprintk("%s PAL-I A1 (status: known-good)\n", __func__); set_audio_registers(core, a1_i); set_audio_registers(core, a2_deemph50); break; case WW_L: - dprintk("%s AM-L (status: devel)\n", __FUNCTION__); + dprintk("%s AM-L (status: devel)\n", __func__); set_audio_registers(core, am_l); break; default: - dprintk("%s Warning: wrong value\n", __FUNCTION__); + dprintk("%s Warning: wrong value\n", __func__); return; break; }; @@ -637,7 +637,7 @@ static void set_audio_standard_EIAJ(struct cx88_core *core) { /* end of list */ }, }; - dprintk("%s (status: unknown)\n", __FUNCTION__); + dprintk("%s (status: unknown)\n", __func__); set_audio_start(core, SEL_EIAJ); set_audio_registers(core, eiaj); @@ -691,7 +691,7 @@ static void set_audio_standard_FM(struct cx88_core *core, { /* end of list */ }, }; - dprintk("%s (status: unknown)\n", __FUNCTION__); + dprintk("%s (status: unknown)\n", __func__); set_audio_start(core, SEL_FMRADIO); switch (deemph) { -- cgit From 9950c1b5b4b86d4aae12853c2f0a0ef11d976764 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Fri, 11 Apr 2008 11:29:44 -0300 Subject: V4L/DVB (7537): cx88/saa7134: Fix: avoid OOPS on module unload If frontend is not attached, both cx88-dvb and saa7134-dvb don't register DVB. However, dvb unregister were inconditionally called. Due to that, an OOPS is generated. Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/cx88/cx88-dvb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'drivers/media/video/cx88') diff --git a/drivers/media/video/cx88/cx88-dvb.c b/drivers/media/video/cx88/cx88-dvb.c index 8fc929eb47b..e83d9869e68 100644 --- a/drivers/media/video/cx88/cx88-dvb.c +++ b/drivers/media/video/cx88/cx88-dvb.c @@ -951,7 +951,8 @@ static int cx8802_dvb_remove(struct cx8802_driver *drv) struct cx8802_dev *dev = drv->core->dvbdev; /* dvb */ - videobuf_dvb_unregister(&dev->dvb); + if (dev->dvb.frontend) + videobuf_dvb_unregister(&dev->dvb); vp3054_i2c_remove(dev); -- cgit From 78e92006f410a4044f8c1760c25ac9d11d259aa2 Mon Sep 17 00:00:00 2001 From: Janne Grunau Date: Wed, 9 Apr 2008 19:13:13 -0300 Subject: V4L/DVB (7538): Adds selectable adapter numbers as per module option The adapter_nr module options can be used to allocate static adapter numbers on a driver level. It avoids problems with changing DVB apapter numbers after warm/cold boot or device unplugging and repluging. Each driver holds DVB_MAX_ADAPTER long array of the preferred order of adapter numbers. options dvb-usb-dib0700 adapter_nr=7,6,5,4,3,2,1,0 would result in a reversed allocation of adapter numbers. With adapter_nr=2,5 it tries first to get adapter number 2 and 5. If both are already in use it will allocate the lowest free adapter number. Signed-off-by: Janne Grunau Acked-by: Hermann Pitton Signed-off-by: Michael Krufky Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/cx88/cx88-dvb.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'drivers/media/video/cx88') diff --git a/drivers/media/video/cx88/cx88-dvb.c b/drivers/media/video/cx88/cx88-dvb.c index e83d9869e68..fda7334d934 100644 --- a/drivers/media/video/cx88/cx88-dvb.c +++ b/drivers/media/video/cx88/cx88-dvb.c @@ -58,6 +58,8 @@ static unsigned int debug; module_param(debug, int, 0644); MODULE_PARM_DESC(debug,"enable debug messages [dvb]"); +DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr); + #define dprintk(level,fmt, arg...) if (debug >= level) \ printk(KERN_DEBUG "%s/2-dvb: " fmt, core->name, ## arg) @@ -862,7 +864,8 @@ static int dvb_register(struct cx8802_dev *dev) cx88_call_i2c_clients (dev->core, TUNER_SET_STANDBY, NULL); /* register everything */ - return videobuf_dvb_register(&dev->dvb, THIS_MODULE, dev, &dev->pci->dev); + return videobuf_dvb_register(&dev->dvb, THIS_MODULE, dev, + &dev->pci->dev, adapter_nr); } /* ----------------------------------------------------------- */ -- cgit From 6b92b3bd7ac91b7e255541f4be9bfd55b12dae41 Mon Sep 17 00:00:00 2001 From: Steven Toth Date: Sat, 5 Apr 2008 16:45:57 -0300 Subject: V4L/DVB (7642): cx88: enable radio GPIO correctly cx88: enable radio GPIO correctly. Signed-off-by: Steven Toth Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/cx88/cx88-cards.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'drivers/media/video/cx88') diff --git a/drivers/media/video/cx88/cx88-cards.c b/drivers/media/video/cx88/cx88-cards.c index 0534f589c72..620159d0550 100644 --- a/drivers/media/video/cx88/cx88-cards.c +++ b/drivers/media/video/cx88/cx88-cards.c @@ -1364,6 +1364,10 @@ static const struct cx88_board cx88_boards[] = { }}, /* fixme: Add radio support */ .mpeg = CX88_MPEG_DVB | CX88_MPEG_BLACKBIRD, + .radio = { + .type = CX88_RADIO, + .gpio0 = 0xe780, + }, }, [CX88_BOARD_ADSTECH_PTV_390] = { .name = "ADS Tech Instant Video PCI", -- cgit From 33e5316113b1a472f54579f014739e4a4a53d704 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Mon, 21 Apr 2008 06:58:48 -0300 Subject: V4L/DVB (7651): tuner-xc2028: Several fixes to SCODE This patch fixes several issues on SCODE: 1) The extracting tool weren't generating the proper tags for SCODE. This has almost no effect, since those tags shouldn't be used; 2) DIBCOM52 were using a wrong IF. It should be 5200, instead of 5700; 3) seek_firmware were wanting an exact match for firmware type. This is wrong. As result, no SCODE firmware were loaded; 4) A few files were including the wrong file for seeking demod firmwares; 5) XC3028_FE_DEFAULT can be used, if user doesn't want to load a firmware. However, this weren't documentated. This feature require more testing. Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/cx88/cx88-dvb.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'drivers/media/video/cx88') diff --git a/drivers/media/video/cx88/cx88-dvb.c b/drivers/media/video/cx88/cx88-dvb.c index fda7334d934..f1251b844e0 100644 --- a/drivers/media/video/cx88/cx88-dvb.c +++ b/drivers/media/video/cx88/cx88-dvb.c @@ -45,7 +45,6 @@ #include "nxt200x.h" #include "cx24123.h" #include "isl6421.h" -#include "tuner-xc2028-types.h" #include "tuner-simple.h" #include "tda9887.h" @@ -813,7 +812,7 @@ static int dvb_register(struct cx8802_dev *dev) static struct xc2028_ctrl ctl = { .fname = "xc3028-v27.fw", .max_len = 64, - .scode_table = OREN538, + .scode_table = XC3028_FE_OREN538, }; fe = dvb_attach(xc2028_attach, -- cgit