Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
4b6142ae
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看板
提交
4b6142ae
编写于
4月 12, 2013
作者:
M
Mark Brown
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'asoc/topic/si476x' into asoc-next
上级
df00b71f
06d7c133
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
41 addition
and
6 deletion
+41
-6
sound/soc/codecs/si476x.c
sound/soc/codecs/si476x.c
+41
-6
未找到文件。
sound/soc/codecs/si476x.c
浏览文件 @
4b6142ae
/*
* sound/soc/codecs/si476x.c -- Codec driver for SI476X chips
*
* Copyright (C) 2012 Innovative Converged Devices(ICD)
* Copyright (C) 2013 Andrey Smirnov
*
* Author: Andrey Smirnov <andrew.smirnov@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
*/
#include <linux/module.h>
#include <linux/slab.h>
#include <sound/pcm.h>
...
...
@@ -45,13 +64,23 @@ static unsigned int si476x_codec_read(struct snd_soc_codec *codec,
unsigned
int
reg
)
{
int
err
;
unsigned
int
val
;
struct
si476x_core
*
core
=
codec
->
control_data
;
si476x_core_lock
(
core
);
err
=
si476x_core_cmd_get_property
(
core
,
reg
);
if
(
!
si476x_core_is_powered_up
(
core
))
regcache_cache_only
(
core
->
regmap
,
true
);
err
=
regmap_read
(
core
->
regmap
,
reg
,
&
val
);
if
(
!
si476x_core_is_powered_up
(
core
))
regcache_cache_only
(
core
->
regmap
,
false
);
si476x_core_unlock
(
core
);
return
err
;
if
(
err
<
0
)
return
err
;
return
val
;
}
static
int
si476x_codec_write
(
struct
snd_soc_codec
*
codec
,
...
...
@@ -61,7 +90,13 @@ static int si476x_codec_write(struct snd_soc_codec *codec,
struct
si476x_core
*
core
=
codec
->
control_data
;
si476x_core_lock
(
core
);
err
=
si476x_core_cmd_set_property
(
core
,
reg
,
val
);
if
(
!
si476x_core_is_powered_up
(
core
))
regcache_cache_only
(
core
->
regmap
,
true
);
err
=
regmap_write
(
core
->
regmap
,
reg
,
val
);
if
(
!
si476x_core_is_powered_up
(
core
))
regcache_cache_only
(
core
->
regmap
,
false
);
si476x_core_unlock
(
core
);
return
err
;
...
...
@@ -140,7 +175,7 @@ static int si476x_codec_set_dai_fmt(struct snd_soc_dai *codec_dai,
dev_err
(
codec_dai
->
codec
->
dev
,
"Failed to set output format
\n
"
);
return
err
;
}
return
0
;
}
...
...
@@ -182,7 +217,7 @@ static int si476x_codec_hw_params(struct snd_pcm_substream *substream,
err
=
snd_soc_update_bits
(
dai
->
codec
,
SI476X_DIGITAL_IO_OUTPUT_FORMAT
,
SI476X_DIGITAL_IO_OUTPUT_WIDTH_MASK
,
(
width
<<
SI476X_DIGITAL_IO_SLOT_SIZE_SHIFT
)
|
(
width
<<
SI476X_DIGITAL_IO_SLOT_SIZE_SHIFT
)
|
(
width
<<
SI476X_DIGITAL_IO_SAMPLE_SIZE_SHIFT
));
if
(
err
<
0
)
{
dev_err
(
dai
->
codec
->
dev
,
"Failed to set output width
\n
"
);
...
...
@@ -251,6 +286,6 @@ static struct platform_driver si476x_platform_driver = {
};
module_platform_driver
(
si476x_platform_driver
);
MODULE_AUTHOR
(
"Andrey Smirnov <andre
y.smirnov@convergeddevices.net
>"
);
MODULE_AUTHOR
(
"Andrey Smirnov <andre
w.smirnov@gmail.com
>"
);
MODULE_DESCRIPTION
(
"ASoC Si4761/64 codec driver"
);
MODULE_LICENSE
(
"GPL"
);
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录