aboutsummaryrefslogtreecommitdiffstats
path: root/sound/oss
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2008-12-19 02:22:57 -0500
committerTakashi Iwai <tiwai@suse.de>2008-12-19 02:22:57 -0500
commit0ff555192a8d20385d49d1c420e2e8d409b3c0da (patch)
treeb6e4b6cae1028a310a3488ebf745954c51694bfc /sound/oss
parent3218c178b41b420cb7e0d120c7a137a3969242e5 (diff)
parent9e43f0de690211cf7153b5f3ec251bc315647ada (diff)
Merge branch 'fix/hda' into topic/hda
Diffstat (limited to 'sound/oss')
-rw-r--r--sound/oss/ac97_codec.c2
-rw-r--r--sound/oss/au1550_ac97.c2
-rw-r--r--sound/oss/dmasound/dmasound.h4
-rw-r--r--sound/oss/dmasound/dmasound_atari.c4
-rw-r--r--sound/oss/dmasound/dmasound_core.c14
-rw-r--r--sound/oss/kahlua.c2
-rw-r--r--sound/oss/msnd.h2
-rw-r--r--sound/oss/sh_dac_audio.c2
-rw-r--r--sound/oss/sound_config.h20
-rw-r--r--sound/oss/soundcard.c15
-rw-r--r--sound/oss/swarm_cs4297a.c2
-rw-r--r--sound/oss/vwsnd.c2
12 files changed, 31 insertions, 40 deletions
diff --git a/sound/oss/ac97_codec.c b/sound/oss/ac97_codec.c
index b63839e8f9bd..456a1b4d7832 100644
--- a/sound/oss/ac97_codec.c
+++ b/sound/oss/ac97_codec.c
@@ -30,7 +30,7 @@
30 ************************************************************************** 30 **************************************************************************
31 * 31 *
32 * History 32 * History
33 * May 02, 2003 Liam Girdwood <liam.girdwood@wolfsonmicro.com> 33 * May 02, 2003 Liam Girdwood <lrg@slimlogic.co.uk>
34 * Removed non existant WM9700 34 * Removed non existant WM9700
35 * Added support for WM9705, WM9708, WM9709, WM9710, WM9711 35 * Added support for WM9705, WM9708, WM9709, WM9710, WM9711
36 * WM9712 and WM9717 36 * WM9712 and WM9717
diff --git a/sound/oss/au1550_ac97.c b/sound/oss/au1550_ac97.c
index 23018a7c063a..81e1f443d094 100644
--- a/sound/oss/au1550_ac97.c
+++ b/sound/oss/au1550_ac97.c
@@ -93,7 +93,7 @@ static struct au1550_state {
93 spinlock_t lock; 93 spinlock_t lock;
94 struct mutex open_mutex; 94 struct mutex open_mutex;
95 struct mutex sem; 95 struct mutex sem;
96 mode_t open_mode; 96 fmode_t open_mode;
97 wait_queue_head_t open_wait; 97 wait_queue_head_t open_wait;
98 98
99 struct dmabuf { 99 struct dmabuf {
diff --git a/sound/oss/dmasound/dmasound.h b/sound/oss/dmasound/dmasound.h
index d978b0096564..1308d8d34186 100644
--- a/sound/oss/dmasound/dmasound.h
+++ b/sound/oss/dmasound/dmasound.h
@@ -129,7 +129,7 @@ typedef struct {
129 int (*mixer_ioctl)(u_int, u_long); /* optional */ 129 int (*mixer_ioctl)(u_int, u_long); /* optional */
130 int (*write_sq_setup)(void); /* optional */ 130 int (*write_sq_setup)(void); /* optional */
131 int (*read_sq_setup)(void); /* optional */ 131 int (*read_sq_setup)(void); /* optional */
132 int (*sq_open)(mode_t); /* optional */ 132 int (*sq_open)(fmode_t); /* optional */
133 int (*state_info)(char *, size_t); /* optional */ 133 int (*state_info)(char *, size_t); /* optional */
134 void (*abort_read)(void); /* optional */ 134 void (*abort_read)(void); /* optional */
135 int min_dsp_speed; 135 int min_dsp_speed;
@@ -235,7 +235,7 @@ struct sound_queue {
235 */ 235 */
236 int active; 236 int active;
237 wait_queue_head_t action_queue, open_queue, sync_queue; 237 wait_queue_head_t action_queue, open_queue, sync_queue;
238 int open_mode; 238 int non_blocking;
239 int busy, syncing, xruns, died; 239 int busy, syncing, xruns, died;
240}; 240};
241 241
diff --git a/sound/oss/dmasound/dmasound_atari.c b/sound/oss/dmasound/dmasound_atari.c
index 285239d64b82..4d45bd63718b 100644
--- a/sound/oss/dmasound/dmasound_atari.c
+++ b/sound/oss/dmasound/dmasound_atari.c
@@ -143,7 +143,7 @@ static int AtaMixerIoctl(u_int cmd, u_long arg);
143static int TTMixerIoctl(u_int cmd, u_long arg); 143static int TTMixerIoctl(u_int cmd, u_long arg);
144static int FalconMixerIoctl(u_int cmd, u_long arg); 144static int FalconMixerIoctl(u_int cmd, u_long arg);
145static int AtaWriteSqSetup(void); 145static int AtaWriteSqSetup(void);
146static int AtaSqOpen(mode_t mode); 146static int AtaSqOpen(fmode_t mode);
147static int TTStateInfo(char *buffer, size_t space); 147static int TTStateInfo(char *buffer, size_t space);
148static int FalconStateInfo(char *buffer, size_t space); 148static int FalconStateInfo(char *buffer, size_t space);
149 149
@@ -1461,7 +1461,7 @@ static int AtaWriteSqSetup(void)
1461 return 0 ; 1461 return 0 ;
1462} 1462}
1463 1463
1464static int AtaSqOpen(mode_t mode) 1464static int AtaSqOpen(fmode_t mode)
1465{ 1465{
1466 write_sq_ignore_int = 1; 1466 write_sq_ignore_int = 1;
1467 return 0 ; 1467 return 0 ;
diff --git a/sound/oss/dmasound/dmasound_core.c b/sound/oss/dmasound/dmasound_core.c
index 95fc5c681755..793b7f478433 100644
--- a/sound/oss/dmasound/dmasound_core.c
+++ b/sound/oss/dmasound/dmasound_core.c
@@ -212,7 +212,7 @@ static int irq_installed;
212#endif /* MODULE */ 212#endif /* MODULE */
213 213
214/* control over who can modify resources shared between play/record */ 214/* control over who can modify resources shared between play/record */
215static mode_t shared_resource_owner; 215static fmode_t shared_resource_owner;
216static int shared_resources_initialised; 216static int shared_resources_initialised;
217 217
218 /* 218 /*
@@ -603,7 +603,7 @@ static ssize_t sq_write(struct file *file, const char __user *src, size_t uLeft,
603 while (uLeft) { 603 while (uLeft) {
604 while (write_sq.count >= write_sq.max_active) { 604 while (write_sq.count >= write_sq.max_active) {
605 sq_play(); 605 sq_play();
606 if (write_sq.open_mode & O_NONBLOCK) 606 if (write_sq.non_blocking)
607 return uWritten > 0 ? uWritten : -EAGAIN; 607 return uWritten > 0 ? uWritten : -EAGAIN;
608 SLEEP(write_sq.action_queue); 608 SLEEP(write_sq.action_queue);
609 if (signal_pending(current)) 609 if (signal_pending(current))
@@ -668,7 +668,7 @@ static inline void sq_init_waitqueue(struct sound_queue *sq)
668 668
669#if 0 /* blocking open() */ 669#if 0 /* blocking open() */
670static inline void sq_wake_up(struct sound_queue *sq, struct file *file, 670static inline void sq_wake_up(struct sound_queue *sq, struct file *file,
671 mode_t mode) 671 fmode_t mode)
672{ 672{
673 if (file->f_mode & mode) { 673 if (file->f_mode & mode) {
674 sq->busy = 0; /* CHECK: IS THIS OK??? */ 674 sq->busy = 0; /* CHECK: IS THIS OK??? */
@@ -677,7 +677,7 @@ static inline void sq_wake_up(struct sound_queue *sq, struct file *file,
677} 677}
678#endif 678#endif
679 679
680static int sq_open2(struct sound_queue *sq, struct file *file, mode_t mode, 680static int sq_open2(struct sound_queue *sq, struct file *file, fmode_t mode,
681 int numbufs, int bufsize) 681 int numbufs, int bufsize)
682{ 682{
683 int rc = 0; 683 int rc = 0;
@@ -718,7 +718,7 @@ static int sq_open2(struct sound_queue *sq, struct file *file, mode_t mode,
718 return rc; 718 return rc;
719 } 719 }
720 720
721 sq->open_mode = file->f_mode; 721 sq->non_blocking = file->f_flags & O_NONBLOCK;
722 } 722 }
723 return rc; 723 return rc;
724} 724}
@@ -891,10 +891,10 @@ static int sq_release(struct inode *inode, struct file *file)
891 is the owner - if we have problems. 891 is the owner - if we have problems.
892*/ 892*/
893 893
894static int shared_resources_are_mine(mode_t md) 894static int shared_resources_are_mine(fmode_t md)
895{ 895{
896 if (shared_resource_owner) 896 if (shared_resource_owner)
897 return (shared_resource_owner & md ) ; 897 return (shared_resource_owner & md) != 0;
898 else { 898 else {
899 shared_resource_owner = md ; 899 shared_resource_owner = md ;
900 return 1 ; 900 return 1 ;
diff --git a/sound/oss/kahlua.c b/sound/oss/kahlua.c
index eb9bc365530d..c180598f1710 100644
--- a/sound/oss/kahlua.c
+++ b/sound/oss/kahlua.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * Initialisation code for Cyrix/NatSemi VSA1 softaudio 2 * Initialisation code for Cyrix/NatSemi VSA1 softaudio
3 * 3 *
4 * (C) Copyright 2003 Red Hat Inc <alan@redhat.com> 4 * (C) Copyright 2003 Red Hat Inc <alan@lxorguk.ukuu.org.uk>
5 * 5 *
6 * XpressAudio(tm) is used on the Cyrix MediaGX (now NatSemi Geode) systems. 6 * XpressAudio(tm) is used on the Cyrix MediaGX (now NatSemi Geode) systems.
7 * The older version (VSA1) provides fairly good soundblaster emulation 7 * The older version (VSA1) provides fairly good soundblaster emulation
diff --git a/sound/oss/msnd.h b/sound/oss/msnd.h
index 61b3955481c5..c8be47ec2b7e 100644
--- a/sound/oss/msnd.h
+++ b/sound/oss/msnd.h
@@ -211,7 +211,7 @@ typedef struct multisound_dev {
211 211
212 /* State variables */ 212 /* State variables */
213 enum { msndClassic, msndPinnacle } type; 213 enum { msndClassic, msndPinnacle } type;
214 mode_t mode; 214 fmode_t mode;
215 unsigned long flags; 215 unsigned long flags;
216#define F_RESETTING 0 216#define F_RESETTING 0
217#define F_HAVEDIGITAL 1 217#define F_HAVEDIGITAL 1
diff --git a/sound/oss/sh_dac_audio.c b/sound/oss/sh_dac_audio.c
index b493660deb36..e5d423994918 100644
--- a/sound/oss/sh_dac_audio.c
+++ b/sound/oss/sh_dac_audio.c
@@ -26,7 +26,7 @@
26#include <asm/cpu/dac.h> 26#include <asm/cpu/dac.h>
27#include <asm/cpu/timer.h> 27#include <asm/cpu/timer.h>
28#include <asm/machvec.h> 28#include <asm/machvec.h>
29#include <asm/hp6xx.h> 29#include <mach/hp6xx.h>
30#include <asm/hd64461.h> 30#include <asm/hd64461.h>
31 31
32#define MODNAME "sh_dac_audio" 32#define MODNAME "sh_dac_audio"
diff --git a/sound/oss/sound_config.h b/sound/oss/sound_config.h
index 1a00a3210616..55271fbe7f49 100644
--- a/sound/oss/sound_config.h
+++ b/sound/oss/sound_config.h
@@ -110,24 +110,16 @@ struct channel_info {
110#define OPEN_WRITE PCM_ENABLE_OUTPUT 110#define OPEN_WRITE PCM_ENABLE_OUTPUT
111#define OPEN_READWRITE (OPEN_READ|OPEN_WRITE) 111#define OPEN_READWRITE (OPEN_READ|OPEN_WRITE)
112 112
113#if OPEN_READ == FMODE_READ && OPEN_WRITE == FMODE_WRITE
114
115static inline int translate_mode(struct file *file)
116{
117 return file->f_mode;
118}
119
120#else
121
122static inline int translate_mode(struct file *file) 113static inline int translate_mode(struct file *file)
123{ 114{
124 return ((file->f_mode & FMODE_READ) ? OPEN_READ : 0) | 115 if (OPEN_READ == (__force int)FMODE_READ &&
125 ((file->f_mode & FMODE_WRITE) ? OPEN_WRITE : 0); 116 OPEN_WRITE == (__force int)FMODE_WRITE)
117 return (__force int)(file->f_mode & (FMODE_READ | FMODE_WRITE));
118 else
119 return ((file->f_mode & FMODE_READ) ? OPEN_READ : 0) |
120 ((file->f_mode & FMODE_WRITE) ? OPEN_WRITE : 0);
126} 121}
127 122
128#endif
129
130
131#include "sound_calls.h" 123#include "sound_calls.h"
132#include "dev_table.h" 124#include "dev_table.h"
133 125
diff --git a/sound/oss/soundcard.c b/sound/oss/soundcard.c
index 7d89c081a086..61aaedae6b7e 100644
--- a/sound/oss/soundcard.c
+++ b/sound/oss/soundcard.c
@@ -560,19 +560,18 @@ static int __init oss_init(void)
560 sound_dmap_flag = (dmabuf > 0 ? 1 : 0); 560 sound_dmap_flag = (dmabuf > 0 ? 1 : 0);
561 561
562 for (i = 0; i < ARRAY_SIZE(dev_list); i++) { 562 for (i = 0; i < ARRAY_SIZE(dev_list); i++) {
563 device_create_drvdata(sound_class, NULL, 563 device_create(sound_class, NULL,
564 MKDEV(SOUND_MAJOR, dev_list[i].minor), 564 MKDEV(SOUND_MAJOR, dev_list[i].minor), NULL,
565 NULL, "%s", dev_list[i].name); 565 "%s", dev_list[i].name);
566 566
567 if (!dev_list[i].num) 567 if (!dev_list[i].num)
568 continue; 568 continue;
569 569
570 for (j = 1; j < *dev_list[i].num; j++) 570 for (j = 1; j < *dev_list[i].num; j++)
571 device_create_drvdata(sound_class, NULL, 571 device_create(sound_class, NULL,
572 MKDEV(SOUND_MAJOR, 572 MKDEV(SOUND_MAJOR,
573 dev_list[i].minor + (j*0x10)), 573 dev_list[i].minor + (j*0x10)),
574 NULL, 574 NULL, "%s%d", dev_list[i].name, j);
575 "%s%d", dev_list[i].name, j);
576 } 575 }
577 576
578 if (sound_nblocks >= 1024) 577 if (sound_nblocks >= 1024)
diff --git a/sound/oss/swarm_cs4297a.c b/sound/oss/swarm_cs4297a.c
index 044453a4ee5b..41562ecde5bb 100644
--- a/sound/oss/swarm_cs4297a.c
+++ b/sound/oss/swarm_cs4297a.c
@@ -295,7 +295,7 @@ struct cs4297a_state {
295 struct mutex open_mutex; 295 struct mutex open_mutex;
296 struct mutex open_sem_adc; 296 struct mutex open_sem_adc;
297 struct mutex open_sem_dac; 297 struct mutex open_sem_dac;
298 mode_t open_mode; 298 fmode_t open_mode;
299 wait_queue_head_t open_wait; 299 wait_queue_head_t open_wait;
300 wait_queue_head_t open_wait_adc; 300 wait_queue_head_t open_wait_adc;
301 wait_queue_head_t open_wait_dac; 301 wait_queue_head_t open_wait_dac;
diff --git a/sound/oss/vwsnd.c b/sound/oss/vwsnd.c
index dcbb3f739e61..78b8acc7c3b9 100644
--- a/sound/oss/vwsnd.c
+++ b/sound/oss/vwsnd.c
@@ -1509,7 +1509,7 @@ typedef struct vwsnd_dev {
1509 struct mutex open_mutex; 1509 struct mutex open_mutex;
1510 struct mutex io_mutex; 1510 struct mutex io_mutex;
1511 struct mutex mix_mutex; 1511 struct mutex mix_mutex;
1512 mode_t open_mode; 1512 fmode_t open_mode;
1513 wait_queue_head_t open_wait; 1513 wait_queue_head_t open_wait;
1514 1514
1515 lithium_t lith; 1515 lithium_t lith;