aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/common/ir-common.c18
-rw-r--r--drivers/media/dvb/frontends/cx22702.c15
-rw-r--r--drivers/media/dvb/frontends/cx22702.h3
-rw-r--r--drivers/media/video/Kconfig1
-rw-r--r--drivers/media/video/bttv-driver.c6
-rw-r--r--drivers/media/video/bttv-i2c.c14
-rw-r--r--drivers/media/video/cx88/cx88-core.c5
-rw-r--r--drivers/media/video/cx88/cx88-dvb.c16
-rw-r--r--drivers/media/video/cx88/cx88-i2c.c4
-rw-r--r--drivers/media/video/cx88/cx88-vbi.c6
-rw-r--r--drivers/media/video/cx88/cx88-video.c12
-rw-r--r--drivers/media/video/cx88/cx88.h4
-rw-r--r--drivers/media/video/msp3400.c28
-rw-r--r--drivers/media/video/saa7134/saa6752hs.c89
-rw-r--r--drivers/media/video/saa7134/saa7134-cards.c21
-rw-r--r--drivers/media/video/saa7134/saa7134-dvb.c2
-rw-r--r--drivers/media/video/saa7134/saa7134-empress.c20
-rw-r--r--drivers/media/video/saa7134/saa7134-input.c1
-rw-r--r--drivers/media/video/tuner-core.c14
-rw-r--r--drivers/media/video/tvaudio.c2
20 files changed, 194 insertions, 87 deletions
diff --git a/drivers/media/common/ir-common.c b/drivers/media/common/ir-common.c
index 8c842e2f59a2..84a49d2ec919 100644
--- a/drivers/media/common/ir-common.c
+++ b/drivers/media/common/ir-common.c
@@ -131,10 +131,10 @@ IR_KEYTAB_TYPE ir_codes_winfast[IR_KEYTAB_SIZE] = {
131 [ 18 ] = KEY_KP0, 131 [ 18 ] = KEY_KP0,
132 132
133 [ 0 ] = KEY_POWER, 133 [ 0 ] = KEY_POWER,
134// [ 27 ] = MTS button 134 [ 27 ] = KEY_LANGUAGE, //MTS button
135 [ 2 ] = KEY_TUNER, // TV/FM 135 [ 2 ] = KEY_TUNER, // TV/FM
136 [ 30 ] = KEY_VIDEO, 136 [ 30 ] = KEY_VIDEO,
137// [ 22 ] = display button 137 [ 22 ] = KEY_INFO, //display button
138 [ 4 ] = KEY_VOLUMEUP, 138 [ 4 ] = KEY_VOLUMEUP,
139 [ 8 ] = KEY_VOLUMEDOWN, 139 [ 8 ] = KEY_VOLUMEDOWN,
140 [ 12 ] = KEY_CHANNELUP, 140 [ 12 ] = KEY_CHANNELUP,
@@ -142,7 +142,7 @@ IR_KEYTAB_TYPE ir_codes_winfast[IR_KEYTAB_SIZE] = {
142 [ 3 ] = KEY_ZOOM, // fullscreen 142 [ 3 ] = KEY_ZOOM, // fullscreen
143 [ 31 ] = KEY_SUBTITLE, // closed caption/teletext 143 [ 31 ] = KEY_SUBTITLE, // closed caption/teletext
144 [ 32 ] = KEY_SLEEP, 144 [ 32 ] = KEY_SLEEP,
145// [ 41 ] = boss key 145 [ 41 ] = KEY_SEARCH, //boss key
146 [ 20 ] = KEY_MUTE, 146 [ 20 ] = KEY_MUTE,
147 [ 43 ] = KEY_RED, 147 [ 43 ] = KEY_RED,
148 [ 44 ] = KEY_GREEN, 148 [ 44 ] = KEY_GREEN,
@@ -150,17 +150,17 @@ IR_KEYTAB_TYPE ir_codes_winfast[IR_KEYTAB_SIZE] = {
150 [ 46 ] = KEY_BLUE, 150 [ 46 ] = KEY_BLUE,
151 [ 24 ] = KEY_KPPLUS, //fine tune + 151 [ 24 ] = KEY_KPPLUS, //fine tune +
152 [ 25 ] = KEY_KPMINUS, //fine tune - 152 [ 25 ] = KEY_KPMINUS, //fine tune -
153// [ 42 ] = picture in picture 153 [ 42 ] = KEY_ANGLE, //picture in picture
154 [ 33 ] = KEY_KPDOT, 154 [ 33 ] = KEY_KPDOT,
155 [ 19 ] = KEY_KPENTER, 155 [ 19 ] = KEY_KPENTER,
156// [ 17 ] = recall 156 [ 17 ] = KEY_AGAIN, //recall
157 [ 34 ] = KEY_BACK, 157 [ 34 ] = KEY_BACK,
158 [ 35 ] = KEY_PLAYPAUSE, 158 [ 35 ] = KEY_PLAYPAUSE,
159 [ 36 ] = KEY_NEXT, 159 [ 36 ] = KEY_NEXT,
160// [ 37 ] = time shifting 160 [ 37 ] = KEY_T, //time shifting
161 [ 38 ] = KEY_STOP, 161 [ 38 ] = KEY_STOP,
162 [ 39 ] = KEY_RECORD 162 [ 39 ] = KEY_RECORD,
163// [ 40 ] = snapshot 163 [ 40 ] = KEY_SHUFFLE //snapshot
164}; 164};
165EXPORT_SYMBOL_GPL(ir_codes_winfast); 165EXPORT_SYMBOL_GPL(ir_codes_winfast);
166 166
diff --git a/drivers/media/dvb/frontends/cx22702.c b/drivers/media/dvb/frontends/cx22702.c
index 1930b513eefa..011860ce36cc 100644
--- a/drivers/media/dvb/frontends/cx22702.c
+++ b/drivers/media/dvb/frontends/cx22702.c
@@ -32,6 +32,7 @@
32#include <linux/slab.h> 32#include <linux/slab.h>
33#include <linux/delay.h> 33#include <linux/delay.h>
34#include "dvb_frontend.h" 34#include "dvb_frontend.h"
35#include "dvb-pll.h"
35#include "cx22702.h" 36#include "cx22702.h"
36 37
37 38
@@ -203,7 +204,19 @@ static int cx22702_set_tps (struct dvb_frontend* fe, struct dvb_frontend_paramet
203 204
204 /* set PLL */ 205 /* set PLL */
205 cx22702_writereg (state, 0x0D, cx22702_readreg(state,0x0D) &0xfe); 206 cx22702_writereg (state, 0x0D, cx22702_readreg(state,0x0D) &0xfe);
206 state->config->pll_set(fe, p); 207 if (state->config->pll_set) {
208 state->config->pll_set(fe, p);
209 } else if (state->config->pll_desc) {
210 u8 pllbuf[4];
211 struct i2c_msg msg = { .addr = state->config->pll_address,
212 .buf = pllbuf, .len = 4 };
213 dvb_pll_configure(state->config->pll_desc, pllbuf,
214 p->frequency,
215 p->u.ofdm.bandwidth);
216 i2c_transfer(state->i2c, &msg, 1);
217 } else {
218 BUG();
219 }
207 cx22702_writereg (state, 0x0D, cx22702_readreg(state,0x0D) | 1); 220 cx22702_writereg (state, 0x0D, cx22702_readreg(state,0x0D) | 1);
208 221
209 /* set inversion */ 222 /* set inversion */
diff --git a/drivers/media/dvb/frontends/cx22702.h b/drivers/media/dvb/frontends/cx22702.h
index 6e34f997aba2..559fdb906669 100644
--- a/drivers/media/dvb/frontends/cx22702.h
+++ b/drivers/media/dvb/frontends/cx22702.h
@@ -36,6 +36,9 @@ struct cx22702_config
36 u8 demod_address; 36 u8 demod_address;
37 37
38 /* PLL maintenance */ 38 /* PLL maintenance */
39 u8 pll_address;
40 struct dvb_pll_desc *pll_desc;
41
39 int (*pll_init)(struct dvb_frontend* fe); 42 int (*pll_init)(struct dvb_frontend* fe);
40 int (*pll_set)(struct dvb_frontend* fe, struct dvb_frontend_parameters* params); 43 int (*pll_set)(struct dvb_frontend* fe, struct dvb_frontend_parameters* params);
41}; 44};
diff --git a/drivers/media/video/Kconfig b/drivers/media/video/Kconfig
index c1b3542dad88..d3dd4228b72d 100644
--- a/drivers/media/video/Kconfig
+++ b/drivers/media/video/Kconfig
@@ -252,6 +252,7 @@ config VIDEO_SAA7134_DVB
252 depends on VIDEO_SAA7134 && DVB_CORE 252 depends on VIDEO_SAA7134 && DVB_CORE
253 select VIDEO_BUF_DVB 253 select VIDEO_BUF_DVB
254 select DVB_MT352 254 select DVB_MT352
255 select DVB_CX22702
255 ---help--- 256 ---help---
256 This adds support for DVB cards based on the 257 This adds support for DVB cards based on the
257 Philips saa7134 chip. 258 Philips saa7134 chip.
diff --git a/drivers/media/video/bttv-driver.c b/drivers/media/video/bttv-driver.c
index c13f222fe6bd..033cc5498f23 100644
--- a/drivers/media/video/bttv-driver.c
+++ b/drivers/media/video/bttv-driver.c
@@ -3169,7 +3169,7 @@ static struct video_device radio_template =
3169/* ----------------------------------------------------------------------- */ 3169/* ----------------------------------------------------------------------- */
3170/* some debug code */ 3170/* some debug code */
3171 3171
3172int bttv_risc_decode(u32 risc) 3172static int bttv_risc_decode(u32 risc)
3173{ 3173{
3174 static char *instr[16] = { 3174 static char *instr[16] = {
3175 [ BT848_RISC_WRITE >> 28 ] = "write", 3175 [ BT848_RISC_WRITE >> 28 ] = "write",
@@ -3206,8 +3206,8 @@ int bttv_risc_decode(u32 risc)
3206 return incr[risc >> 28] ? incr[risc >> 28] : 1; 3206 return incr[risc >> 28] ? incr[risc >> 28] : 1;
3207} 3207}
3208 3208
3209void bttv_risc_disasm(struct bttv *btv, 3209static void bttv_risc_disasm(struct bttv *btv,
3210 struct btcx_riscmem *risc) 3210 struct btcx_riscmem *risc)
3211{ 3211{
3212 unsigned int i,j,n; 3212 unsigned int i,j,n;
3213 3213
diff --git a/drivers/media/video/bttv-i2c.c b/drivers/media/video/bttv-i2c.c
index e42f1ec13f3e..e3f477dff827 100644
--- a/drivers/media/video/bttv-i2c.c
+++ b/drivers/media/video/bttv-i2c.c
@@ -29,6 +29,7 @@
29#include <linux/moduleparam.h> 29#include <linux/moduleparam.h>
30#include <linux/init.h> 30#include <linux/init.h>
31#include <linux/delay.h> 31#include <linux/delay.h>
32#include <linux/jiffies.h>
32#include <asm/io.h> 33#include <asm/io.h>
33 34
34#include "bttvp.h" 35#include "bttvp.h"
@@ -130,17 +131,14 @@ static u32 functionality(struct i2c_adapter *adap)
130static int 131static int
131bttv_i2c_wait_done(struct bttv *btv) 132bttv_i2c_wait_done(struct bttv *btv)
132{ 133{
133 DECLARE_WAITQUEUE(wait, current);
134 int rc = 0; 134 int rc = 0;
135 135
136 add_wait_queue(&btv->i2c_queue, &wait); 136 /* timeout */
137 if (0 == btv->i2c_done) 137 if (wait_event_interruptible_timeout(btv->i2c_queue,
138 msleep_interruptible(20); 138 btv->i2c_done, msecs_to_jiffies(85)) == -ERESTARTSYS)
139 remove_wait_queue(&btv->i2c_queue, &wait); 139
140 rc = -EIO;
140 141
141 if (0 == btv->i2c_done)
142 /* timeout */
143 rc = -EIO;
144 if (btv->i2c_done & BT848_INT_RACK) 142 if (btv->i2c_done & BT848_INT_RACK)
145 rc = 1; 143 rc = 1;
146 btv->i2c_done = 0; 144 btv->i2c_done = 0;
diff --git a/drivers/media/video/cx88/cx88-core.c b/drivers/media/video/cx88/cx88-core.c
index 26a6138015cb..1ff79b5a8835 100644
--- a/drivers/media/video/cx88/cx88-core.c
+++ b/drivers/media/video/cx88/cx88-core.c
@@ -429,7 +429,7 @@ int cx88_sram_channel_setup(struct cx88_core *core,
429/* ------------------------------------------------------------------ */ 429/* ------------------------------------------------------------------ */
430/* debug helper code */ 430/* debug helper code */
431 431
432int cx88_risc_decode(u32 risc) 432static int cx88_risc_decode(u32 risc)
433{ 433{
434 static char *instr[16] = { 434 static char *instr[16] = {
435 [ RISC_SYNC >> 28 ] = "sync", 435 [ RISC_SYNC >> 28 ] = "sync",
@@ -542,7 +542,7 @@ void cx88_sram_channel_dump(struct cx88_core *core,
542 core->name,cx_read(ch->cnt2_reg)); 542 core->name,cx_read(ch->cnt2_reg));
543} 543}
544 544
545char *cx88_pci_irqs[32] = { 545static char *cx88_pci_irqs[32] = {
546 "vid", "aud", "ts", "vip", "hst", "5", "6", "tm1", 546 "vid", "aud", "ts", "vip", "hst", "5", "6", "tm1",
547 "src_dma", "dst_dma", "risc_rd_err", "risc_wr_err", 547 "src_dma", "dst_dma", "risc_rd_err", "risc_wr_err",
548 "brdg_err", "src_dma_err", "dst_dma_err", "ipb_dma_err", 548 "brdg_err", "src_dma_err", "dst_dma_err", "ipb_dma_err",
@@ -1206,7 +1206,6 @@ void cx88_core_put(struct cx88_core *core, struct pci_dev *pci)
1206/* ------------------------------------------------------------------ */ 1206/* ------------------------------------------------------------------ */
1207 1207
1208EXPORT_SYMBOL(cx88_print_ioctl); 1208EXPORT_SYMBOL(cx88_print_ioctl);
1209EXPORT_SYMBOL(cx88_pci_irqs);
1210EXPORT_SYMBOL(cx88_vid_irqs); 1209EXPORT_SYMBOL(cx88_vid_irqs);
1211EXPORT_SYMBOL(cx88_mpeg_irqs); 1210EXPORT_SYMBOL(cx88_mpeg_irqs);
1212EXPORT_SYMBOL(cx88_print_irqbits); 1211EXPORT_SYMBOL(cx88_print_irqbits);
diff --git a/drivers/media/video/cx88/cx88-dvb.c b/drivers/media/video/cx88/cx88-dvb.c
index bc6f18c45357..9d15d3d5a2b7 100644
--- a/drivers/media/video/cx88/cx88-dvb.c
+++ b/drivers/media/video/cx88/cx88-dvb.c
@@ -31,7 +31,7 @@
31#include <linux/suspend.h> 31#include <linux/suspend.h>
32 32
33/* those two frontends need merging via linuxtv cvs ... */ 33/* those two frontends need merging via linuxtv cvs ... */
34#define HAVE_CX22702 0 34#define HAVE_CX22702 1
35#define HAVE_OR51132 1 35#define HAVE_OR51132 1
36 36
37#include "cx88.h" 37#include "cx88.h"
@@ -91,7 +91,7 @@ static void dvb_buf_release(struct videobuf_queue *q, struct videobuf_buffer *vb
91 cx88_free_buffer(dev->pci, (struct cx88_buffer*)vb); 91 cx88_free_buffer(dev->pci, (struct cx88_buffer*)vb);
92} 92}
93 93
94struct videobuf_queue_ops dvb_qops = { 94static struct videobuf_queue_ops dvb_qops = {
95 .buf_setup = dvb_buf_setup, 95 .buf_setup = dvb_buf_setup,
96 .buf_prepare = dvb_buf_prepare, 96 .buf_prepare = dvb_buf_prepare,
97 .buf_queue = dvb_buf_queue, 97 .buf_queue = dvb_buf_queue,
@@ -191,7 +191,7 @@ static int or51132_set_ts_param(struct dvb_frontend* fe,
191 return 0; 191 return 0;
192} 192}
193 193
194struct or51132_config pchdtv_hd3000 = { 194static struct or51132_config pchdtv_hd3000 = {
195 .demod_address = 0x15, 195 .demod_address = 0x15,
196 .pll_address = 0x61, 196 .pll_address = 0x61,
197 .pll_desc = &dvb_pll_thomson_dtt7610, 197 .pll_desc = &dvb_pll_thomson_dtt7610,
@@ -243,10 +243,8 @@ static int dvb_register(struct cx8802_dev *dev)
243 break; 243 break;
244#endif 244#endif
245 default: 245 default:
246 printk("%s: The frontend of your DVB/ATSC card isn't supported yet\n" 246 printk("%s: The frontend of your DVB/ATSC card isn't supported yet\n",
247 "%s: you might want to look out for patches here:\n" 247 dev->core->name);
248 "%s: http://dl.bytesex.org/patches/\n",
249 dev->core->name, dev->core->name, dev->core->name);
250 break; 248 break;
251 } 249 }
252 if (NULL == dev->dvb.frontend) { 250 if (NULL == dev->dvb.frontend) {
@@ -308,9 +306,11 @@ static int __devinit dvb_probe(struct pci_dev *pci_dev,
308 dev); 306 dev);
309 err = dvb_register(dev); 307 err = dvb_register(dev);
310 if (0 != err) 308 if (0 != err)
311 goto fail_free; 309 goto fail_fini;
312 return 0; 310 return 0;
313 311
312 fail_fini:
313 cx8802_fini_common(dev);
314 fail_free: 314 fail_free:
315 kfree(dev); 315 kfree(dev);
316 fail_core: 316 fail_core:
diff --git a/drivers/media/video/cx88/cx88-i2c.c b/drivers/media/video/cx88/cx88-i2c.c
index 60800172c026..0725b1288f4f 100644
--- a/drivers/media/video/cx88/cx88-i2c.c
+++ b/drivers/media/video/cx88/cx88-i2c.c
@@ -45,7 +45,7 @@ MODULE_PARM_DESC(i2c_scan,"scan i2c bus at insmod time");
45 45
46/* ----------------------------------------------------------------------- */ 46/* ----------------------------------------------------------------------- */
47 47
48void cx8800_bit_setscl(void *data, int state) 48static void cx8800_bit_setscl(void *data, int state)
49{ 49{
50 struct cx88_core *core = data; 50 struct cx88_core *core = data;
51 51
@@ -57,7 +57,7 @@ void cx8800_bit_setscl(void *data, int state)
57 cx_read(MO_I2C); 57 cx_read(MO_I2C);
58} 58}
59 59
60void cx8800_bit_setsda(void *data, int state) 60static void cx8800_bit_setsda(void *data, int state)
61{ 61{
62 struct cx88_core *core = data; 62 struct cx88_core *core = data;
63 63
diff --git a/drivers/media/video/cx88/cx88-vbi.c b/drivers/media/video/cx88/cx88-vbi.c
index 471e508b0746..0584ff476387 100644
--- a/drivers/media/video/cx88/cx88-vbi.c
+++ b/drivers/media/video/cx88/cx88-vbi.c
@@ -46,9 +46,9 @@ void cx8800_vbi_fmt(struct cx8800_dev *dev, struct v4l2_format *f)
46 } 46 }
47} 47}
48 48
49int cx8800_start_vbi_dma(struct cx8800_dev *dev, 49static int cx8800_start_vbi_dma(struct cx8800_dev *dev,
50 struct cx88_dmaqueue *q, 50 struct cx88_dmaqueue *q,
51 struct cx88_buffer *buf) 51 struct cx88_buffer *buf)
52{ 52{
53 struct cx88_core *core = dev->core; 53 struct cx88_core *core = dev->core;
54 54
diff --git a/drivers/media/video/cx88/cx88-video.c b/drivers/media/video/cx88/cx88-video.c
index 701f594e1816..d1f5c92f0ce5 100644
--- a/drivers/media/video/cx88/cx88-video.c
+++ b/drivers/media/video/cx88/cx88-video.c
@@ -325,7 +325,7 @@ static struct cx88_ctrl cx8800_ctls[] = {
325 .shift = 0, 325 .shift = 0,
326 } 326 }
327}; 327};
328const int CX8800_CTLS = ARRAY_SIZE(cx8800_ctls); 328static const int CX8800_CTLS = ARRAY_SIZE(cx8800_ctls);
329 329
330/* ------------------------------------------------------------------- */ 330/* ------------------------------------------------------------------- */
331/* resource management */ 331/* resource management */
@@ -665,7 +665,7 @@ static void buffer_release(struct videobuf_queue *q, struct videobuf_buffer *vb)
665 cx88_free_buffer(fh->dev->pci,buf); 665 cx88_free_buffer(fh->dev->pci,buf);
666} 666}
667 667
668struct videobuf_queue_ops cx8800_video_qops = { 668static struct videobuf_queue_ops cx8800_video_qops = {
669 .buf_setup = buffer_setup, 669 .buf_setup = buffer_setup,
670 .buf_prepare = buffer_prepare, 670 .buf_prepare = buffer_prepare,
671 .buf_queue = buffer_queue, 671 .buf_queue = buffer_queue,
@@ -1924,7 +1924,7 @@ static struct file_operations video_fops =
1924 .llseek = no_llseek, 1924 .llseek = no_llseek,
1925}; 1925};
1926 1926
1927struct video_device cx8800_video_template = 1927static struct video_device cx8800_video_template =
1928{ 1928{
1929 .name = "cx8800-video", 1929 .name = "cx8800-video",
1930 .type = VID_TYPE_CAPTURE|VID_TYPE_TUNER|VID_TYPE_SCALES, 1930 .type = VID_TYPE_CAPTURE|VID_TYPE_TUNER|VID_TYPE_SCALES,
@@ -1933,7 +1933,7 @@ struct video_device cx8800_video_template =
1933 .minor = -1, 1933 .minor = -1,
1934}; 1934};
1935 1935
1936struct video_device cx8800_vbi_template = 1936static struct video_device cx8800_vbi_template =
1937{ 1937{
1938 .name = "cx8800-vbi", 1938 .name = "cx8800-vbi",
1939 .type = VID_TYPE_TELETEXT|VID_TYPE_TUNER, 1939 .type = VID_TYPE_TELETEXT|VID_TYPE_TUNER,
@@ -1951,7 +1951,7 @@ static struct file_operations radio_fops =
1951 .llseek = no_llseek, 1951 .llseek = no_llseek,
1952}; 1952};
1953 1953
1954struct video_device cx8800_radio_template = 1954static struct video_device cx8800_radio_template =
1955{ 1955{
1956 .name = "cx8800-radio", 1956 .name = "cx8800-radio",
1957 .type = VID_TYPE_TUNER, 1957 .type = VID_TYPE_TUNER,
@@ -2226,7 +2226,7 @@ static int cx8800_resume(struct pci_dev *pci_dev)
2226 2226
2227/* ----------------------------------------------------------- */ 2227/* ----------------------------------------------------------- */
2228 2228
2229struct pci_device_id cx8800_pci_tbl[] = { 2229static struct pci_device_id cx8800_pci_tbl[] = {
2230 { 2230 {
2231 .vendor = 0x14f1, 2231 .vendor = 0x14f1,
2232 .device = 0x8800, 2232 .device = 0x8800,
diff --git a/drivers/media/video/cx88/cx88.h b/drivers/media/video/cx88/cx88.h
index b351d9eae615..88eaaaba5ad8 100644
--- a/drivers/media/video/cx88/cx88.h
+++ b/drivers/media/video/cx88/cx88.h
@@ -420,7 +420,6 @@ struct cx8802_dev {
420/* ----------------------------------------------------------- */ 420/* ----------------------------------------------------------- */
421/* cx88-core.c */ 421/* cx88-core.c */
422 422
423extern char *cx88_pci_irqs[32];
424extern char *cx88_vid_irqs[32]; 423extern char *cx88_vid_irqs[32];
425extern char *cx88_mpeg_irqs[32]; 424extern char *cx88_mpeg_irqs[32];
426extern void cx88_print_irqbits(char *name, char *tag, char **strings, 425extern void cx88_print_irqbits(char *name, char *tag, char **strings,
@@ -472,9 +471,6 @@ extern void cx88_core_put(struct cx88_core *core,
472/* cx88-vbi.c */ 471/* cx88-vbi.c */
473 472
474void cx8800_vbi_fmt(struct cx8800_dev *dev, struct v4l2_format *f); 473void cx8800_vbi_fmt(struct cx8800_dev *dev, struct v4l2_format *f);
475int cx8800_start_vbi_dma(struct cx8800_dev *dev,
476 struct cx88_dmaqueue *q,
477 struct cx88_buffer *buf);
478int cx8800_stop_vbi_dma(struct cx8800_dev *dev); 474int cx8800_stop_vbi_dma(struct cx8800_dev *dev);
479int cx8800_restart_vbi_queue(struct cx8800_dev *dev, 475int cx8800_restart_vbi_queue(struct cx8800_dev *dev,
480 struct cx88_dmaqueue *q); 476 struct cx88_dmaqueue *q);
diff --git a/drivers/media/video/msp3400.c b/drivers/media/video/msp3400.c
index c97df705df5e..7fbb8581a87d 100644
--- a/drivers/media/video/msp3400.c
+++ b/drivers/media/video/msp3400.c
@@ -380,7 +380,9 @@ static void msp3400c_setvolume(struct i2c_client *client,
380 int val = 0, bal = 0; 380 int val = 0, bal = 0;
381 381
382 if (!muted) { 382 if (!muted) {
383 val = (volume * 0x7F / 65535) << 8; 383 /* 0x7f instead if 0x73 here has sound quality issues,
384 * probably due to overmodulation + clipping ... */
385 val = (volume * 0x73 / 65535) << 8;
384 } 386 }
385 if (val) { 387 if (val) {
386 bal = (balance / 256) - 128; 388 bal = (balance / 256) - 128;
@@ -997,7 +999,13 @@ static int msp34xx_modus(int norm)
997{ 999{
998 switch (norm) { 1000 switch (norm) {
999 case VIDEO_MODE_PAL: 1001 case VIDEO_MODE_PAL:
1002#if 1
1003 /* experimental: not sure this works with all chip versions */
1004 return 0x7003;
1005#else
1006 /* previous value, try this if it breaks ... */
1000 return 0x1003; 1007 return 0x1003;
1008#endif
1001 case VIDEO_MODE_NTSC: /* BTSC */ 1009 case VIDEO_MODE_NTSC: /* BTSC */
1002 return 0x2003; 1010 return 0x2003;
1003 case VIDEO_MODE_SECAM: 1011 case VIDEO_MODE_SECAM:
@@ -1264,6 +1272,7 @@ static int msp34xxg_thread(void *data)
1264 int val, std, i; 1272 int val, std, i;
1265 1273
1266 printk("msp34xxg: daemon started\n"); 1274 printk("msp34xxg: daemon started\n");
1275 msp->source = 1; /* default */
1267 for (;;) { 1276 for (;;) {
1268 d2printk(KERN_DEBUG "msp34xxg: thread: sleep\n"); 1277 d2printk(KERN_DEBUG "msp34xxg: thread: sleep\n");
1269 msp34xx_sleep(msp,-1); 1278 msp34xx_sleep(msp,-1);
@@ -1334,8 +1343,9 @@ static void msp34xxg_set_source(struct i2c_client *client, int source)
1334 1343
1335 /* fix matrix mode to stereo and let the msp choose what 1344 /* fix matrix mode to stereo and let the msp choose what
1336 * to output according to 'source', as recommended 1345 * to output according to 'source', as recommended
1346 * for MONO (source==0) downmixing set bit[7:0] to 0x30
1337 */ 1347 */
1338 int value = (source&0x07)<<8|(source==0 ? 0x00:0x20); 1348 int value = (source&0x07)<<8|(source==0 ? 0x30:0x20);
1339 dprintk("msp34xxg: set source to %d (0x%x)\n", source, value); 1349 dprintk("msp34xxg: set source to %d (0x%x)\n", source, value);
1340 msp3400c_write(client, 1350 msp3400c_write(client,
1341 I2C_MSP3400C_DFP, 1351 I2C_MSP3400C_DFP,
@@ -1359,7 +1369,7 @@ static void msp34xxg_set_source(struct i2c_client *client, int source)
1359 msp3400c_write(client, 1369 msp3400c_write(client,
1360 I2C_MSP3400C_DEM, 1370 I2C_MSP3400C_DEM,
1361 0x22, /* a2 threshold for stereo/bilingual */ 1371 0x22, /* a2 threshold for stereo/bilingual */
1362 source==0 ? 0x7f0:stereo_threshold); 1372 stereo_threshold);
1363 msp->source=source; 1373 msp->source=source;
1364} 1374}
1365 1375
@@ -1394,7 +1404,7 @@ static void msp34xxg_detect_stereo(struct i2c_client *client)
1394static void msp34xxg_set_audmode(struct i2c_client *client, int audmode) 1404static void msp34xxg_set_audmode(struct i2c_client *client, int audmode)
1395{ 1405{
1396 struct msp3400c *msp = i2c_get_clientdata(client); 1406 struct msp3400c *msp = i2c_get_clientdata(client);
1397 int source = 0; 1407 int source;
1398 1408
1399 switch (audmode) { 1409 switch (audmode) {
1400 case V4L2_TUNER_MODE_MONO: 1410 case V4L2_TUNER_MODE_MONO:
@@ -1410,9 +1420,10 @@ static void msp34xxg_set_audmode(struct i2c_client *client, int audmode)
1410 case V4L2_TUNER_MODE_LANG2: 1420 case V4L2_TUNER_MODE_LANG2:
1411 source=4; /* stereo or B */ 1421 source=4; /* stereo or B */
1412 break; 1422 break;
1413 default: /* doing nothing: a safe, sane default */ 1423 default:
1414 audmode = 0; 1424 audmode = 0;
1415 return; 1425 source = 1;
1426 break;
1416 } 1427 }
1417 msp->audmode = audmode; 1428 msp->audmode = audmode;
1418 msp34xxg_set_source(client, source); 1429 msp34xxg_set_source(client, source);
@@ -1514,12 +1525,9 @@ static int msp_attach(struct i2c_adapter *adap, int addr, int kind)
1514 1525
1515 msp->opmode = opmode; 1526 msp->opmode = opmode;
1516 if (OPMODE_AUTO == msp->opmode) { 1527 if (OPMODE_AUTO == msp->opmode) {
1517#if 0 /* seems to work for ivtv only, disable by default for now ... */
1518 if (HAVE_SIMPLER(msp)) 1528 if (HAVE_SIMPLER(msp))
1519 msp->opmode = OPMODE_SIMPLER; 1529 msp->opmode = OPMODE_SIMPLER;
1520 else 1530 else if (HAVE_SIMPLE(msp))
1521#endif
1522 if (HAVE_SIMPLE(msp))
1523 msp->opmode = OPMODE_SIMPLE; 1531 msp->opmode = OPMODE_SIMPLE;
1524 else 1532 else
1525 msp->opmode = OPMODE_MANUAL; 1533 msp->opmode = OPMODE_MANUAL;
diff --git a/drivers/media/video/saa7134/saa6752hs.c b/drivers/media/video/saa7134/saa6752hs.c
index cee13584c9cf..fe6abe34168c 100644
--- a/drivers/media/video/saa7134/saa6752hs.c
+++ b/drivers/media/video/saa7134/saa6752hs.c
@@ -32,9 +32,32 @@ MODULE_LICENSE("GPL");
32static struct i2c_driver driver; 32static struct i2c_driver driver;
33static struct i2c_client client_template; 33static struct i2c_client client_template;
34 34
35enum saa6752hs_videoformat {
36 SAA6752HS_VF_D1 = 0, /* standard D1 video format: 720x576 */
37 SAA6752HS_VF_2_3_D1 = 1,/* 2/3D1 video format: 480x576 */
38 SAA6752HS_VF_1_2_D1 = 2,/* 1/2D1 video format: 352x576 */
39 SAA6752HS_VF_SIF = 3, /* SIF video format: 352x288 */
40 SAA6752HS_VF_UNKNOWN,
41};
42
43static const struct v4l2_format v4l2_format_table[] =
44{
45 [SAA6752HS_VF_D1] = {
46 .fmt.pix.width = 720, .fmt.pix.height = 576 },
47 [SAA6752HS_VF_2_3_D1] = {
48 .fmt.pix.width = 480, .fmt.pix.height = 576 },
49 [SAA6752HS_VF_1_2_D1] = {
50 .fmt.pix.width = 352, .fmt.pix.height = 576 },
51 [SAA6752HS_VF_SIF] = {
52 .fmt.pix.width = 352, .fmt.pix.height = 288 },
53 [SAA6752HS_VF_UNKNOWN] = {
54 .fmt.pix.width = 0, .fmt.pix.height = 0},
55};
56
35struct saa6752hs_state { 57struct saa6752hs_state {
36 struct i2c_client client; 58 struct i2c_client client;
37 struct v4l2_mpeg_compression params; 59 struct v4l2_mpeg_compression params;
60 enum saa6752hs_videoformat video_format;
38}; 61};
39 62
40enum saa6752hs_command { 63enum saa6752hs_command {
@@ -256,6 +279,51 @@ static int saa6752hs_set_bitrate(struct i2c_client* client,
256 return 0; 279 return 0;
257} 280}
258 281
282static void saa6752hs_set_subsampling(struct i2c_client* client,
283 struct v4l2_format* f)
284{
285 struct saa6752hs_state *h = i2c_get_clientdata(client);
286 int dist_352, dist_480, dist_720;
287
288 /*
289 FIXME: translate and round width/height into EMPRESS
290 subsample type:
291
292 type | PAL | NTSC
293 ---------------------------
294 SIF | 352x288 | 352x240
295 1/2 D1 | 352x576 | 352x480
296 2/3 D1 | 480x576 | 480x480
297 D1 | 720x576 | 720x480
298 */
299
300 dist_352 = abs(f->fmt.pix.width - 352);
301 dist_480 = abs(f->fmt.pix.width - 480);
302 dist_720 = abs(f->fmt.pix.width - 720);
303 if (dist_720 < dist_480) {
304 f->fmt.pix.width = 720;
305 f->fmt.pix.height = 576;
306 h->video_format = SAA6752HS_VF_D1;
307 }
308 else if (dist_480 < dist_352) {
309 f->fmt.pix.width = 480;
310 f->fmt.pix.height = 576;
311 h->video_format = SAA6752HS_VF_2_3_D1;
312 }
313 else {
314 f->fmt.pix.width = 352;
315 if (abs(f->fmt.pix.height - 576) <
316 abs(f->fmt.pix.height - 288)) {
317 f->fmt.pix.height = 576;
318 h->video_format = SAA6752HS_VF_1_2_D1;
319 }
320 else {
321 f->fmt.pix.height = 288;
322 h->video_format = SAA6752HS_VF_SIF;
323 }
324 }
325}
326
259 327
260static void saa6752hs_set_params(struct i2c_client* client, 328static void saa6752hs_set_params(struct i2c_client* client,
261 struct v4l2_mpeg_compression* params) 329 struct v4l2_mpeg_compression* params)
@@ -315,7 +383,7 @@ static int saa6752hs_init(struct i2c_client* client)
315 383
316 // Set video format - must be done first as it resets other settings 384 // Set video format - must be done first as it resets other settings
317 buf[0] = 0x41; 385 buf[0] = 0x41;
318 buf[1] = 0 /* MPEG_VIDEO_FORMAT_D1 */; 386 buf[1] = h->video_format;
319 i2c_master_send(client, buf, 2); 387 i2c_master_send(client, buf, 2);
320 388
321 // set bitrate 389 // set bitrate
@@ -494,6 +562,25 @@ saa6752hs_command(struct i2c_client *client, unsigned int cmd, void *arg)
494 case VIDIOC_G_MPEGCOMP: 562 case VIDIOC_G_MPEGCOMP:
495 *params = h->params; 563 *params = h->params;
496 break; 564 break;
565 case VIDIOC_G_FMT:
566 {
567 struct v4l2_format *f = arg;
568
569 if (h->video_format == SAA6752HS_VF_UNKNOWN)
570 h->video_format = SAA6752HS_VF_D1;
571 f->fmt.pix.width =
572 v4l2_format_table[h->video_format].fmt.pix.width;
573 f->fmt.pix.height =
574 v4l2_format_table[h->video_format].fmt.pix.height;
575 break ;
576 }
577 case VIDIOC_S_FMT:
578 {
579 struct v4l2_format *f = arg;
580
581 saa6752hs_set_subsampling(client, f);
582 break;
583 }
497 default: 584 default:
498 /* nothing */ 585 /* nothing */
499 break; 586 break;
diff --git a/drivers/media/video/saa7134/saa7134-cards.c b/drivers/media/video/saa7134/saa7134-cards.c
index 180d3175ea5b..c51eb7f078d3 100644
--- a/drivers/media/video/saa7134/saa7134-cards.c
+++ b/drivers/media/video/saa7134/saa7134-cards.c
@@ -183,12 +183,12 @@ struct saa7134_board saa7134_boards[] = {
183 .name = "LifeView FlyTV Platinum FM", 183 .name = "LifeView FlyTV Platinum FM",
184 .audio_clock = 0x00200000, 184 .audio_clock = 0x00200000,
185 .tuner_type = TUNER_PHILIPS_TDA8290, 185 .tuner_type = TUNER_PHILIPS_TDA8290,
186// .gpiomask = 0xe000, 186 .gpiomask = 0x1E000, /* Set GP16 and unused 15,14,13 to Output */
187 .inputs = {{ 187 .inputs = {{
188 .name = name_tv, 188 .name = name_tv,
189 .vmux = 1, 189 .vmux = 1,
190 .amux = TV, 190 .amux = TV,
191// .gpio = 0x0000, 191 .gpio = 0x10000, /* GP16=1 selects TV input */
192 .tv = 1, 192 .tv = 1,
193 },{ 193 },{
194/* .name = name_tv_mono, 194/* .name = name_tv_mono,
@@ -212,12 +212,12 @@ struct saa7134_board saa7134_boards[] = {
212 .amux = LINE2, 212 .amux = LINE2,
213// .gpio = 0x4000, 213// .gpio = 0x4000,
214 }}, 214 }},
215/* .radio = { 215 .radio = {
216 .name = name_radio, 216 .name = name_radio,
217 .amux = LINE2, 217 .amux = TV,
218 .gpio = 0x2000, 218 .gpio = 0x00000, /* GP16=0 selects FM radio antenna */
219 }, 219 },
220*/ }, 220 },
221 [SAA7134_BOARD_EMPRESS] = { 221 [SAA7134_BOARD_EMPRESS] = {
222 /* "Gert Vervoort" <gert.vervoort@philips.com> */ 222 /* "Gert Vervoort" <gert.vervoort@philips.com> */
223 .name = "EMPRESS", 223 .name = "EMPRESS",
@@ -1628,11 +1628,17 @@ struct pci_device_id saa7134_pci_tbl[] = {
1628 },{ 1628 },{
1629 .vendor = PCI_VENDOR_ID_PHILIPS, 1629 .vendor = PCI_VENDOR_ID_PHILIPS,
1630 .device = PCI_DEVICE_ID_PHILIPS_SAA7133, 1630 .device = PCI_DEVICE_ID_PHILIPS_SAA7133,
1631 .subvendor = 0x5168, 1631 .subvendor = 0x5168, /* Animation Technologies (LifeView) */
1632 .subdevice = 0x0214, /* Standard PCI, LR214WF */ 1632 .subdevice = 0x0214, /* Standard PCI, LR214WF */
1633 .driver_data = SAA7134_BOARD_FLYTVPLATINUM_FM, 1633 .driver_data = SAA7134_BOARD_FLYTVPLATINUM_FM,
1634 },{ 1634 },{
1635 .vendor = PCI_VENDOR_ID_PHILIPS, 1635 .vendor = PCI_VENDOR_ID_PHILIPS,
1636 .device = PCI_DEVICE_ID_PHILIPS_SAA7133,
1637 .subvendor = 0x1489, /* KYE */
1638 .subdevice = 0x0214, /* Genius VideoWonder ProTV */
1639 .driver_data = SAA7134_BOARD_FLYTVPLATINUM_FM, /* is an LR214WF actually */
1640 },{
1641 .vendor = PCI_VENDOR_ID_PHILIPS,
1636 .device = PCI_DEVICE_ID_PHILIPS_SAA7134, 1642 .device = PCI_DEVICE_ID_PHILIPS_SAA7134,
1637 .subvendor = 0x16be, 1643 .subvendor = 0x16be,
1638 .subdevice = 0x0003, 1644 .subdevice = 0x0003,
@@ -1948,6 +1954,7 @@ int saa7134_board_init1(struct saa7134_dev *dev)
1948 dev->has_remote = 1; 1954 dev->has_remote = 1;
1949 board_flyvideo(dev); 1955 board_flyvideo(dev);
1950 break; 1956 break;
1957 case SAA7134_BOARD_FLYTVPLATINUM_FM:
1951 case SAA7134_BOARD_CINERGY400: 1958 case SAA7134_BOARD_CINERGY400:
1952 case SAA7134_BOARD_CINERGY600: 1959 case SAA7134_BOARD_CINERGY600:
1953 case SAA7134_BOARD_CINERGY600_MK3: 1960 case SAA7134_BOARD_CINERGY600_MK3:
diff --git a/drivers/media/video/saa7134/saa7134-dvb.c b/drivers/media/video/saa7134/saa7134-dvb.c
index dd4a6c8ee65f..c2873ae029f9 100644
--- a/drivers/media/video/saa7134/saa7134-dvb.c
+++ b/drivers/media/video/saa7134/saa7134-dvb.c
@@ -172,7 +172,7 @@ static int fe_request_firmware(struct dvb_frontend* fe,
172 return request_firmware(fw, name, &dev->pci->dev); 172 return request_firmware(fw, name, &dev->pci->dev);
173} 173}
174 174
175struct tda1004x_config medion_cardbus = { 175static struct tda1004x_config medion_cardbus = {
176 .demod_address = 0x08, /* not sure this is correct */ 176 .demod_address = 0x08, /* not sure this is correct */
177 .invert = 0, 177 .invert = 0,
178 .invert_oclk = 0, 178 .invert_oclk = 0,
diff --git a/drivers/media/video/saa7134/saa7134-empress.c b/drivers/media/video/saa7134/saa7134-empress.c
index 2021e099e35a..fa1357336907 100644
--- a/drivers/media/video/saa7134/saa7134-empress.c
+++ b/drivers/media/video/saa7134/saa7134-empress.c
@@ -233,10 +233,7 @@ static int ts_do_ioctl(struct inode *inode, struct file *file,
233 memset(f,0,sizeof(*f)); 233 memset(f,0,sizeof(*f));
234 f->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; 234 f->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
235 235
236 /* FIXME: translate subsampling type EMPRESS into 236 saa7134_i2c_call_clients(dev, cmd, arg);
237 * width/height: */
238 f->fmt.pix.width = 720; /* D1 */
239 f->fmt.pix.height = 576;
240 f->fmt.pix.pixelformat = V4L2_PIX_FMT_MPEG; 237 f->fmt.pix.pixelformat = V4L2_PIX_FMT_MPEG;
241 f->fmt.pix.sizeimage = TS_PACKET_SIZE * dev->ts.nr_packets; 238 f->fmt.pix.sizeimage = TS_PACKET_SIZE * dev->ts.nr_packets;
242 return 0; 239 return 0;
@@ -249,20 +246,7 @@ static int ts_do_ioctl(struct inode *inode, struct file *file,
249 if (f->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) 246 if (f->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
250 return -EINVAL; 247 return -EINVAL;
251 248
252 /* 249 saa7134_i2c_call_clients(dev, cmd, arg);
253 FIXME: translate and round width/height into EMPRESS
254 subsample type:
255
256 type | PAL | NTSC
257 ---------------------------
258 SIF | 352x288 | 352x240
259 1/2 D1 | 352x576 | 352x480
260 2/3 D1 | 480x576 | 480x480
261 D1 | 720x576 | 720x480
262 */
263
264 f->fmt.pix.width = 720; /* D1 */
265 f->fmt.pix.height = 576;
266 f->fmt.pix.pixelformat = V4L2_PIX_FMT_MPEG; 250 f->fmt.pix.pixelformat = V4L2_PIX_FMT_MPEG;
267 f->fmt.pix.sizeimage = TS_PACKET_SIZE* dev->ts.nr_packets; 251 f->fmt.pix.sizeimage = TS_PACKET_SIZE* dev->ts.nr_packets;
268 return 0; 252 return 0;
diff --git a/drivers/media/video/saa7134/saa7134-input.c b/drivers/media/video/saa7134/saa7134-input.c
index 727d437e07df..ca50cf531f20 100644
--- a/drivers/media/video/saa7134/saa7134-input.c
+++ b/drivers/media/video/saa7134/saa7134-input.c
@@ -379,6 +379,7 @@ int saa7134_input_init1(struct saa7134_dev *dev)
379 switch (dev->board) { 379 switch (dev->board) {
380 case SAA7134_BOARD_FLYVIDEO2000: 380 case SAA7134_BOARD_FLYVIDEO2000:
381 case SAA7134_BOARD_FLYVIDEO3000: 381 case SAA7134_BOARD_FLYVIDEO3000:
382 case SAA7134_BOARD_FLYTVPLATINUM_FM:
382 ir_codes = flyvideo_codes; 383 ir_codes = flyvideo_codes;
383 mask_keycode = 0xEC00000; 384 mask_keycode = 0xEC00000;
384 mask_keydown = 0x0040000; 385 mask_keydown = 0x0040000;
diff --git a/drivers/media/video/tuner-core.c b/drivers/media/video/tuner-core.c
index 881a0539fc17..6212388edb75 100644
--- a/drivers/media/video/tuner-core.c
+++ b/drivers/media/video/tuner-core.c
@@ -357,8 +357,16 @@ tuner_command(struct i2c_client *client, unsigned int cmd, void *arg)
357 V4L2_TUNER_RADIO != t->mode) 357 V4L2_TUNER_RADIO != t->mode)
358 set_tv_freq(client,400*16); 358 set_tv_freq(client,400*16);
359 t->mode = f->type; 359 t->mode = f->type;
360 t->freq = f->frequency; 360 set_freq(client,f->frequency);
361 set_freq(client,t->freq); 361 break;
362 }
363 case VIDIOC_G_FREQUENCY:
364 {
365 struct v4l2_frequency *f = arg;
366
367 SWITCH_V4L2;
368 f->type = t->mode;
369 f->frequency = t->freq;
362 break; 370 break;
363 } 371 }
364 case VIDIOC_G_TUNER: 372 case VIDIOC_G_TUNER:
@@ -368,6 +376,8 @@ tuner_command(struct i2c_client *client, unsigned int cmd, void *arg)
368 SWITCH_V4L2; 376 SWITCH_V4L2;
369 if (V4L2_TUNER_RADIO == t->mode && t->has_signal) 377 if (V4L2_TUNER_RADIO == t->mode && t->has_signal)
370 tuner->signal = t->has_signal(client); 378 tuner->signal = t->has_signal(client);
379 tuner->rangelow = tv_range[0] * 16;
380 tuner->rangehigh = tv_range[1] * 16;
371 break; 381 break;
372 } 382 }
373 default: 383 default:
diff --git a/drivers/media/video/tvaudio.c b/drivers/media/video/tvaudio.c
index 065eb4007b1d..80dc34f18c2c 100644
--- a/drivers/media/video/tvaudio.c
+++ b/drivers/media/video/tvaudio.c
@@ -991,7 +991,7 @@ static int tda9874a_initialize(struct CHIPSTATE *chip)
991{ 991{
992 if (tda9874a_SIF > 2) 992 if (tda9874a_SIF > 2)
993 tda9874a_SIF = 1; 993 tda9874a_SIF = 1;
994 if (tda9874a_STD >= 8) 994 if (tda9874a_STD > 8)
995 tda9874a_STD = 0; 995 tda9874a_STD = 0;
996 if(tda9874a_AMSEL > 1) 996 if(tda9874a_AMSEL > 1)
997 tda9874a_AMSEL = 0; 997 tda9874a_AMSEL = 0;