Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
3b20532c
K
Kernel
项目概览
openeuler
/
Kernel
大约 1 年 前同步成功
通知
7
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
3b20532c
编写于
9月 27, 2007
作者:
M
Mauro Carvalho Chehab
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
V4L/DVB (6429): Avoid having two tuner commands happening at the same time
Signed-off-by:
N
Mauro Carvalho Chehab
<
mchehab@infradead.org
>
上级
ff7326d4
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
30 addition
and
10 deletion
+30
-10
drivers/media/video/tuner-xc2028.c
drivers/media/video/tuner-xc2028.c
+30
-10
未找到文件。
drivers/media/video/tuner-xc2028.c
浏览文件 @
3b20532c
...
...
@@ -12,6 +12,7 @@
#include <linux/videodev.h>
#include <linux/delay.h>
#include <media/tuner.h>
#include <linux/mutex.h>
#include "tuner-driver.h"
#include "tuner-xc2028.h"
...
...
@@ -47,6 +48,8 @@ struct xc2028_data {
were loaded? */
enum
tuner_mode
mode
;
struct
i2c_client
*
i2c_client
;
struct
mutex
lock
;
};
#define i2c_send(rc,c,buf,size) \
...
...
@@ -286,20 +289,28 @@ static int check_firmware(struct i2c_client *c, enum tuner_mode new_mode,
static
int
xc2028_signal
(
struct
i2c_client
*
c
)
{
int
lock
,
signal
;
struct
tuner
*
t
=
i2c_get_clientdata
(
c
);
struct
xc2028_data
*
xc2028
=
t
->
priv
;
int
frq_lock
,
signal
=
0
;
mutex_lock
(
&
xc2028
->
lock
);
printk
(
KERN_INFO
"xc2028: %s called
\n
"
,
__FUNCTION__
);
lock
=
xc2028_get_reg
(
c
,
0x2
);
if
(
lock
<=
0
)
return
lock
;
frq_
lock
=
xc2028_get_reg
(
c
,
0x2
);
if
(
frq_
lock
<=
0
)
goto
ret
;
/* Frequency is locked. Return signal quality */
signal
=
xc2028_get_reg
(
c
,
0x40
);
if
(
signal
<=
0
)
return
lock
;
if
(
signal
<=
0
)
{
signal
=
frq_lock
;
}
ret:
mutex_unlock
(
&
xc2028
->
lock
);
return
signal
;
}
...
...
@@ -318,6 +329,8 @@ static void generic_set_tv_freq(struct i2c_client *c, u32 freq /* in Hz */,
when freq is changed */
struct
xc2028_data
*
xc2028
=
t
->
priv
;
mutex_lock
(
&
xc2028
->
lock
);
xc2028
->
firm_type
=
0
;
/* Reset GPIO 1 */
...
...
@@ -325,13 +338,13 @@ static void generic_set_tv_freq(struct i2c_client *c, u32 freq /* in Hz */,
rc
=
t
->
tuner_callback
(
c
->
adapter
->
algo_data
,
XC2028_TUNER_RESET
,
0
);
if
(
rc
<
0
)
return
;
goto
ret
;
}
msleep
(
10
);
printk
(
"xc3028: should set frequency %d kHz)
\n
"
,
freq
/
1000
);
if
(
check_firmware
(
c
,
new_mode
,
bandwidth
)
<
0
)
return
;
goto
ret
;
if
(
new_mode
==
T_DIGITAL_TV
)
offset
=
2750000
;
...
...
@@ -344,7 +357,7 @@ static void generic_set_tv_freq(struct i2c_client *c, u32 freq /* in Hz */,
rc
=
t
->
tuner_callback
(
c
->
adapter
->
algo_data
,
XC2028_RESET_CLK
,
1
);
if
(
rc
<
0
)
return
;
goto
ret
;
}
msleep
(
10
);
...
...
@@ -357,12 +370,15 @@ static void generic_set_tv_freq(struct i2c_client *c, u32 freq /* in Hz */,
i2c_send
(
rc
,
c
,
buf
,
sizeof
(
buf
));
if
(
rc
<
0
)
return
;
goto
ret
;
msleep
(
100
);
printk
(
"divider= %02x %02x %02x %02x (freq=%d.%02d)
\n
"
,
buf
[
1
],
buf
[
2
],
buf
[
3
],
buf
[
4
],
freq
/
16
,
freq
%
16
*
100
/
16
);
ret:
mutex_unlock
(
&
xc2028
->
lock
);
}
...
...
@@ -416,6 +432,8 @@ int xc2028_tuner_init(struct i2c_client *c)
xc2028
->
need_load_generic
=
1
;
xc2028
->
mode
=
T_UNINITIALIZED
;
mutex_init
(
&
xc2028
->
lock
);
/* FIXME: Check where t->priv will be freed */
if
(
version
<
0
)
...
...
@@ -498,5 +516,7 @@ int xc2028_attach(struct i2c_client *c, struct dvb_frontend *fe)
return
0
;
}
EXPORT_SYMBOL
(
xc2028_attach
);
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录