Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
27de094f
R
raspberrypi-kernel
项目概览
openeuler
/
raspberrypi-kernel
通知
13
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
raspberrypi-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
27de094f
编写于
1月 18, 2011
作者:
T
Takashi Iwai
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'fix/asoc' into for-linus
上级
321051f5
7322ce21
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
27 addition
and
103 deletion
+27
-103
sound/soc/codecs/Kconfig
sound/soc/codecs/Kconfig
+1
-1
sound/soc/codecs/wl1273.c
sound/soc/codecs/wl1273.c
+12
-17
sound/soc/codecs/wl1273.h
sound/soc/codecs/wl1273.h
+0
-71
sound/soc/codecs/wm8990.c
sound/soc/codecs/wm8990.c
+5
-5
sound/soc/ep93xx/ep93xx-i2s.c
sound/soc/ep93xx/ep93xx-i2s.c
+9
-9
未找到文件。
sound/soc/codecs/Kconfig
浏览文件 @
27de094f
...
...
@@ -44,7 +44,7 @@ config SND_SOC_ALL_CODECS
select SND_SOC_TWL6040 if TWL4030_CORE
select SND_SOC_UDA134X
select SND_SOC_UDA1380 if I2C
select SND_SOC_WL1273 if
WL1273_CORE
select SND_SOC_WL1273 if
RADIO_WL1273
select SND_SOC_WM2000 if I2C
select SND_SOC_WM8350 if MFD_WM8350
select SND_SOC_WM8400 if MFD_WM8400
...
...
sound/soc/codecs/wl1273.c
浏览文件 @
27de094f
...
...
@@ -42,7 +42,7 @@ struct wl1273_priv {
static
int
snd_wl1273_fm_set_i2s_mode
(
struct
wl1273_core
*
core
,
int
rate
,
int
width
)
{
struct
device
*
dev
=
&
core
->
i2c_dev
->
dev
;
struct
device
*
dev
=
&
core
->
client
->
dev
;
int
r
=
0
;
u16
mode
;
...
...
@@ -123,13 +123,13 @@ static int snd_wl1273_fm_set_i2s_mode(struct wl1273_core *core,
dev_dbg
(
dev
,
"mode: 0x%04x
\n
"
,
mode
);
if
(
core
->
i2s_mode
!=
mode
)
{
r
=
wl1273_fm_write_cmd
(
core
,
WL1273_I2S_MODE_CONFIG_SET
,
mode
);
r
=
core
->
write
(
core
,
WL1273_I2S_MODE_CONFIG_SET
,
mode
);
if
(
r
)
goto
out
;
core
->
i2s_mode
=
mode
;
r
=
wl1273_fm_write_cmd
(
core
,
WL1273_AUDIO_ENABLE
,
WL1273_AUDIO_ENABLE_I2S
);
r
=
core
->
write
(
core
,
WL1273_AUDIO_ENABLE
,
WL1273_AUDIO_ENABLE_I2S
);
if
(
r
)
goto
out
;
}
...
...
@@ -142,8 +142,7 @@ static int snd_wl1273_fm_set_i2s_mode(struct wl1273_core *core,
static
int
snd_wl1273_fm_set_channel_number
(
struct
wl1273_core
*
core
,
int
channel_number
)
{
struct
i2c_client
*
client
=
core
->
i2c_dev
;
struct
device
*
dev
=
&
client
->
dev
;
struct
device
*
dev
=
&
core
->
client
->
dev
;
int
r
=
0
;
dev_dbg
(
dev
,
"%s
\n
"
,
__func__
);
...
...
@@ -154,17 +153,13 @@ static int snd_wl1273_fm_set_channel_number(struct wl1273_core *core,
goto
out
;
if
(
channel_number
==
1
&&
core
->
mode
==
WL1273_MODE_RX
)
r
=
wl1273_fm_write_cmd
(
core
,
WL1273_MOST_MODE_SET
,
WL1273_RX_MONO
);
r
=
core
->
write
(
core
,
WL1273_MOST_MODE_SET
,
WL1273_RX_MONO
);
else
if
(
channel_number
==
1
&&
core
->
mode
==
WL1273_MODE_TX
)
r
=
wl1273_fm_write_cmd
(
core
,
WL1273_MONO_SET
,
WL1273_TX_MONO
);
r
=
core
->
write
(
core
,
WL1273_MONO_SET
,
WL1273_TX_MONO
);
else
if
(
channel_number
==
2
&&
core
->
mode
==
WL1273_MODE_RX
)
r
=
wl1273_fm_write_cmd
(
core
,
WL1273_MOST_MODE_SET
,
WL1273_RX_STEREO
);
r
=
core
->
write
(
core
,
WL1273_MOST_MODE_SET
,
WL1273_RX_STEREO
);
else
if
(
channel_number
==
2
&&
core
->
mode
==
WL1273_MODE_TX
)
r
=
wl1273_fm_write_cmd
(
core
,
WL1273_MONO_SET
,
WL1273_TX_STEREO
);
r
=
core
->
write
(
core
,
WL1273_MONO_SET
,
WL1273_TX_STEREO
);
else
r
=
-
EINVAL
;
out:
...
...
@@ -237,7 +232,7 @@ static int snd_wl1273_fm_audio_put(struct snd_kcontrol *kcontrol,
if
(
wl1273
->
core
->
audio_mode
==
val
)
return
0
;
r
=
wl1273
_fm_
set_audio
(
wl1273
->
core
,
val
);
r
=
wl1273
->
core
->
set_audio
(
wl1273
->
core
,
val
);
if
(
r
<
0
)
return
r
;
...
...
@@ -272,8 +267,8 @@ static int snd_wl1273_fm_volume_put(struct snd_kcontrol *kcontrol,
dev_dbg
(
codec
->
dev
,
"%s: enter.
\n
"
,
__func__
);
r
=
wl1273
_fm_
set_volume
(
wl1273
->
core
,
ucontrol
->
value
.
integer
.
value
[
0
]);
r
=
wl1273
->
core
->
set_volume
(
wl1273
->
core
,
ucontrol
->
value
.
integer
.
value
[
0
]);
if
(
r
)
return
r
;
...
...
sound/soc/codecs/wl1273.h
浏览文件 @
27de094f
...
...
@@ -25,77 +25,6 @@
#ifndef __WL1273_CODEC_H__
#define __WL1273_CODEC_H__
/* I2S protocol, left channel first, data width 16 bits */
#define WL1273_PCM_DEF_MODE 0x00
/* Rx */
#define WL1273_AUDIO_ENABLE_I2S (1 << 0)
#define WL1273_AUDIO_ENABLE_ANALOG (1 << 1)
/* Tx */
#define WL1273_AUDIO_IO_SET_ANALOG 0
#define WL1273_AUDIO_IO_SET_I2S 1
#define WL1273_POWER_SET_OFF 0
#define WL1273_POWER_SET_FM (1 << 0)
#define WL1273_POWER_SET_RDS (1 << 1)
#define WL1273_POWER_SET_RETENTION (1 << 4)
#define WL1273_PUPD_SET_OFF 0x00
#define WL1273_PUPD_SET_ON 0x01
#define WL1273_PUPD_SET_RETENTION 0x10
/* I2S mode */
#define WL1273_IS2_WIDTH_32 0x0
#define WL1273_IS2_WIDTH_40 0x1
#define WL1273_IS2_WIDTH_22_23 0x2
#define WL1273_IS2_WIDTH_23_22 0x3
#define WL1273_IS2_WIDTH_48 0x4
#define WL1273_IS2_WIDTH_50 0x5
#define WL1273_IS2_WIDTH_60 0x6
#define WL1273_IS2_WIDTH_64 0x7
#define WL1273_IS2_WIDTH_80 0x8
#define WL1273_IS2_WIDTH_96 0x9
#define WL1273_IS2_WIDTH_128 0xa
#define WL1273_IS2_WIDTH 0xf
#define WL1273_IS2_FORMAT_STD (0x0 << 4)
#define WL1273_IS2_FORMAT_LEFT (0x1 << 4)
#define WL1273_IS2_FORMAT_RIGHT (0x2 << 4)
#define WL1273_IS2_FORMAT_USER (0x3 << 4)
#define WL1273_IS2_MASTER (0x0 << 6)
#define WL1273_IS2_SLAVEW (0x1 << 6)
#define WL1273_IS2_TRI_AFTER_SENDING (0x0 << 7)
#define WL1273_IS2_TRI_ALWAYS_ACTIVE (0x1 << 7)
#define WL1273_IS2_SDOWS_RR (0x0 << 8)
#define WL1273_IS2_SDOWS_RF (0x1 << 8)
#define WL1273_IS2_SDOWS_FR (0x2 << 8)
#define WL1273_IS2_SDOWS_FF (0x3 << 8)
#define WL1273_IS2_TRI_OPT (0x0 << 10)
#define WL1273_IS2_TRI_ALWAYS (0x1 << 10)
#define WL1273_IS2_RATE_48K (0x0 << 12)
#define WL1273_IS2_RATE_44_1K (0x1 << 12)
#define WL1273_IS2_RATE_32K (0x2 << 12)
#define WL1273_IS2_RATE_22_05K (0x4 << 12)
#define WL1273_IS2_RATE_16K (0x5 << 12)
#define WL1273_IS2_RATE_12K (0x8 << 12)
#define WL1273_IS2_RATE_11_025 (0x9 << 12)
#define WL1273_IS2_RATE_8K (0xa << 12)
#define WL1273_IS2_RATE (0xf << 12)
#define WL1273_I2S_DEF_MODE (WL1273_IS2_WIDTH_32 | \
WL1273_IS2_FORMAT_STD | \
WL1273_IS2_MASTER | \
WL1273_IS2_TRI_AFTER_SENDING | \
WL1273_IS2_SDOWS_RR | \
WL1273_IS2_TRI_OPT | \
WL1273_IS2_RATE_48K)
int
wl1273_get_format
(
struct
snd_soc_codec
*
codec
,
unsigned
int
*
fmt
);
#endif
/* End of __WL1273_CODEC_H__ */
sound/soc/codecs/wm8990.c
浏览文件 @
27de094f
...
...
@@ -1183,7 +1183,7 @@ static int wm8990_set_bias_level(struct snd_soc_codec *codec,
WM8990_VMIDTOG
);
/* Delay to allow output caps to discharge */
msleep
(
msecs_to_jiffies
(
300
)
);
msleep
(
300
);
/* Disable VMIDTOG */
snd_soc_write
(
codec
,
WM8990_ANTIPOP2
,
WM8990_SOFTST
|
...
...
@@ -1195,17 +1195,17 @@ static int wm8990_set_bias_level(struct snd_soc_codec *codec,
/* Enable outputs */
snd_soc_write
(
codec
,
WM8990_POWER_MANAGEMENT_1
,
0x1b00
);
msleep
(
msecs_to_jiffies
(
50
)
);
msleep
(
50
);
/* Enable VMID at 2x50k */
snd_soc_write
(
codec
,
WM8990_POWER_MANAGEMENT_1
,
0x1f02
);
msleep
(
msecs_to_jiffies
(
100
)
);
msleep
(
100
);
/* Enable VREF */
snd_soc_write
(
codec
,
WM8990_POWER_MANAGEMENT_1
,
0x1f03
);
msleep
(
msecs_to_jiffies
(
600
)
);
msleep
(
600
);
/* Enable BUFIOEN */
snd_soc_write
(
codec
,
WM8990_ANTIPOP2
,
WM8990_SOFTST
|
...
...
@@ -1250,7 +1250,7 @@ static int wm8990_set_bias_level(struct snd_soc_codec *codec,
/* Disable VMID */
snd_soc_write
(
codec
,
WM8990_POWER_MANAGEMENT_1
,
0x1f01
);
msleep
(
msecs_to_jiffies
(
300
)
);
msleep
(
300
);
/* Enable all output discharge bits */
snd_soc_write
(
codec
,
WM8990_ANTIPOP1
,
WM8990_DIS_LLINE
|
...
...
sound/soc/ep93xx/ep93xx-i2s.c
浏览文件 @
27de094f
...
...
@@ -267,14 +267,16 @@ static int ep93xx_i2s_hw_params(struct snd_pcm_substream *substream,
ep93xx_i2s_write_reg
(
info
,
EP93XX_I2S_RXWRDLEN
,
word_len
);
/*
* Calculate the sdiv (bit clock) and lrdiv (left/right clock) values.
* If the lrclk is pulse length is larger than the word size, then the
* bit clock will be gated for the unused bits.
* EP93xx I2S module can be setup so SCLK / LRCLK value can be
* 32, 64, 128. MCLK / SCLK value can be 2 and 4.
* We set LRCLK equal to `rate' and minimum SCLK / LRCLK
* value is 64, because our sample size is 32 bit * 2 channels.
* I2S standard permits us to transmit more bits than
* the codec uses.
*/
div
=
(
clk_get_rate
(
info
->
mclk
)
/
params_rate
(
params
))
*
params_channels
(
params
);
div
=
clk_get_rate
(
info
->
mclk
)
/
params_rate
(
params
);
for
(
sdiv
=
2
;
sdiv
<=
4
;
sdiv
+=
2
)
for
(
lrdiv
=
32
;
lrdiv
<=
128
;
lrdiv
<<=
1
)
for
(
lrdiv
=
64
;
lrdiv
<=
128
;
lrdiv
<<=
1
)
if
(
sdiv
*
lrdiv
==
div
)
{
found
=
1
;
goto
out
;
...
...
@@ -341,9 +343,7 @@ static struct snd_soc_dai_ops ep93xx_i2s_dai_ops = {
.
set_fmt
=
ep93xx_i2s_set_dai_fmt
,
};
#define EP93XX_I2S_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | \
SNDRV_PCM_FMTBIT_S24_LE | \
SNDRV_PCM_FMTBIT_S32_LE)
#define EP93XX_I2S_FORMATS (SNDRV_PCM_FMTBIT_S32_LE)
static
struct
snd_soc_dai_driver
ep93xx_i2s_dai
=
{
.
symmetric_rates
=
1
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录