diff options
author | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-03-21 07:45:30 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-03-21 07:45:30 -0300 |
commit | 0b6f4aa0fc0cf793e97744580ad53e46f3f1bd95 (patch) | |
tree | 2d2736f6914749502bdf0de211c78d1d56048d68 /linux/drivers/media/video | |
parent | 865624af6da8960703f03756ab73c5438c1eff23 (diff) | |
parent | a40b333c721d9353c3b7b98a22084e2c15095220 (diff) | |
download | mediapointer-dvb-s2-0b6f4aa0fc0cf793e97744580ad53e46f3f1bd95.tar.gz mediapointer-dvb-s2-0b6f4aa0fc0cf793e97744580ad53e46f3f1bd95.tar.bz2 |
merge: http://linuxtv.org/hg/~hhackmann/v4l-dvb
From: Mauro Carvalho Chehab <mchehab@infradead.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'linux/drivers/media/video')
-rw-r--r-- | linux/drivers/media/video/bt8xx/bttv-cards.c | 12 | ||||
-rw-r--r-- | linux/drivers/media/video/cx23885/cx23885-core.c | 2 | ||||
-rw-r--r-- | linux/drivers/media/video/cx23885/cx23885-dvb.c | 4 | ||||
-rw-r--r-- | linux/drivers/media/video/cx88/cx88-core.c | 2 | ||||
-rw-r--r-- | linux/drivers/media/video/cx88/cx88-dvb.c | 2 | ||||
-rw-r--r-- | linux/drivers/media/video/em28xx/em28xx-cards.c | 2 | ||||
-rw-r--r-- | linux/drivers/media/video/ivtv/ivtv-queue.c | 4 | ||||
-rw-r--r-- | linux/drivers/media/video/pvrusb2/pvrusb2-devattr.c | 2 | ||||
-rw-r--r-- | linux/drivers/media/video/saa7134/saa7134-cards.c | 20 | ||||
-rw-r--r-- | linux/drivers/media/video/saa7134/saa7134-dvb.c | 1 | ||||
-rw-r--r-- | linux/drivers/media/video/se401.c | 2 | ||||
-rw-r--r-- | linux/drivers/media/video/tuner-i2c.h | 8 | ||||
-rw-r--r-- | linux/drivers/media/video/tuner-simple.c | 28 | ||||
-rw-r--r-- | linux/drivers/media/video/tuner-types.c | 4 | ||||
-rw-r--r-- | linux/drivers/media/video/videobuf-core.c | 5 |
15 files changed, 68 insertions, 30 deletions
diff --git a/linux/drivers/media/video/bt8xx/bttv-cards.c b/linux/drivers/media/video/bt8xx/bttv-cards.c index 42e0c3bff..177b75ebc 100644 --- a/linux/drivers/media/video/bt8xx/bttv-cards.c +++ b/linux/drivers/media/video/bt8xx/bttv-cards.c @@ -2369,7 +2369,7 @@ struct tvcard bttv_tvcards[] = { .tuner = 0, .svhs = 2, .muxsel = { 2, 3, 1, 0 }, - .tuner_type = TUNER_PHILIPS_ATSC, + .tuner_type = TUNER_PHILIPS_FCV1236D, .tuner_addr = ADDR_UNSET, .radio_addr = ADDR_UNSET, .has_dvb = 1, @@ -3011,7 +3011,7 @@ struct tvcard bttv_tvcards[] = { [BTTV_BOARD_DVICO_FUSIONHDTV_2] = { .name = "DViCO FusionHDTV 2", .tuner = 0, - .tuner_type = TUNER_PHILIPS_ATSC, /* FCV1236D */ + .tuner_type = TUNER_PHILIPS_FCV1236D, .tuner_addr = ADDR_UNSET, .radio_addr = ADDR_UNSET, .video_inputs = 3, @@ -3072,9 +3072,13 @@ struct tvcard bttv_tvcards[] = { .gpiomask = 0x008007, .muxsel = { 2, 3, 1, 1 }, .gpiomux = { 0, 1, 2, 2 }, /* CONTVFMi */ - /*gpiomux = { 0, 1, 2, 3 }, /* MagicTV */ +#if 0 + .gpiomux = { 0, 1, 2, 3 }, /* MagicTV */ +#endif .gpiomute = 3, /* CONTVFMi */ - /*gpiomute = 4, /* MagicTV */ +#if 0 + .gpiomute = 4, /* MagicTV */ +#endif .needs_tvaudio = 0, .tuner_type = TUNER_PHILIPS_FM1216ME_MK3, /* TCL MK3 */ .tuner_addr = ADDR_UNSET, diff --git a/linux/drivers/media/video/cx23885/cx23885-core.c b/linux/drivers/media/video/cx23885/cx23885-core.c index 1a6d87490..0dfe91a1c 100644 --- a/linux/drivers/media/video/cx23885/cx23885-core.c +++ b/linux/drivers/media/video/cx23885/cx23885-core.c @@ -1085,7 +1085,7 @@ void cx23885_free_buffer(struct videobuf_queue *q, struct cx23885_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; } diff --git a/linux/drivers/media/video/cx23885/cx23885-dvb.c b/linux/drivers/media/video/cx23885/cx23885-dvb.c index 649acc942..046aa4a68 100644 --- a/linux/drivers/media/video/cx23885/cx23885-dvb.c +++ b/linux/drivers/media/video/cx23885/cx23885-dvb.c @@ -165,8 +165,8 @@ static struct tda829x_config tda829x_no_probe = { }; static struct tda18271_std_map hauppauge_tda18271_std_map = { - .atsc_6 = { .if_freq = 5380, .std_bits = 0x1b }, - .qam_6 = { .if_freq = 4000, .std_bits = 0x18 }, + .atsc_6 = { .if_freq = 5380, .agc_mode = 3, .std = 3 }, + .qam_6 = { .if_freq = 4000, .agc_mode = 3, .std = 0 }, }; static struct tda18271_config hauppauge_tda18271_config = { diff --git a/linux/drivers/media/video/cx88/cx88-core.c b/linux/drivers/media/video/cx88/cx88-core.c index 25985f7d5..1c6ac4528 100644 --- a/linux/drivers/media/video/cx88/cx88-core.c +++ b/linux/drivers/media/video/cx88/cx88-core.c @@ -222,7 +222,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; } diff --git a/linux/drivers/media/video/cx88/cx88-dvb.c b/linux/drivers/media/video/cx88/cx88-dvb.c index 4cfff6e4a..71447830b 100644 --- a/linux/drivers/media/video/cx88/cx88-dvb.c +++ b/linux/drivers/media/video/cx88/cx88-dvb.c @@ -465,7 +465,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) { diff --git a/linux/drivers/media/video/em28xx/em28xx-cards.c b/linux/drivers/media/video/em28xx/em28xx-cards.c index db07cbbe3..06a4e4a2b 100644 --- a/linux/drivers/media/video/em28xx/em28xx-cards.c +++ b/linux/drivers/media/video/em28xx/em28xx-cards.c @@ -332,7 +332,7 @@ struct em28xx_board em28xx_boards[] = { .name = "Kworld USB2800", .is_em2800 = 1, .vchannels = 3, - .tuner_type = TUNER_PHILIPS_ATSC, + .tuner_type = TUNER_PHILIPS_FCV1236D, .tda9887_conf = TDA9887_PRESENT, .decoder = EM28XX_SAA7113, .input = { { diff --git a/linux/drivers/media/video/ivtv/ivtv-queue.c b/linux/drivers/media/video/ivtv/ivtv-queue.c index 39a216713..3e1deec67 100644 --- a/linux/drivers/media/video/ivtv/ivtv-queue.c +++ b/linux/drivers/media/video/ivtv/ivtv-queue.c @@ -51,7 +51,7 @@ void ivtv_queue_init(struct ivtv_queue *q) void ivtv_enqueue(struct ivtv_stream *s, struct ivtv_buffer *buf, struct ivtv_queue *q) { - unsigned long flags = 0; + unsigned long flags; /* clear the buffer if it is going to be enqueued to the free queue */ if (q == &s->q_free) { @@ -71,7 +71,7 @@ void ivtv_enqueue(struct ivtv_stream *s, struct ivtv_buffer *buf, struct ivtv_qu struct ivtv_buffer *ivtv_dequeue(struct ivtv_stream *s, struct ivtv_queue *q) { struct ivtv_buffer *buf = NULL; - unsigned long flags = 0; + unsigned long flags; spin_lock_irqsave(&s->qlock, flags); if (!list_empty(&q->list)) { diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-devattr.c b/linux/drivers/media/video/pvrusb2/pvrusb2-devattr.c index c54b23787..c7a6bc01d 100644 --- a/linux/drivers/media/video/pvrusb2/pvrusb2-devattr.c +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-devattr.c @@ -185,7 +185,7 @@ static const struct pvr2_device_desc pvr2_device_onair_usb2 = { .shortname = "oa2", .client_modules.lst = pvr2_client_onair_usb2, .client_modules.cnt = ARRAY_SIZE(pvr2_client_onair_usb2), - .default_tuner_type = TUNER_PHILIPS_ATSC, + .default_tuner_type = TUNER_PHILIPS_FCV1236D, .flag_has_analogtuner = !0, .flag_has_composite = !0, .flag_has_svideo = !0, diff --git a/linux/drivers/media/video/saa7134/saa7134-cards.c b/linux/drivers/media/video/saa7134/saa7134-cards.c index 9d50c5660..a846e41c2 100644 --- a/linux/drivers/media/video/saa7134/saa7134-cards.c +++ b/linux/drivers/media/video/saa7134/saa7134-cards.c @@ -3370,7 +3370,7 @@ struct saa7134_board saa7134_boards[] = { /* Juan Pablo Sormani <sorman@gmail.com> */ .name = "Encore ENLTV-FM", .audio_clock = 0x00200000, - .tuner_type = TUNER_PHILIPS_ATSC, + .tuner_type = TUNER_PHILIPS_FCV1236D, .radio_type = UNSET, .tuner_addr = ADDR_UNSET, .radio_addr = ADDR_UNSET, @@ -4105,9 +4105,12 @@ struct saa7134_board saa7134_boards[] = { }, }, [SAA7134_BOARD_AVERMEDIA_CARDBUS_506] = { - .name = "AVerMedia Cardbus TV/Radio (E506R)", - .audio_clock = 0x187de7, - .tuner_type = TUNER_XC2028, + .name = "AVerMedia Cardbus TV/Radio (E506R)", + .audio_clock = 0x187de7, + .tuner_type = TUNER_XC2028, + .radio_type = UNSET, + .tuner_addr = ADDR_UNSET, + .radio_addr = ADDR_UNSET, /* TODO: .mpeg = SAA7134_MPEG_DVB, @@ -4136,6 +4139,9 @@ struct saa7134_board saa7134_boards[] = { .name = "AVerMedia Hybrid TV/Radio (A16D)", .audio_clock = 0x187de7, .tuner_type = TUNER_XC2028, + .radio_type = UNSET, + .tuner_addr = ADDR_UNSET, + .radio_addr = ADDR_UNSET, .inputs = {{ .name = name_tv, .vmux = 1, @@ -4155,6 +4161,9 @@ struct saa7134_board saa7134_boards[] = { .name = "Avermedia M115", .audio_clock = 0x187de7, .tuner_type = TUNER_XC2028, + .radio_type = UNSET, + .tuner_addr = ADDR_UNSET, + .radio_addr = ADDR_UNSET, .inputs = {{ .name = name_tv, .vmux = 1, @@ -4175,6 +4184,9 @@ struct saa7134_board saa7134_boards[] = { .name = "Compro VideoMate T750", .audio_clock = 0x00187de7, .tuner_type = TUNER_XC2028, + .radio_type = UNSET, + .tuner_addr = ADDR_UNSET, + .radio_addr = ADDR_UNSET, .mpeg = SAA7134_MPEG_DVB, .inputs = {{ .name = name_tv, diff --git a/linux/drivers/media/video/saa7134/saa7134-dvb.c b/linux/drivers/media/video/saa7134/saa7134-dvb.c index 951e5e58c..def5e9354 100644 --- a/linux/drivers/media/video/saa7134/saa7134-dvb.c +++ b/linux/drivers/media/video/saa7134/saa7134-dvb.c @@ -1206,6 +1206,7 @@ static int dvb_init(struct saa7134_dev *dev) struct xc2028_config cfg = { .i2c_adap = &dev->i2c_adap, .i2c_addr = 0x61, + .video_dev = dev->i2c_adap.algo_data, }; fe = dvb_attach(xc2028_attach, dev->dvb.frontend, &cfg); if (!fe) { diff --git a/linux/drivers/media/video/se401.c b/linux/drivers/media/video/se401.c index 58db31f22..45d676641 100644 --- a/linux/drivers/media/video/se401.c +++ b/linux/drivers/media/video/se401.c @@ -1287,7 +1287,7 @@ static int se401_init(struct usb_se401 *se401, int button) rc=se401_sndctrl(0, se401, SE401_REQ_GET_HEIGHT, 0, cp, sizeof(cp)); se401->cheight=cp[0]+cp[1]*256; - if (!cp[2] && SE401_FORMAT_BAYER) { + if (!(cp[2] & SE401_FORMAT_BAYER)) { err("Bayer format not supported!"); return 1; } diff --git a/linux/drivers/media/video/tuner-i2c.h b/linux/drivers/media/video/tuner-i2c.h index 60ba79480..3ad6c8e0b 100644 --- a/linux/drivers/media/video/tuner-i2c.h +++ b/linux/drivers/media/video/tuner-i2c.h @@ -129,10 +129,10 @@ static inline int tuner_i2c_xfer_send_recv(struct tuner_i2c_props *props, ({ \ int __ret = 0; \ list_for_each_entry(state, &list, hybrid_tuner_instance_list) { \ - if ((state->i2c_props.addr == i2caddr) && \ - ((state->i2c_props.adap ? \ - i2c_adapter_id(state->i2c_props.adap) : -1) == \ - (i2cadap ? i2c_adapter_id(i2cadap) : -1))) { \ + if (((i2cadap) && (state->i2c_props.adap)) && \ + ((i2c_adapter_id(state->i2c_props.adap) == \ + i2c_adapter_id(i2cadap)) && \ + (i2caddr == state->i2c_props.addr))) { \ __tuner_info(state->i2c_props, \ "attaching existing instance\n"); \ state->i2c_props.count++; \ diff --git a/linux/drivers/media/video/tuner-simple.c b/linux/drivers/media/video/tuner-simple.c index 98cfa1b5b..5a45aca63 100644 --- a/linux/drivers/media/video/tuner-simple.c +++ b/linux/drivers/media/video/tuner-simple.c @@ -298,7 +298,7 @@ static void simple_set_rf_input(struct dvb_frontend *fe, break; } break; - case TUNER_PHILIPS_ATSC: + case TUNER_PHILIPS_FCV1236D: switch (rf) { case 1: *cb |= 0x01; @@ -370,7 +370,7 @@ static int simple_std_setup(struct dvb_frontend *fe, } break; - case TUNER_PHILIPS_ATSC: + case TUNER_PHILIPS_FCV1236D: /* 0x00 -> ATSC antenna input 1 */ /* 0x01 -> ATSC antenna input 2 */ /* 0x02 -> NTSC antenna input 1 */ @@ -793,7 +793,7 @@ static void simple_set_dvb(struct dvb_frontend *fe, u8 *buf, buf[3] |= 1 << 3; break; case TUNER_PHILIPS_TUV1236D: - case TUNER_PHILIPS_ATSC: + case TUNER_PHILIPS_FCV1236D: { unsigned int new_rf; @@ -1022,6 +1022,28 @@ struct dvb_frontend *simple_tuner_attach(struct dvb_frontend *fe, return NULL; } + /* If i2c_adap is set, check that the tuner is at the correct address. + * Otherwise, if i2c_adap is NULL, the tuner will be programmed directly + * by the digital demod via calc_regs. + */ + if (i2c_adap != NULL) { + u8 b[1]; + struct i2c_msg msg = { + .addr = i2c_addr, .flags = I2C_M_RD, + .buf = b, .len = 1, + }; + + if (fe->ops.i2c_gate_ctrl) + fe->ops.i2c_gate_ctrl(fe, 1); + + if (1 != i2c_transfer(i2c_adap, &msg, 1)) + tuner_warn("unable to probe %s, proceeding anyway.", + tuners[type].name); + + if (fe->ops.i2c_gate_ctrl) + fe->ops.i2c_gate_ctrl(fe, 0); + } + mutex_lock(&tuner_simple_list_mutex); instance = hybrid_tuner_request_state(struct tuner_simple_priv, priv, diff --git a/linux/drivers/media/video/tuner-types.c b/linux/drivers/media/video/tuner-types.c index 7311532de..b3f0f62e0 100644 --- a/linux/drivers/media/video/tuner-types.c +++ b/linux/drivers/media/video/tuner-types.c @@ -616,7 +616,7 @@ static struct tuner_params tuner_philips_pal_mk_params[] = { }, }; -/* ---- TUNER_PHILIPS_ATSC - Philips FCV1236D (ATSC/NTSC) ---- */ +/* ---- TUNER_PHILIPS_FCV1236D - Philips FCV1236D (ATSC/NTSC) ---- */ static struct tuner_range tuner_philips_fcv1236d_ntsc_ranges[] = { { 16 * 157.25 /*MHz*/, 0x8e, 0xa2, }, @@ -1435,7 +1435,7 @@ struct tunertype tuners[] = { .params = tuner_philips_pal_mk_params, .count = ARRAY_SIZE(tuner_philips_pal_mk_params), }, - [TUNER_PHILIPS_ATSC] = { /* Philips ATSC */ + [TUNER_PHILIPS_FCV1236D] = { /* Philips ATSC */ .name = "Philips FCV1236D ATSC/NTSC dual in", .params = tuner_philips_fcv1236d_params, .count = ARRAY_SIZE(tuner_philips_fcv1236d_params), diff --git a/linux/drivers/media/video/videobuf-core.c b/linux/drivers/media/video/videobuf-core.c index 86f32545c..164963aa2 100644 --- a/linux/drivers/media/video/videobuf-core.c +++ b/linux/drivers/media/video/videobuf-core.c @@ -121,7 +121,7 @@ int videobuf_iolock(struct videobuf_queue *q, struct videobuf_buffer *vb, void videobuf_queue_core_init(struct videobuf_queue *q, struct videobuf_queue_ops *ops, - void *dev, + struct device *dev, spinlock_t *irqlock, enum v4l2_buf_type type, enum v4l2_field field, @@ -743,14 +743,13 @@ ssize_t videobuf_read_one(struct videobuf_queue *q, { enum v4l2_field field; unsigned long flags = 0; - unsigned size, nbufs; + unsigned size = 0, nbufs = 1; int retval; MAGIC_CHECK(q->int_ops->magic, MAGIC_QTYPE_OPS); mutex_lock(&q->vb_lock); - nbufs = 1; size = 0; q->ops->buf_setup(q, &nbufs, &size); if (NULL == q->read_buf && |