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
Kirill Smelkov
linux
Commits
102cc871
Commit
102cc871
authored
Jul 11, 2003
by
Alan Cox
Committed by
Steve French
Jul 11, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] update ymfpci for new ac97
parent
0d988dba
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
9 deletions
+22
-9
sound/oss/ymfpci.c
sound/oss/ymfpci.c
+21
-9
sound/oss/ymfpci.h
sound/oss/ymfpci.h
+1
-0
No files found.
sound/oss/ymfpci.c
View file @
102cc871
...
...
@@ -177,15 +177,16 @@ static void ymfpci_codec_write(struct ac97_codec *dev, u8 reg, u16 val)
ymfpci_t
*
codec
=
dev
->
private_data
;
u32
cmd
;
spin_lock
(
&
codec
->
ac97_lock
);
/* XXX Do make use of dev->id */
ymfpci_codec_ready
(
codec
,
0
,
0
);
cmd
=
((
YDSXG_AC97WRITECMD
|
reg
)
<<
16
)
|
val
;
ymfpci_writel
(
codec
,
YDSXGR_AC97CMDDATA
,
cmd
);
spin_unlock
(
&
codec
->
ac97_lock
);
}
static
u16
ymfpci_codec_read
(
struct
ac97_codec
*
dev
,
u8
reg
)
static
u16
_ymfpci_codec_read
(
ymfpci_t
*
unit
,
u8
reg
)
{
ymfpci_t
*
unit
=
dev
->
private_data
;
int
i
;
if
(
ymfpci_codec_ready
(
unit
,
0
,
0
))
...
...
@@ -200,6 +201,18 @@ static u16 ymfpci_codec_read(struct ac97_codec *dev, u8 reg)
return
ymfpci_readw
(
unit
,
YDSXGR_PRISTATUSDATA
);
}
static
u16
ymfpci_codec_read
(
struct
ac97_codec
*
dev
,
u8
reg
)
{
ymfpci_t
*
unit
=
dev
->
private_data
;
u16
ret
;
spin_lock
(
&
unit
->
ac97_lock
);
ret
=
_ymfpci_codec_read
(
unit
,
reg
);
spin_unlock
(
&
unit
->
ac97_lock
);
return
ret
;
}
/*
* Misc routines
*/
...
...
@@ -2444,9 +2457,8 @@ static int ymf_ac97_init(ymfpci_t *unit, int num_ac97)
struct
ac97_codec
*
codec
;
u16
eid
;
if
((
codec
=
kmalloc
(
sizeof
(
struct
ac97_codec
),
GFP_KERNEL
))
==
NULL
)
if
((
codec
=
ac97_alloc_codec
(
))
==
NULL
)
return
-
ENOMEM
;
memset
(
codec
,
0
,
sizeof
(
struct
ac97_codec
));
/* initialize some basic codec information, other fields will be filled
in ac97_probe_codec */
...
...
@@ -2462,7 +2474,7 @@ static int ymf_ac97_init(ymfpci_t *unit, int num_ac97)
}
eid
=
ymfpci_codec_read
(
codec
,
AC97_EXTENDED_ID
);
if
(
eid
==
0xFFFF
FF
)
{
if
(
eid
==
0xFFFF
)
{
printk
(
KERN_WARNING
"ymfpci: no codec attached ?
\n
"
);
goto
out_kfree
;
}
...
...
@@ -2478,7 +2490,7 @@ static int ymf_ac97_init(ymfpci_t *unit, int num_ac97)
return
0
;
out_kfree:
kfree
(
codec
);
ac97_release_codec
(
codec
);
return
-
ENODEV
;
}
...
...
@@ -2517,6 +2529,7 @@ static int __devinit ymf_probe_one(struct pci_dev *pcidev, const struct pci_devi
spin_lock_init
(
&
codec
->
reg_lock
);
spin_lock_init
(
&
codec
->
voice_lock
);
spin_lock_init
(
&
codec
->
ac97_lock
);
init_MUTEX
(
&
codec
->
open_sem
);
INIT_LIST_HEAD
(
&
codec
->
states
);
codec
->
pci
=
pcidev
;
...
...
@@ -2615,7 +2628,7 @@ static int __devinit ymf_probe_one(struct pci_dev *pcidev, const struct pci_devi
out_release_region:
release_mem_region
(
pci_resource_start
(
pcidev
,
0
),
0x8000
);
out_free:
kfree
(
codec
);
ac97_release_codec
(
codec
->
ac97_codec
[
0
]
);
return
-
ENODEV
;
}
...
...
@@ -2628,7 +2641,7 @@ static void __devexit ymf_remove_one(struct pci_dev *pcidev)
list_del
(
&
codec
->
ymf_devs
);
unregister_sound_mixer
(
codec
->
ac97_codec
[
0
]
->
dev_mixer
);
kfree
(
codec
->
ac97_codec
[
0
]);
ac97_release_codec
(
codec
->
ac97_codec
[
0
]);
unregister_sound_dsp
(
codec
->
dev_audio
);
free_irq
(
pcidev
->
irq
,
codec
);
ymfpci_memfree
(
codec
);
...
...
@@ -2643,7 +2656,6 @@ static void __devexit ymf_remove_one(struct pci_dev *pcidev)
unload_uart401
(
&
codec
->
mpu_data
);
}
#endif
/* CONFIG_SOUND_YMFPCI_LEGACY */
kfree
(
codec
);
}
MODULE_AUTHOR
(
"Jaroslav Kysela"
);
...
...
sound/oss/ymfpci.h
View file @
102cc871
...
...
@@ -275,6 +275,7 @@ struct ymf_unit {
spinlock_t
reg_lock
;
spinlock_t
voice_lock
;
spinlock_t
ac97_lock
;
/* soundcore stuff */
int
dev_audio
;
...
...
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