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
9229f43f
Commit
9229f43f
authored
Jan 12, 2009
by
Takashi Iwai
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'topic/asoc' into for-linus
parents
c5976504
c6d1662b
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
16 additions
and
130 deletions
+16
-130
include/sound/soc-dapm.h
include/sound/soc-dapm.h
+1
-1
include/sound/soc.h
include/sound/soc.h
+1
-14
sound/soc/codecs/twl4030.c
sound/soc/codecs/twl4030.c
+7
-5
sound/soc/soc-core.c
sound/soc/soc-core.c
+2
-35
sound/soc/soc-dapm.c
sound/soc/soc-dapm.c
+5
-75
No files found.
include/sound/soc-dapm.h
View file @
9229f43f
...
...
@@ -178,7 +178,7 @@
.private_value = (unsigned long)&xenum }
#define SOC_DAPM_VALUE_ENUM(xname, xenum) \
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
.info = snd_soc_info_
value_
enum_double, \
.info = snd_soc_info_enum_double, \
.get = snd_soc_dapm_get_value_enum_double, \
.put = snd_soc_dapm_put_value_enum_double, \
.private_value = (unsigned long)&xenum }
...
...
include/sound/soc.h
View file @
9229f43f
...
...
@@ -106,7 +106,7 @@
.private_value = (unsigned long)&xenum }
#define SOC_VALUE_ENUM(xname, xenum) \
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname,\
.info = snd_soc_info_
value_
enum_double, \
.info = snd_soc_info_enum_double, \
.get = snd_soc_get_value_enum_double, \
.put = snd_soc_put_value_enum_double, \
.private_value = (unsigned long)&xenum }
...
...
@@ -211,8 +211,6 @@ int snd_soc_get_enum_double(struct snd_kcontrol *kcontrol,
struct
snd_ctl_elem_value
*
ucontrol
);
int
snd_soc_put_enum_double
(
struct
snd_kcontrol
*
kcontrol
,
struct
snd_ctl_elem_value
*
ucontrol
);
int
snd_soc_info_value_enum_double
(
struct
snd_kcontrol
*
kcontrol
,
struct
snd_ctl_elem_info
*
uinfo
);
int
snd_soc_get_value_enum_double
(
struct
snd_kcontrol
*
kcontrol
,
struct
snd_ctl_elem_value
*
ucontrol
);
int
snd_soc_put_value_enum_double
(
struct
snd_kcontrol
*
kcontrol
,
...
...
@@ -414,17 +412,6 @@ struct soc_mixer_control {
/* enumerated kcontrol */
struct
soc_enum
{
unsigned
short
reg
;
unsigned
short
reg2
;
unsigned
char
shift_l
;
unsigned
char
shift_r
;
unsigned
int
max
;
const
char
**
texts
;
void
*
dapm
;
};
/* semi enumerated kcontrol */
struct
soc_value_enum
{
unsigned
short
reg
;
unsigned
short
reg2
;
unsigned
char
shift_l
;
...
...
sound/soc/codecs/twl4030.c
View file @
9229f43f
...
...
@@ -197,7 +197,7 @@ static const char *twl4030_earpiece_texts[] =
static
const
unsigned
int
twl4030_earpiece_values
[]
=
{
0x0
,
0x1
,
0x2
,
0x4
};
static
const
struct
soc_
value_
enum
twl4030_earpiece_enum
=
static
const
struct
soc_enum
twl4030_earpiece_enum
=
SOC_VALUE_ENUM_SINGLE
(
TWL4030_REG_EAR_CTL
,
1
,
0x7
,
ARRAY_SIZE
(
twl4030_earpiece_texts
),
twl4030_earpiece_texts
,
...
...
@@ -213,7 +213,7 @@ static const char *twl4030_predrivel_texts[] =
static
const
unsigned
int
twl4030_predrivel_values
[]
=
{
0x0
,
0x1
,
0x2
,
0x4
};
static
const
struct
soc_
value_
enum
twl4030_predrivel_enum
=
static
const
struct
soc_enum
twl4030_predrivel_enum
=
SOC_VALUE_ENUM_SINGLE
(
TWL4030_REG_PREDL_CTL
,
1
,
0x7
,
ARRAY_SIZE
(
twl4030_predrivel_texts
),
twl4030_predrivel_texts
,
...
...
@@ -229,7 +229,7 @@ static const char *twl4030_predriver_texts[] =
static
const
unsigned
int
twl4030_predriver_values
[]
=
{
0x0
,
0x1
,
0x2
,
0x4
};
static
const
struct
soc_
value_
enum
twl4030_predriver_enum
=
static
const
struct
soc_enum
twl4030_predriver_enum
=
SOC_VALUE_ENUM_SINGLE
(
TWL4030_REG_PREDR_CTL
,
1
,
0x7
,
ARRAY_SIZE
(
twl4030_predriver_texts
),
twl4030_predriver_texts
,
...
...
@@ -317,7 +317,7 @@ static const char *twl4030_analoglmic_texts[] =
static
const
unsigned
int
twl4030_analoglmic_values
[]
=
{
0x0
,
0x1
,
0x2
,
0x4
,
0x8
};
static
const
struct
soc_
value_
enum
twl4030_analoglmic_enum
=
static
const
struct
soc_enum
twl4030_analoglmic_enum
=
SOC_VALUE_ENUM_SINGLE
(
TWL4030_REG_ANAMICL
,
0
,
0xf
,
ARRAY_SIZE
(
twl4030_analoglmic_texts
),
twl4030_analoglmic_texts
,
...
...
@@ -333,7 +333,7 @@ static const char *twl4030_analogrmic_texts[] =
static
const
unsigned
int
twl4030_analogrmic_values
[]
=
{
0x0
,
0x1
,
0x4
};
static
const
struct
soc_
value_
enum
twl4030_analogrmic_enum
=
static
const
struct
soc_enum
twl4030_analogrmic_enum
=
SOC_VALUE_ENUM_SINGLE
(
TWL4030_REG_ANAMICR
,
0
,
0x5
,
ARRAY_SIZE
(
twl4030_analogrmic_texts
),
twl4030_analogrmic_texts
,
...
...
@@ -1280,6 +1280,8 @@ static int twl4030_remove(struct platform_device *pdev)
struct
snd_soc_codec
*
codec
=
socdev
->
codec
;
printk
(
KERN_INFO
"TWL4030 Audio Codec remove
\n
"
);
snd_soc_free_pcms
(
socdev
);
snd_soc_dapm_free
(
socdev
);
kfree
(
codec
);
return
0
;
...
...
sound/soc/soc-core.c
View file @
9229f43f
...
...
@@ -1584,37 +1584,6 @@ int snd_soc_put_enum_double(struct snd_kcontrol *kcontrol,
}
EXPORT_SYMBOL_GPL
(
snd_soc_put_enum_double
);
/**
* snd_soc_info_value_enum_double - semi enumerated double mixer info callback
* @kcontrol: mixer control
* @uinfo: control element information
*
* Callback to provide information about a double semi enumerated
* mixer control.
*
* Semi enumerated mixer: the enumerated items are referred as values. Can be
* used for handling bitfield coded enumeration for example.
*
* Returns 0 for success.
*/
int
snd_soc_info_value_enum_double
(
struct
snd_kcontrol
*
kcontrol
,
struct
snd_ctl_elem_info
*
uinfo
)
{
struct
soc_value_enum
*
e
=
(
struct
soc_value_enum
*
)
kcontrol
->
private_value
;
uinfo
->
type
=
SNDRV_CTL_ELEM_TYPE_ENUMERATED
;
uinfo
->
count
=
e
->
shift_l
==
e
->
shift_r
?
1
:
2
;
uinfo
->
value
.
enumerated
.
items
=
e
->
max
;
if
(
uinfo
->
value
.
enumerated
.
item
>
e
->
max
-
1
)
uinfo
->
value
.
enumerated
.
item
=
e
->
max
-
1
;
strcpy
(
uinfo
->
value
.
enumerated
.
name
,
e
->
texts
[
uinfo
->
value
.
enumerated
.
item
]);
return
0
;
}
EXPORT_SYMBOL_GPL
(
snd_soc_info_value_enum_double
);
/**
* snd_soc_get_value_enum_double - semi enumerated double mixer get callback
* @kcontrol: mixer control
...
...
@@ -1631,8 +1600,7 @@ int snd_soc_get_value_enum_double(struct snd_kcontrol *kcontrol,
struct
snd_ctl_elem_value
*
ucontrol
)
{
struct
snd_soc_codec
*
codec
=
snd_kcontrol_chip
(
kcontrol
);
struct
soc_value_enum
*
e
=
(
struct
soc_value_enum
*
)
kcontrol
->
private_value
;
struct
soc_enum
*
e
=
(
struct
soc_enum
*
)
kcontrol
->
private_value
;
unsigned
short
reg_val
,
val
,
mux
;
reg_val
=
snd_soc_read
(
codec
,
e
->
reg
);
...
...
@@ -1671,8 +1639,7 @@ int snd_soc_put_value_enum_double(struct snd_kcontrol *kcontrol,
struct
snd_ctl_elem_value
*
ucontrol
)
{
struct
snd_soc_codec
*
codec
=
snd_kcontrol_chip
(
kcontrol
);
struct
soc_value_enum
*
e
=
(
struct
soc_value_enum
*
)
kcontrol
->
private_value
;
struct
soc_enum
*
e
=
(
struct
soc_enum
*
)
kcontrol
->
private_value
;
unsigned
short
val
;
unsigned
short
mask
;
...
...
sound/soc/soc-dapm.c
View file @
9229f43f
...
...
@@ -137,7 +137,7 @@ static void dapm_set_path_status(struct snd_soc_dapm_widget *w,
}
break
;
case
snd_soc_dapm_value_mux
:
{
struct
soc_
value_enum
*
e
=
(
struct
soc_value
_enum
*
)
struct
soc_
enum
*
e
=
(
struct
soc
_enum
*
)
w
->
kcontrols
[
i
].
private_value
;
int
val
,
item
;
...
...
@@ -200,30 +200,6 @@ static int dapm_connect_mux(struct snd_soc_codec *codec,
return
-
ENODEV
;
}
/* connect value_mux widget to it's interconnecting audio paths */
static
int
dapm_connect_value_mux
(
struct
snd_soc_codec
*
codec
,
struct
snd_soc_dapm_widget
*
src
,
struct
snd_soc_dapm_widget
*
dest
,
struct
snd_soc_dapm_path
*
path
,
const
char
*
control_name
,
const
struct
snd_kcontrol_new
*
kcontrol
)
{
struct
soc_value_enum
*
e
=
(
struct
soc_value_enum
*
)
kcontrol
->
private_value
;
int
i
;
for
(
i
=
0
;
i
<
e
->
max
;
i
++
)
{
if
(
!
(
strcmp
(
control_name
,
e
->
texts
[
i
])))
{
list_add
(
&
path
->
list
,
&
codec
->
dapm_paths
);
list_add
(
&
path
->
list_sink
,
&
dest
->
sources
);
list_add
(
&
path
->
list_source
,
&
src
->
sinks
);
path
->
name
=
(
char
*
)
e
->
texts
[
i
];
dapm_set_path_status
(
dest
,
path
,
0
);
return
0
;
}
}
return
-
ENODEV
;
}
/* connect mixer widget to it's interconnecting audio paths */
static
int
dapm_connect_mixer
(
struct
snd_soc_codec
*
codec
,
struct
snd_soc_dapm_widget
*
src
,
struct
snd_soc_dapm_widget
*
dest
,
...
...
@@ -774,45 +750,6 @@ static int dapm_mux_update_power(struct snd_soc_dapm_widget *widget,
return
0
;
}
/* test and update the power status of a value_mux widget */
static
int
dapm_value_mux_update_power
(
struct
snd_soc_dapm_widget
*
widget
,
struct
snd_kcontrol
*
kcontrol
,
int
mask
,
int
mux
,
int
val
,
struct
soc_value_enum
*
e
)
{
struct
snd_soc_dapm_path
*
path
;
int
found
=
0
;
if
(
widget
->
id
!=
snd_soc_dapm_value_mux
)
return
-
ENODEV
;
if
(
!
snd_soc_test_bits
(
widget
->
codec
,
e
->
reg
,
mask
,
val
))
return
0
;
/* find dapm widget path assoc with kcontrol */
list_for_each_entry
(
path
,
&
widget
->
codec
->
dapm_paths
,
list
)
{
if
(
path
->
kcontrol
!=
kcontrol
)
continue
;
if
(
!
path
->
name
||
!
e
->
texts
[
mux
])
continue
;
found
=
1
;
/* we now need to match the string in the enum to the path */
if
(
!
(
strcmp
(
path
->
name
,
e
->
texts
[
mux
])))
path
->
connect
=
1
;
/* new connection */
else
path
->
connect
=
0
;
/* old connection must be
powered down */
}
if
(
found
)
{
dapm_power_widgets
(
widget
->
codec
,
SND_SOC_DAPM_STREAM_NOP
);
dump_dapm
(
widget
->
codec
,
"mux power update"
);
}
return
0
;
}
/* test and update the power status of a mixer or switch widget */
static
int
dapm_mixer_update_power
(
struct
snd_soc_dapm_widget
*
widget
,
struct
snd_kcontrol
*
kcontrol
,
int
reg
,
...
...
@@ -1045,17 +982,12 @@ static int snd_soc_dapm_add_route(struct snd_soc_codec *codec,
path
->
connect
=
1
;
return
0
;
case
snd_soc_dapm_mux
:
case
snd_soc_dapm_value_mux
:
ret
=
dapm_connect_mux
(
codec
,
wsource
,
wsink
,
path
,
control
,
&
wsink
->
kcontrols
[
0
]);
if
(
ret
!=
0
)
goto
err
;
break
;
case
snd_soc_dapm_value_mux
:
ret
=
dapm_connect_value_mux
(
codec
,
wsource
,
wsink
,
path
,
control
,
&
wsink
->
kcontrols
[
0
]);
if
(
ret
!=
0
)
goto
err
;
break
;
case
snd_soc_dapm_switch
:
case
snd_soc_dapm_mixer
:
ret
=
dapm_connect_mixer
(
codec
,
wsource
,
wsink
,
path
,
control
);
...
...
@@ -1382,8 +1314,7 @@ int snd_soc_dapm_get_value_enum_double(struct snd_kcontrol *kcontrol,
struct
snd_ctl_elem_value
*
ucontrol
)
{
struct
snd_soc_dapm_widget
*
widget
=
snd_kcontrol_chip
(
kcontrol
);
struct
soc_value_enum
*
e
=
(
struct
soc_value_enum
*
)
kcontrol
->
private_value
;
struct
soc_enum
*
e
=
(
struct
soc_enum
*
)
kcontrol
->
private_value
;
unsigned
short
reg_val
,
val
,
mux
;
reg_val
=
snd_soc_read
(
widget
->
codec
,
e
->
reg
);
...
...
@@ -1423,8 +1354,7 @@ int snd_soc_dapm_put_value_enum_double(struct snd_kcontrol *kcontrol,
struct
snd_ctl_elem_value
*
ucontrol
)
{
struct
snd_soc_dapm_widget
*
widget
=
snd_kcontrol_chip
(
kcontrol
);
struct
soc_value_enum
*
e
=
(
struct
soc_value_enum
*
)
kcontrol
->
private_value
;
struct
soc_enum
*
e
=
(
struct
soc_enum
*
)
kcontrol
->
private_value
;
unsigned
short
val
,
mux
;
unsigned
short
mask
;
int
ret
=
0
;
...
...
@@ -1443,7 +1373,7 @@ int snd_soc_dapm_put_value_enum_double(struct snd_kcontrol *kcontrol,
mutex_lock
(
&
widget
->
codec
->
mutex
);
widget
->
value
=
val
;
dapm_
value_
mux_update_power
(
widget
,
kcontrol
,
mask
,
mux
,
val
,
e
);
dapm_mux_update_power
(
widget
,
kcontrol
,
mask
,
mux
,
val
,
e
);
if
(
widget
->
event
)
{
if
(
widget
->
event_flags
&
SND_SOC_DAPM_PRE_REG
)
{
ret
=
widget
->
event
(
widget
,
...
...
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