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
f2777c13
Commit
f2777c13
authored
Dec 16, 2015
by
Takashi Iwai
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'topic/firewire-update' into for-next
parents
5ce8cc48
4d2c50a0
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
46 additions
and
34 deletions
+46
-34
sound/firewire/fireworks/fireworks.h
sound/firewire/fireworks/fireworks.h
+2
-2
sound/firewire/fireworks/fireworks_midi.c
sound/firewire/fireworks/fireworks_midi.c
+12
-4
sound/firewire/fireworks/fireworks_pcm.c
sound/firewire/fireworks/fireworks_pcm.c
+20
-8
sound/firewire/fireworks/fireworks_stream.c
sound/firewire/fireworks/fireworks_stream.c
+12
-20
No files found.
sound/firewire/fireworks/fireworks.h
View file @
f2777c13
...
@@ -86,8 +86,8 @@ struct snd_efw {
...
@@ -86,8 +86,8 @@ struct snd_efw {
struct
amdtp_stream
rx_stream
;
struct
amdtp_stream
rx_stream
;
struct
cmp_connection
out_conn
;
struct
cmp_connection
out_conn
;
struct
cmp_connection
in_conn
;
struct
cmp_connection
in_conn
;
atomic_
t
capture_substreams
;
unsigned
in
t
capture_substreams
;
atomic_
t
playback_substreams
;
unsigned
in
t
playback_substreams
;
/* hardware metering parameters */
/* hardware metering parameters */
unsigned
int
phys_out
;
unsigned
int
phys_out
;
...
...
sound/firewire/fireworks/fireworks_midi.c
View file @
f2777c13
...
@@ -17,8 +17,10 @@ static int midi_capture_open(struct snd_rawmidi_substream *substream)
...
@@ -17,8 +17,10 @@ static int midi_capture_open(struct snd_rawmidi_substream *substream)
if
(
err
<
0
)
if
(
err
<
0
)
goto
end
;
goto
end
;
atomic_inc
(
&
efw
->
capture_substreams
);
mutex_lock
(
&
efw
->
mutex
);
efw
->
capture_substreams
++
;
err
=
snd_efw_stream_start_duplex
(
efw
,
0
);
err
=
snd_efw_stream_start_duplex
(
efw
,
0
);
mutex_unlock
(
&
efw
->
mutex
);
if
(
err
<
0
)
if
(
err
<
0
)
snd_efw_stream_lock_release
(
efw
);
snd_efw_stream_lock_release
(
efw
);
...
@@ -35,8 +37,10 @@ static int midi_playback_open(struct snd_rawmidi_substream *substream)
...
@@ -35,8 +37,10 @@ static int midi_playback_open(struct snd_rawmidi_substream *substream)
if
(
err
<
0
)
if
(
err
<
0
)
goto
end
;
goto
end
;
atomic_inc
(
&
efw
->
playback_substreams
);
mutex_lock
(
&
efw
->
mutex
);
efw
->
playback_substreams
++
;
err
=
snd_efw_stream_start_duplex
(
efw
,
0
);
err
=
snd_efw_stream_start_duplex
(
efw
,
0
);
mutex_unlock
(
&
efw
->
mutex
);
if
(
err
<
0
)
if
(
err
<
0
)
snd_efw_stream_lock_release
(
efw
);
snd_efw_stream_lock_release
(
efw
);
end:
end:
...
@@ -47,8 +51,10 @@ static int midi_capture_close(struct snd_rawmidi_substream *substream)
...
@@ -47,8 +51,10 @@ static int midi_capture_close(struct snd_rawmidi_substream *substream)
{
{
struct
snd_efw
*
efw
=
substream
->
rmidi
->
private_data
;
struct
snd_efw
*
efw
=
substream
->
rmidi
->
private_data
;
atomic_dec
(
&
efw
->
capture_substreams
);
mutex_lock
(
&
efw
->
mutex
);
efw
->
capture_substreams
--
;
snd_efw_stream_stop_duplex
(
efw
);
snd_efw_stream_stop_duplex
(
efw
);
mutex_unlock
(
&
efw
->
mutex
);
snd_efw_stream_lock_release
(
efw
);
snd_efw_stream_lock_release
(
efw
);
return
0
;
return
0
;
...
@@ -58,8 +64,10 @@ static int midi_playback_close(struct snd_rawmidi_substream *substream)
...
@@ -58,8 +64,10 @@ static int midi_playback_close(struct snd_rawmidi_substream *substream)
{
{
struct
snd_efw
*
efw
=
substream
->
rmidi
->
private_data
;
struct
snd_efw
*
efw
=
substream
->
rmidi
->
private_data
;
atomic_dec
(
&
efw
->
playback_substreams
);
mutex_lock
(
&
efw
->
mutex
);
efw
->
playback_substreams
--
;
snd_efw_stream_stop_duplex
(
efw
);
snd_efw_stream_stop_duplex
(
efw
);
mutex_unlock
(
&
efw
->
mutex
);
snd_efw_stream_lock_release
(
efw
);
snd_efw_stream_lock_release
(
efw
);
return
0
;
return
0
;
...
...
sound/firewire/fireworks/fireworks_pcm.c
View file @
f2777c13
...
@@ -251,8 +251,11 @@ static int pcm_capture_hw_params(struct snd_pcm_substream *substream,
...
@@ -251,8 +251,11 @@ static int pcm_capture_hw_params(struct snd_pcm_substream *substream,
if
(
err
<
0
)
if
(
err
<
0
)
return
err
;
return
err
;
if
(
substream
->
runtime
->
status
->
state
==
SNDRV_PCM_STATE_OPEN
)
if
(
substream
->
runtime
->
status
->
state
==
SNDRV_PCM_STATE_OPEN
)
{
atomic_inc
(
&
efw
->
capture_substreams
);
mutex_lock
(
&
efw
->
mutex
);
efw
->
capture_substreams
++
;
mutex_unlock
(
&
efw
->
mutex
);
}
amdtp_am824_set_pcm_format
(
&
efw
->
tx_stream
,
params_format
(
hw_params
));
amdtp_am824_set_pcm_format
(
&
efw
->
tx_stream
,
params_format
(
hw_params
));
...
@@ -269,8 +272,11 @@ static int pcm_playback_hw_params(struct snd_pcm_substream *substream,
...
@@ -269,8 +272,11 @@ static int pcm_playback_hw_params(struct snd_pcm_substream *substream,
if
(
err
<
0
)
if
(
err
<
0
)
return
err
;
return
err
;
if
(
substream
->
runtime
->
status
->
state
==
SNDRV_PCM_STATE_OPEN
)
if
(
substream
->
runtime
->
status
->
state
==
SNDRV_PCM_STATE_OPEN
)
{
atomic_inc
(
&
efw
->
playback_substreams
);
mutex_lock
(
&
efw
->
mutex
);
efw
->
playback_substreams
++
;
mutex_unlock
(
&
efw
->
mutex
);
}
amdtp_am824_set_pcm_format
(
&
efw
->
rx_stream
,
params_format
(
hw_params
));
amdtp_am824_set_pcm_format
(
&
efw
->
rx_stream
,
params_format
(
hw_params
));
...
@@ -281,8 +287,11 @@ static int pcm_capture_hw_free(struct snd_pcm_substream *substream)
...
@@ -281,8 +287,11 @@ static int pcm_capture_hw_free(struct snd_pcm_substream *substream)
{
{
struct
snd_efw
*
efw
=
substream
->
private_data
;
struct
snd_efw
*
efw
=
substream
->
private_data
;
if
(
substream
->
runtime
->
status
->
state
!=
SNDRV_PCM_STATE_OPEN
)
if
(
substream
->
runtime
->
status
->
state
!=
SNDRV_PCM_STATE_OPEN
)
{
atomic_dec
(
&
efw
->
capture_substreams
);
mutex_lock
(
&
efw
->
mutex
);
efw
->
capture_substreams
--
;
mutex_unlock
(
&
efw
->
mutex
);
}
snd_efw_stream_stop_duplex
(
efw
);
snd_efw_stream_stop_duplex
(
efw
);
...
@@ -292,8 +301,11 @@ static int pcm_playback_hw_free(struct snd_pcm_substream *substream)
...
@@ -292,8 +301,11 @@ static int pcm_playback_hw_free(struct snd_pcm_substream *substream)
{
{
struct
snd_efw
*
efw
=
substream
->
private_data
;
struct
snd_efw
*
efw
=
substream
->
private_data
;
if
(
substream
->
runtime
->
status
->
state
!=
SNDRV_PCM_STATE_OPEN
)
if
(
substream
->
runtime
->
status
->
state
!=
SNDRV_PCM_STATE_OPEN
)
{
atomic_dec
(
&
efw
->
playback_substreams
);
mutex_lock
(
&
efw
->
mutex
);
efw
->
playback_substreams
--
;
mutex_unlock
(
&
efw
->
mutex
);
}
snd_efw_stream_stop_duplex
(
efw
);
snd_efw_stream_stop_duplex
(
efw
);
...
...
sound/firewire/fireworks/fireworks_stream.c
View file @
f2777c13
...
@@ -209,16 +209,13 @@ int snd_efw_stream_init_duplex(struct snd_efw *efw)
...
@@ -209,16 +209,13 @@ int snd_efw_stream_init_duplex(struct snd_efw *efw)
int
snd_efw_stream_start_duplex
(
struct
snd_efw
*
efw
,
unsigned
int
rate
)
int
snd_efw_stream_start_duplex
(
struct
snd_efw
*
efw
,
unsigned
int
rate
)
{
{
struct
amdtp_stream
*
master
,
*
slave
;
struct
amdtp_stream
*
master
,
*
slave
;
atomic_t
*
slave_substreams
;
unsigned
int
slave_substreams
;
enum
cip_flags
sync_mode
;
enum
cip_flags
sync_mode
;
unsigned
int
curr_rate
;
unsigned
int
curr_rate
;
int
err
=
0
;
int
err
=
0
;
mutex_lock
(
&
efw
->
mutex
);
/* Need no substreams */
/* Need no substreams */
if
((
atomic_read
(
&
efw
->
playback_substreams
)
==
0
)
&&
if
(
efw
->
playback_substreams
==
0
&&
efw
->
capture_substreams
==
0
)
(
atomic_read
(
&
efw
->
capture_substreams
)
==
0
))
goto
end
;
goto
end
;
err
=
get_sync_mode
(
efw
,
&
sync_mode
);
err
=
get_sync_mode
(
efw
,
&
sync_mode
);
...
@@ -227,11 +224,11 @@ int snd_efw_stream_start_duplex(struct snd_efw *efw, unsigned int rate)
...
@@ -227,11 +224,11 @@ int snd_efw_stream_start_duplex(struct snd_efw *efw, unsigned int rate)
if
(
sync_mode
==
CIP_SYNC_TO_DEVICE
)
{
if
(
sync_mode
==
CIP_SYNC_TO_DEVICE
)
{
master
=
&
efw
->
tx_stream
;
master
=
&
efw
->
tx_stream
;
slave
=
&
efw
->
rx_stream
;
slave
=
&
efw
->
rx_stream
;
slave_substreams
=
&
efw
->
playback_substreams
;
slave_substreams
=
efw
->
playback_substreams
;
}
else
{
}
else
{
master
=
&
efw
->
rx_stream
;
master
=
&
efw
->
rx_stream
;
slave
=
&
efw
->
tx_stream
;
slave
=
&
efw
->
tx_stream
;
slave_substreams
=
&
efw
->
capture_substreams
;
slave_substreams
=
efw
->
capture_substreams
;
}
}
/*
/*
...
@@ -277,7 +274,7 @@ int snd_efw_stream_start_duplex(struct snd_efw *efw, unsigned int rate)
...
@@ -277,7 +274,7 @@ int snd_efw_stream_start_duplex(struct snd_efw *efw, unsigned int rate)
}
}
/* start slave if needed */
/* start slave if needed */
if
(
atomic_read
(
slave_substreams
)
>
0
&&
!
amdtp_stream_running
(
slave
))
{
if
(
slave_substreams
>
0
&&
!
amdtp_stream_running
(
slave
))
{
err
=
start_stream
(
efw
,
slave
,
rate
);
err
=
start_stream
(
efw
,
slave
,
rate
);
if
(
err
<
0
)
{
if
(
err
<
0
)
{
dev_err
(
&
efw
->
unit
->
device
,
dev_err
(
&
efw
->
unit
->
device
,
...
@@ -286,37 +283,32 @@ int snd_efw_stream_start_duplex(struct snd_efw *efw, unsigned int rate)
...
@@ -286,37 +283,32 @@ int snd_efw_stream_start_duplex(struct snd_efw *efw, unsigned int rate)
}
}
}
}
end:
end:
mutex_unlock
(
&
efw
->
mutex
);
return
err
;
return
err
;
}
}
void
snd_efw_stream_stop_duplex
(
struct
snd_efw
*
efw
)
void
snd_efw_stream_stop_duplex
(
struct
snd_efw
*
efw
)
{
{
struct
amdtp_stream
*
master
,
*
slave
;
struct
amdtp_stream
*
master
,
*
slave
;
atomic_t
*
master_substreams
,
*
slave_substreams
;
unsigned
int
master_substreams
,
slave_substreams
;
if
(
efw
->
master
==
&
efw
->
rx_stream
)
{
if
(
efw
->
master
==
&
efw
->
rx_stream
)
{
slave
=
&
efw
->
tx_stream
;
slave
=
&
efw
->
tx_stream
;
master
=
&
efw
->
rx_stream
;
master
=
&
efw
->
rx_stream
;
slave_substreams
=
&
efw
->
capture_substreams
;
slave_substreams
=
efw
->
capture_substreams
;
master_substreams
=
&
efw
->
playback_substreams
;
master_substreams
=
efw
->
playback_substreams
;
}
else
{
}
else
{
slave
=
&
efw
->
rx_stream
;
slave
=
&
efw
->
rx_stream
;
master
=
&
efw
->
tx_stream
;
master
=
&
efw
->
tx_stream
;
slave_substreams
=
&
efw
->
playback_substreams
;
slave_substreams
=
efw
->
playback_substreams
;
master_substreams
=
&
efw
->
capture_substreams
;
master_substreams
=
efw
->
capture_substreams
;
}
}
mutex_lock
(
&
efw
->
mutex
);
if
(
slave_substreams
==
0
)
{
if
(
atomic_read
(
slave_substreams
)
==
0
)
{
stop_stream
(
efw
,
slave
);
stop_stream
(
efw
,
slave
);
if
(
atomic_read
(
master_substreams
)
==
0
)
if
(
master_substreams
==
0
)
stop_stream
(
efw
,
master
);
stop_stream
(
efw
,
master
);
}
}
mutex_unlock
(
&
efw
->
mutex
);
}
}
void
snd_efw_stream_update_duplex
(
struct
snd_efw
*
efw
)
void
snd_efw_stream_update_duplex
(
struct
snd_efw
*
efw
)
...
...
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