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
12e7b4a4
Commit
12e7b4a4
authored
Oct 26, 2015
by
Mark Brown
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'asoc/topic/dapm' into asoc-next
parents
6439e5c2
93e39a11
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
56 additions
and
6 deletions
+56
-6
include/sound/soc-dapm.h
include/sound/soc-dapm.h
+3
-0
sound/soc/soc-dapm.c
sound/soc/soc-dapm.c
+53
-6
No files found.
include/sound/soc-dapm.h
View file @
12e7b4a4
...
@@ -451,6 +451,9 @@ int snd_soc_dapm_dai_get_connected_widgets(struct snd_soc_dai *dai, int stream,
...
@@ -451,6 +451,9 @@ int snd_soc_dapm_dai_get_connected_widgets(struct snd_soc_dai *dai, int stream,
struct
snd_soc_dapm_context
*
snd_soc_dapm_kcontrol_dapm
(
struct
snd_soc_dapm_context
*
snd_soc_dapm_kcontrol_dapm
(
struct
snd_kcontrol
*
kcontrol
);
struct
snd_kcontrol
*
kcontrol
);
struct
snd_soc_dapm_widget
*
snd_soc_dapm_kcontrol_widget
(
struct
snd_kcontrol
*
kcontrol
);
int
snd_soc_dapm_force_bias_level
(
struct
snd_soc_dapm_context
*
dapm
,
int
snd_soc_dapm_force_bias_level
(
struct
snd_soc_dapm_context
*
dapm
,
enum
snd_soc_bias_level
level
);
enum
snd_soc_bias_level
level
);
...
...
sound/soc/soc-dapm.c
View file @
12e7b4a4
...
@@ -508,6 +508,18 @@ static bool dapm_kcontrol_set_value(const struct snd_kcontrol *kcontrol,
...
@@ -508,6 +508,18 @@ static bool dapm_kcontrol_set_value(const struct snd_kcontrol *kcontrol,
return
true
;
return
true
;
}
}
/**
* snd_soc_dapm_kcontrol_widget() - Returns the widget associated to a
* kcontrol
* @kcontrol: The kcontrol
*/
struct
snd_soc_dapm_widget
*
snd_soc_dapm_kcontrol_widget
(
struct
snd_kcontrol
*
kcontrol
)
{
return
dapm_kcontrol_get_wlist
(
kcontrol
)
->
widgets
[
0
];
}
EXPORT_SYMBOL_GPL
(
snd_soc_dapm_kcontrol_widget
);
/**
/**
* snd_soc_dapm_kcontrol_dapm() - Returns the dapm context associated to a
* snd_soc_dapm_kcontrol_dapm() - Returns the dapm context associated to a
* kcontrol
* kcontrol
...
@@ -779,7 +791,7 @@ static int dapm_is_shared_kcontrol(struct snd_soc_dapm_context *dapm,
...
@@ -779,7 +791,7 @@ static int dapm_is_shared_kcontrol(struct snd_soc_dapm_context *dapm,
* Determine if a kcontrol is shared. If it is, look it up. If it isn't,
* Determine if a kcontrol is shared. If it is, look it up. If it isn't,
* create it. Either way, add the widget into the control's widget list
* create it. Either way, add the widget into the control's widget list
*/
*/
static
int
dapm_create_or_share_
mixmux_
kcontrol
(
struct
snd_soc_dapm_widget
*
w
,
static
int
dapm_create_or_share_kcontrol
(
struct
snd_soc_dapm_widget
*
w
,
int
kci
)
int
kci
)
{
{
struct
snd_soc_dapm_context
*
dapm
=
w
->
dapm
;
struct
snd_soc_dapm_context
*
dapm
=
w
->
dapm
;
...
@@ -810,6 +822,7 @@ static int dapm_create_or_share_mixmux_kcontrol(struct snd_soc_dapm_widget *w,
...
@@ -810,6 +822,7 @@ static int dapm_create_or_share_mixmux_kcontrol(struct snd_soc_dapm_widget *w,
switch
(
w
->
id
)
{
switch
(
w
->
id
)
{
case
snd_soc_dapm_switch
:
case
snd_soc_dapm_switch
:
case
snd_soc_dapm_mixer
:
case
snd_soc_dapm_mixer
:
case
snd_soc_dapm_pga
:
wname_in_long_name
=
true
;
wname_in_long_name
=
true
;
kcname_in_long_name
=
true
;
kcname_in_long_name
=
true
;
break
;
break
;
...
@@ -899,7 +912,7 @@ static int dapm_new_mixer(struct snd_soc_dapm_widget *w)
...
@@ -899,7 +912,7 @@ static int dapm_new_mixer(struct snd_soc_dapm_widget *w)
continue
;
continue
;
if
(
!
w
->
kcontrols
[
i
])
{
if
(
!
w
->
kcontrols
[
i
])
{
ret
=
dapm_create_or_share_
mixmux_
kcontrol
(
w
,
i
);
ret
=
dapm_create_or_share_kcontrol
(
w
,
i
);
if
(
ret
<
0
)
if
(
ret
<
0
)
return
ret
;
return
ret
;
}
}
...
@@ -952,7 +965,7 @@ static int dapm_new_mux(struct snd_soc_dapm_widget *w)
...
@@ -952,7 +965,7 @@ static int dapm_new_mux(struct snd_soc_dapm_widget *w)
return
-
EINVAL
;
return
-
EINVAL
;
}
}
ret
=
dapm_create_or_share_
mixmux_
kcontrol
(
w
,
0
);
ret
=
dapm_create_or_share_kcontrol
(
w
,
0
);
if
(
ret
<
0
)
if
(
ret
<
0
)
return
ret
;
return
ret
;
...
@@ -967,9 +980,13 @@ static int dapm_new_mux(struct snd_soc_dapm_widget *w)
...
@@ -967,9 +980,13 @@ static int dapm_new_mux(struct snd_soc_dapm_widget *w)
/* create new dapm volume control */
/* create new dapm volume control */
static
int
dapm_new_pga
(
struct
snd_soc_dapm_widget
*
w
)
static
int
dapm_new_pga
(
struct
snd_soc_dapm_widget
*
w
)
{
{
if
(
w
->
num_kcontrols
)
int
i
,
ret
;
dev_err
(
w
->
dapm
->
dev
,
"ASoC: PGA controls not supported: '%s'
\n
"
,
w
->
name
);
for
(
i
=
0
;
i
<
w
->
num_kcontrols
;
i
++
)
{
ret
=
dapm_create_or_share_kcontrol
(
w
,
i
);
if
(
ret
<
0
)
return
ret
;
}
return
0
;
return
0
;
}
}
...
@@ -3473,11 +3490,29 @@ static int snd_soc_dai_link_event(struct snd_soc_dapm_widget *w,
...
@@ -3473,11 +3490,29 @@ static int snd_soc_dai_link_event(struct snd_soc_dapm_widget *w,
switch
(
event
)
{
switch
(
event
)
{
case
SND_SOC_DAPM_PRE_PMU
:
case
SND_SOC_DAPM_PRE_PMU
:
substream
.
stream
=
SNDRV_PCM_STREAM_CAPTURE
;
substream
.
stream
=
SNDRV_PCM_STREAM_CAPTURE
;
if
(
source
->
driver
->
ops
&&
source
->
driver
->
ops
->
startup
)
{
ret
=
source
->
driver
->
ops
->
startup
(
&
substream
,
source
);
if
(
ret
<
0
)
{
dev_err
(
source
->
dev
,
"ASoC: startup() failed: %d
\n
"
,
ret
);
goto
out
;
}
source
->
active
++
;
}
ret
=
soc_dai_hw_params
(
&
substream
,
params
,
source
);
ret
=
soc_dai_hw_params
(
&
substream
,
params
,
source
);
if
(
ret
<
0
)
if
(
ret
<
0
)
goto
out
;
goto
out
;
substream
.
stream
=
SNDRV_PCM_STREAM_PLAYBACK
;
substream
.
stream
=
SNDRV_PCM_STREAM_PLAYBACK
;
if
(
sink
->
driver
->
ops
&&
sink
->
driver
->
ops
->
startup
)
{
ret
=
sink
->
driver
->
ops
->
startup
(
&
substream
,
sink
);
if
(
ret
<
0
)
{
dev_err
(
sink
->
dev
,
"ASoC: startup() failed: %d
\n
"
,
ret
);
goto
out
;
}
sink
->
active
++
;
}
ret
=
soc_dai_hw_params
(
&
substream
,
params
,
sink
);
ret
=
soc_dai_hw_params
(
&
substream
,
params
,
sink
);
if
(
ret
<
0
)
if
(
ret
<
0
)
goto
out
;
goto
out
;
...
@@ -3497,6 +3532,18 @@ static int snd_soc_dai_link_event(struct snd_soc_dapm_widget *w,
...
@@ -3497,6 +3532,18 @@ static int snd_soc_dai_link_event(struct snd_soc_dapm_widget *w,
if
(
ret
!=
0
&&
ret
!=
-
ENOTSUPP
)
if
(
ret
!=
0
&&
ret
!=
-
ENOTSUPP
)
dev_warn
(
sink
->
dev
,
"ASoC: Failed to mute: %d
\n
"
,
ret
);
dev_warn
(
sink
->
dev
,
"ASoC: Failed to mute: %d
\n
"
,
ret
);
ret
=
0
;
ret
=
0
;
source
->
active
--
;
if
(
source
->
driver
->
ops
&&
source
->
driver
->
ops
->
shutdown
)
{
substream
.
stream
=
SNDRV_PCM_STREAM_CAPTURE
;
source
->
driver
->
ops
->
shutdown
(
&
substream
,
source
);
}
sink
->
active
--
;
if
(
sink
->
driver
->
ops
&&
sink
->
driver
->
ops
->
shutdown
)
{
substream
.
stream
=
SNDRV_PCM_STREAM_PLAYBACK
;
sink
->
driver
->
ops
->
shutdown
(
&
substream
,
sink
);
}
break
;
break
;
default:
default:
...
...
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