Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
7a7ef5b9
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看板
提交
7a7ef5b9
编写于
5月 26, 2017
作者:
M
Mark Brown
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'asoc/fix/rcar' into asoc-linus
上级
5e8338db
e8a3ce11
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
86 addition
and
8 deletion
+86
-8
sound/soc/sh/rcar/adg.c
sound/soc/sh/rcar/adg.c
+4
-2
sound/soc/sh/rcar/cmd.c
sound/soc/sh/rcar/cmd.c
+1
-0
sound/soc/sh/rcar/core.c
sound/soc/sh/rcar/core.c
+51
-0
sound/soc/sh/rcar/gen.c
sound/soc/sh/rcar/gen.c
+1
-0
sound/soc/sh/rcar/rsnd.h
sound/soc/sh/rcar/rsnd.h
+2
-0
sound/soc/sh/rcar/src.c
sound/soc/sh/rcar/src.c
+10
-2
sound/soc/sh/rcar/ssi.c
sound/soc/sh/rcar/ssi.c
+15
-3
sound/soc/sh/rcar/ssiu.c
sound/soc/sh/rcar/ssiu.c
+2
-1
未找到文件。
sound/soc/sh/rcar/adg.c
浏览文件 @
7a7ef5b9
...
...
@@ -507,7 +507,8 @@ static void rsnd_adg_get_clkout(struct rsnd_priv *priv,
rbga
=
rbgx
;
adg
->
rbga_rate_for_441khz
=
rate
/
div
;
ckr
|=
brg_table
[
i
]
<<
20
;
if
(
req_441kHz_rate
)
if
(
req_441kHz_rate
&&
!
(
adg_mode_flags
(
adg
)
&
AUDIO_OUT_48
))
parent_clk_name
=
__clk_get_name
(
clk
);
}
}
...
...
@@ -522,7 +523,8 @@ static void rsnd_adg_get_clkout(struct rsnd_priv *priv,
rbgb
=
rbgx
;
adg
->
rbgb_rate_for_48khz
=
rate
/
div
;
ckr
|=
brg_table
[
i
]
<<
16
;
if
(
req_48kHz_rate
)
if
(
req_48kHz_rate
&&
(
adg_mode_flags
(
adg
)
&
AUDIO_OUT_48
))
parent_clk_name
=
__clk_get_name
(
clk
);
}
}
...
...
sound/soc/sh/rcar/cmd.c
浏览文件 @
7a7ef5b9
...
...
@@ -89,6 +89,7 @@ static int rsnd_cmd_init(struct rsnd_mod *mod,
dev_dbg
(
dev
,
"ctu/mix path = 0x%08x"
,
data
);
rsnd_mod_write
(
mod
,
CMD_ROUTE_SLCT
,
data
);
rsnd_mod_write
(
mod
,
CMD_BUSIF_MODE
,
rsnd_get_busif_shift
(
io
,
mod
)
|
1
);
rsnd_mod_write
(
mod
,
CMD_BUSIF_DALIGN
,
rsnd_get_dalign
(
mod
,
io
));
rsnd_adg_set_cmd_timsel_gen2
(
mod
,
io
);
...
...
sound/soc/sh/rcar/core.c
浏览文件 @
7a7ef5b9
...
...
@@ -343,6 +343,57 @@ u32 rsnd_get_dalign(struct rsnd_mod *mod, struct rsnd_dai_stream *io)
return
0x76543210
;
}
u32
rsnd_get_busif_shift
(
struct
rsnd_dai_stream
*
io
,
struct
rsnd_mod
*
mod
)
{
enum
rsnd_mod_type
playback_mods
[]
=
{
RSND_MOD_SRC
,
RSND_MOD_CMD
,
RSND_MOD_SSIU
,
};
enum
rsnd_mod_type
capture_mods
[]
=
{
RSND_MOD_CMD
,
RSND_MOD_SRC
,
RSND_MOD_SSIU
,
};
struct
snd_pcm_runtime
*
runtime
=
rsnd_io_to_runtime
(
io
);
struct
rsnd_mod
*
tmod
=
NULL
;
enum
rsnd_mod_type
*
mods
=
rsnd_io_is_play
(
io
)
?
playback_mods
:
capture_mods
;
int
i
;
/*
* This is needed for 24bit data
* We need to shift 8bit
*
* Linux 24bit data is located as 0x00******
* HW 24bit data is located as 0x******00
*
*/
switch
(
runtime
->
sample_bits
)
{
case
16
:
return
0
;
case
32
:
break
;
}
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
playback_mods
);
i
++
)
{
tmod
=
rsnd_io_to_mod
(
io
,
mods
[
i
]);
if
(
tmod
)
break
;
}
if
(
tmod
!=
mod
)
return
0
;
if
(
rsnd_io_is_play
(
io
))
return
(
0
<<
20
)
|
/* shift to Left */
(
8
<<
16
);
/* 8bit */
else
return
(
1
<<
20
)
|
/* shift to Right */
(
8
<<
16
);
/* 8bit */
}
/*
* rsnd_dai functions
*/
...
...
sound/soc/sh/rcar/gen.c
浏览文件 @
7a7ef5b9
...
...
@@ -236,6 +236,7 @@ static int rsnd_gen2_probe(struct rsnd_priv *priv)
RSND_GEN_M_REG
(
SRC_ROUTE_MODE0
,
0xc
,
0x20
),
RSND_GEN_M_REG
(
SRC_CTRL
,
0x10
,
0x20
),
RSND_GEN_M_REG
(
SRC_INT_ENABLE0
,
0x18
,
0x20
),
RSND_GEN_M_REG
(
CMD_BUSIF_MODE
,
0x184
,
0x20
),
RSND_GEN_M_REG
(
CMD_BUSIF_DALIGN
,
0x188
,
0x20
),
RSND_GEN_M_REG
(
CMD_ROUTE_SLCT
,
0x18c
,
0x20
),
RSND_GEN_M_REG
(
CMD_CTRL
,
0x190
,
0x20
),
...
...
sound/soc/sh/rcar/rsnd.h
浏览文件 @
7a7ef5b9
...
...
@@ -73,6 +73,7 @@ enum rsnd_reg {
RSND_REG_SCU_SYS_INT_EN0
,
RSND_REG_SCU_SYS_INT_EN1
,
RSND_REG_CMD_CTRL
,
RSND_REG_CMD_BUSIF_MODE
,
RSND_REG_CMD_BUSIF_DALIGN
,
RSND_REG_CMD_ROUTE_SLCT
,
RSND_REG_CMDOUT_TIMSEL
,
...
...
@@ -204,6 +205,7 @@ void rsnd_bset(struct rsnd_priv *priv, struct rsnd_mod *mod, enum rsnd_reg reg,
u32
mask
,
u32
data
);
u32
rsnd_get_adinr_bit
(
struct
rsnd_mod
*
mod
,
struct
rsnd_dai_stream
*
io
);
u32
rsnd_get_dalign
(
struct
rsnd_mod
*
mod
,
struct
rsnd_dai_stream
*
io
);
u32
rsnd_get_busif_shift
(
struct
rsnd_dai_stream
*
io
,
struct
rsnd_mod
*
mod
);
/*
* R-Car DMA
...
...
sound/soc/sh/rcar/src.c
浏览文件 @
7a7ef5b9
...
...
@@ -190,11 +190,13 @@ static void rsnd_src_set_convert_rate(struct rsnd_dai_stream *io,
struct
rsnd_priv
*
priv
=
rsnd_mod_to_priv
(
mod
);
struct
device
*
dev
=
rsnd_priv_to_dev
(
priv
);
struct
snd_pcm_runtime
*
runtime
=
rsnd_io_to_runtime
(
io
);
int
is_play
=
rsnd_io_is_play
(
io
);
int
use_src
=
0
;
u32
fin
,
fout
;
u32
ifscr
,
fsrate
,
adinr
;
u32
cr
,
route
;
u32
bsdsr
,
bsisr
;
u32
i_busif
,
o_busif
,
tmp
;
uint
ratio
;
if
(
!
runtime
)
...
...
@@ -270,6 +272,11 @@ static void rsnd_src_set_convert_rate(struct rsnd_dai_stream *io,
break
;
}
/* BUSIF_MODE */
tmp
=
rsnd_get_busif_shift
(
io
,
mod
);
i_busif
=
(
is_play
?
tmp
:
0
)
|
1
;
o_busif
=
(
!
is_play
?
tmp
:
0
)
|
1
;
rsnd_mod_write
(
mod
,
SRC_ROUTE_MODE0
,
route
);
rsnd_mod_write
(
mod
,
SRC_SRCIR
,
1
);
/* initialize */
...
...
@@ -281,8 +288,9 @@ static void rsnd_src_set_convert_rate(struct rsnd_dai_stream *io,
rsnd_mod_write
(
mod
,
SRC_BSISR
,
bsisr
);
rsnd_mod_write
(
mod
,
SRC_SRCIR
,
0
);
/* cancel initialize */
rsnd_mod_write
(
mod
,
SRC_I_BUSIF_MODE
,
1
);
rsnd_mod_write
(
mod
,
SRC_O_BUSIF_MODE
,
1
);
rsnd_mod_write
(
mod
,
SRC_I_BUSIF_MODE
,
i_busif
);
rsnd_mod_write
(
mod
,
SRC_O_BUSIF_MODE
,
o_busif
);
rsnd_mod_write
(
mod
,
SRC_BUSIF_DALIGN
,
rsnd_get_dalign
(
mod
,
io
));
rsnd_adg_set_src_timesel_gen2
(
mod
,
io
,
fin
,
fout
);
...
...
sound/soc/sh/rcar/ssi.c
浏览文件 @
7a7ef5b9
...
...
@@ -302,7 +302,7 @@ static void rsnd_ssi_config_init(struct rsnd_mod *mod,
* always use 32bit system word.
* see also rsnd_ssi_master_clk_enable()
*/
cr_own
=
FORCE
|
SWL_32
|
PDTA
;
cr_own
=
FORCE
|
SWL_32
;
if
(
rdai
->
bit_clk_inv
)
cr_own
|=
SCKP
;
...
...
@@ -550,6 +550,13 @@ static void __rsnd_ssi_interrupt(struct rsnd_mod *mod,
struct
snd_pcm_runtime
*
runtime
=
rsnd_io_to_runtime
(
io
);
u32
*
buf
=
(
u32
*
)(
runtime
->
dma_area
+
rsnd_dai_pointer_offset
(
io
,
0
));
int
shift
=
0
;
switch
(
runtime
->
sample_bits
)
{
case
32
:
shift
=
8
;
break
;
}
/*
* 8/16/32 data can be assesse to TDR/RDR register
...
...
@@ -557,9 +564,9 @@ static void __rsnd_ssi_interrupt(struct rsnd_mod *mod,
* see rsnd_ssi_init()
*/
if
(
rsnd_io_is_play
(
io
))
rsnd_mod_write
(
mod
,
SSITDR
,
*
buf
);
rsnd_mod_write
(
mod
,
SSITDR
,
(
*
buf
)
<<
shift
);
else
*
buf
=
rsnd_mod_read
(
mod
,
SSIRDR
);
*
buf
=
(
rsnd_mod_read
(
mod
,
SSIRDR
)
>>
shift
);
elapsed
=
rsnd_dai_pointer_update
(
io
,
sizeof
(
*
buf
));
}
...
...
@@ -709,6 +716,11 @@ static int rsnd_ssi_dma_remove(struct rsnd_mod *mod,
struct
rsnd_priv
*
priv
)
{
struct
rsnd_ssi
*
ssi
=
rsnd_mod_to_ssi
(
mod
);
struct
rsnd_mod
*
ssi_parent_mod
=
rsnd_io_to_mod_ssip
(
io
);
/* Do nothing for SSI parent mod */
if
(
ssi_parent_mod
==
mod
)
return
0
;
/* PIO will request IRQ again */
free_irq
(
ssi
->
irq
,
mod
);
...
...
sound/soc/sh/rcar/ssiu.c
浏览文件 @
7a7ef5b9
...
...
@@ -144,7 +144,8 @@ static int rsnd_ssiu_init_gen2(struct rsnd_mod *mod,
(
rsnd_io_is_play
(
io
)
?
rsnd_runtime_channel_after_ctu
(
io
)
:
rsnd_runtime_channel_original
(
io
)));
rsnd_mod_write
(
mod
,
SSI_BUSIF_MODE
,
1
);
rsnd_mod_write
(
mod
,
SSI_BUSIF_MODE
,
rsnd_get_busif_shift
(
io
,
mod
)
|
1
);
rsnd_mod_write
(
mod
,
SSI_BUSIF_DALIGN
,
rsnd_get_dalign
(
mod
,
io
));
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录