Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
7e8be1b3
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看板
提交
7e8be1b3
编写于
4月 14, 2015
作者:
T
Takashi Iwai
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ALSA: hda - Move send_cmd / get_response to hdac_bus_ops
One less redirection. Signed-off-by:
N
Takashi Iwai
<
tiwai@suse.de
>
上级
fb3b07c2
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
23 addition
and
34 deletion
+23
-34
sound/pci/hda/hda_codec.c
sound/pci/hda/hda_codec.c
+2
-20
sound/pci/hda/hda_codec.h
sound/pci/hda/hda_codec.h
+6
-5
sound/pci/hda/hda_controller.c
sound/pci/hda/hda_controller.c
+15
-9
未找到文件。
sound/pci/hda/hda_codec.c
浏览文件 @
7e8be1b3
...
...
@@ -507,25 +507,6 @@ static int snd_hda_bus_dev_disconnect(struct snd_device *device)
return
0
;
}
/* hdac_bus_ops translations */
static
int
_hda_bus_command
(
struct
hdac_bus
*
_bus
,
unsigned
int
cmd
)
{
struct
hda_bus
*
bus
=
container_of
(
_bus
,
struct
hda_bus
,
core
);
return
bus
->
ops
.
command
(
bus
,
cmd
);
}
static
int
_hda_bus_get_response
(
struct
hdac_bus
*
_bus
,
unsigned
int
addr
,
unsigned
int
*
res
)
{
struct
hda_bus
*
bus
=
container_of
(
_bus
,
struct
hda_bus
,
core
);
return
bus
->
ops
.
get_response
(
bus
,
addr
,
res
);
}
static
const
struct
hdac_bus_ops
bus_ops
=
{
.
command
=
_hda_bus_command
,
.
get_response
=
_hda_bus_get_response
,
};
/**
* snd_hda_bus_new - create a HDA bus
* @card: the card entry
...
...
@@ -534,6 +515,7 @@ static const struct hdac_bus_ops bus_ops = {
* Returns 0 if successful, or a negative error code.
*/
int
snd_hda_bus_new
(
struct
snd_card
*
card
,
const
struct
hdac_bus_ops
*
ops
,
struct
hda_bus
**
busp
)
{
struct
hda_bus
*
bus
;
...
...
@@ -550,7 +532,7 @@ int snd_hda_bus_new(struct snd_card *card,
if
(
!
bus
)
return
-
ENOMEM
;
err
=
snd_hdac_bus_init
(
&
bus
->
core
,
card
->
dev
,
&
bus_
ops
,
NULL
);
err
=
snd_hdac_bus_init
(
&
bus
->
core
,
card
->
dev
,
ops
,
NULL
);
if
(
err
<
0
)
{
kfree
(
bus
);
return
err
;
...
...
sound/pci/hda/hda_codec.h
浏览文件 @
7e8be1b3
...
...
@@ -42,10 +42,6 @@ struct hda_pcm_stream;
/* bus operators */
struct
hda_bus_ops
{
/* send a single command */
int
(
*
command
)(
struct
hda_bus
*
bus
,
unsigned
int
cmd
);
/* get a response from the last command */
int
(
*
get_response
)(
struct
hda_bus
*
bus
,
unsigned
int
addr
,
unsigned
int
*
res
);
/* free the private data */
void
(
*
private_free
)(
struct
hda_bus
*
);
/* attach a PCM stream */
...
...
@@ -99,6 +95,9 @@ struct hda_bus {
int
primary_dig_out_type
;
/* primary digital out PCM type */
};
/* from hdac_bus to hda_bus */
#define to_hda_bus(bus) container_of(bus, struct hda_bus, core)
/*
* codec preset
*
...
...
@@ -327,7 +326,9 @@ struct hda_codec {
/*
* constructors
*/
int
snd_hda_bus_new
(
struct
snd_card
*
card
,
struct
hda_bus
**
busp
);
int
snd_hda_bus_new
(
struct
snd_card
*
card
,
const
struct
hdac_bus_ops
*
ops
,
struct
hda_bus
**
busp
);
int
snd_hda_codec_new
(
struct
hda_bus
*
bus
,
struct
snd_card
*
card
,
unsigned
int
codec_addr
,
struct
hda_codec
**
codecp
);
int
snd_hda_codec_configure
(
struct
hda_codec
*
codec
);
...
...
sound/pci/hda/hda_controller.c
浏览文件 @
7e8be1b3
...
...
@@ -1328,8 +1328,9 @@ static int azx_single_get_response(struct hda_bus *bus, unsigned int addr,
*/
/* send a command */
static
int
azx_send_cmd
(
struct
hda
_bus
*
bus
,
unsigned
int
val
)
static
int
azx_send_cmd
(
struct
hda
c_bus
*
_
bus
,
unsigned
int
val
)
{
struct
hda_bus
*
bus
=
to_hda_bus
(
_bus
);
struct
azx
*
chip
=
bus
->
private_data
;
if
(
chip
->
disabled
)
...
...
@@ -1342,9 +1343,10 @@ static int azx_send_cmd(struct hda_bus *bus, unsigned int val)
}
/* get a response */
static
int
azx_get_response
(
struct
hda
_bus
*
bus
,
unsigned
int
addr
,
static
int
azx_get_response
(
struct
hda
c_bus
*
_
bus
,
unsigned
int
addr
,
unsigned
int
*
res
)
{
struct
hda_bus
*
bus
=
to_hda_bus
(
_bus
);
struct
azx
*
chip
=
bus
->
private_data
;
if
(
chip
->
disabled
)
return
0
;
...
...
@@ -1354,6 +1356,11 @@ static int azx_get_response(struct hda_bus *bus, unsigned int addr,
return
azx_rirb_get_response
(
bus
,
addr
,
res
);
}
static
const
struct
hdac_bus_ops
bus_core_ops
=
{
.
command
=
azx_send_cmd
,
.
get_response
=
azx_get_response
,
};
#ifdef CONFIG_SND_HDA_DSP_LOADER
/*
* DSP loading code (e.g. for CA0132)
...
...
@@ -1762,15 +1769,16 @@ static int probe_codec(struct azx *chip, int addr)
{
unsigned
int
cmd
=
(
addr
<<
28
)
|
(
AC_NODE_ROOT
<<
20
)
|
(
AC_VERB_PARAMETERS
<<
8
)
|
AC_PAR_VENDOR_ID
;
struct
hdac_bus
*
bus
=
&
chip
->
bus
->
core
;
int
err
;
unsigned
int
res
;
mutex_lock
(
&
chip
->
bus
->
core
.
cmd_mutex
);
mutex_lock
(
&
bus
->
cmd_mutex
);
chip
->
probing
=
1
;
azx_send_cmd
(
chip
->
bus
,
cmd
);
err
=
azx_get_response
(
chip
->
bus
,
addr
,
&
res
);
azx_send_cmd
(
bus
,
cmd
);
err
=
azx_get_response
(
bus
,
addr
,
&
res
);
chip
->
probing
=
0
;
mutex_unlock
(
&
chip
->
bus
->
core
.
cmd_mutex
);
mutex_unlock
(
&
bus
->
cmd_mutex
);
if
(
err
<
0
||
res
==
-
1
)
return
-
EIO
;
dev_dbg
(
chip
->
card
->
dev
,
"codec #%d probed OK
\n
"
,
addr
);
...
...
@@ -1811,8 +1819,6 @@ static int get_jackpoll_interval(struct azx *chip)
}
static
struct
hda_bus_ops
bus_ops
=
{
.
command
=
azx_send_cmd
,
.
get_response
=
azx_get_response
,
.
attach_pcm
=
azx_attach_pcm_stream
,
.
bus_reset
=
azx_bus_reset
,
#ifdef CONFIG_SND_HDA_DSP_LOADER
...
...
@@ -1828,7 +1834,7 @@ int azx_bus_create(struct azx *chip, const char *model)
struct
hda_bus
*
bus
;
int
err
;
err
=
snd_hda_bus_new
(
chip
->
card
,
&
bus
);
err
=
snd_hda_bus_new
(
chip
->
card
,
&
bus
_core_ops
,
&
bus
);
if
(
err
<
0
)
return
err
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录