Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
5852973c
R
raspberrypi-kernel
项目概览
openeuler
/
raspberrypi-kernel
通知
13
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
raspberrypi-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
5852973c
编写于
1月 09, 2009
作者:
M
Mark Brown
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'for-2.6.29' into for-2.6.30
上级
3e8e1952
c6d1662b
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
16 addition
and
130 deletion
+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
未找到文件。
include/sound/soc-dapm.h
浏览文件 @
5852973c
...
...
@@ -188,7 +188,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
浏览文件 @
5852973c
...
...
@@ -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 }
...
...
@@ -224,8 +224,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
,
...
...
@@ -448,17 +446,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
浏览文件 @
5852973c
...
...
@@ -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
,
...
...
@@ -1265,6 +1265,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
浏览文件 @
5852973c
...
...
@@ -1615,37 +1615,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
...
...
@@ -1662,8 +1631,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
);
...
...
@@ -1702,8 +1670,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
浏览文件 @
5852973c
...
...
@@ -139,7 +139,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
;
...
...
@@ -202,30 +202,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
,
...
...
@@ -795,45 +771,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
,
...
...
@@ -1068,17 +1005,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
:
case
snd_soc_dapm_mixer_named_ctl
:
...
...
@@ -1407,8 +1339,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
);
...
...
@@ -1448,8 +1379,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
;
...
...
@@ -1468,7 +1398,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
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录