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
1110afbe
Commit
1110afbe
authored
Sep 10, 2009
by
Takashi Iwai
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'topic/ymfpci' into for-linus
* topic/ymfpci: sound: ymfpci: increase timer resolution to 96 kHz
parents
fd30afa4
6e2efaac
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
5 deletions
+16
-5
include/sound/ymfpci.h
include/sound/ymfpci.h
+1
-0
sound/pci/ymfpci/ymfpci_main.c
sound/pci/ymfpci/ymfpci_main.c
+15
-5
No files found.
include/sound/ymfpci.h
View file @
1110afbe
...
...
@@ -331,6 +331,7 @@ struct snd_ymfpci {
struct
snd_ac97
*
ac97
;
struct
snd_rawmidi
*
rawmidi
;
struct
snd_timer
*
timer
;
unsigned
int
timer_ticks
;
struct
pci_dev
*
pci
;
struct
snd_card
*
card
;
...
...
sound/pci/ymfpci/ymfpci_main.c
View file @
1110afbe
...
...
@@ -834,7 +834,7 @@ static irqreturn_t snd_ymfpci_interrupt(int irq, void *dev_id)
status
=
snd_ymfpci_readw
(
chip
,
YDSXGR_INTFLAG
);
if
(
status
&
1
)
{
if
(
chip
->
timer
)
snd_timer_interrupt
(
chip
->
timer
,
chip
->
timer
->
s
ticks
);
snd_timer_interrupt
(
chip
->
timer
,
chip
->
timer
_
ticks
);
}
snd_ymfpci_writew
(
chip
,
YDSXGR_INTFLAG
,
status
);
...
...
@@ -1885,8 +1885,18 @@ static int snd_ymfpci_timer_start(struct snd_timer *timer)
unsigned
int
count
;
chip
=
snd_timer_chip
(
timer
);
count
=
(
timer
->
sticks
<<
1
)
-
1
;
spin_lock_irqsave
(
&
chip
->
reg_lock
,
flags
);
if
(
timer
->
sticks
>
1
)
{
chip
->
timer_ticks
=
timer
->
sticks
;
count
=
timer
->
sticks
-
1
;
}
else
{
/*
* Divisor 1 is not allowed; fake it by using divisor 2 and
* counting two ticks for each interrupt.
*/
chip
->
timer_ticks
=
2
;
count
=
2
-
1
;
}
snd_ymfpci_writew
(
chip
,
YDSXGR_TIMERCOUNT
,
count
);
snd_ymfpci_writeb
(
chip
,
YDSXGR_TIMERCTRL
,
0x03
);
spin_unlock_irqrestore
(
&
chip
->
reg_lock
,
flags
);
...
...
@@ -1909,14 +1919,14 @@ static int snd_ymfpci_timer_precise_resolution(struct snd_timer *timer,
unsigned
long
*
num
,
unsigned
long
*
den
)
{
*
num
=
1
;
*
den
=
48
000
;
*
den
=
96
000
;
return
0
;
}
static
struct
snd_timer_hardware
snd_ymfpci_timer_hw
=
{
.
flags
=
SNDRV_TIMER_HW_AUTO
,
.
resolution
=
20833
,
/* 1/fs = 20.8333
...us */
.
ticks
=
0x
8
000
,
.
resolution
=
10417
,
/* 1 / 96 kHz = 10.41666
...us */
.
ticks
=
0x
10
000
,
.
start
=
snd_ymfpci_timer_start
,
.
stop
=
snd_ymfpci_timer_stop
,
.
precise_resolution
=
snd_ymfpci_timer_precise_resolution
,
...
...
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