Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
08aff8cd
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看板
提交
08aff8cd
编写于
8月 18, 2009
作者:
M
Mark Brown
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ASoC: Add SPI support to WM8711
Signed-off-by:
N
Mark Brown
<
broonie@opensource.wolfsonmicro.com
>
上级
d97d2e35
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
67 addition
and
1 deletion
+67
-1
sound/soc/codecs/Kconfig
sound/soc/codecs/Kconfig
+1
-1
sound/soc/codecs/wm8711.c
sound/soc/codecs/wm8711.c
+66
-0
未找到文件。
sound/soc/codecs/Kconfig
浏览文件 @
08aff8cd
...
...
@@ -35,7 +35,7 @@ config SND_SOC_ALL_CODECS
select SND_SOC_WM8510 if SND_SOC_I2C_AND_SPI
select SND_SOC_WM8523 if I2C
select SND_SOC_WM8580 if I2C
select SND_SOC_WM8711 if
I2C
select SND_SOC_WM8711 if
SND_SOC_I2C_AND_SPI
select SND_SOC_WM8728 if SND_SOC_I2C_AND_SPI
select SND_SOC_WM8731 if SND_SOC_I2C_AND_SPI
select SND_SOC_WM8750 if SND_SOC_I2C_AND_SPI
...
...
sound/soc/codecs/wm8711.c
浏览文件 @
08aff8cd
...
...
@@ -535,6 +535,62 @@ static void wm8711_unregister(struct wm8711_priv *wm8711)
wm8711_codec
=
NULL
;
}
#if defined(CONFIG_SPI_MASTER)
static
int
__devinit
wm8711_spi_probe
(
struct
spi_device
*
spi
)
{
struct
snd_soc_codec
*
codec
;
struct
wm8711_priv
*
wm8711
;
wm8711
=
kzalloc
(
sizeof
(
struct
wm8711_priv
),
GFP_KERNEL
);
if
(
wm8711
==
NULL
)
return
-
ENOMEM
;
codec
=
&
wm8711
->
codec
;
codec
->
control_data
=
spi
;
codec
->
dev
=
&
spi
->
dev
;
dev_set_drvdata
(
&
spi
->
dev
,
wm8711
);
return
wm8711_register
(
wm8711
,
SND_SOC_SPI
);
}
static
int
__devexit
wm8711_spi_remove
(
struct
spi_device
*
spi
)
{
struct
wm8711_priv
*
wm8711
=
dev_get_drvdata
(
&
spi
->
dev
);
wm8711_unregister
(
wm8711
);
return
0
;
}
#ifdef CONFIG_PM
static
int
wm8711_spi_suspend
(
struct
spi_device
*
spi
,
pm_message_t
msg
)
{
return
snd_soc_suspend_device
(
&
spi
->
dev
);
}
static
int
wm8711_spi_resume
(
struct
spi_device
*
spi
)
{
return
snd_soc_resume_device
(
&
spi
->
dev
);
}
#else
#define wm8711_spi_suspend NULL
#define wm8711_spi_resume NULL
#endif
static
struct
spi_driver
wm8711_spi_driver
=
{
.
driver
=
{
.
name
=
"wm8711"
,
.
bus
=
&
spi_bus_type
,
.
owner
=
THIS_MODULE
,
},
.
probe
=
wm8711_spi_probe
,
.
suspend
=
wm8711_spi_suspend
,
.
resume
=
wm8711_spi_resume
,
.
remove
=
__devexit_p
(
wm8711_spi_remove
),
};
#endif
/* CONFIG_SPI_MASTER */
#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
static
__devinit
int
wm8711_i2c_probe
(
struct
i2c_client
*
i2c
,
const
struct
i2c_device_id
*
id
)
...
...
@@ -590,6 +646,13 @@ static int __init wm8711_modinit(void)
printk
(
KERN_ERR
"Failed to register WM8711 I2C driver: %d
\n
"
,
ret
);
}
#endif
#if defined(CONFIG_SPI_MASTER)
ret
=
spi_register_driver
(
&
wm8731_spi_driver
);
if
(
ret
!=
0
)
{
printk
(
KERN_ERR
"Failed to register WM8731 SPI driver: %d
\n
"
,
ret
);
}
#endif
return
0
;
}
...
...
@@ -600,6 +663,9 @@ static void __exit wm8711_exit(void)
#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
i2c_del_driver
(
&
wm8711_i2c_driver
);
#endif
#if defined(CONFIG_SPI_MASTER)
spi_unregister_driver
(
&
wm8731_spi_driver
);
#endif
}
module_exit
(
wm8711_exit
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录