aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2006-01-15 18:01:27 -0500
committerMauro Carvalho Chehab <mchehab@infradead.org>2006-01-15 18:01:27 -0500
commitd04ae27bae42bcce1b3fa70ca2edf25d92b1cf39 (patch)
tree1bf8070b7cff7a5f1375a141c51edcd92e3e3c6a /drivers/media
parentf1dccedc8148026d9071c6805f7cb77374a9e56f (diff)
parente0ad8486266c3415ab9c17f5c03c47edc7b93d7b (diff)
Merge branch 'work'
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/dvb/dvb-core/dvbdev.c22
-rw-r--r--drivers/media/dvb/ttpci/av7110_hw.c40
-rw-r--r--drivers/media/dvb/ttpci/av7110_hw.h12
-rw-r--r--drivers/media/video/cx25840/cx25840-core.c2
-rw-r--r--drivers/media/video/cx88/Kconfig3
-rw-r--r--drivers/media/video/cx88/cx88-alsa.c1
-rw-r--r--drivers/media/video/cx88/cx88-core.c15
-rw-r--r--drivers/media/video/cx88/cx88-tvaudio.c8
-rw-r--r--drivers/media/video/em28xx/em28xx-video.c7
-rw-r--r--drivers/media/video/saa7134/saa7134-cards.c6
-rw-r--r--drivers/media/video/saa7134/saa7134-core.c19
-rw-r--r--drivers/media/video/saa7134/saa7134-tvaudio.c11
-rw-r--r--drivers/media/video/tvp5150.c2
-rw-r--r--drivers/media/video/videodev.c25
14 files changed, 95 insertions, 78 deletions
diff --git a/drivers/media/dvb/dvb-core/dvbdev.c b/drivers/media/dvb/dvb-core/dvbdev.c
index 06b696e9acbd..54f8b95717b0 100644
--- a/drivers/media/dvb/dvb-core/dvbdev.c
+++ b/drivers/media/dvb/dvb-core/dvbdev.c
@@ -33,7 +33,7 @@
33#include <linux/device.h> 33#include <linux/device.h>
34#include <linux/fs.h> 34#include <linux/fs.h>
35#include <linux/cdev.h> 35#include <linux/cdev.h>
36 36#include <linux/mutex.h>
37#include "dvbdev.h" 37#include "dvbdev.h"
38 38
39static int dvbdev_debug; 39static int dvbdev_debug;
@@ -44,7 +44,7 @@ MODULE_PARM_DESC(dvbdev_debug, "Turn on/off device debugging (default:off).");
44#define dprintk if (dvbdev_debug) printk 44#define dprintk if (dvbdev_debug) printk
45 45
46static LIST_HEAD(dvb_adapter_list); 46static LIST_HEAD(dvb_adapter_list);
47static DECLARE_MUTEX(dvbdev_register_lock); 47static DEFINE_MUTEX(dvbdev_register_lock);
48 48
49static const char * const dnames[] = { 49static const char * const dnames[] = {
50 "video", "audio", "sec", "frontend", "demux", "dvr", "ca", 50 "video", "audio", "sec", "frontend", "demux", "dvr", "ca",
@@ -202,11 +202,11 @@ int dvb_register_device(struct dvb_adapter *adap, struct dvb_device **pdvbdev,
202 struct dvb_device *dvbdev; 202 struct dvb_device *dvbdev;
203 int id; 203 int id;
204 204
205 if (down_interruptible (&dvbdev_register_lock)) 205 if (mutex_lock_interruptible(&dvbdev_register_lock))
206 return -ERESTARTSYS; 206 return -ERESTARTSYS;
207 207
208 if ((id = dvbdev_get_free_id (adap, type)) < 0) { 208 if ((id = dvbdev_get_free_id (adap, type)) < 0) {
209 up (&dvbdev_register_lock); 209 mutex_unlock(&dvbdev_register_lock);
210 *pdvbdev = NULL; 210 *pdvbdev = NULL;
211 printk ("%s: could get find free device id...\n", __FUNCTION__); 211 printk ("%s: could get find free device id...\n", __FUNCTION__);
212 return -ENFILE; 212 return -ENFILE;
@@ -215,11 +215,11 @@ int dvb_register_device(struct dvb_adapter *adap, struct dvb_device **pdvbdev,
215 *pdvbdev = dvbdev = kmalloc(sizeof(struct dvb_device), GFP_KERNEL); 215 *pdvbdev = dvbdev = kmalloc(sizeof(struct dvb_device), GFP_KERNEL);
216 216
217 if (!dvbdev) { 217 if (!dvbdev) {
218 up(&dvbdev_register_lock); 218 mutex_unlock(&dvbdev_register_lock);
219 return -ENOMEM; 219 return -ENOMEM;
220 } 220 }
221 221
222 up (&dvbdev_register_lock); 222 mutex_unlock(&dvbdev_register_lock);
223 223
224 memcpy(dvbdev, template, sizeof(struct dvb_device)); 224 memcpy(dvbdev, template, sizeof(struct dvb_device));
225 dvbdev->type = type; 225 dvbdev->type = type;
@@ -289,11 +289,11 @@ int dvb_register_adapter(struct dvb_adapter *adap, const char *name, struct modu
289{ 289{
290 int num; 290 int num;
291 291
292 if (down_interruptible (&dvbdev_register_lock)) 292 if (mutex_lock_interruptible(&dvbdev_register_lock))
293 return -ERESTARTSYS; 293 return -ERESTARTSYS;
294 294
295 if ((num = dvbdev_get_free_adapter_num ()) < 0) { 295 if ((num = dvbdev_get_free_adapter_num ()) < 0) {
296 up (&dvbdev_register_lock); 296 mutex_unlock(&dvbdev_register_lock);
297 return -ENFILE; 297 return -ENFILE;
298 } 298 }
299 299
@@ -309,7 +309,7 @@ int dvb_register_adapter(struct dvb_adapter *adap, const char *name, struct modu
309 309
310 list_add_tail (&adap->list_head, &dvb_adapter_list); 310 list_add_tail (&adap->list_head, &dvb_adapter_list);
311 311
312 up (&dvbdev_register_lock); 312 mutex_unlock(&dvbdev_register_lock);
313 313
314 return num; 314 return num;
315} 315}
@@ -320,10 +320,10 @@ int dvb_unregister_adapter(struct dvb_adapter *adap)
320{ 320{
321 devfs_remove("dvb/adapter%d", adap->num); 321 devfs_remove("dvb/adapter%d", adap->num);
322 322
323 if (down_interruptible (&dvbdev_register_lock)) 323 if (mutex_lock_interruptible(&dvbdev_register_lock))
324 return -ERESTARTSYS; 324 return -ERESTARTSYS;
325 list_del (&adap->list_head); 325 list_del (&adap->list_head);
326 up (&dvbdev_register_lock); 326 mutex_unlock(&dvbdev_register_lock);
327 return 0; 327 return 0;
328} 328}
329EXPORT_SYMBOL(dvb_unregister_adapter); 329EXPORT_SYMBOL(dvb_unregister_adapter);
diff --git a/drivers/media/dvb/ttpci/av7110_hw.c b/drivers/media/dvb/ttpci/av7110_hw.c
index cb377452b57d..b2e63e9fc053 100644
--- a/drivers/media/dvb/ttpci/av7110_hw.c
+++ b/drivers/media/dvb/ttpci/av7110_hw.c
@@ -146,52 +146,52 @@ static int load_dram(struct av7110 *av7110, u32 *data, int len)
146{ 146{
147 int i; 147 int i;
148 int blocks, rest; 148 int blocks, rest;
149 u32 base, bootblock = BOOT_BLOCK; 149 u32 base, bootblock = AV7110_BOOT_BLOCK;
150 150
151 dprintk(4, "%p\n", av7110); 151 dprintk(4, "%p\n", av7110);
152 152
153 blocks = len / BOOT_MAX_SIZE; 153 blocks = len / AV7110_BOOT_MAX_SIZE;
154 rest = len % BOOT_MAX_SIZE; 154 rest = len % AV7110_BOOT_MAX_SIZE;
155 base = DRAM_START_CODE; 155 base = DRAM_START_CODE;
156 156
157 for (i = 0; i < blocks; i++) { 157 for (i = 0; i < blocks; i++) {
158 if (waitdebi(av7110, BOOT_STATE, BOOTSTATE_BUFFER_EMPTY) < 0) { 158 if (waitdebi(av7110, AV7110_BOOT_STATE, BOOTSTATE_BUFFER_EMPTY) < 0) {
159 printk(KERN_ERR "dvb-ttpci: load_dram(): timeout at block %d\n", i); 159 printk(KERN_ERR "dvb-ttpci: load_dram(): timeout at block %d\n", i);
160 return -ETIMEDOUT; 160 return -ETIMEDOUT;
161 } 161 }
162 dprintk(4, "writing DRAM block %d\n", i); 162 dprintk(4, "writing DRAM block %d\n", i);
163 mwdebi(av7110, DEBISWAB, bootblock, 163 mwdebi(av7110, DEBISWAB, bootblock,
164 ((char*)data) + i * BOOT_MAX_SIZE, BOOT_MAX_SIZE); 164 ((char*)data) + i * AV7110_BOOT_MAX_SIZE, AV7110_BOOT_MAX_SIZE);
165 bootblock ^= 0x1400; 165 bootblock ^= 0x1400;
166 iwdebi(av7110, DEBISWAB, BOOT_BASE, swab32(base), 4); 166 iwdebi(av7110, DEBISWAB, AV7110_BOOT_BASE, swab32(base), 4);
167 iwdebi(av7110, DEBINOSWAP, BOOT_SIZE, BOOT_MAX_SIZE, 2); 167 iwdebi(av7110, DEBINOSWAP, AV7110_BOOT_SIZE, AV7110_BOOT_MAX_SIZE, 2);
168 iwdebi(av7110, DEBINOSWAP, BOOT_STATE, BOOTSTATE_BUFFER_FULL, 2); 168 iwdebi(av7110, DEBINOSWAP, AV7110_BOOT_STATE, BOOTSTATE_BUFFER_FULL, 2);
169 base += BOOT_MAX_SIZE; 169 base += AV7110_BOOT_MAX_SIZE;
170 } 170 }
171 171
172 if (rest > 0) { 172 if (rest > 0) {
173 if (waitdebi(av7110, BOOT_STATE, BOOTSTATE_BUFFER_EMPTY) < 0) { 173 if (waitdebi(av7110, AV7110_BOOT_STATE, BOOTSTATE_BUFFER_EMPTY) < 0) {
174 printk(KERN_ERR "dvb-ttpci: load_dram(): timeout at last block\n"); 174 printk(KERN_ERR "dvb-ttpci: load_dram(): timeout at last block\n");
175 return -ETIMEDOUT; 175 return -ETIMEDOUT;
176 } 176 }
177 if (rest > 4) 177 if (rest > 4)
178 mwdebi(av7110, DEBISWAB, bootblock, 178 mwdebi(av7110, DEBISWAB, bootblock,
179 ((char*)data) + i * BOOT_MAX_SIZE, rest); 179 ((char*)data) + i * AV7110_BOOT_MAX_SIZE, rest);
180 else 180 else
181 mwdebi(av7110, DEBISWAB, bootblock, 181 mwdebi(av7110, DEBISWAB, bootblock,
182 ((char*)data) + i * BOOT_MAX_SIZE - 4, rest + 4); 182 ((char*)data) + i * AV7110_BOOT_MAX_SIZE - 4, rest + 4);
183 183
184 iwdebi(av7110, DEBISWAB, BOOT_BASE, swab32(base), 4); 184 iwdebi(av7110, DEBISWAB, AV7110_BOOT_BASE, swab32(base), 4);
185 iwdebi(av7110, DEBINOSWAP, BOOT_SIZE, rest, 2); 185 iwdebi(av7110, DEBINOSWAP, AV7110_BOOT_SIZE, rest, 2);
186 iwdebi(av7110, DEBINOSWAP, BOOT_STATE, BOOTSTATE_BUFFER_FULL, 2); 186 iwdebi(av7110, DEBINOSWAP, AV7110_BOOT_STATE, BOOTSTATE_BUFFER_FULL, 2);
187 } 187 }
188 if (waitdebi(av7110, BOOT_STATE, BOOTSTATE_BUFFER_EMPTY) < 0) { 188 if (waitdebi(av7110, AV7110_BOOT_STATE, BOOTSTATE_BUFFER_EMPTY) < 0) {
189 printk(KERN_ERR "dvb-ttpci: load_dram(): timeout after last block\n"); 189 printk(KERN_ERR "dvb-ttpci: load_dram(): timeout after last block\n");
190 return -ETIMEDOUT; 190 return -ETIMEDOUT;
191 } 191 }
192 iwdebi(av7110, DEBINOSWAP, BOOT_SIZE, 0, 2); 192 iwdebi(av7110, DEBINOSWAP, AV7110_BOOT_SIZE, 0, 2);
193 iwdebi(av7110, DEBINOSWAP, BOOT_STATE, BOOTSTATE_BUFFER_FULL, 2); 193 iwdebi(av7110, DEBINOSWAP, AV7110_BOOT_STATE, BOOTSTATE_BUFFER_FULL, 2);
194 if (waitdebi(av7110, BOOT_STATE, BOOTSTATE_BOOT_COMPLETE) < 0) { 194 if (waitdebi(av7110, AV7110_BOOT_STATE, BOOTSTATE_AV7110_BOOT_COMPLETE) < 0) {
195 printk(KERN_ERR "dvb-ttpci: load_dram(): final handshake timeout\n"); 195 printk(KERN_ERR "dvb-ttpci: load_dram(): final handshake timeout\n");
196 return -ETIMEDOUT; 196 return -ETIMEDOUT;
197 } 197 }
@@ -262,7 +262,7 @@ int av7110_bootarm(struct av7110 *av7110)
262 //saa7146_setgpio(dev, 3, SAA7146_GPIO_INPUT); 262 //saa7146_setgpio(dev, 3, SAA7146_GPIO_INPUT);
263 263
264 mwdebi(av7110, DEBISWAB, DPRAM_BASE, bootcode, sizeof(bootcode)); 264 mwdebi(av7110, DEBISWAB, DPRAM_BASE, bootcode, sizeof(bootcode));
265 iwdebi(av7110, DEBINOSWAP, BOOT_STATE, BOOTSTATE_BUFFER_FULL, 2); 265 iwdebi(av7110, DEBINOSWAP, AV7110_BOOT_STATE, BOOTSTATE_BUFFER_FULL, 2);
266 266
267 if (saa7146_wait_for_debi_done(av7110->dev, 1)) { 267 if (saa7146_wait_for_debi_done(av7110->dev, 1)) {
268 printk(KERN_ERR "dvb-ttpci: av7110_bootarm(): " 268 printk(KERN_ERR "dvb-ttpci: av7110_bootarm(): "
diff --git a/drivers/media/dvb/ttpci/av7110_hw.h b/drivers/media/dvb/ttpci/av7110_hw.h
index 84b83299b8be..4e173c67fbb2 100644
--- a/drivers/media/dvb/ttpci/av7110_hw.h
+++ b/drivers/media/dvb/ttpci/av7110_hw.h
@@ -18,7 +18,7 @@ enum av7110_bootstate
18{ 18{
19 BOOTSTATE_BUFFER_EMPTY = 0, 19 BOOTSTATE_BUFFER_EMPTY = 0,
20 BOOTSTATE_BUFFER_FULL = 1, 20 BOOTSTATE_BUFFER_FULL = 1,
21 BOOTSTATE_BOOT_COMPLETE = 2 21 BOOTSTATE_AV7110_BOOT_COMPLETE = 2
22}; 22};
23 23
24enum av7110_type_rec_play_format 24enum av7110_type_rec_play_format
@@ -295,11 +295,11 @@ enum av7110_command_type {
295#define DPRAM_BASE 0x4000 295#define DPRAM_BASE 0x4000
296 296
297/* boot protocol area */ 297/* boot protocol area */
298#define BOOT_STATE (DPRAM_BASE + 0x3F8) 298#define AV7110_BOOT_STATE (DPRAM_BASE + 0x3F8)
299#define BOOT_SIZE (DPRAM_BASE + 0x3FA) 299#define AV7110_BOOT_SIZE (DPRAM_BASE + 0x3FA)
300#define BOOT_BASE (DPRAM_BASE + 0x3FC) 300#define AV7110_BOOT_BASE (DPRAM_BASE + 0x3FC)
301#define BOOT_BLOCK (DPRAM_BASE + 0x400) 301#define AV7110_BOOT_BLOCK (DPRAM_BASE + 0x400)
302#define BOOT_MAX_SIZE 0xc00 302#define AV7110_BOOT_MAX_SIZE 0xc00
303 303
304/* firmware command protocol area */ 304/* firmware command protocol area */
305#define IRQ_STATE (DPRAM_BASE + 0x0F4) 305#define IRQ_STATE (DPRAM_BASE + 0x0F4)
diff --git a/drivers/media/video/cx25840/cx25840-core.c b/drivers/media/video/cx25840/cx25840-core.c
index 0da744c1d23e..c66c2c1f4809 100644
--- a/drivers/media/video/cx25840/cx25840-core.c
+++ b/drivers/media/video/cx25840/cx25840-core.c
@@ -43,7 +43,7 @@ MODULE_LICENSE("GPL");
43static unsigned short normal_i2c[] = { 0x88 >> 1, I2C_CLIENT_END }; 43static unsigned short normal_i2c[] = { 0x88 >> 1, I2C_CLIENT_END };
44 44
45 45
46int cx25840_debug; 46static int cx25840_debug;
47 47
48module_param_named(debug,cx25840_debug, int, 0644); 48module_param_named(debug,cx25840_debug, int, 0644);
49 49
diff --git a/drivers/media/video/cx88/Kconfig b/drivers/media/video/cx88/Kconfig
index 76fcb4e995c9..53308911ae6e 100644
--- a/drivers/media/video/cx88/Kconfig
+++ b/drivers/media/video/cx88/Kconfig
@@ -31,8 +31,7 @@ config VIDEO_CX88_DVB
31 31
32config VIDEO_CX88_ALSA 32config VIDEO_CX88_ALSA
33 tristate "ALSA DMA audio support" 33 tristate "ALSA DMA audio support"
34 depends on VIDEO_CX88 && SND 34 depends on VIDEO_CX88 && SND && EXPERIMENTAL
35 select SND_PCM_OSS
36 ---help--- 35 ---help---
37 This is a video4linux driver for direct (DMA) audio on 36 This is a video4linux driver for direct (DMA) audio on
38 Conexant 2388x based TV cards. 37 Conexant 2388x based TV cards.
diff --git a/drivers/media/video/cx88/cx88-alsa.c b/drivers/media/video/cx88/cx88-alsa.c
index fd8bc718f0e3..e649f678d47a 100644
--- a/drivers/media/video/cx88/cx88-alsa.c
+++ b/drivers/media/video/cx88/cx88-alsa.c
@@ -805,7 +805,6 @@ static struct pci_driver cx88_audio_pci_driver = {
805 .id_table = cx88_audio_pci_tbl, 805 .id_table = cx88_audio_pci_tbl,
806 .probe = cx88_audio_initdev, 806 .probe = cx88_audio_initdev,
807 .remove = cx88_audio_finidev, 807 .remove = cx88_audio_finidev,
808 SND_PCI_PM_CALLBACKS
809}; 808};
810 809
811/**************************************************************************** 810/****************************************************************************
diff --git a/drivers/media/video/cx88/cx88-core.c b/drivers/media/video/cx88/cx88-core.c
index 194446f28c55..8d6d6a6cf785 100644
--- a/drivers/media/video/cx88/cx88-core.c
+++ b/drivers/media/video/cx88/cx88-core.c
@@ -32,6 +32,7 @@
32#include <linux/pci.h> 32#include <linux/pci.h>
33#include <linux/delay.h> 33#include <linux/delay.h>
34#include <linux/videodev2.h> 34#include <linux/videodev2.h>
35#include <linux/mutex.h>
35 36
36#include "cx88.h" 37#include "cx88.h"
37#include <media/v4l2-common.h> 38#include <media/v4l2-common.h>
@@ -75,7 +76,7 @@ MODULE_PARM_DESC(nocomb,"disable comb filter");
75 76
76static unsigned int cx88_devcount; 77static unsigned int cx88_devcount;
77static LIST_HEAD(cx88_devlist); 78static LIST_HEAD(cx88_devlist);
78static DECLARE_MUTEX(devlist); 79static DEFINE_MUTEX(devlist);
79 80
80#define NO_SYNC_LINE (-1U) 81#define NO_SYNC_LINE (-1U)
81 82
@@ -1036,7 +1037,7 @@ struct cx88_core* cx88_core_get(struct pci_dev *pci)
1036 struct list_head *item; 1037 struct list_head *item;
1037 int i; 1038 int i;
1038 1039
1039 down(&devlist); 1040 mutex_lock(&devlist);
1040 list_for_each(item,&cx88_devlist) { 1041 list_for_each(item,&cx88_devlist) {
1041 core = list_entry(item, struct cx88_core, devlist); 1042 core = list_entry(item, struct cx88_core, devlist);
1042 if (pci->bus->number != core->pci_bus) 1043 if (pci->bus->number != core->pci_bus)
@@ -1047,7 +1048,7 @@ struct cx88_core* cx88_core_get(struct pci_dev *pci)
1047 if (0 != get_ressources(core,pci)) 1048 if (0 != get_ressources(core,pci))
1048 goto fail_unlock; 1049 goto fail_unlock;
1049 atomic_inc(&core->refcount); 1050 atomic_inc(&core->refcount);
1050 up(&devlist); 1051 mutex_unlock(&devlist);
1051 return core; 1052 return core;
1052 } 1053 }
1053 core = kzalloc(sizeof(*core),GFP_KERNEL); 1054 core = kzalloc(sizeof(*core),GFP_KERNEL);
@@ -1122,13 +1123,13 @@ struct cx88_core* cx88_core_get(struct pci_dev *pci)
1122 cx88_card_setup(core); 1123 cx88_card_setup(core);
1123 cx88_ir_init(core,pci); 1124 cx88_ir_init(core,pci);
1124 1125
1125 up(&devlist); 1126 mutex_unlock(&devlist);
1126 return core; 1127 return core;
1127 1128
1128fail_free: 1129fail_free:
1129 kfree(core); 1130 kfree(core);
1130fail_unlock: 1131fail_unlock:
1131 up(&devlist); 1132 mutex_unlock(&devlist);
1132 return NULL; 1133 return NULL;
1133} 1134}
1134 1135
@@ -1140,14 +1141,14 @@ void cx88_core_put(struct cx88_core *core, struct pci_dev *pci)
1140 if (!atomic_dec_and_test(&core->refcount)) 1141 if (!atomic_dec_and_test(&core->refcount))
1141 return; 1142 return;
1142 1143
1143 down(&devlist); 1144 mutex_lock(&devlist);
1144 cx88_ir_fini(core); 1145 cx88_ir_fini(core);
1145 if (0 == core->i2c_rc) 1146 if (0 == core->i2c_rc)
1146 i2c_bit_del_bus(&core->i2c_adap); 1147 i2c_bit_del_bus(&core->i2c_adap);
1147 list_del(&core->devlist); 1148 list_del(&core->devlist);
1148 iounmap(core->lmmio); 1149 iounmap(core->lmmio);
1149 cx88_devcount--; 1150 cx88_devcount--;
1150 up(&devlist); 1151 mutex_unlock(&devlist);
1151 kfree(core); 1152 kfree(core);
1152} 1153}
1153 1154
diff --git a/drivers/media/video/cx88/cx88-tvaudio.c b/drivers/media/video/cx88/cx88-tvaudio.c
index 24118e43e73a..da8d97ce0c4b 100644
--- a/drivers/media/video/cx88/cx88-tvaudio.c
+++ b/drivers/media/video/cx88/cx88-tvaudio.c
@@ -60,6 +60,11 @@ static unsigned int audio_debug = 0;
60module_param(audio_debug, int, 0644); 60module_param(audio_debug, int, 0644);
61MODULE_PARM_DESC(audio_debug, "enable debug messages [audio]"); 61MODULE_PARM_DESC(audio_debug, "enable debug messages [audio]");
62 62
63static unsigned int always_analog = 0;
64module_param(always_analog,int,0644);
65MODULE_PARM_DESC(always_analog,"force analog audio out");
66
67
63#define dprintk(fmt, arg...) if (audio_debug) \ 68#define dprintk(fmt, arg...) if (audio_debug) \
64 printk(KERN_DEBUG "%s/0: " fmt, core->name , ## arg) 69 printk(KERN_DEBUG "%s/0: " fmt, core->name , ## arg)
65 70
@@ -155,7 +160,8 @@ static void set_audio_finish(struct cx88_core *core, u32 ctl)
155 cx_write(AUD_I2SOUTPUTCNTL, 1); 160 cx_write(AUD_I2SOUTPUTCNTL, 1);
156 cx_write(AUD_I2SCNTL, 0); 161 cx_write(AUD_I2SCNTL, 0);
157 /* cx_write(AUD_APB_IN_RATE_ADJ, 0); */ 162 /* cx_write(AUD_APB_IN_RATE_ADJ, 0); */
158 } else { 163 }
164 if ((always_analog) || (!cx88_boards[core->board].blackbird)) {
159 ctl |= EN_DAC_ENABLE; 165 ctl |= EN_DAC_ENABLE;
160 cx_write(AUD_CTL, ctl); 166 cx_write(AUD_CTL, ctl);
161 } 167 }
diff --git a/drivers/media/video/em28xx/em28xx-video.c b/drivers/media/video/em28xx/em28xx-video.c
index 3323dffe26a4..eea304f75176 100644
--- a/drivers/media/video/em28xx/em28xx-video.c
+++ b/drivers/media/video/em28xx/em28xx-video.c
@@ -29,6 +29,7 @@
29#include <linux/i2c.h> 29#include <linux/i2c.h>
30#include <linux/version.h> 30#include <linux/version.h>
31#include <linux/video_decoder.h> 31#include <linux/video_decoder.h>
32#include <linux/mutex.h>
32 33
33#include "em28xx.h" 34#include "em28xx.h"
34#include <media/tuner.h> 35#include <media/tuner.h>
@@ -191,7 +192,7 @@ static struct v4l2_queryctrl saa711x_qctrl[] = {
191 192
192static struct usb_driver em28xx_usb_driver; 193static struct usb_driver em28xx_usb_driver;
193 194
194static DECLARE_MUTEX(em28xx_sysfs_lock); 195static DEFINE_MUTEX(em28xx_sysfs_lock);
195static DECLARE_RWSEM(em28xx_disconnect); 196static DECLARE_RWSEM(em28xx_disconnect);
196 197
197/********************* v4l2 interface ******************************************/ 198/********************* v4l2 interface ******************************************/
@@ -394,7 +395,7 @@ static int em28xx_v4l2_open(struct inode *inode, struct file *filp)
394*/ 395*/
395static void em28xx_release_resources(struct em28xx *dev) 396static void em28xx_release_resources(struct em28xx *dev)
396{ 397{
397 down(&em28xx_sysfs_lock); 398 mutex_lock(&em28xx_sysfs_lock);
398 399
399 em28xx_info("V4L2 device /dev/video%d deregistered\n", 400 em28xx_info("V4L2 device /dev/video%d deregistered\n",
400 dev->vdev->minor); 401 dev->vdev->minor);
@@ -403,7 +404,7 @@ static void em28xx_release_resources(struct em28xx *dev)
403/* video_unregister_device(dev->vbi_dev); */ 404/* video_unregister_device(dev->vbi_dev); */
404 em28xx_i2c_unregister(dev); 405 em28xx_i2c_unregister(dev);
405 usb_put_dev(dev->udev); 406 usb_put_dev(dev->udev);
406 up(&em28xx_sysfs_lock); 407 mutex_unlock(&em28xx_sysfs_lock);
407} 408}
408 409
409/* 410/*
diff --git a/drivers/media/video/saa7134/saa7134-cards.c b/drivers/media/video/saa7134/saa7134-cards.c
index 275d06af69d2..c64718aec9cb 100644
--- a/drivers/media/video/saa7134/saa7134-cards.c
+++ b/drivers/media/video/saa7134/saa7134-cards.c
@@ -2515,6 +2515,7 @@ struct saa7134_board saa7134_boards[] = {
2515 .tuner_addr = ADDR_UNSET, 2515 .tuner_addr = ADDR_UNSET,
2516 .radio_addr = ADDR_UNSET, 2516 .radio_addr = ADDR_UNSET,
2517 .mpeg = SAA7134_MPEG_DVB, 2517 .mpeg = SAA7134_MPEG_DVB,
2518 .gpiomask = 1 << 21,
2518 .inputs = {{ 2519 .inputs = {{
2519 .name = name_tv, 2520 .name = name_tv,
2520 .vmux = 1, 2521 .vmux = 1,
@@ -2529,6 +2530,11 @@ struct saa7134_board saa7134_boards[] = {
2529 .vmux = 8, 2530 .vmux = 8,
2530 .amux = LINE1, 2531 .amux = LINE1,
2531 }}, 2532 }},
2533 .radio = {
2534 .name = name_radio,
2535 .amux = TV,
2536 .gpio = 0x0200000,
2537 },
2532 }, 2538 },
2533 [SAA7134_BOARD_MSI_TVATANYWHERE_PLUS] = { 2539 [SAA7134_BOARD_MSI_TVATANYWHERE_PLUS] = {
2534 .name = "MSI TV@Anywhere plus", 2540 .name = "MSI TV@Anywhere plus",
diff --git a/drivers/media/video/saa7134/saa7134-core.c b/drivers/media/video/saa7134/saa7134-core.c
index 3dd42efe3699..028904bd94a2 100644
--- a/drivers/media/video/saa7134/saa7134-core.c
+++ b/drivers/media/video/saa7134/saa7134-core.c
@@ -31,6 +31,7 @@
31#include <linux/sound.h> 31#include <linux/sound.h>
32#include <linux/interrupt.h> 32#include <linux/interrupt.h>
33#include <linux/delay.h> 33#include <linux/delay.h>
34#include <linux/mutex.h>
34 35
35#include "saa7134-reg.h" 36#include "saa7134-reg.h"
36#include "saa7134.h" 37#include "saa7134.h"
@@ -84,7 +85,7 @@ MODULE_PARM_DESC(radio_nr, "radio device number");
84MODULE_PARM_DESC(tuner, "tuner type"); 85MODULE_PARM_DESC(tuner, "tuner type");
85MODULE_PARM_DESC(card, "card type"); 86MODULE_PARM_DESC(card, "card type");
86 87
87static DECLARE_MUTEX(devlist_lock); 88static DEFINE_MUTEX(devlist_lock);
88LIST_HEAD(saa7134_devlist); 89LIST_HEAD(saa7134_devlist);
89static LIST_HEAD(mops_list); 90static LIST_HEAD(mops_list);
90static unsigned int saa7134_devcount; 91static unsigned int saa7134_devcount;
@@ -969,13 +970,13 @@ static int __devinit saa7134_initdev(struct pci_dev *pci_dev,
969 pci_set_drvdata(pci_dev,dev); 970 pci_set_drvdata(pci_dev,dev);
970 saa7134_devcount++; 971 saa7134_devcount++;
971 972
972 down(&devlist_lock); 973 mutex_lock(&devlist_lock);
973 list_for_each(item,&mops_list) { 974 list_for_each(item,&mops_list) {
974 mops = list_entry(item, struct saa7134_mpeg_ops, next); 975 mops = list_entry(item, struct saa7134_mpeg_ops, next);
975 mpeg_ops_attach(mops, dev); 976 mpeg_ops_attach(mops, dev);
976 } 977 }
977 list_add_tail(&dev->devlist,&saa7134_devlist); 978 list_add_tail(&dev->devlist,&saa7134_devlist);
978 up(&devlist_lock); 979 mutex_unlock(&devlist_lock);
979 980
980 /* check for signal */ 981 /* check for signal */
981 saa7134_irq_video_intl(dev); 982 saa7134_irq_video_intl(dev);
@@ -1031,13 +1032,13 @@ static void __devexit saa7134_finidev(struct pci_dev *pci_dev)
1031 saa7134_hwfini(dev); 1032 saa7134_hwfini(dev);
1032 1033
1033 /* unregister */ 1034 /* unregister */
1034 down(&devlist_lock); 1035 mutex_lock(&devlist_lock);
1035 list_del(&dev->devlist); 1036 list_del(&dev->devlist);
1036 list_for_each(item,&mops_list) { 1037 list_for_each(item,&mops_list) {
1037 mops = list_entry(item, struct saa7134_mpeg_ops, next); 1038 mops = list_entry(item, struct saa7134_mpeg_ops, next);
1038 mpeg_ops_detach(mops, dev); 1039 mpeg_ops_detach(mops, dev);
1039 } 1040 }
1040 up(&devlist_lock); 1041 mutex_unlock(&devlist_lock);
1041 saa7134_devcount--; 1042 saa7134_devcount--;
1042 1043
1043 saa7134_i2c_unregister(dev); 1044 saa7134_i2c_unregister(dev);
@@ -1071,13 +1072,13 @@ int saa7134_ts_register(struct saa7134_mpeg_ops *ops)
1071 struct list_head *item; 1072 struct list_head *item;
1072 struct saa7134_dev *dev; 1073 struct saa7134_dev *dev;
1073 1074
1074 down(&devlist_lock); 1075 mutex_lock(&devlist_lock);
1075 list_for_each(item,&saa7134_devlist) { 1076 list_for_each(item,&saa7134_devlist) {
1076 dev = list_entry(item, struct saa7134_dev, devlist); 1077 dev = list_entry(item, struct saa7134_dev, devlist);
1077 mpeg_ops_attach(ops, dev); 1078 mpeg_ops_attach(ops, dev);
1078 } 1079 }
1079 list_add_tail(&ops->next,&mops_list); 1080 list_add_tail(&ops->next,&mops_list);
1080 up(&devlist_lock); 1081 mutex_unlock(&devlist_lock);
1081 return 0; 1082 return 0;
1082} 1083}
1083 1084
@@ -1086,13 +1087,13 @@ void saa7134_ts_unregister(struct saa7134_mpeg_ops *ops)
1086 struct list_head *item; 1087 struct list_head *item;
1087 struct saa7134_dev *dev; 1088 struct saa7134_dev *dev;
1088 1089
1089 down(&devlist_lock); 1090 mutex_lock(&devlist_lock);
1090 list_del(&ops->next); 1091 list_del(&ops->next);
1091 list_for_each(item,&saa7134_devlist) { 1092 list_for_each(item,&saa7134_devlist) {
1092 dev = list_entry(item, struct saa7134_dev, devlist); 1093 dev = list_entry(item, struct saa7134_dev, devlist);
1093 mpeg_ops_detach(ops, dev); 1094 mpeg_ops_detach(ops, dev);
1094 } 1095 }
1095 up(&devlist_lock); 1096 mutex_unlock(&devlist_lock);
1096} 1097}
1097 1098
1098EXPORT_SYMBOL(saa7134_ts_register); 1099EXPORT_SYMBOL(saa7134_ts_register);
diff --git a/drivers/media/video/saa7134/saa7134-tvaudio.c b/drivers/media/video/saa7134/saa7134-tvaudio.c
index 93268427750d..afa4dcb3f96d 100644
--- a/drivers/media/video/saa7134/saa7134-tvaudio.c
+++ b/drivers/media/video/saa7134/saa7134-tvaudio.c
@@ -180,8 +180,8 @@ static void tvaudio_init(struct saa7134_dev *dev)
180 saa_writeb(SAA7134_AUDIO_CLOCK0, clock & 0xff); 180 saa_writeb(SAA7134_AUDIO_CLOCK0, clock & 0xff);
181 saa_writeb(SAA7134_AUDIO_CLOCK1, (clock >> 8) & 0xff); 181 saa_writeb(SAA7134_AUDIO_CLOCK1, (clock >> 8) & 0xff);
182 saa_writeb(SAA7134_AUDIO_CLOCK2, (clock >> 16) & 0xff); 182 saa_writeb(SAA7134_AUDIO_CLOCK2, (clock >> 16) & 0xff);
183 // frame locked audio was reported not to be reliable 183 /* frame locked audio is mandatory for NICAM */
184 saa_writeb(SAA7134_AUDIO_PLL_CTRL, 0x02); 184 saa_writeb(SAA7134_AUDIO_PLL_CTRL, 0x01);
185 185
186 saa_writeb(SAA7134_NICAM_ERROR_LOW, 0x14); 186 saa_writeb(SAA7134_NICAM_ERROR_LOW, 0x14);
187 saa_writeb(SAA7134_NICAM_ERROR_HIGH, 0x50); 187 saa_writeb(SAA7134_NICAM_ERROR_HIGH, 0x50);
@@ -809,7 +809,12 @@ static int tvaudio_thread_ddep(void *data)
809 dprintk("ddep override: %s\n",stdres[audio_ddep]); 809 dprintk("ddep override: %s\n",stdres[audio_ddep]);
810 } else if (&card(dev).radio == dev->input) { 810 } else if (&card(dev).radio == dev->input) {
811 dprintk("FM Radio\n"); 811 dprintk("FM Radio\n");
812 norms = (0x0f << 2) | 0x01; 812 if (dev->tuner_type == TUNER_PHILIPS_TDA8290) {
813 norms = (0x11 << 2) | 0x01;
814 saa_dsp_writel(dev, 0x42c >> 2, 0x729555);
815 } else {
816 norms = (0x0f << 2) | 0x01;
817 }
813 } else { 818 } else {
814 /* (let chip) scan for sound carrier */ 819 /* (let chip) scan for sound carrier */
815 norms = 0; 820 norms = 0;
diff --git a/drivers/media/video/tvp5150.c b/drivers/media/video/tvp5150.c
index 9094fa9f2ecb..fad9ea0ae4f2 100644
--- a/drivers/media/video/tvp5150.c
+++ b/drivers/media/video/tvp5150.c
@@ -634,7 +634,7 @@ struct i2c_vbi_ram_value {
634 unsigned char values[26]; 634 unsigned char values[26];
635}; 635};
636 636
637struct i2c_vbi_ram_value vbi_ram_default[] = 637static struct i2c_vbi_ram_value vbi_ram_default[] =
638{ 638{
639 {0x010, /* WST SECAM 6 */ 639 {0x010, /* WST SECAM 6 */
640 { 0xaa, 0xaa, 0xff, 0xff , 0xe7, 0x2e, 0x20, 0x26, 0xe6, 0xb4, 0x0e, 0x0, 0x0, 0x0, 0x10, 0x0 } 640 { 0xaa, 0xaa, 0xff, 0xff , 0xe7, 0x2e, 0x20, 0x26, 0xe6, 0xb4, 0x0e, 0x0, 0x0, 0x0, 0x10, 0x0 }
diff --git a/drivers/media/video/videodev.c b/drivers/media/video/videodev.c
index d5be25987142..078880e4c8c0 100644
--- a/drivers/media/video/videodev.c
+++ b/drivers/media/video/videodev.c
@@ -29,7 +29,6 @@
29#include <linux/devfs_fs_kernel.h> 29#include <linux/devfs_fs_kernel.h>
30#include <asm/uaccess.h> 30#include <asm/uaccess.h>
31#include <asm/system.h> 31#include <asm/system.h>
32#include <asm/semaphore.h>
33 32
34#include <linux/videodev.h> 33#include <linux/videodev.h>
35 34
@@ -83,7 +82,7 @@ static struct class video_class = {
83 */ 82 */
84 83
85static struct video_device *video_device[VIDEO_NUM_DEVICES]; 84static struct video_device *video_device[VIDEO_NUM_DEVICES];
86static DECLARE_MUTEX(videodev_lock); 85static DEFINE_MUTEX(videodev_lock);
87 86
88struct video_device* video_devdata(struct file *file) 87struct video_device* video_devdata(struct file *file)
89{ 88{
@@ -102,15 +101,15 @@ static int video_open(struct inode *inode, struct file *file)
102 101
103 if(minor>=VIDEO_NUM_DEVICES) 102 if(minor>=VIDEO_NUM_DEVICES)
104 return -ENODEV; 103 return -ENODEV;
105 down(&videodev_lock); 104 mutex_lock(&videodev_lock);
106 vfl=video_device[minor]; 105 vfl=video_device[minor];
107 if(vfl==NULL) { 106 if(vfl==NULL) {
108 up(&videodev_lock); 107 mutex_unlock(&videodev_lock);
109 request_module("char-major-%d-%d", VIDEO_MAJOR, minor); 108 request_module("char-major-%d-%d", VIDEO_MAJOR, minor);
110 down(&videodev_lock); 109 mutex_lock(&videodev_lock);
111 vfl=video_device[minor]; 110 vfl=video_device[minor];
112 if (vfl==NULL) { 111 if (vfl==NULL) {
113 up(&videodev_lock); 112 mutex_unlock(&videodev_lock);
114 return -ENODEV; 113 return -ENODEV;
115 } 114 }
116 } 115 }
@@ -123,7 +122,7 @@ static int video_open(struct inode *inode, struct file *file)
123 file->f_op = fops_get(old_fops); 122 file->f_op = fops_get(old_fops);
124 } 123 }
125 fops_put(old_fops); 124 fops_put(old_fops);
126 up(&videodev_lock); 125 mutex_unlock(&videodev_lock);
127 return err; 126 return err;
128} 127}
129 128
@@ -304,12 +303,12 @@ int video_register_device(struct video_device *vfd, int type, int nr)
304 } 303 }
305 304
306 /* pick a minor number */ 305 /* pick a minor number */
307 down(&videodev_lock); 306 mutex_lock(&videodev_lock);
308 if (nr >= 0 && nr < end-base) { 307 if (nr >= 0 && nr < end-base) {
309 /* use the one the driver asked for */ 308 /* use the one the driver asked for */
310 i = base+nr; 309 i = base+nr;
311 if (NULL != video_device[i]) { 310 if (NULL != video_device[i]) {
312 up(&videodev_lock); 311 mutex_unlock(&videodev_lock);
313 return -ENFILE; 312 return -ENFILE;
314 } 313 }
315 } else { 314 } else {
@@ -318,13 +317,13 @@ int video_register_device(struct video_device *vfd, int type, int nr)
318 if (NULL == video_device[i]) 317 if (NULL == video_device[i])
319 break; 318 break;
320 if (i == end) { 319 if (i == end) {
321 up(&videodev_lock); 320 mutex_unlock(&videodev_lock);
322 return -ENFILE; 321 return -ENFILE;
323 } 322 }
324 } 323 }
325 video_device[i]=vfd; 324 video_device[i]=vfd;
326 vfd->minor=i; 325 vfd->minor=i;
327 up(&videodev_lock); 326 mutex_unlock(&videodev_lock);
328 327
329 sprintf(vfd->devfs_name, "v4l/%s%d", name_base, i - base); 328 sprintf(vfd->devfs_name, "v4l/%s%d", name_base, i - base);
330 devfs_mk_cdev(MKDEV(VIDEO_MAJOR, vfd->minor), 329 devfs_mk_cdev(MKDEV(VIDEO_MAJOR, vfd->minor),
@@ -362,14 +361,14 @@ int video_register_device(struct video_device *vfd, int type, int nr)
362 361
363void video_unregister_device(struct video_device *vfd) 362void video_unregister_device(struct video_device *vfd)
364{ 363{
365 down(&videodev_lock); 364 mutex_lock(&videodev_lock);
366 if(video_device[vfd->minor]!=vfd) 365 if(video_device[vfd->minor]!=vfd)
367 panic("videodev: bad unregister"); 366 panic("videodev: bad unregister");
368 367
369 devfs_remove(vfd->devfs_name); 368 devfs_remove(vfd->devfs_name);
370 video_device[vfd->minor]=NULL; 369 video_device[vfd->minor]=NULL;
371 class_device_unregister(&vfd->class_dev); 370 class_device_unregister(&vfd->class_dev);
372 up(&videodev_lock); 371 mutex_unlock(&videodev_lock);
373} 372}
374 373
375 374