diff options
author | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-01-15 18:01:27 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-01-15 18:01:27 -0500 |
commit | d04ae27bae42bcce1b3fa70ca2edf25d92b1cf39 (patch) | |
tree | 1bf8070b7cff7a5f1375a141c51edcd92e3e3c6a /drivers/media/dvb | |
parent | f1dccedc8148026d9071c6805f7cb77374a9e56f (diff) | |
parent | e0ad8486266c3415ab9c17f5c03c47edc7b93d7b (diff) |
Merge branch 'work'
Diffstat (limited to 'drivers/media/dvb')
-rw-r--r-- | drivers/media/dvb/dvb-core/dvbdev.c | 22 | ||||
-rw-r--r-- | drivers/media/dvb/ttpci/av7110_hw.c | 40 | ||||
-rw-r--r-- | drivers/media/dvb/ttpci/av7110_hw.h | 12 |
3 files changed, 37 insertions, 37 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 | ||
39 | static int dvbdev_debug; | 39 | static 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 | ||
46 | static LIST_HEAD(dvb_adapter_list); | 46 | static LIST_HEAD(dvb_adapter_list); |
47 | static DECLARE_MUTEX(dvbdev_register_lock); | 47 | static DEFINE_MUTEX(dvbdev_register_lock); |
48 | 48 | ||
49 | static const char * const dnames[] = { | 49 | static 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 | } |
329 | EXPORT_SYMBOL(dvb_unregister_adapter); | 329 | EXPORT_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 | ||
24 | enum av7110_type_rec_play_format | 24 | enum 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) |