Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
c159a850
cloud-kernel
项目概览
openanolis
/
cloud-kernel
1 年多 前同步成功
通知
160
Star
36
Fork
7
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
10
列表
看板
标记
里程碑
合并请求
2
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
cloud-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
10
Issue
10
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
c159a850
编写于
3月 25, 2014
作者:
M
Mark Brown
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branches 'asoc/topic/tdm' and 'asoc/topic/tegra' into asoc-next
上级
bad318cd
5f9e6ff6
1ca2e847
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
59 addition
and
23 deletion
+59
-23
include/sound/soc-dai.h
include/sound/soc-dai.h
+1
-1
sound/soc/fsl/Kconfig
sound/soc/fsl/Kconfig
+2
-0
sound/soc/fsl/fsl_esai.c
sound/soc/fsl/fsl_esai.c
+2
-0
sound/soc/fsl/fsl_utils.c
sound/soc/fsl/fsl_utils.c
+27
-0
sound/soc/fsl/fsl_utils.h
sound/soc/fsl/fsl_utils.h
+3
-1
sound/soc/fsl/imx-ssi.c
sound/soc/fsl/imx-ssi.c
+2
-0
sound/soc/soc-core.c
sound/soc/soc-core.c
+5
-5
sound/soc/tegra/tegra20_ac97.c
sound/soc/tegra/tegra20_ac97.c
+1
-14
sound/soc/tegra/tegra20_ac97.h
sound/soc/tegra/tegra20_ac97.h
+0
-1
sound/soc/tegra/tegra_wm9712.c
sound/soc/tegra/tegra_wm9712.c
+16
-1
未找到文件。
include/sound/soc-dai.h
浏览文件 @
c159a850
...
...
@@ -142,7 +142,7 @@ struct snd_soc_dai_ops {
* Called by soc_card drivers, normally in their hw_params.
*/
int
(
*
set_fmt
)(
struct
snd_soc_dai
*
dai
,
unsigned
int
fmt
);
int
(
*
of_
xlate_tdm_slot_mask
)(
unsigned
int
slots
,
int
(
*
xlate_tdm_slot_mask
)(
unsigned
int
slots
,
unsigned
int
*
tx_mask
,
unsigned
int
*
rx_mask
);
int
(
*
set_tdm_slot
)(
struct
snd_soc_dai
*
dai
,
unsigned
int
tx_mask
,
unsigned
int
rx_mask
,
...
...
sound/soc/fsl/Kconfig
浏览文件 @
c159a850
...
...
@@ -13,6 +13,7 @@ config SND_SOC_FSL_SPDIF
config SND_SOC_FSL_ESAI
tristate
select REGMAP_MMIO
select SND_SOC_FSL_UTILS
config SND_SOC_FSL_UTILS
tristate
...
...
@@ -120,6 +121,7 @@ if SND_IMX_SOC
config SND_SOC_IMX_SSI
tristate
select SND_SOC_FSL_UTILS
config SND_SOC_IMX_PCM_FIQ
tristate
...
...
sound/soc/fsl/fsl_esai.c
浏览文件 @
c159a850
...
...
@@ -18,6 +18,7 @@
#include "fsl_esai.h"
#include "imx-pcm.h"
#include "fsl_utils.h"
#define FSL_ESAI_RATES SNDRV_PCM_RATE_8000_192000
#define FSL_ESAI_FORMATS (SNDRV_PCM_FMTBIT_S8 | \
...
...
@@ -581,6 +582,7 @@ static struct snd_soc_dai_ops fsl_esai_dai_ops = {
.
hw_params
=
fsl_esai_hw_params
,
.
set_sysclk
=
fsl_esai_set_dai_sysclk
,
.
set_fmt
=
fsl_esai_set_dai_fmt
,
.
xlate_tdm_slot_mask
=
fsl_asoc_xlate_tdm_slot_mask
,
.
set_tdm_slot
=
fsl_esai_set_dai_tdm_slot
,
};
...
...
sound/soc/fsl/fsl_utils.c
浏览文件 @
c159a850
...
...
@@ -86,6 +86,33 @@ int fsl_asoc_get_dma_channel(struct device_node *ssi_np,
}
EXPORT_SYMBOL
(
fsl_asoc_get_dma_channel
);
/**
* fsl_asoc_xlate_tdm_slot_mask - generate TDM slot TX/RX mask.
*
* @slots: Number of slots in use.
* @tx_mask: bitmask representing active TX slots.
* @rx_mask: bitmask representing active RX slots.
*
* This function used to generate the TDM slot TX/RX mask. And the TX/RX
* mask will use a 0 bit for an active slot as default, and the default
* active bits are at the LSB of the mask value.
*/
int
fsl_asoc_xlate_tdm_slot_mask
(
unsigned
int
slots
,
unsigned
int
*
tx_mask
,
unsigned
int
*
rx_mask
)
{
if
(
!
slots
)
return
-
EINVAL
;
if
(
tx_mask
)
*
tx_mask
=
~
((
1
<<
slots
)
-
1
);
if
(
rx_mask
)
*
rx_mask
=
~
((
1
<<
slots
)
-
1
);
return
0
;
}
EXPORT_SYMBOL_GPL
(
fsl_asoc_xlate_tdm_slot_mask
);
MODULE_AUTHOR
(
"Timur Tabi <timur@freescale.com>"
);
MODULE_DESCRIPTION
(
"Freescale ASoC utility code"
);
MODULE_LICENSE
(
"GPL v2"
);
sound/soc/fsl/fsl_utils.h
浏览文件 @
c159a850
...
...
@@ -22,5 +22,7 @@ int fsl_asoc_get_dma_channel(struct device_node *ssi_np, const char *name,
struct
snd_soc_dai_link
*
dai
,
unsigned
int
*
dma_channel_id
,
unsigned
int
*
dma_id
);
int
fsl_asoc_xlate_tdm_slot_mask
(
unsigned
int
slots
,
unsigned
int
*
tx_mask
,
unsigned
int
*
rx_mask
);
#endif
/* _FSL_UTILS_H */
sound/soc/fsl/imx-ssi.c
浏览文件 @
c159a850
...
...
@@ -50,6 +50,7 @@
#include <linux/platform_data/asoc-imx-ssi.h>
#include "imx-ssi.h"
#include "fsl_utils.h"
#define SSI_SACNT_DEFAULT (SSI_SACNT_AC97EN | SSI_SACNT_FV)
...
...
@@ -339,6 +340,7 @@ static const struct snd_soc_dai_ops imx_ssi_pcm_dai_ops = {
.
set_fmt
=
imx_ssi_set_dai_fmt
,
.
set_clkdiv
=
imx_ssi_set_dai_clkdiv
,
.
set_sysclk
=
imx_ssi_set_dai_sysclk
,
.
xlate_tdm_slot_mask
=
fsl_asoc_xlate_tdm_slot_mask
,
.
set_tdm_slot
=
imx_ssi_set_dai_tdm_slot
,
.
trigger
=
imx_ssi_trigger
,
};
...
...
sound/soc/soc-core.c
浏览文件 @
c159a850
...
...
@@ -3620,14 +3620,14 @@ int snd_soc_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
EXPORT_SYMBOL_GPL
(
snd_soc_dai_set_fmt
);
/**
* snd_soc_
of_
xlate_tdm_slot - generate tx/rx slot mask.
* snd_soc_xlate_tdm_slot - generate tx/rx slot mask.
* @slots: Number of slots in use.
* @tx_mask: bitmask representing active TX slots.
* @rx_mask: bitmask representing active RX slots.
*
* Generates the TDM tx and rx slot default masks for DAI.
*/
static
int
snd_soc_
of_
xlate_tdm_slot_mask
(
unsigned
int
slots
,
static
int
snd_soc_xlate_tdm_slot_mask
(
unsigned
int
slots
,
unsigned
int
*
tx_mask
,
unsigned
int
*
rx_mask
)
{
...
...
@@ -3657,11 +3657,11 @@ static int snd_soc_of_xlate_tdm_slot_mask(unsigned int slots,
int
snd_soc_dai_set_tdm_slot
(
struct
snd_soc_dai
*
dai
,
unsigned
int
tx_mask
,
unsigned
int
rx_mask
,
int
slots
,
int
slot_width
)
{
if
(
dai
->
driver
&&
dai
->
driver
->
ops
->
of_
xlate_tdm_slot_mask
)
dai
->
driver
->
ops
->
of_
xlate_tdm_slot_mask
(
slots
,
if
(
dai
->
driver
&&
dai
->
driver
->
ops
->
xlate_tdm_slot_mask
)
dai
->
driver
->
ops
->
xlate_tdm_slot_mask
(
slots
,
&
tx_mask
,
&
rx_mask
);
else
snd_soc_
of_
xlate_tdm_slot_mask
(
slots
,
&
tx_mask
,
&
rx_mask
);
snd_soc_xlate_tdm_slot_mask
(
slots
,
&
tx_mask
,
&
rx_mask
);
if
(
dai
->
driver
&&
dai
->
driver
->
ops
->
set_tdm_slot
)
return
dai
->
driver
->
ops
->
set_tdm_slot
(
dai
,
tx_mask
,
rx_mask
,
...
...
sound/soc/tegra/tegra20_ac97.c
浏览文件 @
c159a850
...
...
@@ -37,7 +37,6 @@
#include <sound/soc.h>
#include <sound/dmaengine_pcm.h>
#include "tegra_asoc_utils.h"
#include "tegra20_ac97.h"
#define DRV_NAME "tegra20-ac97"
...
...
@@ -376,18 +375,10 @@ static int tegra20_ac97_platform_probe(struct platform_device *pdev)
ac97
->
playback_dma_data
.
addr_width
=
DMA_SLAVE_BUSWIDTH_4_BYTES
;
ac97
->
playback_dma_data
.
maxburst
=
4
;
ret
=
tegra_asoc_utils_init
(
&
ac97
->
util_data
,
&
pdev
->
dev
);
if
(
ret
)
goto
err_clk_put
;
ret
=
tegra_asoc_utils_set_ac97_rate
(
&
ac97
->
util_data
);
if
(
ret
)
goto
err_asoc_utils_fini
;
ret
=
clk_prepare_enable
(
ac97
->
clk_ac97
);
if
(
ret
)
{
dev_err
(
&
pdev
->
dev
,
"clk_enable failed: %d
\n
"
,
ret
);
goto
err
_asoc_utils_fini
;
goto
err
;
}
ret
=
snd_soc_set_ac97_ops
(
&
tegra20_ac97_ops
);
...
...
@@ -419,8 +410,6 @@ static int tegra20_ac97_platform_probe(struct platform_device *pdev)
snd_soc_unregister_component
(
&
pdev
->
dev
);
err_clk_disable_unprepare:
clk_disable_unprepare
(
ac97
->
clk_ac97
);
err_asoc_utils_fini:
tegra_asoc_utils_fini
(
&
ac97
->
util_data
);
err_clk_put:
err:
snd_soc_set_ac97_ops
(
NULL
);
...
...
@@ -434,8 +423,6 @@ static int tegra20_ac97_platform_remove(struct platform_device *pdev)
tegra_pcm_platform_unregister
(
&
pdev
->
dev
);
snd_soc_unregister_component
(
&
pdev
->
dev
);
tegra_asoc_utils_fini
(
&
ac97
->
util_data
);
clk_disable_unprepare
(
ac97
->
clk_ac97
);
snd_soc_set_ac97_ops
(
NULL
);
...
...
sound/soc/tegra/tegra20_ac97.h
浏览文件 @
c159a850
...
...
@@ -90,6 +90,5 @@ struct tegra20_ac97 {
struct
regmap
*
regmap
;
int
reset_gpio
;
int
sync_gpio
;
struct
tegra_asoc_utils_data
util_data
;
};
#endif
/* __TEGRA20_AC97_H__ */
sound/soc/tegra/tegra_wm9712.c
浏览文件 @
c159a850
...
...
@@ -29,10 +29,13 @@
#include <sound/pcm_params.h>
#include <sound/soc.h>
#include "tegra_asoc_utils.h"
#define DRV_NAME "tegra-snd-wm9712"
struct
tegra_wm9712
{
struct
platform_device
*
codec
;
struct
tegra_asoc_utils_data
util_data
;
};
static
const
struct
snd_soc_dapm_widget
tegra_wm9712_dapm_widgets
[]
=
{
...
...
@@ -118,15 +121,25 @@ static int tegra_wm9712_driver_probe(struct platform_device *pdev)
tegra_wm9712_dai
.
platform_of_node
=
tegra_wm9712_dai
.
cpu_of_node
;
ret
=
tegra_asoc_utils_init
(
&
machine
->
util_data
,
&
pdev
->
dev
);
if
(
ret
)
goto
codec_unregister
;
ret
=
tegra_asoc_utils_set_ac97_rate
(
&
machine
->
util_data
);
if
(
ret
)
goto
asoc_utils_fini
;
ret
=
snd_soc_register_card
(
card
);
if
(
ret
)
{
dev_err
(
&
pdev
->
dev
,
"snd_soc_register_card failed (%d)
\n
"
,
ret
);
goto
codec_unregister
;
goto
asoc_utils_fini
;
}
return
0
;
asoc_utils_fini:
tegra_asoc_utils_fini
(
&
machine
->
util_data
);
codec_unregister:
platform_device_del
(
machine
->
codec
);
codec_put:
...
...
@@ -141,6 +154,8 @@ static int tegra_wm9712_driver_remove(struct platform_device *pdev)
snd_soc_unregister_card
(
card
);
tegra_asoc_utils_fini
(
&
machine
->
util_data
);
platform_device_unregister
(
machine
->
codec
);
return
0
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录