Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
141dee78
cloud-kernel
项目概览
openanolis
/
cloud-kernel
接近 2 年 前同步成功
通知
170
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看板
提交
141dee78
编写于
2月 19, 2017
作者:
M
Mark Brown
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branches 'asoc/topic/wm8753' and 'asoc/topic/zte' into asoc-next
上级
ebfa3dcc
af4b654f
66ead502
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
40 addition
and
20 deletion
+40
-20
Documentation/devicetree/bindings/sound/zte,zx-i2s.txt
Documentation/devicetree/bindings/sound/zte,zx-i2s.txt
+8
-6
sound/soc/codecs/wm8753.c
sound/soc/codecs/wm8753.c
+2
-1
sound/soc/zte/zx-i2s.c
sound/soc/zte/zx-i2s.c
+30
-13
未找到文件。
Documentation/devicetree/bindings/sound/zte,zx-i2s.txt
浏览文件 @
141dee78
ZTE ZX296702 I2S controller
ZTE ZX296702 I2S controller
Required properties:
Required properties:
- compatible : Must be "zte,zx296702-i2s"
- compatible : Must be one of:
"zte,zx296718-i2s", "zte,zx296702-i2s"
"zte,zx296702-i2s"
- reg : Must contain I2S core's registers location and length
- reg : Must contain I2S core's registers location and length
- clocks : Pairs of phandle and specifier referencing the controller's clocks.
- clocks : Pairs of phandle and specifier referencing the controller's clocks.
- clock-names: "
tx" for the cloc
k to the I2S interface.
- clock-names: "
wclk" for the wclk, "pclk" for the pcl
k to the I2S interface.
- dmas: Pairs of phandle and specifier for the DMA channel that is used by
- dmas: Pairs of phandle and specifier for the DMA channel that is used by
the core. The core expects two dma channels for transmit.
the core. The core expects two dma channels for transmit.
- dma-names : Must be "tx" and "rx"
- dma-names : Must be "tx" and "rx"
...
@@ -16,12 +18,12 @@ please check:
...
@@ -16,12 +18,12 @@ please check:
* dma/dma.txt
* dma/dma.txt
Example:
Example:
i2s0: i2s
0@0
b005000 {
i2s0: i2s
@
b005000 {
#sound-dai-cells = <0>;
#sound-dai-cells = <0>;
compatible = "zte,zx296702-i2s";
compatible = "zte,zx2967
18-i2s", "zte,zx2967
02-i2s";
reg = <0x0b005000 0x1000>;
reg = <0x0b005000 0x1000>;
clocks = <&
lsp0clk ZX296702_I2S0_DIV
>;
clocks = <&
audiocrm AUDIO_I2S0_WCLK>, <&audiocrm AUDIO_I2S0_PCLK
>;
clock-names = "
tx
";
clock-names = "
wclk", "pclk
";
interrupts = <GIC_SPI 22 IRQ_TYPE_LEVEL_HIGH>;
interrupts = <GIC_SPI 22 IRQ_TYPE_LEVEL_HIGH>;
dmas = <&dma 5>, <&dma 6>;
dmas = <&dma 5>, <&dma 6>;
dma-names = "tx", "rx";
dma-names = "tx", "rx";
...
...
sound/soc/codecs/wm8753.c
浏览文件 @
141dee78
...
@@ -280,6 +280,7 @@ static const DECLARE_TLV_DB_SCALE(voice_mix_tlv, -1200, 300, 0);
...
@@ -280,6 +280,7 @@ static const DECLARE_TLV_DB_SCALE(voice_mix_tlv, -1200, 300, 0);
static
const
DECLARE_TLV_DB_SCALE
(
pga_tlv
,
-
1725
,
75
,
0
);
static
const
DECLARE_TLV_DB_SCALE
(
pga_tlv
,
-
1725
,
75
,
0
);
static
const
struct
snd_kcontrol_new
wm8753_snd_controls
[]
=
{
static
const
struct
snd_kcontrol_new
wm8753_snd_controls
[]
=
{
SOC_SINGLE
(
"Hi-Fi DAC Left/Right channel Swap"
,
WM8753_HIFI
,
5
,
1
,
0
),
SOC_DOUBLE_R_TLV
(
"PCM Volume"
,
WM8753_LDAC
,
WM8753_RDAC
,
0
,
255
,
0
,
dac_tlv
),
SOC_DOUBLE_R_TLV
(
"PCM Volume"
,
WM8753_LDAC
,
WM8753_RDAC
,
0
,
255
,
0
,
dac_tlv
),
SOC_DOUBLE_R_TLV
(
"ADC Capture Volume"
,
WM8753_LADC
,
WM8753_RADC
,
0
,
255
,
0
,
SOC_DOUBLE_R_TLV
(
"ADC Capture Volume"
,
WM8753_LADC
,
WM8753_RADC
,
0
,
255
,
0
,
...
@@ -1087,7 +1088,7 @@ static int wm8753_i2s_set_dai_fmt(struct snd_soc_codec *codec,
...
@@ -1087,7 +1088,7 @@ static int wm8753_i2s_set_dai_fmt(struct snd_soc_codec *codec,
{
{
u16
ioctl
,
hifi
;
u16
ioctl
,
hifi
;
hifi
=
snd_soc_read
(
codec
,
WM8753_HIFI
)
&
0x01
1
f
;
hifi
=
snd_soc_read
(
codec
,
WM8753_HIFI
)
&
0x01
3
f
;
ioctl
=
snd_soc_read
(
codec
,
WM8753_IOCTL
)
&
0x00ae
;
ioctl
=
snd_soc_read
(
codec
,
WM8753_IOCTL
)
&
0x00ae
;
/* set master/slave audio interface */
/* set master/slave audio interface */
...
...
sound/soc/zte/zx-i2s.c
浏览文件 @
141dee78
...
@@ -95,7 +95,8 @@
...
@@ -95,7 +95,8 @@
struct
zx_i2s_info
{
struct
zx_i2s_info
{
struct
snd_dmaengine_dai_dma_data
dma_playback
;
struct
snd_dmaengine_dai_dma_data
dma_playback
;
struct
snd_dmaengine_dai_dma_data
dma_capture
;
struct
snd_dmaengine_dai_dma_data
dma_capture
;
struct
clk
*
dai_clk
;
struct
clk
*
dai_wclk
;
struct
clk
*
dai_pclk
;
void
__iomem
*
reg_base
;
void
__iomem
*
reg_base
;
int
master
;
int
master
;
resource_size_t
mapbase
;
resource_size_t
mapbase
;
...
@@ -225,7 +226,7 @@ static int zx_i2s_hw_params(struct snd_pcm_substream *substream,
...
@@ -225,7 +226,7 @@ static int zx_i2s_hw_params(struct snd_pcm_substream *substream,
struct
zx_i2s_info
*
i2s
=
snd_soc_dai_get_drvdata
(
socdai
);
struct
zx_i2s_info
*
i2s
=
snd_soc_dai_get_drvdata
(
socdai
);
struct
snd_dmaengine_dai_dma_data
*
dma_data
;
struct
snd_dmaengine_dai_dma_data
*
dma_data
;
unsigned
int
lane
,
ch_num
,
len
,
ret
=
0
;
unsigned
int
lane
,
ch_num
,
len
,
ret
=
0
;
unsigned
long
val
,
format
;
unsigned
long
val
;
unsigned
long
chn_cfg
;
unsigned
long
chn_cfg
;
dma_data
=
snd_soc_dai_get_dma_data
(
socdai
,
substream
);
dma_data
=
snd_soc_dai_get_dma_data
(
socdai
,
substream
);
...
@@ -238,15 +239,12 @@ static int zx_i2s_hw_params(struct snd_pcm_substream *substream,
...
@@ -238,15 +239,12 @@ static int zx_i2s_hw_params(struct snd_pcm_substream *substream,
switch
(
params_format
(
params
))
{
switch
(
params_format
(
params
))
{
case
SNDRV_PCM_FORMAT_S16_LE
:
case
SNDRV_PCM_FORMAT_S16_LE
:
format
=
0
;
len
=
16
;
len
=
16
;
break
;
break
;
case
SNDRV_PCM_FORMAT_S24_LE
:
case
SNDRV_PCM_FORMAT_S24_LE
:
format
=
1
;
len
=
24
;
len
=
24
;
break
;
break
;
case
SNDRV_PCM_FORMAT_S32_LE
:
case
SNDRV_PCM_FORMAT_S32_LE
:
format
=
2
;
len
=
32
;
len
=
32
;
break
;
break
;
default:
default:
...
@@ -278,8 +276,9 @@ static int zx_i2s_hw_params(struct snd_pcm_substream *substream,
...
@@ -278,8 +276,9 @@ static int zx_i2s_hw_params(struct snd_pcm_substream *substream,
writel_relaxed
(
val
,
i2s
->
reg_base
+
ZX_I2S_TIMING_CTRL
);
writel_relaxed
(
val
,
i2s
->
reg_base
+
ZX_I2S_TIMING_CTRL
);
if
(
i2s
->
master
)
if
(
i2s
->
master
)
ret
=
clk_set_rate
(
i2s
->
dai_clk
,
ret
=
clk_set_rate
(
i2s
->
dai_wclk
,
params_rate
(
params
)
*
ch_num
*
CLK_RAT
);
params_rate
(
params
)
*
ch_num
*
CLK_RAT
);
return
ret
;
return
ret
;
}
}
...
@@ -331,8 +330,19 @@ static int zx_i2s_startup(struct snd_pcm_substream *substream,
...
@@ -331,8 +330,19 @@ static int zx_i2s_startup(struct snd_pcm_substream *substream,
struct
snd_soc_dai
*
dai
)
struct
snd_soc_dai
*
dai
)
{
{
struct
zx_i2s_info
*
zx_i2s
=
dev_get_drvdata
(
dai
->
dev
);
struct
zx_i2s_info
*
zx_i2s
=
dev_get_drvdata
(
dai
->
dev
);
int
ret
;
return
clk_prepare_enable
(
zx_i2s
->
dai_clk
);
ret
=
clk_prepare_enable
(
zx_i2s
->
dai_wclk
);
if
(
ret
)
return
ret
;
ret
=
clk_prepare_enable
(
zx_i2s
->
dai_pclk
);
if
(
ret
)
{
clk_disable_unprepare
(
zx_i2s
->
dai_wclk
);
return
ret
;
}
return
ret
;
}
}
static
void
zx_i2s_shutdown
(
struct
snd_pcm_substream
*
substream
,
static
void
zx_i2s_shutdown
(
struct
snd_pcm_substream
*
substream
,
...
@@ -340,7 +350,8 @@ static void zx_i2s_shutdown(struct snd_pcm_substream *substream,
...
@@ -340,7 +350,8 @@ static void zx_i2s_shutdown(struct snd_pcm_substream *substream,
{
{
struct
zx_i2s_info
*
zx_i2s
=
dev_get_drvdata
(
dai
->
dev
);
struct
zx_i2s_info
*
zx_i2s
=
dev_get_drvdata
(
dai
->
dev
);
clk_disable_unprepare
(
zx_i2s
->
dai_clk
);
clk_disable_unprepare
(
zx_i2s
->
dai_wclk
);
clk_disable_unprepare
(
zx_i2s
->
dai_pclk
);
}
}
static
struct
snd_soc_dai_ops
zx_i2s_dai_ops
=
{
static
struct
snd_soc_dai_ops
zx_i2s_dai_ops
=
{
...
@@ -384,10 +395,16 @@ static int zx_i2s_probe(struct platform_device *pdev)
...
@@ -384,10 +395,16 @@ static int zx_i2s_probe(struct platform_device *pdev)
if
(
!
zx_i2s
)
if
(
!
zx_i2s
)
return
-
ENOMEM
;
return
-
ENOMEM
;
zx_i2s
->
dai_clk
=
devm_clk_get
(
&
pdev
->
dev
,
"tx"
);
zx_i2s
->
dai_wclk
=
devm_clk_get
(
&
pdev
->
dev
,
"wclk"
);
if
(
IS_ERR
(
zx_i2s
->
dai_clk
))
{
if
(
IS_ERR
(
zx_i2s
->
dai_wclk
))
{
dev_err
(
&
pdev
->
dev
,
"Fail to get clk
\n
"
);
dev_err
(
&
pdev
->
dev
,
"Fail to get wclk
\n
"
);
return
PTR_ERR
(
zx_i2s
->
dai_clk
);
return
PTR_ERR
(
zx_i2s
->
dai_wclk
);
}
zx_i2s
->
dai_pclk
=
devm_clk_get
(
&
pdev
->
dev
,
"pclk"
);
if
(
IS_ERR
(
zx_i2s
->
dai_pclk
))
{
dev_err
(
&
pdev
->
dev
,
"Fail to get pclk
\n
"
);
return
PTR_ERR
(
zx_i2s
->
dai_pclk
);
}
}
res
=
platform_get_resource
(
pdev
,
IORESOURCE_MEM
,
0
);
res
=
platform_get_resource
(
pdev
,
IORESOURCE_MEM
,
0
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录