Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
f2f8e850
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看板
提交
f2f8e850
编写于
9月 15, 2010
作者:
M
Mauro Carvalho Chehab
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
V4L/DVB: radio-si470x: use unlocked ioctl
Signed-off-by:
N
Mauro Carvalho Chehab
<
mchehab@redhat.com
>
上级
cf9b475d
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
22 addition
and
6 deletion
+22
-6
drivers/media/radio/si470x/radio-si470x-common.c
drivers/media/radio/si470x/radio-si470x-common.c
+22
-5
drivers/media/radio/si470x/radio-si470x.h
drivers/media/radio/si470x/radio-si470x.h
+0
-1
未找到文件。
drivers/media/radio/si470x/radio-si470x-common.c
浏览文件 @
f2f8e850
...
...
@@ -408,17 +408,15 @@ int si470x_stop(struct si470x_device *radio)
/*
* si470x_rds_on - switch on rds reception
*/
int
si470x_rds_on
(
struct
si470x_device
*
radio
)
static
int
si470x_rds_on
(
struct
si470x_device
*
radio
)
{
int
retval
;
/* sysconfig 1 */
mutex_lock
(
&
radio
->
lock
);
radio
->
registers
[
SYSCONFIG1
]
|=
SYSCONFIG1_RDS
;
retval
=
si470x_set_register
(
radio
,
SYSCONFIG1
);
if
(
retval
<
0
)
radio
->
registers
[
SYSCONFIG1
]
&=
~
SYSCONFIG1_RDS
;
mutex_unlock
(
&
radio
->
lock
);
return
retval
;
}
...
...
@@ -440,6 +438,7 @@ static ssize_t si470x_fops_read(struct file *file, char __user *buf,
unsigned
int
block_count
=
0
;
/* switch on rds reception */
mutex_lock
(
&
radio
->
lock
);
if
((
radio
->
registers
[
SYSCONFIG1
]
&
SYSCONFIG1_RDS
)
==
0
)
si470x_rds_on
(
radio
);
...
...
@@ -480,9 +479,9 @@ static ssize_t si470x_fops_read(struct file *file, char __user *buf,
buf
+=
3
;
retval
+=
3
;
}
mutex_unlock
(
&
radio
->
lock
);
done:
mutex_unlock
(
&
radio
->
lock
);
return
retval
;
}
...
...
@@ -497,8 +496,11 @@ static unsigned int si470x_fops_poll(struct file *file,
int
retval
=
0
;
/* switch on rds reception */
mutex_lock
(
&
radio
->
lock
);
if
((
radio
->
registers
[
SYSCONFIG1
]
&
SYSCONFIG1_RDS
)
==
0
)
si470x_rds_on
(
radio
);
mutex_unlock
(
&
radio
->
lock
);
poll_wait
(
file
,
&
radio
->
read_queue
,
pts
);
...
...
@@ -516,7 +518,7 @@ static const struct v4l2_file_operations si470x_fops = {
.
owner
=
THIS_MODULE
,
.
read
=
si470x_fops_read
,
.
poll
=
si470x_fops_poll
,
.
ioctl
=
video_ioctl2
,
.
unlocked_ioctl
=
video_ioctl2
,
.
open
=
si470x_fops_open
,
.
release
=
si470x_fops_release
,
};
...
...
@@ -572,6 +574,7 @@ static int si470x_vidioc_g_ctrl(struct file *file, void *priv,
struct
si470x_device
*
radio
=
video_drvdata
(
file
);
int
retval
=
0
;
mutex_lock
(
&
radio
->
lock
);
/* safety checks */
retval
=
si470x_disconnect_check
(
radio
);
if
(
retval
)
...
...
@@ -594,6 +597,8 @@ static int si470x_vidioc_g_ctrl(struct file *file, void *priv,
if
(
retval
<
0
)
dev_warn
(
&
radio
->
videodev
->
dev
,
"get control failed with %d
\n
"
,
retval
);
mutex_unlock
(
&
radio
->
lock
);
return
retval
;
}
...
...
@@ -607,6 +612,7 @@ static int si470x_vidioc_s_ctrl(struct file *file, void *priv,
struct
si470x_device
*
radio
=
video_drvdata
(
file
);
int
retval
=
0
;
mutex_lock
(
&
radio
->
lock
);
/* safety checks */
retval
=
si470x_disconnect_check
(
radio
);
if
(
retval
)
...
...
@@ -633,6 +639,7 @@ static int si470x_vidioc_s_ctrl(struct file *file, void *priv,
if
(
retval
<
0
)
dev_warn
(
&
radio
->
videodev
->
dev
,
"set control failed with %d
\n
"
,
retval
);
mutex_unlock
(
&
radio
->
lock
);
return
retval
;
}
...
...
@@ -662,6 +669,7 @@ static int si470x_vidioc_g_tuner(struct file *file, void *priv,
struct
si470x_device
*
radio
=
video_drvdata
(
file
);
int
retval
=
0
;
mutex_lock
(
&
radio
->
lock
);
/* safety checks */
retval
=
si470x_disconnect_check
(
radio
);
if
(
retval
)
...
...
@@ -737,6 +745,7 @@ static int si470x_vidioc_g_tuner(struct file *file, void *priv,
if
(
retval
<
0
)
dev_warn
(
&
radio
->
videodev
->
dev
,
"get tuner failed with %d
\n
"
,
retval
);
mutex_unlock
(
&
radio
->
lock
);
return
retval
;
}
...
...
@@ -750,6 +759,7 @@ static int si470x_vidioc_s_tuner(struct file *file, void *priv,
struct
si470x_device
*
radio
=
video_drvdata
(
file
);
int
retval
=
0
;
mutex_lock
(
&
radio
->
lock
);
/* safety checks */
retval
=
si470x_disconnect_check
(
radio
);
if
(
retval
)
...
...
@@ -776,6 +786,7 @@ static int si470x_vidioc_s_tuner(struct file *file, void *priv,
if
(
retval
<
0
)
dev_warn
(
&
radio
->
videodev
->
dev
,
"set tuner failed with %d
\n
"
,
retval
);
mutex_unlock
(
&
radio
->
lock
);
return
retval
;
}
...
...
@@ -790,6 +801,7 @@ static int si470x_vidioc_g_frequency(struct file *file, void *priv,
int
retval
=
0
;
/* safety checks */
mutex_lock
(
&
radio
->
lock
);
retval
=
si470x_disconnect_check
(
radio
);
if
(
retval
)
goto
done
;
...
...
@@ -806,6 +818,7 @@ static int si470x_vidioc_g_frequency(struct file *file, void *priv,
if
(
retval
<
0
)
dev_warn
(
&
radio
->
videodev
->
dev
,
"get frequency failed with %d
\n
"
,
retval
);
mutex_unlock
(
&
radio
->
lock
);
return
retval
;
}
...
...
@@ -819,6 +832,7 @@ static int si470x_vidioc_s_frequency(struct file *file, void *priv,
struct
si470x_device
*
radio
=
video_drvdata
(
file
);
int
retval
=
0
;
mutex_lock
(
&
radio
->
lock
);
/* safety checks */
retval
=
si470x_disconnect_check
(
radio
);
if
(
retval
)
...
...
@@ -835,6 +849,7 @@ static int si470x_vidioc_s_frequency(struct file *file, void *priv,
if
(
retval
<
0
)
dev_warn
(
&
radio
->
videodev
->
dev
,
"set frequency failed with %d
\n
"
,
retval
);
mutex_unlock
(
&
radio
->
lock
);
return
retval
;
}
...
...
@@ -848,6 +863,7 @@ static int si470x_vidioc_s_hw_freq_seek(struct file *file, void *priv,
struct
si470x_device
*
radio
=
video_drvdata
(
file
);
int
retval
=
0
;
mutex_lock
(
&
radio
->
lock
);
/* safety checks */
retval
=
si470x_disconnect_check
(
radio
);
if
(
retval
)
...
...
@@ -864,6 +880,7 @@ static int si470x_vidioc_s_hw_freq_seek(struct file *file, void *priv,
if
(
retval
<
0
)
dev_warn
(
&
radio
->
videodev
->
dev
,
"set hardware frequency seek failed with %d
\n
"
,
retval
);
mutex_unlock
(
&
radio
->
lock
);
return
retval
;
}
...
...
drivers/media/radio/si470x/radio-si470x.h
浏览文件 @
f2f8e850
...
...
@@ -220,7 +220,6 @@ int si470x_disconnect_check(struct si470x_device *radio);
int
si470x_set_freq
(
struct
si470x_device
*
radio
,
unsigned
int
freq
);
int
si470x_start
(
struct
si470x_device
*
radio
);
int
si470x_stop
(
struct
si470x_device
*
radio
);
int
si470x_rds_on
(
struct
si470x_device
*
radio
);
int
si470x_fops_open
(
struct
file
*
file
);
int
si470x_fops_release
(
struct
file
*
file
);
int
si470x_vidioc_querycap
(
struct
file
*
file
,
void
*
priv
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录