Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
35a2f28e
Commit
35a2f28e
authored
Jun 03, 2004
by
Alexander Viro
Committed by
Linus Torvalds
Jun 03, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] sparse: i810 annotation
i810 annotated
parent
d361e46c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
36 deletions
+38
-36
sound/oss/i810_audio.c
sound/oss/i810_audio.c
+38
-36
No files found.
sound/oss/i810_audio.c
View file @
35a2f28e
...
...
@@ -1393,7 +1393,7 @@ static irqreturn_t i810_interrupt(int irq, void *dev_id, struct pt_regs *regs)
waiting to be copied to the user's buffer. It is filled by the dma
machine and drained by this loop. */
static
ssize_t
i810_read
(
struct
file
*
file
,
char
*
buffer
,
size_t
count
,
loff_t
*
ppos
)
static
ssize_t
i810_read
(
struct
file
*
file
,
char
__user
*
buffer
,
size_t
count
,
loff_t
*
ppos
)
{
struct
i810_state
*
state
=
(
struct
i810_state
*
)
file
->
private_data
;
struct
i810_card
*
card
=
state
?
state
->
card
:
0
;
...
...
@@ -1533,7 +1533,7 @@ static ssize_t i810_read(struct file *file, char *buffer, size_t count, loff_t *
/* in this loop, dmabuf.count signifies the amount of data that is waiting to be dma to
the soundcard. it is drained by the dma machine and filled by this loop. */
static
ssize_t
i810_write
(
struct
file
*
file
,
const
char
*
buffer
,
size_t
count
,
loff_t
*
ppos
)
static
ssize_t
i810_write
(
struct
file
*
file
,
const
char
__user
*
buffer
,
size_t
count
,
loff_t
*
ppos
)
{
struct
i810_state
*
state
=
(
struct
i810_state
*
)
file
->
private_data
;
struct
i810_card
*
card
=
state
?
state
->
card
:
0
;
...
...
@@ -1755,9 +1755,11 @@ static int i810_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
unsigned
int
i_glob_cnt
;
int
val
=
0
,
ret
;
struct
ac97_codec
*
codec
=
state
->
card
->
ac97_codec
[
0
];
void
__user
*
argp
=
(
void
__user
*
)
arg
;
int
__user
*
p
=
argp
;
#ifdef DEBUG
printk
(
"i810_audio: i810_ioctl, arg=0x%x, cmd="
,
arg
?
*
(
int
*
)
arg
:
0
);
printk
(
"i810_audio: i810_ioctl, arg=0x%x, cmd="
,
arg
?
*
p
:
0
);
#endif
switch
(
cmd
)
...
...
@@ -1766,7 +1768,7 @@ static int i810_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
#ifdef DEBUG
printk
(
"OSS_GETVERSION
\n
"
);
#endif
return
put_user
(
SOUND_VERSION
,
(
int
*
)
arg
);
return
put_user
(
SOUND_VERSION
,
p
);
case
SNDCTL_DSP_RESET
:
#ifdef DEBUG
...
...
@@ -1813,7 +1815,7 @@ static int i810_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
#ifdef DEBUG
printk
(
"SNDCTL_DSP_SPEED
\n
"
);
#endif
if
(
get_user
(
val
,
(
int
*
)
arg
))
if
(
get_user
(
val
,
p
))
return
-
EFAULT
;
if
(
val
>=
0
)
{
if
(
file
->
f_mode
&
FMODE_WRITE
)
{
...
...
@@ -1851,7 +1853,7 @@ static int i810_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
spin_unlock_irqrestore
(
&
state
->
card
->
lock
,
flags
);
}
}
return
put_user
(
dmabuf
->
rate
,
(
int
*
)
arg
);
return
put_user
(
dmabuf
->
rate
,
p
);
case
SNDCTL_DSP_STEREO
:
/* set stereo or mono channel */
#ifdef DEBUG
...
...
@@ -1863,7 +1865,7 @@ static int i810_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
if
(
dmabuf
->
enable
&
ADC_RUNNING
)
{
stop_adc
(
state
);
}
return
put_user
(
1
,
(
int
*
)
arg
);
return
put_user
(
1
,
p
);
case
SNDCTL_DSP_GETBLKSIZE
:
if
(
file
->
f_mode
&
FMODE_WRITE
)
{
...
...
@@ -1877,25 +1879,25 @@ static int i810_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
#ifdef DEBUG
printk
(
"SNDCTL_DSP_GETBLKSIZE %d
\n
"
,
dmabuf
->
userfragsize
);
#endif
return
put_user
(
dmabuf
->
userfragsize
,
(
int
*
)
arg
);
return
put_user
(
dmabuf
->
userfragsize
,
p
);
case
SNDCTL_DSP_GETFMTS
:
/* Returns a mask of supported sample format*/
#ifdef DEBUG
printk
(
"SNDCTL_DSP_GETFMTS
\n
"
);
#endif
return
put_user
(
AFMT_S16_LE
,
(
int
*
)
arg
);
return
put_user
(
AFMT_S16_LE
,
p
);
case
SNDCTL_DSP_SETFMT
:
/* Select sample format */
#ifdef DEBUG
printk
(
"SNDCTL_DSP_SETFMT
\n
"
);
#endif
return
put_user
(
AFMT_S16_LE
,
(
int
*
)
arg
);
return
put_user
(
AFMT_S16_LE
,
p
);
case
SNDCTL_DSP_CHANNELS
:
#ifdef DEBUG
printk
(
"SNDCTL_DSP_CHANNELS
\n
"
);
#endif
if
(
get_user
(
val
,
(
int
*
)
arg
))
if
(
get_user
(
val
,
p
))
return
-
EFAULT
;
if
(
val
>
0
)
{
...
...
@@ -1906,13 +1908,13 @@ static int i810_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
stop_adc
(
state
);
}
}
else
{
return
put_user
(
state
->
card
->
channels
,
(
int
*
)
arg
);
return
put_user
(
state
->
card
->
channels
,
p
);
}
/* ICH and ICH0 only support 2 channels */
if
(
state
->
card
->
pci_id
==
PCI_DEVICE_ID_INTEL_82801AA_5
||
state
->
card
->
pci_id
==
PCI_DEVICE_ID_INTEL_82801AB_5
)
return
put_user
(
2
,
(
int
*
)
arg
);
return
put_user
(
2
,
p
);
/* Multi-channel support was added with ICH2. Bits in */
/* Global Status and Global Control register are now */
...
...
@@ -1957,7 +1959,7 @@ static int i810_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
break
;
}
return
put_user
(
val
,
(
int
*
)
arg
);
return
put_user
(
val
,
p
);
case
SNDCTL_DSP_POST
:
/* the user has sent all data and is notifying us */
/* we update the swptr to the end of the last sg segment then return */
...
...
@@ -1976,7 +1978,7 @@ static int i810_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
case
SNDCTL_DSP_SUBDIVIDE
:
if
(
dmabuf
->
subdivision
)
return
-
EINVAL
;
if
(
get_user
(
val
,
(
int
*
)
arg
))
if
(
get_user
(
val
,
p
))
return
-
EFAULT
;
if
(
val
!=
1
&&
val
!=
2
&&
val
!=
4
)
return
-
EINVAL
;
...
...
@@ -1988,7 +1990,7 @@ static int i810_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
return
0
;
case
SNDCTL_DSP_SETFRAGMENT
:
if
(
get_user
(
val
,
(
int
*
)
arg
))
if
(
get_user
(
val
,
p
))
return
-
EFAULT
;
dmabuf
->
ossfragsize
=
1
<<
(
val
&
0xffff
);
...
...
@@ -2061,7 +2063,7 @@ static int i810_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
printk
(
"SNDCTL_DSP_GETOSPACE %d, %d, %d, %d
\n
"
,
abinfo
.
bytes
,
abinfo
.
fragsize
,
abinfo
.
fragments
,
abinfo
.
fragstotal
);
#endif
return
copy_to_user
(
(
void
*
)
arg
,
&
abinfo
,
sizeof
(
abinfo
))
?
-
EFAULT
:
0
;
return
copy_to_user
(
argp
,
&
abinfo
,
sizeof
(
abinfo
))
?
-
EFAULT
:
0
;
case
SNDCTL_DSP_GETOPTR
:
if
(
!
(
file
->
f_mode
&
FMODE_WRITE
))
...
...
@@ -2083,7 +2085,7 @@ static int i810_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
printk
(
"SNDCTL_DSP_GETOPTR %d, %d, %d, %d
\n
"
,
cinfo
.
bytes
,
cinfo
.
blocks
,
cinfo
.
ptr
,
dmabuf
->
count
);
#endif
return
copy_to_user
(
(
void
*
)
arg
,
&
cinfo
,
sizeof
(
cinfo
))
?
-
EFAULT
:
0
;
return
copy_to_user
(
argp
,
&
cinfo
,
sizeof
(
cinfo
))
?
-
EFAULT
:
0
;
case
SNDCTL_DSP_GETISPACE
:
if
(
!
(
file
->
f_mode
&
FMODE_READ
))
...
...
@@ -2100,7 +2102,7 @@ static int i810_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
printk
(
"SNDCTL_DSP_GETISPACE %d, %d, %d, %d
\n
"
,
abinfo
.
bytes
,
abinfo
.
fragsize
,
abinfo
.
fragments
,
abinfo
.
fragstotal
);
#endif
return
copy_to_user
(
(
void
*
)
arg
,
&
abinfo
,
sizeof
(
abinfo
))
?
-
EFAULT
:
0
;
return
copy_to_user
(
argp
,
&
abinfo
,
sizeof
(
abinfo
))
?
-
EFAULT
:
0
;
case
SNDCTL_DSP_GETIPTR
:
if
(
!
(
file
->
f_mode
&
FMODE_READ
))
...
...
@@ -2122,7 +2124,7 @@ static int i810_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
printk
(
"SNDCTL_DSP_GETIPTR %d, %d, %d, %d
\n
"
,
cinfo
.
bytes
,
cinfo
.
blocks
,
cinfo
.
ptr
,
dmabuf
->
count
);
#endif
return
copy_to_user
(
(
void
*
)
arg
,
&
cinfo
,
sizeof
(
cinfo
))
?
-
EFAULT
:
0
;
return
copy_to_user
(
argp
,
&
cinfo
,
sizeof
(
cinfo
))
?
-
EFAULT
:
0
;
case
SNDCTL_DSP_NONBLOCK
:
#ifdef DEBUG
...
...
@@ -2136,17 +2138,17 @@ static int i810_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
printk
(
"SNDCTL_DSP_GETCAPS
\n
"
);
#endif
return
put_user
(
DSP_CAP_REALTIME
|
DSP_CAP_TRIGGER
|
DSP_CAP_MMAP
|
DSP_CAP_BIND
,
(
int
*
)
arg
);
p
);
case
SNDCTL_DSP_GETTRIGGER
:
val
=
0
;
#ifdef DEBUG
printk
(
"SNDCTL_DSP_GETTRIGGER 0x%x
\n
"
,
dmabuf
->
trigger
);
#endif
return
put_user
(
dmabuf
->
trigger
,
(
int
*
)
arg
);
return
put_user
(
dmabuf
->
trigger
,
p
);
case
SNDCTL_DSP_SETTRIGGER
:
if
(
get_user
(
val
,
(
int
*
)
arg
))
if
(
get_user
(
val
,
p
))
return
-
EFAULT
;
#if defined(DEBUG) || defined(DEBUG_MMAP)
printk
(
"SNDCTL_DSP_SETTRIGGER 0x%x
\n
"
,
val
);
...
...
@@ -2223,31 +2225,31 @@ static int i810_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
#ifdef DEBUG
printk
(
"SNDCTL_DSP_GETODELAY %d
\n
"
,
dmabuf
->
count
);
#endif
return
put_user
(
val
,
(
int
*
)
arg
);
return
put_user
(
val
,
p
);
case
SOUND_PCM_READ_RATE
:
#ifdef DEBUG
printk
(
"SOUND_PCM_READ_RATE %d
\n
"
,
dmabuf
->
rate
);
#endif
return
put_user
(
dmabuf
->
rate
,
(
int
*
)
arg
);
return
put_user
(
dmabuf
->
rate
,
p
);
case
SOUND_PCM_READ_CHANNELS
:
#ifdef DEBUG
printk
(
"SOUND_PCM_READ_CHANNELS
\n
"
);
#endif
return
put_user
(
2
,
(
int
*
)
arg
);
return
put_user
(
2
,
p
);
case
SOUND_PCM_READ_BITS
:
#ifdef DEBUG
printk
(
"SOUND_PCM_READ_BITS
\n
"
);
#endif
return
put_user
(
AFMT_S16_LE
,
(
int
*
)
arg
);
return
put_user
(
AFMT_S16_LE
,
p
);
case
SNDCTL_DSP_SETSPDIF
:
/* Set S/PDIF Control register */
#ifdef DEBUG
printk
(
"SNDCTL_DSP_SETSPDIF
\n
"
);
#endif
if
(
get_user
(
val
,
(
int
*
)
arg
))
if
(
get_user
(
val
,
p
))
return
-
EFAULT
;
/* Check to make sure the codec supports S/PDIF transmitter */
...
...
@@ -2270,13 +2272,13 @@ static int i810_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
else
printk
(
KERN_WARNING
"i810_audio: S/PDIF transmitter not avalible.
\n
"
);
#endif
return
put_user
(
val
,
(
int
*
)
arg
);
return
put_user
(
val
,
p
);
case
SNDCTL_DSP_GETSPDIF
:
/* Get S/PDIF Control register */
#ifdef DEBUG
printk
(
"SNDCTL_DSP_GETSPDIF
\n
"
);
#endif
if
(
get_user
(
val
,
(
int
*
)
arg
))
if
(
get_user
(
val
,
p
))
return
-
EFAULT
;
/* Check to make sure the codec supports S/PDIF transmitter */
...
...
@@ -2289,14 +2291,14 @@ static int i810_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
}
else
{
val
=
i810_ac97_get
(
codec
,
AC97_SPDIF_CONTROL
);
}
//return put_user((val & 0xcfff),
(int *)arg
);
return
put_user
(
val
,
(
int
*
)
arg
);
//return put_user((val & 0xcfff),
p
);
return
put_user
(
val
,
p
);
case
SNDCTL_DSP_GETCHANNELMASK
:
#ifdef DEBUG
printk
(
"SNDCTL_DSP_GETCHANNELMASK
\n
"
);
#endif
if
(
get_user
(
val
,
(
int
*
)
arg
))
if
(
get_user
(
val
,
p
))
return
-
EFAULT
;
/* Based on AC'97 DAC support, not ICH hardware */
...
...
@@ -2309,13 +2311,13 @@ static int i810_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
if
(
state
->
card
->
ac97_features
&
0x0140
)
val
|=
DSP_BIND_CENTER_LFE
;
return
put_user
(
val
,
(
int
*
)
arg
);
return
put_user
(
val
,
p
);
case
SNDCTL_DSP_BIND_CHANNEL
:
#ifdef DEBUG
printk
(
"SNDCTL_DSP_BIND_CHANNEL
\n
"
);
#endif
if
(
get_user
(
val
,
(
int
*
)
arg
))
if
(
get_user
(
val
,
p
))
return
-
EFAULT
;
if
(
val
==
DSP_BIND_QUERY
)
{
val
=
DSP_BIND_FRONT
;
/* Always report this as being enabled */
...
...
@@ -2383,7 +2385,7 @@ static int i810_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
val
&=
~
DSP_BIND_CENTER_LFE
;
}
}
return
put_user
(
val
,
(
int
*
)
arg
);
return
put_user
(
val
,
p
);
case
SNDCTL_DSP_MAPINBUF
:
case
SNDCTL_DSP_MAPOUTBUF
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment