Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
kernel_linux
提交
a1cb98ac
K
kernel_linux
项目概览
OpenHarmony
/
kernel_linux
上一次同步 4 年多
通知
15
Star
8
Fork
2
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
kernel_linux
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
a1cb98ac
编写于
8月 04, 2014
作者:
M
Mark Brown
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'asoc/topic/component' into asoc-next
上级
7c081528
0f2780ad
变更
23
展开全部
显示空白变更内容
内联
并排
Showing
23 changed file
with
1125 addition
and
749 deletion
+1125
-749
include/sound/soc-dai.h
include/sound/soc-dai.h
+4
-1
include/sound/soc-dapm.h
include/sound/soc-dapm.h
+5
-3
include/sound/soc.h
include/sound/soc.h
+57
-21
include/trace/events/asoc.h
include/trace/events/asoc.h
+3
-3
sound/soc/codecs/ac97.c
sound/soc/codecs/ac97.c
+2
-2
sound/soc/codecs/cx20442.c
sound/soc/codecs/cx20442.c
+3
-3
sound/soc/codecs/tlv320dac33.c
sound/soc/codecs/tlv320dac33.c
+1
-1
sound/soc/codecs/uda134x.c
sound/soc/codecs/uda134x.c
+1
-1
sound/soc/codecs/wm8960.c
sound/soc/codecs/wm8960.c
+1
-1
sound/soc/codecs/wm_adsp.c
sound/soc/codecs/wm_adsp.c
+2
-2
sound/soc/omap/ams-delta.c
sound/soc/omap/ams-delta.c
+1
-1
sound/soc/soc-cache.c
sound/soc/soc-cache.c
+3
-4
sound/soc/soc-compress.c
sound/soc/soc-compress.c
+10
-3
sound/soc/soc-core.c
sound/soc/soc-core.c
+462
-384
sound/soc/soc-dapm.c
sound/soc/soc-dapm.c
+158
-121
sound/soc/soc-jack.c
sound/soc/soc-jack.c
+2
-2
sound/soc/soc-pcm.c
sound/soc/soc-pcm.c
+400
-180
sound/soc/tegra/tegra_alc5632.c
sound/soc/tegra/tegra_alc5632.c
+2
-3
sound/soc/tegra/tegra_max98090.c
sound/soc/tegra/tegra_max98090.c
+2
-3
sound/soc/tegra/tegra_rt5640.c
sound/soc/tegra/tegra_rt5640.c
+2
-3
sound/soc/tegra/tegra_wm8753.c
sound/soc/tegra/tegra_wm8753.c
+1
-2
sound/soc/tegra/tegra_wm8903.c
sound/soc/tegra/tegra_wm8903.c
+2
-3
sound/soc/tegra/trimslice.c
sound/soc/tegra/trimslice.c
+1
-2
未找到文件。
include/sound/soc-dai.h
浏览文件 @
a1cb98ac
...
@@ -257,7 +257,6 @@ struct snd_soc_dai {
...
@@ -257,7 +257,6 @@ struct snd_soc_dai {
struct
snd_soc_dapm_widget
*
playback_widget
;
struct
snd_soc_dapm_widget
*
playback_widget
;
struct
snd_soc_dapm_widget
*
capture_widget
;
struct
snd_soc_dapm_widget
*
capture_widget
;
struct
snd_soc_dapm_context
dapm
;
/* DAI DMA data */
/* DAI DMA data */
void
*
playback_dma_data
;
void
*
playback_dma_data
;
...
@@ -273,6 +272,10 @@ struct snd_soc_dai {
...
@@ -273,6 +272,10 @@ struct snd_soc_dai {
struct
snd_soc_codec
*
codec
;
struct
snd_soc_codec
*
codec
;
struct
snd_soc_component
*
component
;
struct
snd_soc_component
*
component
;
/* CODEC TDM slot masks and params (for fixup) */
unsigned
int
tx_mask
;
unsigned
int
rx_mask
;
struct
snd_soc_card
*
card
;
struct
snd_soc_card
*
card
;
struct
list_head
list
;
struct
list_head
list
;
...
...
include/sound/soc-dapm.h
浏览文件 @
a1cb98ac
...
@@ -431,7 +431,7 @@ int snd_soc_dapm_force_enable_pin_unlocked(struct snd_soc_dapm_context *dapm,
...
@@ -431,7 +431,7 @@ int snd_soc_dapm_force_enable_pin_unlocked(struct snd_soc_dapm_context *dapm,
const
char
*
pin
);
const
char
*
pin
);
int
snd_soc_dapm_ignore_suspend
(
struct
snd_soc_dapm_context
*
dapm
,
int
snd_soc_dapm_ignore_suspend
(
struct
snd_soc_dapm_context
*
dapm
,
const
char
*
pin
);
const
char
*
pin
);
void
snd_soc_dapm_auto_nc_
codec_pins
(
struct
snd_soc_codec
*
codec
);
void
snd_soc_dapm_auto_nc_
pins
(
struct
snd_soc_card
*
card
);
/* Mostly internal - should not normally be used */
/* Mostly internal - should not normally be used */
void
dapm_mark_io_dirty
(
struct
snd_soc_dapm_context
*
dapm
);
void
dapm_mark_io_dirty
(
struct
snd_soc_dapm_context
*
dapm
);
...
@@ -441,6 +441,8 @@ int snd_soc_dapm_dai_get_connected_widgets(struct snd_soc_dai *dai, int stream,
...
@@ -441,6 +441,8 @@ int snd_soc_dapm_dai_get_connected_widgets(struct snd_soc_dai *dai, int stream,
struct
snd_soc_dapm_widget_list
**
list
);
struct
snd_soc_dapm_widget_list
**
list
);
struct
snd_soc_codec
*
snd_soc_dapm_kcontrol_codec
(
struct
snd_kcontrol
*
kcontrol
);
struct
snd_soc_codec
*
snd_soc_dapm_kcontrol_codec
(
struct
snd_kcontrol
*
kcontrol
);
struct
snd_soc_dapm_context
*
snd_soc_dapm_kcontrol_dapm
(
struct
snd_kcontrol
*
kcontrol
);
/* dapm widget types */
/* dapm widget types */
enum
snd_soc_dapm_type
{
enum
snd_soc_dapm_type
{
...
@@ -524,7 +526,6 @@ struct snd_soc_dapm_widget {
...
@@ -524,7 +526,6 @@ struct snd_soc_dapm_widget {
const
char
*
name
;
/* widget name */
const
char
*
name
;
/* widget name */
const
char
*
sname
;
/* stream name */
const
char
*
sname
;
/* stream name */
struct
snd_soc_codec
*
codec
;
struct
snd_soc_codec
*
codec
;
struct
snd_soc_platform
*
platform
;
struct
list_head
list
;
struct
list_head
list
;
struct
snd_soc_dapm_context
*
dapm
;
struct
snd_soc_dapm_context
*
dapm
;
...
@@ -593,7 +594,6 @@ struct snd_soc_dapm_context {
...
@@ -593,7 +594,6 @@ struct snd_soc_dapm_context {
struct
device
*
dev
;
/* from parent - for debug */
struct
device
*
dev
;
/* from parent - for debug */
struct
snd_soc_component
*
component
;
/* parent component */
struct
snd_soc_component
*
component
;
/* parent component */
struct
snd_soc_codec
*
codec
;
/* parent codec */
struct
snd_soc_codec
*
codec
;
/* parent codec */
struct
snd_soc_platform
*
platform
;
/* parent platform */
struct
snd_soc_card
*
card
;
/* parent card */
struct
snd_soc_card
*
card
;
/* parent card */
/* used during DAPM updates */
/* used during DAPM updates */
...
@@ -601,6 +601,8 @@ struct snd_soc_dapm_context {
...
@@ -601,6 +601,8 @@ struct snd_soc_dapm_context {
struct
list_head
list
;
struct
list_head
list
;
int
(
*
stream_event
)(
struct
snd_soc_dapm_context
*
dapm
,
int
event
);
int
(
*
stream_event
)(
struct
snd_soc_dapm_context
*
dapm
,
int
event
);
int
(
*
set_bias_level
)(
struct
snd_soc_dapm_context
*
dapm
,
enum
snd_soc_bias_level
level
);
#ifdef CONFIG_DEBUG_FS
#ifdef CONFIG_DEBUG_FS
struct
dentry
*
debugfs_dapm
;
struct
dentry
*
debugfs_dapm
;
...
...
include/sound/soc.h
浏览文件 @
a1cb98ac
...
@@ -436,6 +436,10 @@ int snd_soc_set_runtime_hwparams(struct snd_pcm_substream *substream,
...
@@ -436,6 +436,10 @@ int snd_soc_set_runtime_hwparams(struct snd_pcm_substream *substream,
int
snd_soc_platform_trigger
(
struct
snd_pcm_substream
*
substream
,
int
snd_soc_platform_trigger
(
struct
snd_pcm_substream
*
substream
,
int
cmd
,
struct
snd_soc_platform
*
platform
);
int
cmd
,
struct
snd_soc_platform
*
platform
);
int
soc_dai_hw_params
(
struct
snd_pcm_substream
*
substream
,
struct
snd_pcm_hw_params
*
params
,
struct
snd_soc_dai
*
dai
);
/* Jack reporting */
/* Jack reporting */
int
snd_soc_jack_new
(
struct
snd_soc_codec
*
codec
,
const
char
*
id
,
int
type
,
int
snd_soc_jack_new
(
struct
snd_soc_codec
*
codec
,
const
char
*
id
,
int
type
,
struct
snd_soc_jack
*
jack
);
struct
snd_soc_jack
*
jack
);
...
@@ -503,10 +507,12 @@ struct snd_kcontrol *snd_soc_cnew(const struct snd_kcontrol_new *_template,
...
@@ -503,10 +507,12 @@ struct snd_kcontrol *snd_soc_cnew(const struct snd_kcontrol_new *_template,
const
char
*
prefix
);
const
char
*
prefix
);
struct
snd_kcontrol
*
snd_soc_card_get_kcontrol
(
struct
snd_soc_card
*
soc_card
,
struct
snd_kcontrol
*
snd_soc_card_get_kcontrol
(
struct
snd_soc_card
*
soc_card
,
const
char
*
name
);
const
char
*
name
);
int
snd_soc_add_component_controls
(
struct
snd_soc_component
*
component
,
const
struct
snd_kcontrol_new
*
controls
,
unsigned
int
num_controls
);
int
snd_soc_add_codec_controls
(
struct
snd_soc_codec
*
codec
,
int
snd_soc_add_codec_controls
(
struct
snd_soc_codec
*
codec
,
const
struct
snd_kcontrol_new
*
controls
,
int
num_controls
);
const
struct
snd_kcontrol_new
*
controls
,
unsigned
int
num_controls
);
int
snd_soc_add_platform_controls
(
struct
snd_soc_platform
*
platform
,
int
snd_soc_add_platform_controls
(
struct
snd_soc_platform
*
platform
,
const
struct
snd_kcontrol_new
*
controls
,
int
num_controls
);
const
struct
snd_kcontrol_new
*
controls
,
unsigned
int
num_controls
);
int
snd_soc_add_card_controls
(
struct
snd_soc_card
*
soc_card
,
int
snd_soc_add_card_controls
(
struct
snd_soc_card
*
soc_card
,
const
struct
snd_kcontrol_new
*
controls
,
int
num_controls
);
const
struct
snd_kcontrol_new
*
controls
,
int
num_controls
);
int
snd_soc_add_dai_controls
(
struct
snd_soc_dai
*
dai
,
int
snd_soc_add_dai_controls
(
struct
snd_soc_dai
*
dai
,
...
@@ -677,12 +683,17 @@ struct snd_soc_component_driver {
...
@@ -677,12 +683,17 @@ struct snd_soc_component_driver {
int
(
*
of_xlate_dai_name
)(
struct
snd_soc_component
*
component
,
int
(
*
of_xlate_dai_name
)(
struct
snd_soc_component
*
component
,
struct
of_phandle_args
*
args
,
struct
of_phandle_args
*
args
,
const
char
**
dai_name
);
const
char
**
dai_name
);
void
(
*
seq_notifier
)(
struct
snd_soc_component
*
,
enum
snd_soc_dapm_type
,
int
subseq
);
int
(
*
stream_event
)(
struct
snd_soc_component
*
,
int
event
);
};
};
struct
snd_soc_component
{
struct
snd_soc_component
{
const
char
*
name
;
const
char
*
name
;
int
id
;
int
id
;
const
char
*
name_prefix
;
struct
device
*
dev
;
struct
device
*
dev
;
struct
snd_soc_card
*
card
;
unsigned
int
active
;
unsigned
int
active
;
...
@@ -705,18 +716,18 @@ struct snd_soc_component {
...
@@ -705,18 +716,18 @@ struct snd_soc_component {
int
val_bytes
;
int
val_bytes
;
struct
mutex
io_mutex
;
struct
mutex
io_mutex
;
/* Don't use these, use snd_soc_component_get_dapm() */
struct
snd_soc_dapm_context
dapm
;
struct
snd_soc_dapm_context
*
dapm_ptr
;
};
};
/* SoC Audio Codec device */
/* SoC Audio Codec device */
struct
snd_soc_codec
{
struct
snd_soc_codec
{
const
char
*
name
;
const
char
*
name_prefix
;
int
id
;
struct
device
*
dev
;
struct
device
*
dev
;
const
struct
snd_soc_codec_driver
*
driver
;
const
struct
snd_soc_codec_driver
*
driver
;
struct
mutex
mutex
;
struct
mutex
mutex
;
struct
snd_soc_card
*
card
;
struct
list_head
list
;
struct
list_head
list
;
struct
list_head
card_list
;
struct
list_head
card_list
;
...
@@ -790,9 +801,6 @@ struct snd_soc_codec_driver {
...
@@ -790,9 +801,6 @@ struct snd_soc_codec_driver {
void
(
*
seq_notifier
)(
struct
snd_soc_dapm_context
*
,
void
(
*
seq_notifier
)(
struct
snd_soc_dapm_context
*
,
enum
snd_soc_dapm_type
,
int
);
enum
snd_soc_dapm_type
,
int
);
/* codec stream completion event */
int
(
*
stream_event
)(
struct
snd_soc_dapm_context
*
dapm
,
int
event
);
bool
ignore_pmdown_time
;
/* Doesn't benefit from pmdown delay */
bool
ignore_pmdown_time
;
/* Doesn't benefit from pmdown delay */
/* probe ordering - for components with runtime dependencies */
/* probe ordering - for components with runtime dependencies */
...
@@ -834,9 +842,6 @@ struct snd_soc_platform_driver {
...
@@ -834,9 +842,6 @@ struct snd_soc_platform_driver {
/* platform stream compress ops */
/* platform stream compress ops */
const
struct
snd_compr_ops
*
compr_ops
;
const
struct
snd_compr_ops
*
compr_ops
;
/* platform stream completion event */
int
(
*
stream_event
)(
struct
snd_soc_dapm_context
*
dapm
,
int
event
);
/* probe ordering - for components with runtime dependencies */
/* probe ordering - for components with runtime dependencies */
int
probe_order
;
int
probe_order
;
int
remove_order
;
int
remove_order
;
...
@@ -847,23 +852,23 @@ struct snd_soc_platform_driver {
...
@@ -847,23 +852,23 @@ struct snd_soc_platform_driver {
int
(
*
bespoke_trigger
)(
struct
snd_pcm_substream
*
,
int
);
int
(
*
bespoke_trigger
)(
struct
snd_pcm_substream
*
,
int
);
};
};
struct
snd_soc_
platform
{
struct
snd_soc_
dai_link_component
{
const
char
*
name
;
const
char
*
name
;
int
id
;
const
struct
device_node
*
of_node
;
const
char
*
dai_name
;
};
struct
snd_soc_platform
{
struct
device
*
dev
;
struct
device
*
dev
;
const
struct
snd_soc_platform_driver
*
driver
;
const
struct
snd_soc_platform_driver
*
driver
;
unsigned
int
suspended
:
1
;
/* platform is suspended */
unsigned
int
suspended
:
1
;
/* platform is suspended */
unsigned
int
probed
:
1
;
unsigned
int
probed
:
1
;
struct
snd_soc_card
*
card
;
struct
list_head
list
;
struct
list_head
list
;
struct
list_head
card_list
;
struct
snd_soc_component
component
;
struct
snd_soc_component
component
;
struct
snd_soc_dapm_context
dapm
;
#ifdef CONFIG_DEBUG_FS
#ifdef CONFIG_DEBUG_FS
struct
dentry
*
debugfs_platform_root
;
struct
dentry
*
debugfs_platform_root
;
#endif
#endif
...
@@ -896,6 +901,10 @@ struct snd_soc_dai_link {
...
@@ -896,6 +901,10 @@ struct snd_soc_dai_link {
const
struct
device_node
*
codec_of_node
;
const
struct
device_node
*
codec_of_node
;
/* You MUST specify the DAI name within the codec */
/* You MUST specify the DAI name within the codec */
const
char
*
codec_dai_name
;
const
char
*
codec_dai_name
;
struct
snd_soc_dai_link_component
*
codecs
;
unsigned
int
num_codecs
;
/*
/*
* You MAY specify the link's platform/PCM/DMA driver, either by
* You MAY specify the link's platform/PCM/DMA driver, either by
* device name, or by DT/OF node, but not both. Some forms of link
* device name, or by DT/OF node, but not both. Some forms of link
...
@@ -1047,7 +1056,6 @@ struct snd_soc_card {
...
@@ -1047,7 +1056,6 @@ struct snd_soc_card {
/* lists of probed devices belonging to this card */
/* lists of probed devices belonging to this card */
struct
list_head
codec_dev_list
;
struct
list_head
codec_dev_list
;
struct
list_head
platform_dev_list
;
struct
list_head
widgets
;
struct
list_head
widgets
;
struct
list_head
paths
;
struct
list_head
paths
;
...
@@ -1094,6 +1102,9 @@ struct snd_soc_pcm_runtime {
...
@@ -1094,6 +1102,9 @@ struct snd_soc_pcm_runtime {
struct
snd_soc_dai
*
codec_dai
;
struct
snd_soc_dai
*
codec_dai
;
struct
snd_soc_dai
*
cpu_dai
;
struct
snd_soc_dai
*
cpu_dai
;
struct
snd_soc_dai
**
codec_dais
;
unsigned
int
num_codecs
;
struct
delayed_work
delayed_work
;
struct
delayed_work
delayed_work
;
#ifdef CONFIG_DEBUG_FS
#ifdef CONFIG_DEBUG_FS
struct
dentry
*
debugfs_dpcm_root
;
struct
dentry
*
debugfs_dpcm_root
;
...
@@ -1164,6 +1175,21 @@ static inline struct snd_soc_platform *snd_soc_component_to_platform(
...
@@ -1164,6 +1175,21 @@ static inline struct snd_soc_platform *snd_soc_component_to_platform(
return
container_of
(
component
,
struct
snd_soc_platform
,
component
);
return
container_of
(
component
,
struct
snd_soc_platform
,
component
);
}
}
/**
* snd_soc_dapm_to_component() - Casts a DAPM context to the component it is
* embedded in
* @dapm: The DAPM context to cast to the component
*
* This function must only be used on DAPM contexts that are known to be part of
* a component (e.g. in a component driver). Otherwise the behavior is
* undefined.
*/
static
inline
struct
snd_soc_component
*
snd_soc_dapm_to_component
(
struct
snd_soc_dapm_context
*
dapm
)
{
return
container_of
(
dapm
,
struct
snd_soc_component
,
dapm
);
}
/**
/**
* snd_soc_dapm_to_codec() - Casts a DAPM context to the CODEC it is embedded in
* snd_soc_dapm_to_codec() - Casts a DAPM context to the CODEC it is embedded in
* @dapm: The DAPM context to cast to the CODEC
* @dapm: The DAPM context to cast to the CODEC
...
@@ -1188,7 +1214,18 @@ static inline struct snd_soc_codec *snd_soc_dapm_to_codec(
...
@@ -1188,7 +1214,18 @@ static inline struct snd_soc_codec *snd_soc_dapm_to_codec(
static
inline
struct
snd_soc_platform
*
snd_soc_dapm_to_platform
(
static
inline
struct
snd_soc_platform
*
snd_soc_dapm_to_platform
(
struct
snd_soc_dapm_context
*
dapm
)
struct
snd_soc_dapm_context
*
dapm
)
{
{
return
container_of
(
dapm
,
struct
snd_soc_platform
,
dapm
);
return
snd_soc_component_to_platform
(
snd_soc_dapm_to_component
(
dapm
));
}
/**
* snd_soc_component_get_dapm() - Returns the DAPM context associated with a
* component
* @component: The component for which to get the DAPM context
*/
static
inline
struct
snd_soc_dapm_context
*
snd_soc_component_get_dapm
(
struct
snd_soc_component
*
component
)
{
return
component
->
dapm_ptr
;
}
}
/* codec IO */
/* codec IO */
...
@@ -1261,7 +1298,6 @@ static inline void *snd_soc_pcm_get_drvdata(struct snd_soc_pcm_runtime *rtd)
...
@@ -1261,7 +1298,6 @@ static inline void *snd_soc_pcm_get_drvdata(struct snd_soc_pcm_runtime *rtd)
static
inline
void
snd_soc_initialize_card_lists
(
struct
snd_soc_card
*
card
)
static
inline
void
snd_soc_initialize_card_lists
(
struct
snd_soc_card
*
card
)
{
{
INIT_LIST_HEAD
(
&
card
->
codec_dev_list
);
INIT_LIST_HEAD
(
&
card
->
codec_dev_list
);
INIT_LIST_HEAD
(
&
card
->
platform_dev_list
);
INIT_LIST_HEAD
(
&
card
->
widgets
);
INIT_LIST_HEAD
(
&
card
->
widgets
);
INIT_LIST_HEAD
(
&
card
->
paths
);
INIT_LIST_HEAD
(
&
card
->
paths
);
INIT_LIST_HEAD
(
&
card
->
dapm_list
);
INIT_LIST_HEAD
(
&
card
->
dapm_list
);
...
...
include/trace/events/asoc.h
浏览文件 @
a1cb98ac
...
@@ -296,17 +296,17 @@ TRACE_EVENT(snd_soc_cache_sync,
...
@@ -296,17 +296,17 @@ TRACE_EVENT(snd_soc_cache_sync,
TP_ARGS
(
codec
,
type
,
status
),
TP_ARGS
(
codec
,
type
,
status
),
TP_STRUCT__entry
(
TP_STRUCT__entry
(
__string
(
name
,
codec
->
name
)
__string
(
name
,
codec
->
component
.
name
)
__string
(
status
,
status
)
__string
(
status
,
status
)
__string
(
type
,
type
)
__string
(
type
,
type
)
__field
(
int
,
id
)
__field
(
int
,
id
)
),
),
TP_fast_assign
(
TP_fast_assign
(
__assign_str
(
name
,
codec
->
name
);
__assign_str
(
name
,
codec
->
component
.
name
);
__assign_str
(
status
,
status
);
__assign_str
(
status
,
status
);
__assign_str
(
type
,
type
);
__assign_str
(
type
,
type
);
__entry
->
id
=
codec
->
id
;
__entry
->
id
=
codec
->
component
.
id
;
),
),
TP_printk
(
"codec=%s.%d type=%s status=%s"
,
__get_str
(
name
),
TP_printk
(
"codec=%s.%d type=%s status=%s"
,
__get_str
(
name
),
...
...
sound/soc/codecs/ac97.c
浏览文件 @
a1cb98ac
...
@@ -89,8 +89,8 @@ static int ac97_soc_probe(struct snd_soc_codec *codec)
...
@@ -89,8 +89,8 @@ static int ac97_soc_probe(struct snd_soc_codec *codec)
int
ret
;
int
ret
;
/* add codec as bus device for standard ac97 */
/* add codec as bus device for standard ac97 */
ret
=
snd_ac97_bus
(
codec
->
c
ard
->
snd_card
,
0
,
soc_ac97_ops
,
NULL
,
ret
=
snd_ac97_bus
(
codec
->
c
omponent
.
card
->
snd_card
,
0
,
soc_ac97_ops
,
&
ac97_bus
);
NULL
,
&
ac97_bus
);
if
(
ret
<
0
)
if
(
ret
<
0
)
return
ret
;
return
ret
;
...
...
sound/soc/codecs/cx20442.c
浏览文件 @
a1cb98ac
...
@@ -253,7 +253,7 @@ static void v253_close(struct tty_struct *tty)
...
@@ -253,7 +253,7 @@ static void v253_close(struct tty_struct *tty)
/* Prevent the codec driver from further accessing the modem */
/* Prevent the codec driver from further accessing the modem */
codec
->
hw_write
=
NULL
;
codec
->
hw_write
=
NULL
;
cx20442
->
control_data
=
NULL
;
cx20442
->
control_data
=
NULL
;
codec
->
card
->
pop_time
=
0
;
codec
->
c
omponent
.
c
ard
->
pop_time
=
0
;
}
}
/* Line discipline .hangup() */
/* Line discipline .hangup() */
...
@@ -281,7 +281,7 @@ static void v253_receive(struct tty_struct *tty,
...
@@ -281,7 +281,7 @@ static void v253_receive(struct tty_struct *tty,
/* Set up codec driver access to modem controls */
/* Set up codec driver access to modem controls */
cx20442
->
control_data
=
tty
;
cx20442
->
control_data
=
tty
;
codec
->
hw_write
=
(
hw_write_t
)
tty
->
ops
->
write
;
codec
->
hw_write
=
(
hw_write_t
)
tty
->
ops
->
write
;
codec
->
card
->
pop_time
=
1
;
codec
->
c
omponent
.
c
ard
->
pop_time
=
1
;
}
}
}
}
...
@@ -372,7 +372,7 @@ static int cx20442_codec_probe(struct snd_soc_codec *codec)
...
@@ -372,7 +372,7 @@ static int cx20442_codec_probe(struct snd_soc_codec *codec)
snd_soc_codec_set_drvdata
(
codec
,
cx20442
);
snd_soc_codec_set_drvdata
(
codec
,
cx20442
);
codec
->
hw_write
=
NULL
;
codec
->
hw_write
=
NULL
;
codec
->
card
->
pop_time
=
0
;
codec
->
c
omponent
.
c
ard
->
pop_time
=
0
;
return
0
;
return
0
;
}
}
...
...
sound/soc/codecs/tlv320dac33.c
浏览文件 @
a1cb98ac
...
@@ -1404,7 +1404,7 @@ static int dac33_soc_probe(struct snd_soc_codec *codec)
...
@@ -1404,7 +1404,7 @@ static int dac33_soc_probe(struct snd_soc_codec *codec)
if
(
dac33
->
irq
>=
0
)
{
if
(
dac33
->
irq
>=
0
)
{
ret
=
request_irq
(
dac33
->
irq
,
dac33_interrupt_handler
,
ret
=
request_irq
(
dac33
->
irq
,
dac33_interrupt_handler
,
IRQF_TRIGGER_RISING
,
IRQF_TRIGGER_RISING
,
codec
->
name
,
codec
);
codec
->
component
.
name
,
codec
);
if
(
ret
<
0
)
{
if
(
ret
<
0
)
{
dev_err
(
codec
->
dev
,
"Could not request IRQ%d (%d)
\n
"
,
dev_err
(
codec
->
dev
,
"Could not request IRQ%d (%d)
\n
"
,
dac33
->
irq
,
ret
);
dac33
->
irq
,
ret
);
...
...
sound/soc/codecs/uda134x.c
浏览文件 @
a1cb98ac
...
@@ -479,7 +479,7 @@ static struct snd_soc_dai_driver uda134x_dai = {
...
@@ -479,7 +479,7 @@ static struct snd_soc_dai_driver uda134x_dai = {
static
int
uda134x_soc_probe
(
struct
snd_soc_codec
*
codec
)
static
int
uda134x_soc_probe
(
struct
snd_soc_codec
*
codec
)
{
{
struct
uda134x_priv
*
uda134x
;
struct
uda134x_priv
*
uda134x
;
struct
uda134x_platform_data
*
pd
=
codec
->
card
->
dev
->
platform_data
;
struct
uda134x_platform_data
*
pd
=
codec
->
c
omponent
.
c
ard
->
dev
->
platform_data
;
const
struct
snd_soc_dapm_widget
*
widgets
;
const
struct
snd_soc_dapm_widget
*
widgets
;
unsigned
num_widgets
;
unsigned
num_widgets
;
...
...
sound/soc/codecs/wm8960.c
浏览文件 @
a1cb98ac
...
@@ -472,7 +472,7 @@ static int wm8960_add_widgets(struct snd_soc_codec *codec)
...
@@ -472,7 +472,7 @@ static int wm8960_add_widgets(struct snd_soc_codec *codec)
* list each time to find the desired power state do so now
* list each time to find the desired power state do so now
* and save the result.
* and save the result.
*/
*/
list_for_each_entry
(
w
,
&
codec
->
card
->
widgets
,
list
)
{
list_for_each_entry
(
w
,
&
codec
->
c
omponent
.
c
ard
->
widgets
,
list
)
{
if
(
w
->
dapm
!=
&
codec
->
dapm
)
if
(
w
->
dapm
!=
&
codec
->
dapm
)
continue
;
continue
;
if
(
strcmp
(
w
->
name
,
"LOUT1 PGA"
)
==
0
)
if
(
strcmp
(
w
->
name
,
"LOUT1 PGA"
)
==
0
)
...
...
sound/soc/codecs/wm_adsp.c
浏览文件 @
a1cb98ac
...
@@ -1382,7 +1382,7 @@ int wm_adsp1_event(struct snd_soc_dapm_widget *w,
...
@@ -1382,7 +1382,7 @@ int wm_adsp1_event(struct snd_soc_dapm_widget *w,
int
ret
;
int
ret
;
int
val
;
int
val
;
dsp
->
card
=
codec
->
card
;
dsp
->
card
=
codec
->
c
omponent
.
c
ard
;
switch
(
event
)
{
switch
(
event
)
{
case
SND_SOC_DAPM_POST_PMU
:
case
SND_SOC_DAPM_POST_PMU
:
...
@@ -1617,7 +1617,7 @@ int wm_adsp2_early_event(struct snd_soc_dapm_widget *w,
...
@@ -1617,7 +1617,7 @@ int wm_adsp2_early_event(struct snd_soc_dapm_widget *w,
struct
wm_adsp
*
dsps
=
snd_soc_codec_get_drvdata
(
codec
);
struct
wm_adsp
*
dsps
=
snd_soc_codec_get_drvdata
(
codec
);
struct
wm_adsp
*
dsp
=
&
dsps
[
w
->
shift
];
struct
wm_adsp
*
dsp
=
&
dsps
[
w
->
shift
];
dsp
->
card
=
codec
->
card
;
dsp
->
card
=
codec
->
c
omponent
.
c
ard
;
switch
(
event
)
{
switch
(
event
)
{
case
SND_SOC_DAPM_PRE_PMU
:
case
SND_SOC_DAPM_PRE_PMU
:
...
...
sound/soc/omap/ams-delta.c
浏览文件 @
a1cb98ac
...
@@ -301,7 +301,7 @@ static int cx81801_open(struct tty_struct *tty)
...
@@ -301,7 +301,7 @@ static int cx81801_open(struct tty_struct *tty)
static
void
cx81801_close
(
struct
tty_struct
*
tty
)
static
void
cx81801_close
(
struct
tty_struct
*
tty
)
{
{
struct
snd_soc_codec
*
codec
=
tty
->
disc_data
;
struct
snd_soc_codec
*
codec
=
tty
->
disc_data
;
struct
snd_soc_dapm_context
*
dapm
=
&
codec
->
card
->
dapm
;
struct
snd_soc_dapm_context
*
dapm
=
&
codec
->
c
omponent
.
c
ard
->
dapm
;
del_timer_sync
(
&
cx81801_timer
);
del_timer_sync
(
&
cx81801_timer
);
...
...
sound/soc/soc-cache.c
浏览文件 @
a1cb98ac
...
@@ -78,7 +78,7 @@ int snd_soc_cache_init(struct snd_soc_codec *codec)
...
@@ -78,7 +78,7 @@ int snd_soc_cache_init(struct snd_soc_codec *codec)
mutex_init
(
&
codec
->
cache_rw_mutex
);
mutex_init
(
&
codec
->
cache_rw_mutex
);
dev_dbg
(
codec
->
dev
,
"ASoC: Initializing cache for %s codec
\n
"
,
dev_dbg
(
codec
->
dev
,
"ASoC: Initializing cache for %s codec
\n
"
,
codec
->
name
);
codec
->
component
.
name
);
if
(
codec_drv
->
reg_cache_default
)
if
(
codec_drv
->
reg_cache_default
)
codec
->
reg_cache
=
kmemdup
(
codec_drv
->
reg_cache_default
,
codec
->
reg_cache
=
kmemdup
(
codec_drv
->
reg_cache_default
,
...
@@ -98,8 +98,7 @@ int snd_soc_cache_init(struct snd_soc_codec *codec)
...
@@ -98,8 +98,7 @@ int snd_soc_cache_init(struct snd_soc_codec *codec)
int
snd_soc_cache_exit
(
struct
snd_soc_codec
*
codec
)
int
snd_soc_cache_exit
(
struct
snd_soc_codec
*
codec
)
{
{
dev_dbg
(
codec
->
dev
,
"ASoC: Destroying cache for %s codec
\n
"
,
dev_dbg
(
codec
->
dev
,
"ASoC: Destroying cache for %s codec
\n
"
,
codec
->
name
);
codec
->
component
.
name
);
kfree
(
codec
->
reg_cache
);
kfree
(
codec
->
reg_cache
);
codec
->
reg_cache
=
NULL
;
codec
->
reg_cache
=
NULL
;
return
0
;
return
0
;
...
@@ -192,7 +191,7 @@ int snd_soc_cache_sync(struct snd_soc_codec *codec)
...
@@ -192,7 +191,7 @@ int snd_soc_cache_sync(struct snd_soc_codec *codec)
return
0
;
return
0
;
dev_dbg
(
codec
->
dev
,
"ASoC: Syncing cache for %s codec
\n
"
,
dev_dbg
(
codec
->
dev
,
"ASoC: Syncing cache for %s codec
\n
"
,
codec
->
name
);
codec
->
component
.
name
);
trace_snd_soc_cache_sync
(
codec
,
name
,
"start"
);
trace_snd_soc_cache_sync
(
codec
,
name
,
"start"
);
ret
=
snd_soc_flat_cache_sync
(
codec
);
ret
=
snd_soc_flat_cache_sync
(
codec
);
if
(
!
ret
)
if
(
!
ret
)
...
...
sound/soc/soc-compress.c
浏览文件 @
a1cb98ac
...
@@ -37,7 +37,8 @@ static int soc_compr_open(struct snd_compr_stream *cstream)
...
@@ -37,7 +37,8 @@ static int soc_compr_open(struct snd_compr_stream *cstream)
if
(
platform
->
driver
->
compr_ops
&&
platform
->
driver
->
compr_ops
->
open
)
{
if
(
platform
->
driver
->
compr_ops
&&
platform
->
driver
->
compr_ops
->
open
)
{
ret
=
platform
->
driver
->
compr_ops
->
open
(
cstream
);
ret
=
platform
->
driver
->
compr_ops
->
open
(
cstream
);
if
(
ret
<
0
)
{
if
(
ret
<
0
)
{
pr_err
(
"compress asoc: can't open platform %s
\n
"
,
platform
->
name
);
pr_err
(
"compress asoc: can't open platform %s
\n
"
,
platform
->
component
.
name
);
goto
out
;
goto
out
;
}
}
}
}
...
@@ -84,7 +85,8 @@ static int soc_compr_open_fe(struct snd_compr_stream *cstream)
...
@@ -84,7 +85,8 @@ static int soc_compr_open_fe(struct snd_compr_stream *cstream)
if
(
platform
->
driver
->
compr_ops
&&
platform
->
driver
->
compr_ops
->
open
)
{
if
(
platform
->
driver
->
compr_ops
&&
platform
->
driver
->
compr_ops
->
open
)
{
ret
=
platform
->
driver
->
compr_ops
->
open
(
cstream
);
ret
=
platform
->
driver
->
compr_ops
->
open
(
cstream
);
if
(
ret
<
0
)
{
if
(
ret
<
0
)
{
pr_err
(
"compress asoc: can't open platform %s
\n
"
,
platform
->
name
);
pr_err
(
"compress asoc: can't open platform %s
\n
"
,
platform
->
component
.
name
);
goto
out
;
goto
out
;
}
}
}
}
...
@@ -627,6 +629,11 @@ int soc_new_compress(struct snd_soc_pcm_runtime *rtd, int num)
...
@@ -627,6 +629,11 @@ int soc_new_compress(struct snd_soc_pcm_runtime *rtd, int num)
char
new_name
[
64
];
char
new_name
[
64
];
int
ret
=
0
,
direction
=
0
;
int
ret
=
0
,
direction
=
0
;
if
(
rtd
->
num_codecs
>
1
)
{
dev_err
(
rtd
->
card
->
dev
,
"Multicodec not supported for compressed stream
\n
"
);
return
-
EINVAL
;
}
/* check client and interface hw capabilities */
/* check client and interface hw capabilities */
snprintf
(
new_name
,
sizeof
(
new_name
),
"%s %s-%d"
,
snprintf
(
new_name
,
sizeof
(
new_name
),
"%s %s-%d"
,
rtd
->
dai_link
->
stream_name
,
codec_dai
->
name
,
num
);
rtd
->
dai_link
->
stream_name
,
codec_dai
->
name
,
num
);
...
@@ -680,7 +687,7 @@ int soc_new_compress(struct snd_soc_pcm_runtime *rtd, int num)
...
@@ -680,7 +687,7 @@ int soc_new_compress(struct snd_soc_pcm_runtime *rtd, int num)
ret
=
snd_compress_new
(
rtd
->
card
->
snd_card
,
num
,
direction
,
compr
);
ret
=
snd_compress_new
(
rtd
->
card
->
snd_card
,
num
,
direction
,
compr
);
if
(
ret
<
0
)
{
if
(
ret
<
0
)
{
pr_err
(
"compress asoc: can't create compress for codec %s
\n
"
,
pr_err
(
"compress asoc: can't create compress for codec %s
\n
"
,
codec
->
name
);
codec
->
component
.
name
);
goto
compr_err
;
goto
compr_err
;
}
}
...
...
sound/soc/soc-core.c
浏览文件 @
a1cb98ac
此差异已折叠。
点击以展开。
sound/soc/soc-dapm.c
浏览文件 @
a1cb98ac
...
@@ -349,13 +349,28 @@ static bool dapm_kcontrol_set_value(const struct snd_kcontrol *kcontrol,
...
@@ -349,13 +349,28 @@ static bool dapm_kcontrol_set_value(const struct snd_kcontrol *kcontrol,
return
true
;
return
true
;
}
}
/**
* snd_soc_dapm_kcontrol_dapm() - Returns the dapm context associated to a
* kcontrol
* @kcontrol: The kcontrol
*
* Note: This function must only be used on kcontrols that are known to have
* been registered for a CODEC. Otherwise the behaviour is undefined.
*/
struct
snd_soc_dapm_context
*
snd_soc_dapm_kcontrol_dapm
(
struct
snd_kcontrol
*
kcontrol
)
{
return
dapm_kcontrol_get_wlist
(
kcontrol
)
->
widgets
[
0
]
->
dapm
;
}
EXPORT_SYMBOL_GPL
(
snd_soc_dapm_kcontrol_dapm
);
/**
/**
* snd_soc_dapm_kcontrol_codec() - Returns the codec associated to a kcontrol
* snd_soc_dapm_kcontrol_codec() - Returns the codec associated to a kcontrol
* @kcontrol: The kcontrol
* @kcontrol: The kcontrol
*/
*/
struct
snd_soc_codec
*
snd_soc_dapm_kcontrol_codec
(
struct
snd_kcontrol
*
kcontrol
)
struct
snd_soc_codec
*
snd_soc_dapm_kcontrol_codec
(
struct
snd_kcontrol
*
kcontrol
)
{
{
return
dapm_kcontrol_get_wlist
(
kcontrol
)
->
widgets
[
0
]
->
codec
;
return
snd_soc_dapm_to_codec
(
snd_soc_dapm_kcontrol_dapm
(
kcontrol
))
;
}
}
EXPORT_SYMBOL_GPL
(
snd_soc_dapm_kcontrol_codec
);
EXPORT_SYMBOL_GPL
(
snd_soc_dapm_kcontrol_codec
);
...
@@ -375,23 +390,38 @@ static void dapm_reset(struct snd_soc_card *card)
...
@@ -375,23 +390,38 @@ static void dapm_reset(struct snd_soc_card *card)
}
}
}
}
static
int
soc_widget_read
(
struct
snd_soc_dapm_widget
*
w
,
int
reg
,
static
const
char
*
soc_dapm_prefix
(
struct
snd_soc_dapm_context
*
dapm
)
{
if
(
!
dapm
->
component
)
return
NULL
;
return
dapm
->
component
->
name_prefix
;
}
static
int
soc_dapm_read
(
struct
snd_soc_dapm_context
*
dapm
,
int
reg
,
unsigned
int
*
value
)
unsigned
int
*
value
)
{
{
if
(
!
w
->
dapm
->
component
)
if
(
!
dapm
->
component
)
return
-
EIO
;
return
-
EIO
;
return
snd_soc_component_read
(
w
->
dapm
->
component
,
reg
,
value
);
return
snd_soc_component_read
(
dapm
->
component
,
reg
,
value
);
}
}
static
int
soc_
widget_update_bits
(
struct
snd_soc_dapm_widget
*
w
,
static
int
soc_
dapm_update_bits
(
struct
snd_soc_dapm_context
*
dapm
,
int
reg
,
unsigned
int
mask
,
unsigned
int
value
)
int
reg
,
unsigned
int
mask
,
unsigned
int
value
)
{
{
if
(
!
w
->
dapm
->
component
)
if
(
!
dapm
->
component
)
return
-
EIO
;
return
-
EIO
;
return
snd_soc_component_update_bits_async
(
w
->
dapm
->
component
,
reg
,
return
snd_soc_component_update_bits_async
(
dapm
->
component
,
reg
,
mask
,
value
);
mask
,
value
);
}
}
static
int
soc_dapm_test_bits
(
struct
snd_soc_dapm_context
*
dapm
,
int
reg
,
unsigned
int
mask
,
unsigned
int
value
)
{
if
(
!
dapm
->
component
)
return
-
EIO
;
return
snd_soc_component_test_bits
(
dapm
->
component
,
reg
,
mask
,
value
);
}
static
void
soc_dapm_async_complete
(
struct
snd_soc_dapm_context
*
dapm
)
static
void
soc_dapm_async_complete
(
struct
snd_soc_dapm_context
*
dapm
)
{
{
if
(
dapm
->
component
)
if
(
dapm
->
component
)
...
@@ -420,15 +450,10 @@ static int snd_soc_dapm_set_bias_level(struct snd_soc_dapm_context *dapm,
...
@@ -420,15 +450,10 @@ static int snd_soc_dapm_set_bias_level(struct snd_soc_dapm_context *dapm,
if
(
ret
!=
0
)
if
(
ret
!=
0
)
goto
out
;
goto
out
;
if
(
dapm
->
codec
)
{
if
(
dapm
->
set_bias_level
)
if
(
dapm
->
codec
->
driver
->
set_bias_level
)
ret
=
dapm
->
set_bias_level
(
dapm
,
level
);
ret
=
dapm
->
codec
->
driver
->
set_bias_level
(
dapm
->
codec
,
else
if
(
!
card
||
dapm
!=
&
card
->
dapm
)
level
);
else
dapm
->
bias_level
=
level
;
}
else
if
(
!
card
||
dapm
!=
&
card
->
dapm
)
{
dapm
->
bias_level
=
level
;
dapm
->
bias_level
=
level
;
}
if
(
ret
!=
0
)
if
(
ret
!=
0
)
goto
out
;
goto
out
;
...
@@ -452,7 +477,7 @@ static int dapm_connect_mux(struct snd_soc_dapm_context *dapm,
...
@@ -452,7 +477,7 @@ static int dapm_connect_mux(struct snd_soc_dapm_context *dapm,
int
i
;
int
i
;
if
(
e
->
reg
!=
SND_SOC_NOPM
)
{
if
(
e
->
reg
!=
SND_SOC_NOPM
)
{
soc_
widget_read
(
dest
,
e
->
reg
,
&
val
);
soc_
dapm_read
(
dapm
,
e
->
reg
,
&
val
);
val
=
(
val
>>
e
->
shift_l
)
&
e
->
mask
;
val
=
(
val
>>
e
->
shift_l
)
&
e
->
mask
;
item
=
snd_soc_enum_val_to_item
(
e
,
val
);
item
=
snd_soc_enum_val_to_item
(
e
,
val
);
}
else
{
}
else
{
...
@@ -496,7 +521,7 @@ static void dapm_set_mixer_path_status(struct snd_soc_dapm_widget *w,
...
@@ -496,7 +521,7 @@ static void dapm_set_mixer_path_status(struct snd_soc_dapm_widget *w,
unsigned
int
val
;
unsigned
int
val
;
if
(
reg
!=
SND_SOC_NOPM
)
{
if
(
reg
!=
SND_SOC_NOPM
)
{
soc_
widget_read
(
w
,
reg
,
&
val
);
soc_
dapm_read
(
w
->
dapm
,
reg
,
&
val
);
val
=
(
val
>>
shift
)
&
mask
;
val
=
(
val
>>
shift
)
&
mask
;
if
(
invert
)
if
(
invert
)
val
=
max
-
val
;
val
=
max
-
val
;
...
@@ -570,11 +595,7 @@ static int dapm_create_or_share_mixmux_kcontrol(struct snd_soc_dapm_widget *w,
...
@@ -570,11 +595,7 @@ static int dapm_create_or_share_mixmux_kcontrol(struct snd_soc_dapm_widget *w,
const
char
*
name
;
const
char
*
name
;
int
ret
;
int
ret
;
if
(
dapm
->
codec
)
prefix
=
soc_dapm_prefix
(
dapm
);
prefix
=
dapm
->
codec
->
name_prefix
;
else
prefix
=
NULL
;
if
(
prefix
)
if
(
prefix
)
prefix_len
=
strlen
(
prefix
)
+
1
;
prefix_len
=
strlen
(
prefix
)
+
1
;
else
else
...
@@ -1308,16 +1329,18 @@ static void dapm_seq_check_event(struct snd_soc_card *card,
...
@@ -1308,16 +1329,18 @@ static void dapm_seq_check_event(struct snd_soc_card *card,
static
void
dapm_seq_run_coalesced
(
struct
snd_soc_card
*
card
,
static
void
dapm_seq_run_coalesced
(
struct
snd_soc_card
*
card
,
struct
list_head
*
pending
)
struct
list_head
*
pending
)
{
{
struct
snd_soc_dapm_context
*
dapm
;
struct
snd_soc_dapm_widget
*
w
;
struct
snd_soc_dapm_widget
*
w
;
int
reg
;
int
reg
;
unsigned
int
value
=
0
;
unsigned
int
value
=
0
;
unsigned
int
mask
=
0
;
unsigned
int
mask
=
0
;
reg
=
list_first_entry
(
pending
,
struct
snd_soc_dapm_widget
,
w
=
list_first_entry
(
pending
,
struct
snd_soc_dapm_widget
,
power_list
);
power_list
)
->
reg
;
reg
=
w
->
reg
;
dapm
=
w
->
dapm
;
list_for_each_entry
(
w
,
pending
,
power_list
)
{
list_for_each_entry
(
w
,
pending
,
power_list
)
{
WARN_ON
(
reg
!=
w
->
reg
);
WARN_ON
(
reg
!=
w
->
reg
||
dapm
!=
w
->
dapm
);
w
->
power
=
w
->
new_power
;
w
->
power
=
w
->
new_power
;
mask
|=
w
->
mask
<<
w
->
shift
;
mask
|=
w
->
mask
<<
w
->
shift
;
...
@@ -1326,7 +1349,7 @@ static void dapm_seq_run_coalesced(struct snd_soc_card *card,
...
@@ -1326,7 +1349,7 @@ static void dapm_seq_run_coalesced(struct snd_soc_card *card,
else
else
value
|=
w
->
off_val
<<
w
->
shift
;
value
|=
w
->
off_val
<<
w
->
shift
;
pop_dbg
(
w
->
dapm
->
dev
,
card
->
pop_time
,
pop_dbg
(
dapm
->
dev
,
card
->
pop_time
,
"pop test : Queue %s: reg=0x%x, 0x%x/0x%x
\n
"
,
"pop test : Queue %s: reg=0x%x, 0x%x/0x%x
\n
"
,
w
->
name
,
reg
,
value
,
mask
);
w
->
name
,
reg
,
value
,
mask
);
...
@@ -1339,14 +1362,12 @@ static void dapm_seq_run_coalesced(struct snd_soc_card *card,
...
@@ -1339,14 +1362,12 @@ static void dapm_seq_run_coalesced(struct snd_soc_card *card,
/* Any widget will do, they should all be updating the
/* Any widget will do, they should all be updating the
* same register.
* same register.
*/
*/
w
=
list_first_entry
(
pending
,
struct
snd_soc_dapm_widget
,
power_list
);
pop_dbg
(
w
->
dapm
->
dev
,
card
->
pop_time
,
pop_dbg
(
dapm
->
dev
,
card
->
pop_time
,
"pop test : Applying 0x%x/0x%x to %x in %dms
\n
"
,
"pop test : Applying 0x%x/0x%x to %x in %dms
\n
"
,
value
,
mask
,
reg
,
card
->
pop_time
);
value
,
mask
,
reg
,
card
->
pop_time
);
pop_wait
(
card
->
pop_time
);
pop_wait
(
card
->
pop_time
);
soc_
widget_update_bits
(
w
,
reg
,
mask
,
value
);
soc_
dapm_update_bits
(
dapm
,
reg
,
mask
,
value
);
}
}
list_for_each_entry
(
w
,
pending
,
power_list
)
{
list_for_each_entry
(
w
,
pending
,
power_list
)
{
...
@@ -1492,7 +1513,8 @@ static void dapm_widget_update(struct snd_soc_card *card)
...
@@ -1492,7 +1513,8 @@ static void dapm_widget_update(struct snd_soc_card *card)
if
(
!
w
)
if
(
!
w
)
return
;
return
;
ret
=
soc_widget_update_bits
(
w
,
update
->
reg
,
update
->
mask
,
update
->
val
);
ret
=
soc_dapm_update_bits
(
w
->
dapm
,
update
->
reg
,
update
->
mask
,
update
->
val
);
if
(
ret
<
0
)
if
(
ret
<
0
)
dev_err
(
w
->
dapm
->
dev
,
"ASoC: %s DAPM update failed: %d
\n
"
,
dev_err
(
w
->
dapm
->
dev
,
"ASoC: %s DAPM update failed: %d
\n
"
,
w
->
name
,
ret
);
w
->
name
,
ret
);
...
@@ -2062,17 +2084,13 @@ int snd_soc_dapm_mixer_update_power(struct snd_soc_dapm_context *dapm,
...
@@ -2062,17 +2084,13 @@ int snd_soc_dapm_mixer_update_power(struct snd_soc_dapm_context *dapm,
}
}
EXPORT_SYMBOL_GPL
(
snd_soc_dapm_mixer_update_power
);
EXPORT_SYMBOL_GPL
(
snd_soc_dapm_mixer_update_power
);
/* show dapm widget status in sys fs */
static
ssize_t
dapm_widget_show_codec
(
struct
snd_soc_codec
*
codec
,
char
*
buf
)
static
ssize_t
dapm_widget_show
(
struct
device
*
dev
,
struct
device_attribute
*
attr
,
char
*
buf
)
{
{
struct
snd_soc_pcm_runtime
*
rtd
=
dev_get_drvdata
(
dev
);
struct
snd_soc_codec
*
codec
=
rtd
->
codec
;
struct
snd_soc_dapm_widget
*
w
;
struct
snd_soc_dapm_widget
*
w
;
int
count
=
0
;
int
count
=
0
;
char
*
state
=
"not set"
;
char
*
state
=
"not set"
;
list_for_each_entry
(
w
,
&
codec
->
card
->
widgets
,
list
)
{
list_for_each_entry
(
w
,
&
codec
->
c
omponent
.
c
ard
->
widgets
,
list
)
{
if
(
w
->
dapm
!=
&
codec
->
dapm
)
if
(
w
->
dapm
!=
&
codec
->
dapm
)
continue
;
continue
;
...
@@ -2120,6 +2138,21 @@ static ssize_t dapm_widget_show(struct device *dev,
...
@@ -2120,6 +2138,21 @@ static ssize_t dapm_widget_show(struct device *dev,
return
count
;
return
count
;
}
}
/* show dapm widget status in sys fs */
static
ssize_t
dapm_widget_show
(
struct
device
*
dev
,
struct
device_attribute
*
attr
,
char
*
buf
)
{
struct
snd_soc_pcm_runtime
*
rtd
=
dev_get_drvdata
(
dev
);
int
i
,
count
=
0
;
for
(
i
=
0
;
i
<
rtd
->
num_codecs
;
i
++
)
{
struct
snd_soc_codec
*
codec
=
rtd
->
codec_dais
[
i
]
->
codec
;
count
+=
dapm_widget_show_codec
(
codec
,
buf
+
count
);
}
return
count
;
}
static
DEVICE_ATTR
(
dapm_widget
,
0444
,
dapm_widget_show
,
NULL
);
static
DEVICE_ATTR
(
dapm_widget
,
0444
,
dapm_widget_show
,
NULL
);
int
snd_soc_dapm_sys_add
(
struct
device
*
dev
)
int
snd_soc_dapm_sys_add
(
struct
device
*
dev
)
...
@@ -2371,14 +2404,16 @@ static int snd_soc_dapm_add_route(struct snd_soc_dapm_context *dapm,
...
@@ -2371,14 +2404,16 @@ static int snd_soc_dapm_add_route(struct snd_soc_dapm_context *dapm,
const
char
*
source
;
const
char
*
source
;
char
prefixed_sink
[
80
];
char
prefixed_sink
[
80
];
char
prefixed_source
[
80
];
char
prefixed_source
[
80
];
const
char
*
prefix
;
int
ret
;
int
ret
;
if
(
dapm
->
codec
&&
dapm
->
codec
->
name_prefix
)
{
prefix
=
soc_dapm_prefix
(
dapm
);
if
(
prefix
)
{
snprintf
(
prefixed_sink
,
sizeof
(
prefixed_sink
),
"%s %s"
,
snprintf
(
prefixed_sink
,
sizeof
(
prefixed_sink
),
"%s %s"
,
dapm
->
codec
->
name_
prefix
,
route
->
sink
);
prefix
,
route
->
sink
);
sink
=
prefixed_sink
;
sink
=
prefixed_sink
;
snprintf
(
prefixed_source
,
sizeof
(
prefixed_source
),
"%s %s"
,
snprintf
(
prefixed_source
,
sizeof
(
prefixed_source
),
"%s %s"
,
dapm
->
codec
->
name_
prefix
,
route
->
source
);
prefix
,
route
->
source
);
source
=
prefixed_source
;
source
=
prefixed_source
;
}
else
{
}
else
{
sink
=
route
->
sink
;
sink
=
route
->
sink
;
...
@@ -2439,6 +2474,7 @@ static int snd_soc_dapm_del_route(struct snd_soc_dapm_context *dapm,
...
@@ -2439,6 +2474,7 @@ static int snd_soc_dapm_del_route(struct snd_soc_dapm_context *dapm,
const
char
*
source
;
const
char
*
source
;
char
prefixed_sink
[
80
];
char
prefixed_sink
[
80
];
char
prefixed_source
[
80
];
char
prefixed_source
[
80
];
const
char
*
prefix
;
if
(
route
->
control
)
{
if
(
route
->
control
)
{
dev_err
(
dapm
->
dev
,
dev_err
(
dapm
->
dev
,
...
@@ -2446,12 +2482,13 @@ static int snd_soc_dapm_del_route(struct snd_soc_dapm_context *dapm,
...
@@ -2446,12 +2482,13 @@ static int snd_soc_dapm_del_route(struct snd_soc_dapm_context *dapm,
return
-
EINVAL
;
return
-
EINVAL
;
}
}
if
(
dapm
->
codec
&&
dapm
->
codec
->
name_prefix
)
{
prefix
=
soc_dapm_prefix
(
dapm
);
if
(
prefix
)
{
snprintf
(
prefixed_sink
,
sizeof
(
prefixed_sink
),
"%s %s"
,
snprintf
(
prefixed_sink
,
sizeof
(
prefixed_sink
),
"%s %s"
,
dapm
->
codec
->
name_
prefix
,
route
->
sink
);
prefix
,
route
->
sink
);
sink
=
prefixed_sink
;
sink
=
prefixed_sink
;
snprintf
(
prefixed_source
,
sizeof
(
prefixed_source
),
"%s %s"
,
snprintf
(
prefixed_source
,
sizeof
(
prefixed_source
),
"%s %s"
,
dapm
->
codec
->
name_
prefix
,
route
->
source
);
prefix
,
route
->
source
);
source
=
prefixed_source
;
source
=
prefixed_source
;
}
else
{
}
else
{
sink
=
route
->
sink
;
sink
=
route
->
sink
;
...
@@ -2670,7 +2707,7 @@ int snd_soc_dapm_new_widgets(struct snd_soc_card *card)
...
@@ -2670,7 +2707,7 @@ int snd_soc_dapm_new_widgets(struct snd_soc_card *card)
/* Read the initial power state from the device */
/* Read the initial power state from the device */
if
(
w
->
reg
>=
0
)
{
if
(
w
->
reg
>=
0
)
{
soc_
widget_read
(
w
,
w
->
reg
,
&
val
);
soc_
dapm_read
(
w
->
dapm
,
w
->
reg
,
&
val
);
val
=
val
>>
w
->
shift
;
val
=
val
>>
w
->
shift
;
val
&=
w
->
mask
;
val
&=
w
->
mask
;
if
(
val
==
w
->
on_val
)
if
(
val
==
w
->
on_val
)
...
@@ -2701,8 +2738,8 @@ EXPORT_SYMBOL_GPL(snd_soc_dapm_new_widgets);
...
@@ -2701,8 +2738,8 @@ EXPORT_SYMBOL_GPL(snd_soc_dapm_new_widgets);
int
snd_soc_dapm_get_volsw
(
struct
snd_kcontrol
*
kcontrol
,
int
snd_soc_dapm_get_volsw
(
struct
snd_kcontrol
*
kcontrol
,
struct
snd_ctl_elem_value
*
ucontrol
)
struct
snd_ctl_elem_value
*
ucontrol
)
{
{
struct
snd_soc_
codec
*
codec
=
snd_soc_dapm_kcontrol_codec
(
kcontrol
);
struct
snd_soc_
dapm_context
*
dapm
=
snd_soc_dapm_kcontrol_dapm
(
kcontrol
);
struct
snd_soc_card
*
card
=
codec
->
card
;
struct
snd_soc_card
*
card
=
dapm
->
card
;
struct
soc_mixer_control
*
mc
=
struct
soc_mixer_control
*
mc
=
(
struct
soc_mixer_control
*
)
kcontrol
->
private_value
;
(
struct
soc_mixer_control
*
)
kcontrol
->
private_value
;
int
reg
=
mc
->
reg
;
int
reg
=
mc
->
reg
;
...
@@ -2711,17 +2748,20 @@ int snd_soc_dapm_get_volsw(struct snd_kcontrol *kcontrol,
...
@@ -2711,17 +2748,20 @@ int snd_soc_dapm_get_volsw(struct snd_kcontrol *kcontrol,
unsigned
int
mask
=
(
1
<<
fls
(
max
))
-
1
;
unsigned
int
mask
=
(
1
<<
fls
(
max
))
-
1
;
unsigned
int
invert
=
mc
->
invert
;
unsigned
int
invert
=
mc
->
invert
;
unsigned
int
val
;
unsigned
int
val
;
int
ret
=
0
;
if
(
snd_soc_volsw_is_stereo
(
mc
))
if
(
snd_soc_volsw_is_stereo
(
mc
))
dev_warn
(
codec
->
dapm
.
dev
,
dev_warn
(
dapm
->
dev
,
"ASoC: Control '%s' is stereo, which is not supported
\n
"
,
"ASoC: Control '%s' is stereo, which is not supported
\n
"
,
kcontrol
->
id
.
name
);
kcontrol
->
id
.
name
);
mutex_lock_nested
(
&
card
->
dapm_mutex
,
SND_SOC_DAPM_CLASS_RUNTIME
);
mutex_lock_nested
(
&
card
->
dapm_mutex
,
SND_SOC_DAPM_CLASS_RUNTIME
);
if
(
dapm_kcontrol_is_powered
(
kcontrol
)
&&
reg
!=
SND_SOC_NOPM
)
if
(
dapm_kcontrol_is_powered
(
kcontrol
)
&&
reg
!=
SND_SOC_NOPM
)
{
val
=
(
snd_soc_read
(
codec
,
reg
)
>>
shift
)
&
mask
;
ret
=
soc_dapm_read
(
dapm
,
reg
,
&
val
);
else
val
=
(
val
>>
shift
)
&
mask
;
}
else
{
val
=
dapm_kcontrol_get_value
(
kcontrol
);
val
=
dapm_kcontrol_get_value
(
kcontrol
);
}
mutex_unlock
(
&
card
->
dapm_mutex
);
mutex_unlock
(
&
card
->
dapm_mutex
);
if
(
invert
)
if
(
invert
)
...
@@ -2729,7 +2769,7 @@ int snd_soc_dapm_get_volsw(struct snd_kcontrol *kcontrol,
...
@@ -2729,7 +2769,7 @@ int snd_soc_dapm_get_volsw(struct snd_kcontrol *kcontrol,
else
else
ucontrol
->
value
.
integer
.
value
[
0
]
=
val
;
ucontrol
->
value
.
integer
.
value
[
0
]
=
val
;
return
0
;
return
ret
;
}
}
EXPORT_SYMBOL_GPL
(
snd_soc_dapm_get_volsw
);
EXPORT_SYMBOL_GPL
(
snd_soc_dapm_get_volsw
);
...
@@ -2745,8 +2785,8 @@ EXPORT_SYMBOL_GPL(snd_soc_dapm_get_volsw);
...
@@ -2745,8 +2785,8 @@ EXPORT_SYMBOL_GPL(snd_soc_dapm_get_volsw);
int
snd_soc_dapm_put_volsw
(
struct
snd_kcontrol
*
kcontrol
,
int
snd_soc_dapm_put_volsw
(
struct
snd_kcontrol
*
kcontrol
,
struct
snd_ctl_elem_value
*
ucontrol
)
struct
snd_ctl_elem_value
*
ucontrol
)
{
{
struct
snd_soc_
codec
*
codec
=
snd_soc_dapm_kcontrol_codec
(
kcontrol
);
struct
snd_soc_
dapm_context
*
dapm
=
snd_soc_dapm_kcontrol_dapm
(
kcontrol
);
struct
snd_soc_card
*
card
=
codec
->
card
;
struct
snd_soc_card
*
card
=
dapm
->
card
;
struct
soc_mixer_control
*
mc
=
struct
soc_mixer_control
*
mc
=
(
struct
soc_mixer_control
*
)
kcontrol
->
private_value
;
(
struct
soc_mixer_control
*
)
kcontrol
->
private_value
;
int
reg
=
mc
->
reg
;
int
reg
=
mc
->
reg
;
...
@@ -2760,7 +2800,7 @@ int snd_soc_dapm_put_volsw(struct snd_kcontrol *kcontrol,
...
@@ -2760,7 +2800,7 @@ int snd_soc_dapm_put_volsw(struct snd_kcontrol *kcontrol,
int
ret
=
0
;
int
ret
=
0
;
if
(
snd_soc_volsw_is_stereo
(
mc
))
if
(
snd_soc_volsw_is_stereo
(
mc
))
dev_warn
(
codec
->
dapm
.
dev
,
dev_warn
(
dapm
->
dev
,
"ASoC: Control '%s' is stereo, which is not supported
\n
"
,
"ASoC: Control '%s' is stereo, which is not supported
\n
"
,
kcontrol
->
id
.
name
);
kcontrol
->
id
.
name
);
...
@@ -2778,7 +2818,7 @@ int snd_soc_dapm_put_volsw(struct snd_kcontrol *kcontrol,
...
@@ -2778,7 +2818,7 @@ int snd_soc_dapm_put_volsw(struct snd_kcontrol *kcontrol,
mask
=
mask
<<
shift
;
mask
=
mask
<<
shift
;
val
=
val
<<
shift
;
val
=
val
<<
shift
;
reg_change
=
s
nd_soc_test_bits
(
codec
,
reg
,
mask
,
val
);
reg_change
=
s
oc_dapm_test_bits
(
dapm
,
reg
,
mask
,
val
);
}
}
if
(
change
||
reg_change
)
{
if
(
change
||
reg_change
)
{
...
@@ -2817,12 +2857,13 @@ EXPORT_SYMBOL_GPL(snd_soc_dapm_put_volsw);
...
@@ -2817,12 +2857,13 @@ EXPORT_SYMBOL_GPL(snd_soc_dapm_put_volsw);
int
snd_soc_dapm_get_enum_double
(
struct
snd_kcontrol
*
kcontrol
,
int
snd_soc_dapm_get_enum_double
(
struct
snd_kcontrol
*
kcontrol
,
struct
snd_ctl_elem_value
*
ucontrol
)
struct
snd_ctl_elem_value
*
ucontrol
)
{
{
struct
snd_soc_
codec
*
codec
=
snd_soc_dapm_kcontrol_codec
(
kcontrol
);
struct
snd_soc_
dapm_context
*
dapm
=
snd_soc_dapm_kcontrol_dapm
(
kcontrol
);
struct
soc_enum
*
e
=
(
struct
soc_enum
*
)
kcontrol
->
private_value
;
struct
soc_enum
*
e
=
(
struct
soc_enum
*
)
kcontrol
->
private_value
;
unsigned
int
reg_val
,
val
;
unsigned
int
reg_val
,
val
;
int
ret
=
0
;
if
(
e
->
reg
!=
SND_SOC_NOPM
)
if
(
e
->
reg
!=
SND_SOC_NOPM
)
re
g_val
=
snd_soc_read
(
codec
,
e
->
reg
);
re
t
=
soc_dapm_read
(
dapm
,
e
->
reg
,
&
reg_val
);
else
else
reg_val
=
dapm_kcontrol_get_value
(
kcontrol
);
reg_val
=
dapm_kcontrol_get_value
(
kcontrol
);
...
@@ -2834,7 +2875,7 @@ int snd_soc_dapm_get_enum_double(struct snd_kcontrol *kcontrol,
...
@@ -2834,7 +2875,7 @@ int snd_soc_dapm_get_enum_double(struct snd_kcontrol *kcontrol,
ucontrol
->
value
.
enumerated
.
item
[
1
]
=
val
;
ucontrol
->
value
.
enumerated
.
item
[
1
]
=
val
;
}
}
return
0
;
return
ret
;
}
}
EXPORT_SYMBOL_GPL
(
snd_soc_dapm_get_enum_double
);
EXPORT_SYMBOL_GPL
(
snd_soc_dapm_get_enum_double
);
...
@@ -2850,8 +2891,8 @@ EXPORT_SYMBOL_GPL(snd_soc_dapm_get_enum_double);
...
@@ -2850,8 +2891,8 @@ EXPORT_SYMBOL_GPL(snd_soc_dapm_get_enum_double);
int
snd_soc_dapm_put_enum_double
(
struct
snd_kcontrol
*
kcontrol
,
int
snd_soc_dapm_put_enum_double
(
struct
snd_kcontrol
*
kcontrol
,
struct
snd_ctl_elem_value
*
ucontrol
)
struct
snd_ctl_elem_value
*
ucontrol
)
{
{
struct
snd_soc_
codec
*
codec
=
snd_soc_dapm_kcontrol_codec
(
kcontrol
);
struct
snd_soc_
dapm_context
*
dapm
=
snd_soc_dapm_kcontrol_dapm
(
kcontrol
);
struct
snd_soc_card
*
card
=
codec
->
card
;
struct
snd_soc_card
*
card
=
dapm
->
card
;
struct
soc_enum
*
e
=
(
struct
soc_enum
*
)
kcontrol
->
private_value
;
struct
soc_enum
*
e
=
(
struct
soc_enum
*
)
kcontrol
->
private_value
;
unsigned
int
*
item
=
ucontrol
->
value
.
enumerated
.
item
;
unsigned
int
*
item
=
ucontrol
->
value
.
enumerated
.
item
;
unsigned
int
val
,
change
;
unsigned
int
val
,
change
;
...
@@ -2874,7 +2915,7 @@ int snd_soc_dapm_put_enum_double(struct snd_kcontrol *kcontrol,
...
@@ -2874,7 +2915,7 @@ int snd_soc_dapm_put_enum_double(struct snd_kcontrol *kcontrol,
mutex_lock_nested
(
&
card
->
dapm_mutex
,
SND_SOC_DAPM_CLASS_RUNTIME
);
mutex_lock_nested
(
&
card
->
dapm_mutex
,
SND_SOC_DAPM_CLASS_RUNTIME
);
if
(
e
->
reg
!=
SND_SOC_NOPM
)
if
(
e
->
reg
!=
SND_SOC_NOPM
)
change
=
s
nd_soc_test_bits
(
codec
,
e
->
reg
,
mask
,
val
);
change
=
s
oc_dapm_test_bits
(
dapm
,
e
->
reg
,
mask
,
val
);
else
else
change
=
dapm_kcontrol_set_value
(
kcontrol
,
val
);
change
=
dapm_kcontrol_set_value
(
kcontrol
,
val
);
...
@@ -2971,6 +3012,7 @@ snd_soc_dapm_new_control(struct snd_soc_dapm_context *dapm,
...
@@ -2971,6 +3012,7 @@ snd_soc_dapm_new_control(struct snd_soc_dapm_context *dapm,
const
struct
snd_soc_dapm_widget
*
widget
)
const
struct
snd_soc_dapm_widget
*
widget
)
{
{
struct
snd_soc_dapm_widget
*
w
;
struct
snd_soc_dapm_widget
*
w
;
const
char
*
prefix
;
int
ret
;
int
ret
;
if
((
w
=
dapm_cnew_widget
(
widget
))
==
NULL
)
if
((
w
=
dapm_cnew_widget
(
widget
))
==
NULL
)
...
@@ -3011,9 +3053,9 @@ snd_soc_dapm_new_control(struct snd_soc_dapm_context *dapm,
...
@@ -3011,9 +3053,9 @@ snd_soc_dapm_new_control(struct snd_soc_dapm_context *dapm,
break
;
break
;
}
}
if
(
dapm
->
codec
&&
dapm
->
codec
->
name_prefix
)
prefix
=
soc_dapm_prefix
(
dapm
);
w
->
name
=
kasprintf
(
GFP_KERNEL
,
"%s %s"
,
if
(
prefix
)
dapm
->
codec
->
name_
prefix
,
widget
->
name
);
w
->
name
=
kasprintf
(
GFP_KERNEL
,
"%s %s"
,
prefix
,
widget
->
name
);
else
else
w
->
name
=
kasprintf
(
GFP_KERNEL
,
"%s"
,
widget
->
name
);
w
->
name
=
kasprintf
(
GFP_KERNEL
,
"%s"
,
widget
->
name
);
...
@@ -3066,7 +3108,6 @@ snd_soc_dapm_new_control(struct snd_soc_dapm_context *dapm,
...
@@ -3066,7 +3108,6 @@ snd_soc_dapm_new_control(struct snd_soc_dapm_context *dapm,
w
->
dapm
=
dapm
;
w
->
dapm
=
dapm
;
w
->
codec
=
dapm
->
codec
;
w
->
codec
=
dapm
->
codec
;
w
->
platform
=
dapm
->
platform
;
INIT_LIST_HEAD
(
&
w
->
sources
);
INIT_LIST_HEAD
(
&
w
->
sources
);
INIT_LIST_HEAD
(
&
w
->
sinks
);
INIT_LIST_HEAD
(
&
w
->
sinks
);
INIT_LIST_HEAD
(
&
w
->
list
);
INIT_LIST_HEAD
(
&
w
->
list
);
...
@@ -3173,27 +3214,15 @@ static int snd_soc_dai_link_event(struct snd_soc_dapm_widget *w,
...
@@ -3173,27 +3214,15 @@ 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
:
if
(
source
->
driver
->
ops
&&
source
->
driver
->
ops
->
hw_params
)
{
substream
.
stream
=
SNDRV_PCM_STREAM_CAPTURE
;
substream
.
stream
=
SNDRV_PCM_STREAM_CAPTURE
;
ret
=
source
->
driver
->
ops
->
hw_params
(
&
substream
,
ret
=
soc_dai_hw_params
(
&
substream
,
params
,
source
);
params
,
source
);
if
(
ret
<
0
)
if
(
ret
!=
0
)
{
dev_err
(
source
->
dev
,
"ASoC: hw_params() failed: %d
\n
"
,
ret
);
goto
out
;
goto
out
;
}
}
if
(
sink
->
driver
->
ops
&&
sink
->
driver
->
ops
->
hw_params
)
{
substream
.
stream
=
SNDRV_PCM_STREAM_PLAYBACK
;
substream
.
stream
=
SNDRV_PCM_STREAM_PLAYBACK
;
ret
=
sink
->
driver
->
ops
->
hw_params
(
&
substream
,
params
,
ret
=
soc_dai_hw_params
(
&
substream
,
params
,
sink
);
sink
);
if
(
ret
<
0
)
if
(
ret
!=
0
)
{
dev_err
(
sink
->
dev
,
"ASoC: hw_params() failed: %d
\n
"
,
ret
);
goto
out
;
goto
out
;
}
}
break
;
break
;
case
SND_SOC_DAPM_POST_PMU
:
case
SND_SOC_DAPM_POST_PMU
:
...
@@ -3365,25 +3394,15 @@ int snd_soc_dapm_link_dai_widgets(struct snd_soc_card *card)
...
@@ -3365,25 +3394,15 @@ int snd_soc_dapm_link_dai_widgets(struct snd_soc_card *card)
return
0
;
return
0
;
}
}
void
snd_soc_dapm_connect_dai_link_widgets
(
struct
snd_soc_card
*
card
)
static
void
dapm_connect_dai_link_widgets
(
struct
snd_soc_card
*
card
,
struct
snd_soc_pcm_runtime
*
rtd
)
{
{
struct
snd_soc_
pcm_runtime
*
rtd
=
card
->
rtd
;
struct
snd_soc_
dai
*
cpu_dai
=
rtd
->
cpu_dai
;
struct
snd_soc_dapm_widget
*
sink
,
*
source
;
struct
snd_soc_dapm_widget
*
sink
,
*
source
;
struct
snd_soc_dai
*
cpu_dai
,
*
codec_dai
;
int
i
;
int
i
;
/* for each BE DAI link... */
for
(
i
=
0
;
i
<
rtd
->
num_codecs
;
i
++
)
{
for
(
i
=
0
;
i
<
card
->
num_rtd
;
i
++
)
{
struct
snd_soc_dai
*
codec_dai
=
rtd
->
codec_dais
[
i
];
rtd
=
&
card
->
rtd
[
i
];
cpu_dai
=
rtd
->
cpu_dai
;
codec_dai
=
rtd
->
codec_dai
;
/*
* dynamic FE links have no fixed DAI mapping.
* CODEC<->CODEC links have no direct connection.
*/
if
(
rtd
->
dai_link
->
dynamic
||
rtd
->
dai_link
->
params
)
continue
;
/* there is no point in connecting BE DAI links with dummies */
/* there is no point in connecting BE DAI links with dummies */
if
(
snd_soc_dai_is_dummy
(
codec_dai
)
||
if
(
snd_soc_dai_is_dummy
(
codec_dai
)
||
...
@@ -3395,8 +3414,8 @@ void snd_soc_dapm_connect_dai_link_widgets(struct snd_soc_card *card)
...
@@ -3395,8 +3414,8 @@ void snd_soc_dapm_connect_dai_link_widgets(struct snd_soc_card *card)
source
=
cpu_dai
->
playback_widget
;
source
=
cpu_dai
->
playback_widget
;
sink
=
codec_dai
->
playback_widget
;
sink
=
codec_dai
->
playback_widget
;
dev_dbg
(
rtd
->
dev
,
"connected DAI link %s:%s -> %s:%s
\n
"
,
dev_dbg
(
rtd
->
dev
,
"connected DAI link %s:%s -> %s:%s
\n
"
,
cpu_dai
->
co
dec
->
name
,
source
->
name
,
cpu_dai
->
co
mponent
->
name
,
source
->
name
,
codec_dai
->
platform
->
name
,
sink
->
name
);
codec_dai
->
component
->
name
,
sink
->
name
);
snd_soc_dapm_add_path
(
&
card
->
dapm
,
source
,
sink
,
snd_soc_dapm_add_path
(
&
card
->
dapm
,
source
,
sink
,
NULL
,
NULL
);
NULL
,
NULL
);
...
@@ -3407,8 +3426,8 @@ void snd_soc_dapm_connect_dai_link_widgets(struct snd_soc_card *card)
...
@@ -3407,8 +3426,8 @@ void snd_soc_dapm_connect_dai_link_widgets(struct snd_soc_card *card)
source
=
codec_dai
->
capture_widget
;
source
=
codec_dai
->
capture_widget
;
sink
=
cpu_dai
->
capture_widget
;
sink
=
cpu_dai
->
capture_widget
;
dev_dbg
(
rtd
->
dev
,
"connected DAI link %s:%s -> %s:%s
\n
"
,
dev_dbg
(
rtd
->
dev
,
"connected DAI link %s:%s -> %s:%s
\n
"
,
codec_dai
->
co
dec
->
name
,
source
->
name
,
codec_dai
->
co
mponent
->
name
,
source
->
name
,
cpu_dai
->
platform
->
name
,
sink
->
name
);
cpu_dai
->
component
->
name
,
sink
->
name
);
snd_soc_dapm_add_path
(
&
card
->
dapm
,
source
,
sink
,
snd_soc_dapm_add_path
(
&
card
->
dapm
,
source
,
sink
,
NULL
,
NULL
);
NULL
,
NULL
);
...
@@ -3445,11 +3464,34 @@ static void soc_dapm_dai_stream_event(struct snd_soc_dai *dai, int stream,
...
@@ -3445,11 +3464,34 @@ static void soc_dapm_dai_stream_event(struct snd_soc_dai *dai, int stream,
}
}
}
}
void
snd_soc_dapm_connect_dai_link_widgets
(
struct
snd_soc_card
*
card
)
{
struct
snd_soc_pcm_runtime
*
rtd
=
card
->
rtd
;
int
i
;
/* for each BE DAI link... */
for
(
i
=
0
;
i
<
card
->
num_rtd
;
i
++
)
{
rtd
=
&
card
->
rtd
[
i
];
/*
* dynamic FE links have no fixed DAI mapping.
* CODEC<->CODEC links have no direct connection.
*/
if
(
rtd
->
dai_link
->
dynamic
||
rtd
->
dai_link
->
params
)
continue
;
dapm_connect_dai_link_widgets
(
card
,
rtd
);
}
}
static
void
soc_dapm_stream_event
(
struct
snd_soc_pcm_runtime
*
rtd
,
int
stream
,
static
void
soc_dapm_stream_event
(
struct
snd_soc_pcm_runtime
*
rtd
,
int
stream
,
int
event
)
int
event
)
{
{
int
i
;
soc_dapm_dai_stream_event
(
rtd
->
cpu_dai
,
stream
,
event
);
soc_dapm_dai_stream_event
(
rtd
->
cpu_dai
,
stream
,
event
);
soc_dapm_dai_stream_event
(
rtd
->
codec_dai
,
stream
,
event
);
for
(
i
=
0
;
i
<
rtd
->
num_codecs
;
i
++
)
soc_dapm_dai_stream_event
(
rtd
->
codec_dais
[
i
],
stream
,
event
);
dapm_power_widgets
(
rtd
->
card
,
event
);
dapm_power_widgets
(
rtd
->
card
,
event
);
}
}
...
@@ -3758,36 +3800,31 @@ static bool snd_soc_dapm_widget_in_card_paths(struct snd_soc_card *card,
...
@@ -3758,36 +3800,31 @@ static bool snd_soc_dapm_widget_in_card_paths(struct snd_soc_card *card,
}
}
/**
/**
* snd_soc_dapm_auto_nc_
codec_
pins - call snd_soc_dapm_nc_pin for unused pins
* snd_soc_dapm_auto_nc_pins - call snd_soc_dapm_nc_pin for unused pins
* @c
odec: The codec
whose pins should be processed
* @c
ard: The card
whose pins should be processed
*
*
* Automatically call snd_soc_dapm_nc_pin() for any external pins in the c
odec
* Automatically call snd_soc_dapm_nc_pin() for any external pins in the c
ard
* which are unused. Pins are used if they are connected externally to
the
* which are unused. Pins are used if they are connected externally to
a
* co
dec
, whether that be to some other device, or a loop-back connection to
* co
mponent
, whether that be to some other device, or a loop-back connection to
* the co
dec
itself.
* the co
mponent
itself.
*/
*/
void
snd_soc_dapm_auto_nc_
codec_pins
(
struct
snd_soc_codec
*
codec
)
void
snd_soc_dapm_auto_nc_
pins
(
struct
snd_soc_card
*
card
)
{
{
struct
snd_soc_card
*
card
=
codec
->
card
;
struct
snd_soc_dapm_context
*
dapm
=
&
codec
->
dapm
;
struct
snd_soc_dapm_widget
*
w
;
struct
snd_soc_dapm_widget
*
w
;
dev_dbg
(
codec
->
dev
,
"ASoC: Auto NC: DAPMs: card:%p codec:%p
\n
"
,
dev_dbg
(
card
->
dev
,
"ASoC: Auto NC: DAPMs: card:%p
\n
"
,
&
card
->
dapm
);
&
card
->
dapm
,
&
codec
->
dapm
);
list_for_each_entry
(
w
,
&
card
->
widgets
,
list
)
{
list_for_each_entry
(
w
,
&
card
->
widgets
,
list
)
{
if
(
w
->
dapm
!=
dapm
)
continue
;
switch
(
w
->
id
)
{
switch
(
w
->
id
)
{
case
snd_soc_dapm_input
:
case
snd_soc_dapm_input
:
case
snd_soc_dapm_output
:
case
snd_soc_dapm_output
:
case
snd_soc_dapm_micbias
:
case
snd_soc_dapm_micbias
:
dev_dbg
(
c
odec
->
dev
,
"ASoC: Auto NC: Checking widget %s
\n
"
,
dev_dbg
(
c
ard
->
dev
,
"ASoC: Auto NC: Checking widget %s
\n
"
,
w
->
name
);
w
->
name
);
if
(
!
snd_soc_dapm_widget_in_card_paths
(
card
,
w
))
{
if
(
!
snd_soc_dapm_widget_in_card_paths
(
card
,
w
))
{
dev_dbg
(
c
odec
->
dev
,
dev_dbg
(
c
ard
->
dev
,
"... Not in map; disabling
\n
"
);
"... Not in map; disabling
\n
"
);
snd_soc_dapm_nc_pin
(
dapm
,
w
->
name
);
snd_soc_dapm_nc_pin
(
w
->
dapm
,
w
->
name
);
}
}
break
;
break
;
default:
default:
...
...
sound/soc/soc-jack.c
浏览文件 @
a1cb98ac
...
@@ -43,7 +43,7 @@ int snd_soc_jack_new(struct snd_soc_codec *codec, const char *id, int type,
...
@@ -43,7 +43,7 @@ int snd_soc_jack_new(struct snd_soc_codec *codec, const char *id, int type,
INIT_LIST_HEAD
(
&
jack
->
jack_zones
);
INIT_LIST_HEAD
(
&
jack
->
jack_zones
);
BLOCKING_INIT_NOTIFIER_HEAD
(
&
jack
->
notifier
);
BLOCKING_INIT_NOTIFIER_HEAD
(
&
jack
->
notifier
);
return
snd_jack_new
(
codec
->
card
->
snd_card
,
id
,
type
,
&
jack
->
jack
);
return
snd_jack_new
(
codec
->
c
omponent
.
c
ard
->
snd_card
,
id
,
type
,
&
jack
->
jack
);
}
}
EXPORT_SYMBOL_GPL
(
snd_soc_jack_new
);
EXPORT_SYMBOL_GPL
(
snd_soc_jack_new
);
...
@@ -260,7 +260,7 @@ static void snd_soc_jack_gpio_detect(struct snd_soc_jack_gpio *gpio)
...
@@ -260,7 +260,7 @@ static void snd_soc_jack_gpio_detect(struct snd_soc_jack_gpio *gpio)
static
irqreturn_t
gpio_handler
(
int
irq
,
void
*
data
)
static
irqreturn_t
gpio_handler
(
int
irq
,
void
*
data
)
{
{
struct
snd_soc_jack_gpio
*
gpio
=
data
;
struct
snd_soc_jack_gpio
*
gpio
=
data
;
struct
device
*
dev
=
gpio
->
jack
->
codec
->
card
->
dev
;
struct
device
*
dev
=
gpio
->
jack
->
codec
->
c
omponent
.
c
ard
->
dev
;
trace_snd_soc_jack_irq
(
gpio
->
name
);
trace_snd_soc_jack_irq
(
gpio
->
name
);
...
...
sound/soc/soc-pcm.c
浏览文件 @
a1cb98ac
此差异已折叠。
点击以展开。
sound/soc/tegra/tegra_alc5632.c
浏览文件 @
a1cb98ac
...
@@ -41,8 +41,7 @@ static int tegra_alc5632_asoc_hw_params(struct snd_pcm_substream *substream,
...
@@ -41,8 +41,7 @@ static int tegra_alc5632_asoc_hw_params(struct snd_pcm_substream *substream,
{
{
struct
snd_soc_pcm_runtime
*
rtd
=
substream
->
private_data
;
struct
snd_soc_pcm_runtime
*
rtd
=
substream
->
private_data
;
struct
snd_soc_dai
*
codec_dai
=
rtd
->
codec_dai
;
struct
snd_soc_dai
*
codec_dai
=
rtd
->
codec_dai
;
struct
snd_soc_codec
*
codec
=
codec_dai
->
codec
;
struct
snd_soc_card
*
card
=
rtd
->
card
;
struct
snd_soc_card
*
card
=
codec
->
card
;
struct
tegra_alc5632
*
alc5632
=
snd_soc_card_get_drvdata
(
card
);
struct
tegra_alc5632
*
alc5632
=
snd_soc_card_get_drvdata
(
card
);
int
srate
,
mclk
;
int
srate
,
mclk
;
int
err
;
int
err
;
...
@@ -105,7 +104,7 @@ static int tegra_alc5632_asoc_init(struct snd_soc_pcm_runtime *rtd)
...
@@ -105,7 +104,7 @@ static int tegra_alc5632_asoc_init(struct snd_soc_pcm_runtime *rtd)
struct
snd_soc_dai
*
codec_dai
=
rtd
->
codec_dai
;
struct
snd_soc_dai
*
codec_dai
=
rtd
->
codec_dai
;
struct
snd_soc_codec
*
codec
=
codec_dai
->
codec
;
struct
snd_soc_codec
*
codec
=
codec_dai
->
codec
;
struct
snd_soc_dapm_context
*
dapm
=
&
codec
->
dapm
;
struct
snd_soc_dapm_context
*
dapm
=
&
codec
->
dapm
;
struct
tegra_alc5632
*
machine
=
snd_soc_card_get_drvdata
(
codec
->
card
);
struct
tegra_alc5632
*
machine
=
snd_soc_card_get_drvdata
(
rtd
->
card
);
snd_soc_jack_new
(
codec
,
"Headset Jack"
,
SND_JACK_HEADSET
,
snd_soc_jack_new
(
codec
,
"Headset Jack"
,
SND_JACK_HEADSET
,
&
tegra_alc5632_hs_jack
);
&
tegra_alc5632_hs_jack
);
...
...
sound/soc/tegra/tegra_max98090.c
浏览文件 @
a1cb98ac
...
@@ -49,8 +49,7 @@ static int tegra_max98090_asoc_hw_params(struct snd_pcm_substream *substream,
...
@@ -49,8 +49,7 @@ static int tegra_max98090_asoc_hw_params(struct snd_pcm_substream *substream,
{
{
struct
snd_soc_pcm_runtime
*
rtd
=
substream
->
private_data
;
struct
snd_soc_pcm_runtime
*
rtd
=
substream
->
private_data
;
struct
snd_soc_dai
*
codec_dai
=
rtd
->
codec_dai
;
struct
snd_soc_dai
*
codec_dai
=
rtd
->
codec_dai
;
struct
snd_soc_codec
*
codec
=
codec_dai
->
codec
;
struct
snd_soc_card
*
card
=
rtd
->
card
;
struct
snd_soc_card
*
card
=
codec
->
card
;
struct
tegra_max98090
*
machine
=
snd_soc_card_get_drvdata
(
card
);
struct
tegra_max98090
*
machine
=
snd_soc_card_get_drvdata
(
card
);
int
srate
,
mclk
;
int
srate
,
mclk
;
int
err
;
int
err
;
...
@@ -127,7 +126,7 @@ static int tegra_max98090_asoc_init(struct snd_soc_pcm_runtime *rtd)
...
@@ -127,7 +126,7 @@ static int tegra_max98090_asoc_init(struct snd_soc_pcm_runtime *rtd)
{
{
struct
snd_soc_dai
*
codec_dai
=
rtd
->
codec_dai
;
struct
snd_soc_dai
*
codec_dai
=
rtd
->
codec_dai
;
struct
snd_soc_codec
*
codec
=
codec_dai
->
codec
;
struct
snd_soc_codec
*
codec
=
codec_dai
->
codec
;
struct
tegra_max98090
*
machine
=
snd_soc_card_get_drvdata
(
codec
->
card
);
struct
tegra_max98090
*
machine
=
snd_soc_card_get_drvdata
(
rtd
->
card
);
if
(
gpio_is_valid
(
machine
->
gpio_hp_det
))
{
if
(
gpio_is_valid
(
machine
->
gpio_hp_det
))
{
snd_soc_jack_new
(
codec
,
"Headphones"
,
SND_JACK_HEADPHONE
,
snd_soc_jack_new
(
codec
,
"Headphones"
,
SND_JACK_HEADPHONE
,
...
...
sound/soc/tegra/tegra_rt5640.c
浏览文件 @
a1cb98ac
...
@@ -51,8 +51,7 @@ static int tegra_rt5640_asoc_hw_params(struct snd_pcm_substream *substream,
...
@@ -51,8 +51,7 @@ static int tegra_rt5640_asoc_hw_params(struct snd_pcm_substream *substream,
{
{
struct
snd_soc_pcm_runtime
*
rtd
=
substream
->
private_data
;
struct
snd_soc_pcm_runtime
*
rtd
=
substream
->
private_data
;
struct
snd_soc_dai
*
codec_dai
=
rtd
->
codec_dai
;
struct
snd_soc_dai
*
codec_dai
=
rtd
->
codec_dai
;
struct
snd_soc_codec
*
codec
=
codec_dai
->
codec
;
struct
snd_soc_card
*
card
=
rtd
->
card
;
struct
snd_soc_card
*
card
=
codec
->
card
;
struct
tegra_rt5640
*
machine
=
snd_soc_card_get_drvdata
(
card
);
struct
tegra_rt5640
*
machine
=
snd_soc_card_get_drvdata
(
card
);
int
srate
,
mclk
;
int
srate
,
mclk
;
int
err
;
int
err
;
...
@@ -110,7 +109,7 @@ static int tegra_rt5640_asoc_init(struct snd_soc_pcm_runtime *rtd)
...
@@ -110,7 +109,7 @@ static int tegra_rt5640_asoc_init(struct snd_soc_pcm_runtime *rtd)
{
{
struct
snd_soc_dai
*
codec_dai
=
rtd
->
codec_dai
;
struct
snd_soc_dai
*
codec_dai
=
rtd
->
codec_dai
;
struct
snd_soc_codec
*
codec
=
codec_dai
->
codec
;
struct
snd_soc_codec
*
codec
=
codec_dai
->
codec
;
struct
tegra_rt5640
*
machine
=
snd_soc_card_get_drvdata
(
codec
->
card
);
struct
tegra_rt5640
*
machine
=
snd_soc_card_get_drvdata
(
rtd
->
card
);
snd_soc_jack_new
(
codec
,
"Headphones"
,
SND_JACK_HEADPHONE
,
snd_soc_jack_new
(
codec
,
"Headphones"
,
SND_JACK_HEADPHONE
,
&
tegra_rt5640_hp_jack
);
&
tegra_rt5640_hp_jack
);
...
...
sound/soc/tegra/tegra_wm8753.c
浏览文件 @
a1cb98ac
...
@@ -55,8 +55,7 @@ static int tegra_wm8753_hw_params(struct snd_pcm_substream *substream,
...
@@ -55,8 +55,7 @@ static int tegra_wm8753_hw_params(struct snd_pcm_substream *substream,
{
{
struct
snd_soc_pcm_runtime
*
rtd
=
substream
->
private_data
;
struct
snd_soc_pcm_runtime
*
rtd
=
substream
->
private_data
;
struct
snd_soc_dai
*
codec_dai
=
rtd
->
codec_dai
;
struct
snd_soc_dai
*
codec_dai
=
rtd
->
codec_dai
;
struct
snd_soc_codec
*
codec
=
codec_dai
->
codec
;
struct
snd_soc_card
*
card
=
rtd
->
card
;
struct
snd_soc_card
*
card
=
codec
->
card
;
struct
tegra_wm8753
*
machine
=
snd_soc_card_get_drvdata
(
card
);
struct
tegra_wm8753
*
machine
=
snd_soc_card_get_drvdata
(
card
);
int
srate
,
mclk
;
int
srate
,
mclk
;
int
err
;
int
err
;
...
...
sound/soc/tegra/tegra_wm8903.c
浏览文件 @
a1cb98ac
...
@@ -60,8 +60,7 @@ static int tegra_wm8903_hw_params(struct snd_pcm_substream *substream,
...
@@ -60,8 +60,7 @@ static int tegra_wm8903_hw_params(struct snd_pcm_substream *substream,
{
{
struct
snd_soc_pcm_runtime
*
rtd
=
substream
->
private_data
;
struct
snd_soc_pcm_runtime
*
rtd
=
substream
->
private_data
;
struct
snd_soc_dai
*
codec_dai
=
rtd
->
codec_dai
;
struct
snd_soc_dai
*
codec_dai
=
rtd
->
codec_dai
;
struct
snd_soc_codec
*
codec
=
codec_dai
->
codec
;
struct
snd_soc_card
*
card
=
rtd
->
card
;
struct
snd_soc_card
*
card
=
codec
->
card
;
struct
tegra_wm8903
*
machine
=
snd_soc_card_get_drvdata
(
card
);
struct
tegra_wm8903
*
machine
=
snd_soc_card_get_drvdata
(
card
);
int
srate
,
mclk
;
int
srate
,
mclk
;
int
err
;
int
err
;
...
@@ -173,7 +172,7 @@ static int tegra_wm8903_init(struct snd_soc_pcm_runtime *rtd)
...
@@ -173,7 +172,7 @@ static int tegra_wm8903_init(struct snd_soc_pcm_runtime *rtd)
struct
snd_soc_dai
*
codec_dai
=
rtd
->
codec_dai
;
struct
snd_soc_dai
*
codec_dai
=
rtd
->
codec_dai
;
struct
snd_soc_codec
*
codec
=
codec_dai
->
codec
;
struct
snd_soc_codec
*
codec
=
codec_dai
->
codec
;
struct
snd_soc_dapm_context
*
dapm
=
&
codec
->
dapm
;
struct
snd_soc_dapm_context
*
dapm
=
&
codec
->
dapm
;
struct
snd_soc_card
*
card
=
codec
->
card
;
struct
snd_soc_card
*
card
=
rtd
->
card
;
struct
tegra_wm8903
*
machine
=
snd_soc_card_get_drvdata
(
card
);
struct
tegra_wm8903
*
machine
=
snd_soc_card_get_drvdata
(
card
);
if
(
gpio_is_valid
(
machine
->
gpio_hp_det
))
{
if
(
gpio_is_valid
(
machine
->
gpio_hp_det
))
{
...
...
sound/soc/tegra/trimslice.c
浏览文件 @
a1cb98ac
...
@@ -50,8 +50,7 @@ static int trimslice_asoc_hw_params(struct snd_pcm_substream *substream,
...
@@ -50,8 +50,7 @@ static int trimslice_asoc_hw_params(struct snd_pcm_substream *substream,
{
{
struct
snd_soc_pcm_runtime
*
rtd
=
substream
->
private_data
;
struct
snd_soc_pcm_runtime
*
rtd
=
substream
->
private_data
;
struct
snd_soc_dai
*
codec_dai
=
rtd
->
codec_dai
;
struct
snd_soc_dai
*
codec_dai
=
rtd
->
codec_dai
;
struct
snd_soc_codec
*
codec
=
codec_dai
->
codec
;
struct
snd_soc_card
*
card
=
rtd
->
card
;
struct
snd_soc_card
*
card
=
codec
->
card
;
struct
tegra_trimslice
*
trimslice
=
snd_soc_card_get_drvdata
(
card
);
struct
tegra_trimslice
*
trimslice
=
snd_soc_card_get_drvdata
(
card
);
int
srate
,
mclk
;
int
srate
,
mclk
;
int
err
;
int
err
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录