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
4253f3a8
Commit
4253f3a8
authored
Aug 30, 2015
by
Mark Brown
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'asoc/topic/dapm' into asoc-next
parents
24ecc23c
6e588a0d
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
311 additions
and
347 deletions
+311
-347
include/sound/soc-dapm.h
include/sound/soc-dapm.h
+72
-12
include/trace/events/asoc.h
include/trace/events/asoc.h
+15
-38
sound/soc/intel/atom/sst-atom-controls.c
sound/soc/intel/atom/sst-atom-controls.c
+2
-2
sound/soc/soc-dapm.c
sound/soc/soc-dapm.c
+219
-262
sound/soc/soc-pcm.c
sound/soc/soc-pcm.c
+2
-9
sound/soc/soc-topology.c
sound/soc/soc-topology.c
+1
-24
No files found.
include/sound/soc-dapm.h
View file @
4253f3a8
...
...
@@ -397,6 +397,7 @@ int snd_soc_dapm_del_routes(struct snd_soc_dapm_context *dapm,
const
struct
snd_soc_dapm_route
*
route
,
int
num
);
int
snd_soc_dapm_weak_routes
(
struct
snd_soc_dapm_context
*
dapm
,
const
struct
snd_soc_dapm_route
*
route
,
int
num
);
void
snd_soc_dapm_free_widget
(
struct
snd_soc_dapm_widget
*
w
);
/* dapm events */
void
snd_soc_dapm_stream_event
(
struct
snd_soc_pcm_runtime
*
rtd
,
int
stream
,
...
...
@@ -511,9 +512,18 @@ struct snd_soc_dapm_route {
struct
snd_soc_dapm_path
{
const
char
*
name
;
/* source (input) and sink (output) widgets */
struct
snd_soc_dapm_widget
*
source
;
struct
snd_soc_dapm_widget
*
sink
;
/*
* source (input) and sink (output) widgets
* The union is for convience, since it is a lot nicer to type
* p->source, rather than p->node[SND_SOC_DAPM_DIR_IN]
*/
union
{
struct
{
struct
snd_soc_dapm_widget
*
source
;
struct
snd_soc_dapm_widget
*
sink
;
};
struct
snd_soc_dapm_widget
*
node
[
2
];
};
/* status */
u32
connect
:
1
;
/* source and sink widgets are connected */
...
...
@@ -524,8 +534,7 @@ struct snd_soc_dapm_path {
int
(
*
connected
)(
struct
snd_soc_dapm_widget
*
source
,
struct
snd_soc_dapm_widget
*
sink
);
struct
list_head
list_source
;
struct
list_head
list_sink
;
struct
list_head
list_node
[
2
];
struct
list_head
list_kcontrol
;
struct
list_head
list
;
};
...
...
@@ -559,8 +568,7 @@ struct snd_soc_dapm_widget {
unsigned
char
new_power
:
1
;
/* power from this run */
unsigned
char
power_checked
:
1
;
/* power checked this run */
unsigned
char
is_supply
:
1
;
/* Widget is a supply type widget */
unsigned
char
is_sink
:
1
;
/* Widget is a sink type widget */
unsigned
char
is_source
:
1
;
/* Widget is a source type widget */
unsigned
char
is_ep
:
2
;
/* Widget is a endpoint type widget */
int
subseq
;
/* sort within widget type */
int
(
*
power_check
)(
struct
snd_soc_dapm_widget
*
w
);
...
...
@@ -575,16 +583,14 @@ struct snd_soc_dapm_widget {
struct
snd_kcontrol
**
kcontrols
;
struct
snd_soc_dobj
dobj
;
/* widget input and outputs */
struct
list_head
sources
;
struct
list_head
sinks
;
/* widget input and output edges */
struct
list_head
edges
[
2
];
/* used during DAPM updates */
struct
list_head
work_list
;
struct
list_head
power_list
;
struct
list_head
dirty
;
int
inputs
;
int
outputs
;
int
endpoints
[
2
];
struct
clk
*
clk
;
};
...
...
@@ -672,4 +678,58 @@ static inline enum snd_soc_bias_level snd_soc_dapm_get_bias_level(
return
dapm
->
bias_level
;
}
enum
snd_soc_dapm_direction
{
SND_SOC_DAPM_DIR_IN
,
SND_SOC_DAPM_DIR_OUT
};
#define SND_SOC_DAPM_DIR_TO_EP(x) BIT(x)
#define SND_SOC_DAPM_EP_SOURCE SND_SOC_DAPM_DIR_TO_EP(SND_SOC_DAPM_DIR_IN)
#define SND_SOC_DAPM_EP_SINK SND_SOC_DAPM_DIR_TO_EP(SND_SOC_DAPM_DIR_OUT)
/**
* snd_soc_dapm_widget_for_each_sink_path - Iterates over all paths in the
* specified direction of a widget
* @w: The widget
* @dir: Whether to iterate over the paths where the specified widget is the
* incoming or outgoing widgets
* @p: The path iterator variable
*/
#define snd_soc_dapm_widget_for_each_path(w, dir, p) \
list_for_each_entry(p, &w->edges[dir], list_node[dir])
/**
* snd_soc_dapm_widget_for_each_sink_path_safe - Iterates over all paths in the
* specified direction of a widget
* @w: The widget
* @dir: Whether to iterate over the paths where the specified widget is the
* incoming or outgoing widgets
* @p: The path iterator variable
* @next_p: Temporary storage for the next path
*
* This function works like snd_soc_dapm_widget_for_each_sink_path, expect that
* it is safe to remove the current path from the list while iterating
*/
#define snd_soc_dapm_widget_for_each_path_safe(w, dir, p, next_p) \
list_for_each_entry_safe(p, next_p, &w->edges[dir], list_node[dir])
/**
* snd_soc_dapm_widget_for_each_sink_path - Iterates over all paths leaving a
* widget
* @w: The widget
* @p: The path iterator variable
*/
#define snd_soc_dapm_widget_for_each_sink_path(w, p) \
snd_soc_dapm_widget_for_each_path(w, SND_SOC_DAPM_DIR_IN, p)
/**
* snd_soc_dapm_widget_for_each_source_path - Iterates over all paths leading to
* a widget
* @w: The widget
* @p: The path iterator variable
*/
#define snd_soc_dapm_widget_for_each_source_path(w, p) \
snd_soc_dapm_widget_for_each_path(w, SND_SOC_DAPM_DIR_OUT, p)
#endif
include/trace/events/asoc.h
View file @
4253f3a8
...
...
@@ -8,6 +8,7 @@
#include <linux/tracepoint.h>
#define DAPM_DIRECT "(direct)"
#define DAPM_ARROW(dir) (((dir) == SND_SOC_DAPM_DIR_OUT) ? "->" : "<-")
struct
snd_soc_jack
;
struct
snd_soc_codec
;
...
...
@@ -152,62 +153,38 @@ TRACE_EVENT(snd_soc_dapm_walk_done,
(
int
)
__entry
->
path_checks
,
(
int
)
__entry
->
neighbour_checks
)
);
TRACE_EVENT
(
snd_soc_dapm_
output_
path
,
TRACE_EVENT
(
snd_soc_dapm_path
,
TP_PROTO
(
struct
snd_soc_dapm_widget
*
widget
,
enum
snd_soc_dapm_direction
dir
,
struct
snd_soc_dapm_path
*
path
),
TP_ARGS
(
widget
,
path
),
TP_ARGS
(
widget
,
dir
,
path
),
TP_STRUCT__entry
(
__string
(
wname
,
widget
->
name
)
__string
(
pname
,
path
->
name
?
path
->
name
:
DAPM_DIRECT
)
__string
(
p
sname
,
path
->
sink
->
name
)
__field
(
int
,
path_
sink
)
__string
(
p
nname
,
path
->
node
[
dir
]
->
name
)
__field
(
int
,
path_
node
)
__field
(
int
,
path_connect
)
__field
(
int
,
path_dir
)
),
TP_fast_assign
(
__assign_str
(
wname
,
widget
->
name
);
__assign_str
(
pname
,
path
->
name
?
path
->
name
:
DAPM_DIRECT
);
__assign_str
(
p
sname
,
path
->
sink
->
name
);
__assign_str
(
p
nname
,
path
->
node
[
dir
]
->
name
);
__entry
->
path_connect
=
path
->
connect
;
__entry
->
path_sink
=
(
long
)
path
->
sink
;
__entry
->
path_node
=
(
long
)
path
->
node
[
dir
];
__entry
->
path_dir
=
dir
;
),
TP_printk
(
"%c%s
-> %s ->
%s"
,
(
int
)
__entry
->
path_
sink
&&
TP_printk
(
"%c%s
%s %s %s
%s"
,
(
int
)
__entry
->
path_
node
&&
(
int
)
__entry
->
path_connect
?
'*'
:
' '
,
__get_str
(
wname
),
__get_str
(
pname
),
__get_str
(
psname
))
);
TRACE_EVENT
(
snd_soc_dapm_input_path
,
TP_PROTO
(
struct
snd_soc_dapm_widget
*
widget
,
struct
snd_soc_dapm_path
*
path
),
TP_ARGS
(
widget
,
path
),
TP_STRUCT__entry
(
__string
(
wname
,
widget
->
name
)
__string
(
pname
,
path
->
name
?
path
->
name
:
DAPM_DIRECT
)
__string
(
psname
,
path
->
source
->
name
)
__field
(
int
,
path_source
)
__field
(
int
,
path_connect
)
),
TP_fast_assign
(
__assign_str
(
wname
,
widget
->
name
);
__assign_str
(
pname
,
path
->
name
?
path
->
name
:
DAPM_DIRECT
);
__assign_str
(
psname
,
path
->
source
->
name
);
__entry
->
path_connect
=
path
->
connect
;
__entry
->
path_source
=
(
long
)
path
->
source
;
),
TP_printk
(
"%c%s <- %s <- %s"
,
(
int
)
__entry
->
path_source
&&
(
int
)
__entry
->
path_connect
?
'*'
:
' '
,
__get_str
(
wname
),
__get_str
(
pname
),
__get_str
(
psname
))
__get_str
(
wname
),
DAPM_ARROW
(
__entry
->
path_dir
),
__get_str
(
pname
),
DAPM_ARROW
(
__entry
->
path_dir
),
__get_str
(
pnname
))
);
TRACE_EVENT
(
snd_soc_dapm_connected
,
...
...
sound/soc/intel/atom/sst-atom-controls.c
View file @
4253f3a8
...
...
@@ -1298,7 +1298,7 @@ int sst_send_pipe_gains(struct snd_soc_dai *dai, int stream, int mute)
dev_dbg
(
dai
->
dev
,
"Stream name=%s
\n
"
,
dai
->
playback_widget
->
name
);
w
=
dai
->
playback_widget
;
list_for_each_entry
(
p
,
&
w
->
sinks
,
list_source
)
{
snd_soc_dapm_widget_for_each_sink_path
(
w
,
p
)
{
if
(
p
->
connected
&&
!
p
->
connected
(
w
,
p
->
sink
))
continue
;
...
...
@@ -1317,7 +1317,7 @@ int sst_send_pipe_gains(struct snd_soc_dai *dai, int stream, int mute)
dev_dbg
(
dai
->
dev
,
"Stream name=%s
\n
"
,
dai
->
capture_widget
->
name
);
w
=
dai
->
capture_widget
;
list_for_each_entry
(
p
,
&
w
->
sources
,
list_sink
)
{
snd_soc_dapm_widget_for_each_source_path
(
w
,
p
)
{
if
(
p
->
connected
&&
!
p
->
connected
(
w
,
p
->
sink
))
continue
;
...
...
sound/soc/soc-dapm.c
View file @
4253f3a8
This diff is collapsed.
Click to expand it.
sound/soc/soc-pcm.c
View file @
4253f3a8
...
...
@@ -1231,24 +1231,17 @@ static int widget_in_list(struct snd_soc_dapm_widget_list *list,
}
int
dpcm_path_get
(
struct
snd_soc_pcm_runtime
*
fe
,
int
stream
,
struct
snd_soc_dapm_widget_list
**
list
_
)
int
stream
,
struct
snd_soc_dapm_widget_list
**
list
)
{
struct
snd_soc_dai
*
cpu_dai
=
fe
->
cpu_dai
;
struct
snd_soc_dapm_widget_list
*
list
;
int
paths
;
list
=
kzalloc
(
sizeof
(
struct
snd_soc_dapm_widget_list
)
+
sizeof
(
struct
snd_soc_dapm_widget
*
),
GFP_KERNEL
);
if
(
list
==
NULL
)
return
-
ENOMEM
;
/* get number of valid DAI paths and their widgets */
paths
=
snd_soc_dapm_dai_get_connected_widgets
(
cpu_dai
,
stream
,
&
list
);
paths
=
snd_soc_dapm_dai_get_connected_widgets
(
cpu_dai
,
stream
,
list
);
dev_dbg
(
fe
->
dev
,
"ASoC: found %d audio %s paths
\n
"
,
paths
,
stream
?
"capture"
:
"playback"
);
*
list_
=
list
;
return
paths
;
}
...
...
sound/soc/soc-topology.c
View file @
4253f3a8
...
...
@@ -1758,7 +1758,6 @@ void snd_soc_tplg_widget_remove_all(struct snd_soc_dapm_context *dapm,
u32
index
)
{
struct
snd_soc_dapm_widget
*
w
,
*
next_w
;
struct
snd_soc_dapm_path
*
p
,
*
next_p
;
list_for_each_entry_safe
(
w
,
next_w
,
&
dapm
->
card
->
widgets
,
list
)
{
...
...
@@ -1770,31 +1769,9 @@ void snd_soc_tplg_widget_remove_all(struct snd_soc_dapm_context *dapm,
if
(
w
->
dobj
.
index
!=
index
&&
w
->
dobj
.
index
!=
SND_SOC_TPLG_INDEX_ALL
)
continue
;
list_del
(
&
w
->
list
);
/*
* remove source and sink paths associated to this widget.
* While removing the path, remove reference to it from both
* source and sink widgets so that path is removed only once.
*/
list_for_each_entry_safe
(
p
,
next_p
,
&
w
->
sources
,
list_sink
)
{
list_del
(
&
p
->
list_sink
);
list_del
(
&
p
->
list_source
);
list_del
(
&
p
->
list
);
kfree
(
p
);
}
list_for_each_entry_safe
(
p
,
next_p
,
&
w
->
sinks
,
list_source
)
{
list_del
(
&
p
->
list_sink
);
list_del
(
&
p
->
list_source
);
list_del
(
&
p
->
list
);
kfree
(
p
);
}
/* check and free and dynamic widget kcontrols */
snd_soc_tplg_widget_remove
(
w
);
kfree
(
w
->
kcontrols
);
kfree
(
w
->
name
);
kfree
(
w
);
snd_soc_dapm_free_widget
(
w
);
}
}
EXPORT_SYMBOL_GPL
(
snd_soc_tplg_widget_remove_all
);
...
...
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