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
38f7d75e
Commit
38f7d75e
authored
Aug 27, 2013
by
Mark Brown
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'asoc/topic/dapm' into asoc-core
parents
c22cff94
34742cb0
Changes
11
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
628 additions
and
493 deletions
+628
-493
include/sound/soc-dapm.h
include/sound/soc-dapm.h
+118
-81
include/sound/soc-dpcm.h
include/sound/soc-dpcm.h
+1
-1
include/sound/soc.h
include/sound/soc.h
+16
-13
sound/soc/codecs/tlv320aic3x.c
sound/soc/codecs/tlv320aic3x.c
+17
-35
sound/soc/codecs/twl6040.c
sound/soc/codecs/twl6040.c
+1
-3
sound/soc/codecs/wm8903.c
sound/soc/codecs/wm8903.c
+1
-3
sound/soc/codecs/wm8994.c
sound/soc/codecs/wm8994.c
+1
-3
sound/soc/codecs/wm8995.c
sound/soc/codecs/wm8995.c
+1
-4
sound/soc/codecs/wm_hubs.c
sound/soc/codecs/wm_hubs.c
+2
-6
sound/soc/soc-dapm.c
sound/soc/soc-dapm.c
+469
-335
sound/soc/soc-pcm.c
sound/soc/soc-pcm.c
+1
-9
No files found.
include/sound/soc-dapm.h
View file @
38f7d75e
This diff is collapsed.
Click to expand it.
include/sound/soc-dpcm.h
View file @
38f7d75e
...
...
@@ -133,6 +133,6 @@ void snd_soc_dpcm_be_set_state(struct snd_soc_pcm_runtime *be, int stream,
/* internal use only */
int
soc_dpcm_be_digital_mute
(
struct
snd_soc_pcm_runtime
*
fe
,
int
mute
);
int
soc_dpcm_debugfs_add
(
struct
snd_soc_pcm_runtime
*
rtd
);
int
soc_dpcm_runtime_update
(
struct
snd_soc_
dapm_widget
*
);
int
soc_dpcm_runtime_update
(
struct
snd_soc_
card
*
);
#endif
include/sound/soc.h
View file @
38f7d75e
...
...
@@ -30,13 +30,13 @@
/*
* Convenience kcontrol builders
*/
#define SOC_DOUBLE_VALUE(xreg, shift_left, shift_right, xmax, xinvert) \
#define SOC_DOUBLE_VALUE(xreg, shift_left, shift_right, xmax, xinvert
, xautodisable
) \
((unsigned long)&(struct soc_mixer_control) \
{.reg = xreg, .rreg = xreg, .shift = shift_left, \
.rshift = shift_right, .max = xmax, .platform_max = xmax, \
.invert = xinvert})
#define SOC_SINGLE_VALUE(xreg, xshift, xmax, xinvert) \
SOC_DOUBLE_VALUE(xreg, xshift, xshift, xmax, xinvert)
.invert = xinvert
, .autodisable = xautodisable
})
#define SOC_SINGLE_VALUE(xreg, xshift, xmax, xinvert
, xautodisable
) \
SOC_DOUBLE_VALUE(xreg, xshift, xshift, xmax, xinvert
, xautodisable
)
#define SOC_SINGLE_VALUE_EXT(xreg, xmax, xinvert) \
((unsigned long)&(struct soc_mixer_control) \
{.reg = xreg, .max = xmax, .platform_max = xmax, .invert = xinvert})
...
...
@@ -52,7 +52,7 @@
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
.info = snd_soc_info_volsw, .get = snd_soc_get_volsw,\
.put = snd_soc_put_volsw, \
.private_value =
SOC_SINGLE_VALUE(reg, shift, max, invert
) }
.private_value =
SOC_SINGLE_VALUE(reg, shift, max, invert, 0
) }
#define SOC_SINGLE_RANGE(xname, xreg, xshift, xmin, xmax, xinvert) \
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\
.info = snd_soc_info_volsw_range, .get = snd_soc_get_volsw_range, \
...
...
@@ -68,7 +68,7 @@
.tlv.p = (tlv_array), \
.info = snd_soc_info_volsw, .get = snd_soc_get_volsw,\
.put = snd_soc_put_volsw, \
.private_value =
SOC_SINGLE_VALUE(reg, shift, max, invert
) }
.private_value =
SOC_SINGLE_VALUE(reg, shift, max, invert, 0
) }
#define SOC_SINGLE_SX_TLV(xname, xreg, xshift, xmin, xmax, tlv_array) \
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
.access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | \
...
...
@@ -97,7 +97,7 @@
.info = snd_soc_info_volsw, .get = snd_soc_get_volsw, \
.put = snd_soc_put_volsw, \
.private_value = SOC_DOUBLE_VALUE(reg, shift_left, shift_right, \
max, invert) }
max, invert
, 0
) }
#define SOC_DOUBLE_R(xname, reg_left, reg_right, xshift, xmax, xinvert) \
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \
.info = snd_soc_info_volsw, \
...
...
@@ -119,7 +119,7 @@
.info = snd_soc_info_volsw, .get = snd_soc_get_volsw, \
.put = snd_soc_put_volsw, \
.private_value = SOC_DOUBLE_VALUE(reg, shift_left, shift_right, \
max, invert) }
max, invert
, 0
) }
#define SOC_DOUBLE_R_TLV(xname, reg_left, reg_right, xshift, xmax, xinvert, tlv_array) \
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\
.access = SNDRV_CTL_ELEM_ACCESS_TLV_READ |\
...
...
@@ -190,14 +190,14 @@
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
.info = snd_soc_info_volsw, \
.get = xhandler_get, .put = xhandler_put, \
.private_value = SOC_SINGLE_VALUE(xreg, xshift, xmax, xinvert) }
.private_value = SOC_SINGLE_VALUE(xreg, xshift, xmax, xinvert
, 0
) }
#define SOC_DOUBLE_EXT(xname, reg, shift_left, shift_right, max, invert,\
xhandler_get, xhandler_put) \
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\
.info = snd_soc_info_volsw, \
.get = xhandler_get, .put = xhandler_put, \
.private_value = \
SOC_DOUBLE_VALUE(reg, shift_left, shift_right, max, invert) }
SOC_DOUBLE_VALUE(reg, shift_left, shift_right, max, invert
, 0
) }
#define SOC_SINGLE_EXT_TLV(xname, xreg, xshift, xmax, xinvert,\
xhandler_get, xhandler_put, tlv_array) \
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
...
...
@@ -206,7 +206,7 @@
.tlv.p = (tlv_array), \
.info = snd_soc_info_volsw, \
.get = xhandler_get, .put = xhandler_put, \
.private_value = SOC_SINGLE_VALUE(xreg, xshift, xmax, xinvert) }
.private_value = SOC_SINGLE_VALUE(xreg, xshift, xmax, xinvert
, 0
) }
#define SOC_DOUBLE_EXT_TLV(xname, xreg, shift_left, shift_right, xmax, xinvert,\
xhandler_get, xhandler_put, tlv_array) \
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \
...
...
@@ -216,7 +216,7 @@
.info = snd_soc_info_volsw, \
.get = xhandler_get, .put = xhandler_put, \
.private_value = SOC_DOUBLE_VALUE(xreg, shift_left, shift_right, \
xmax, xinvert) }
xmax, xinvert
, 0
) }
#define SOC_DOUBLE_R_EXT_TLV(xname, reg_left, reg_right, xshift, xmax, xinvert,\
xhandler_get, xhandler_put, tlv_array) \
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \
...
...
@@ -1038,6 +1038,7 @@ struct snd_soc_card {
/* Generic DAPM context for the card */
struct
snd_soc_dapm_context
dapm
;
struct
snd_soc_dapm_stats
dapm_stats
;
struct
snd_soc_dapm_update
*
update
;
#ifdef CONFIG_DEBUG_FS
struct
dentry
*
debugfs_card_root
;
...
...
@@ -1083,7 +1084,9 @@ struct snd_soc_pcm_runtime {
/* mixer control */
struct
soc_mixer_control
{
int
min
,
max
,
platform_max
;
unsigned
int
reg
,
rreg
,
shift
,
rshift
,
invert
;
unsigned
int
reg
,
rreg
,
shift
,
rshift
;
unsigned
int
invert
:
1
;
unsigned
int
autodisable
:
1
;
};
struct
soc_bytes
{
...
...
sound/soc/codecs/tlv320aic3x.c
View file @
38f7d75e
...
...
@@ -138,8 +138,7 @@ static const u8 aic3x_reg[AIC3X_CACHEREGNUM] = {
static
int
snd_soc_dapm_put_volsw_aic3x
(
struct
snd_kcontrol
*
kcontrol
,
struct
snd_ctl_elem_value
*
ucontrol
)
{
struct
snd_soc_dapm_widget_list
*
wlist
=
snd_kcontrol_chip
(
kcontrol
);
struct
snd_soc_dapm_widget
*
widget
=
wlist
->
widgets
[
0
];
struct
snd_soc_codec
*
codec
=
snd_soc_dapm_kcontrol_codec
(
kcontrol
);
struct
soc_mixer_control
*
mc
=
(
struct
soc_mixer_control
*
)
kcontrol
->
private_value
;
unsigned
int
reg
=
mc
->
reg
;
...
...
@@ -147,10 +146,9 @@ static int snd_soc_dapm_put_volsw_aic3x(struct snd_kcontrol *kcontrol,
int
max
=
mc
->
max
;
unsigned
int
mask
=
(
1
<<
fls
(
max
))
-
1
;
unsigned
int
invert
=
mc
->
invert
;
unsigned
short
val
,
val_mask
;
int
ret
;
struct
snd_soc_dapm_path
*
path
;
int
found
=
0
;
unsigned
short
val
;
struct
snd_soc_dapm_update
update
;
int
connect
,
change
;
val
=
(
ucontrol
->
value
.
integer
.
value
[
0
]
&
mask
);
...
...
@@ -158,42 +156,26 @@ static int snd_soc_dapm_put_volsw_aic3x(struct snd_kcontrol *kcontrol,
if
(
val
)
val
=
mask
;
connect
=
!!
val
;
if
(
invert
)
val
=
mask
-
val
;
val_mask
=
mask
<<
shift
;
val
=
val
<<
shift
;
mutex_lock
(
&
widget
->
codec
->
mutex
);
if
(
snd_soc_test_bits
(
widget
->
codec
,
reg
,
val_mask
,
val
))
{
/* find dapm widget path assoc with kcontrol */
list_for_each_entry
(
path
,
&
widget
->
dapm
->
card
->
paths
,
list
)
{
if
(
path
->
kcontrol
!=
kcontrol
)
continue
;
mask
<<=
shift
;
val
<<=
shift
;
/* found, now check type */
found
=
1
;
if
(
val
)
/* new connection */
path
->
connect
=
invert
?
0
:
1
;
else
/* old connection must be powered down */
path
->
connect
=
invert
?
1
:
0
;
change
=
snd_soc_test_bits
(
codec
,
val
,
mask
,
reg
);
if
(
change
)
{
update
.
kcontrol
=
kcontrol
;
update
.
reg
=
reg
;
update
.
mask
=
mask
;
update
.
val
=
val
;
dapm_mark_dirty
(
path
->
source
,
"tlv320aic3x source"
);
dapm_mark_dirty
(
path
->
sink
,
"tlv320aic3x sink"
);
break
;
}
snd_soc_dapm_mixer_update_power
(
&
codec
->
dapm
,
kcontrol
,
connect
,
&
update
);
}
mutex_unlock
(
&
widget
->
codec
->
mutex
);
if
(
found
)
snd_soc_dapm_sync
(
widget
->
dapm
);
ret
=
snd_soc_update_bits_locked
(
widget
->
codec
,
reg
,
val_mask
,
val
);
return
ret
;
return
change
;
}
/*
...
...
sound/soc/codecs/twl6040.c
View file @
38f7d75e
...
...
@@ -437,9 +437,7 @@ static irqreturn_t twl6040_audio_handler(int irq, void *data)
static
int
twl6040_soc_dapm_put_vibra_enum
(
struct
snd_kcontrol
*
kcontrol
,
struct
snd_ctl_elem_value
*
ucontrol
)
{
struct
snd_soc_dapm_widget_list
*
wlist
=
snd_kcontrol_chip
(
kcontrol
);
struct
snd_soc_dapm_widget
*
widget
=
wlist
->
widgets
[
0
];
struct
snd_soc_codec
*
codec
=
widget
->
codec
;
struct
snd_soc_codec
*
codec
=
snd_soc_dapm_kcontrol_codec
(
kcontrol
);
struct
soc_enum
*
e
=
(
struct
soc_enum
*
)
kcontrol
->
private_value
;
unsigned
int
val
;
...
...
sound/soc/codecs/wm8903.c
View file @
38f7d75e
...
...
@@ -364,9 +364,7 @@ static void wm8903_seq_notifier(struct snd_soc_dapm_context *dapm,
static
int
wm8903_class_w_put
(
struct
snd_kcontrol
*
kcontrol
,
struct
snd_ctl_elem_value
*
ucontrol
)
{
struct
snd_soc_dapm_widget_list
*
wlist
=
snd_kcontrol_chip
(
kcontrol
);
struct
snd_soc_dapm_widget
*
widget
=
wlist
->
widgets
[
0
];
struct
snd_soc_codec
*
codec
=
widget
->
codec
;
struct
snd_soc_codec
*
codec
=
snd_soc_dapm_kcontrol_codec
(
kcontrol
);
struct
wm8903_priv
*
wm8903
=
snd_soc_codec_get_drvdata
(
codec
);
u16
reg
;
int
ret
;
...
...
sound/soc/codecs/wm8994.c
View file @
38f7d75e
...
...
@@ -1437,9 +1437,7 @@ SOC_DAPM_SINGLE("AIF1.1 Switch", WM8994_DAC2_RIGHT_MIXER_ROUTING,
static
int
wm8994_put_class_w
(
struct
snd_kcontrol
*
kcontrol
,
struct
snd_ctl_elem_value
*
ucontrol
)
{
struct
snd_soc_dapm_widget_list
*
wlist
=
snd_kcontrol_chip
(
kcontrol
);
struct
snd_soc_dapm_widget
*
w
=
wlist
->
widgets
[
0
];
struct
snd_soc_codec
*
codec
=
w
->
codec
;
struct
snd_soc_codec
*
codec
=
snd_soc_dapm_kcontrol_codec
(
kcontrol
);
int
ret
;
ret
=
snd_soc_dapm_put_volsw
(
kcontrol
,
ucontrol
);
...
...
sound/soc/codecs/wm8995.c
View file @
38f7d75e
...
...
@@ -549,12 +549,9 @@ static int check_clk_sys(struct snd_soc_dapm_widget *source,
static
int
wm8995_put_class_w
(
struct
snd_kcontrol
*
kcontrol
,
struct
snd_ctl_elem_value
*
ucontrol
)
{
struct
snd_soc_dapm_widget_list
*
wlist
=
snd_kcontrol_chip
(
kcontrol
);
struct
snd_soc_dapm_widget
*
w
=
wlist
->
widgets
[
0
];
struct
snd_soc_codec
*
codec
;
struct
snd_soc_codec
*
codec
=
snd_soc_dapm_kcontrol_codec
(
kcontrol
);
int
ret
;
codec
=
w
->
codec
;
ret
=
snd_soc_dapm_put_volsw
(
kcontrol
,
ucontrol
);
wm8995_update_class_w
(
codec
);
return
ret
;
...
...
sound/soc/codecs/wm_hubs.c
View file @
38f7d75e
...
...
@@ -699,9 +699,7 @@ EXPORT_SYMBOL_GPL(wm_hubs_update_class_w);
static
int
class_w_put_volsw
(
struct
snd_kcontrol
*
kcontrol
,
struct
snd_ctl_elem_value
*
ucontrol
)
{
struct
snd_soc_dapm_widget_list
*
wlist
=
snd_kcontrol_chip
(
kcontrol
);
struct
snd_soc_dapm_widget
*
widget
=
wlist
->
widgets
[
0
];
struct
snd_soc_codec
*
codec
=
widget
->
codec
;
struct
snd_soc_codec
*
codec
=
snd_soc_dapm_kcontrol_codec
(
kcontrol
);
int
ret
;
ret
=
snd_soc_dapm_put_volsw
(
kcontrol
,
ucontrol
);
...
...
@@ -721,9 +719,7 @@ static int class_w_put_volsw(struct snd_kcontrol *kcontrol,
static
int
class_w_put_double
(
struct
snd_kcontrol
*
kcontrol
,
struct
snd_ctl_elem_value
*
ucontrol
)
{
struct
snd_soc_dapm_widget_list
*
wlist
=
snd_kcontrol_chip
(
kcontrol
);
struct
snd_soc_dapm_widget
*
widget
=
wlist
->
widgets
[
0
];
struct
snd_soc_codec
*
codec
=
widget
->
codec
;
struct
snd_soc_codec
*
codec
=
snd_soc_dapm_kcontrol_codec
(
kcontrol
);
int
ret
;
ret
=
snd_soc_dapm_put_enum_double
(
kcontrol
,
ucontrol
);
...
...
sound/soc/soc-dapm.c
View file @
38f7d75e
This diff is collapsed.
Click to expand it.
sound/soc/soc-pcm.c
View file @
38f7d75e
...
...
@@ -1833,18 +1833,10 @@ static int dpcm_run_old_update(struct snd_soc_pcm_runtime *fe, int stream)
/* Called by DAPM mixer/mux changes to update audio routing between PCMs and
* any DAI links.
*/
int
soc_dpcm_runtime_update
(
struct
snd_soc_
dapm_widget
*
widget
)
int
soc_dpcm_runtime_update
(
struct
snd_soc_
card
*
card
)
{
struct
snd_soc_card
*
card
;
int
i
,
old
,
new
,
paths
;
if
(
widget
->
codec
)
card
=
widget
->
codec
->
card
;
else
if
(
widget
->
platform
)
card
=
widget
->
platform
->
card
;
else
return
-
EINVAL
;
mutex_lock_nested
(
&
card
->
mutex
,
SND_SOC_CARD_CLASS_RUNTIME
);
for
(
i
=
0
;
i
<
card
->
num_rtd
;
i
++
)
{
struct
snd_soc_dapm_widget_list
*
list
;
...
...
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