Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
54da49f5
cloud-kernel
项目概览
openanolis
/
cloud-kernel
大约 1 年 前同步成功
通知
158
Star
36
Fork
7
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
10
列表
看板
标记
里程碑
合并请求
2
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
cloud-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
10
Issue
10
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
54da49f5
编写于
1月 20, 2007
作者:
M
Mauro Carvalho Chehab
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
V4L/DVB (5100): Make cx88-blackbird to work again
Signed-off-by:
N
Mauro Carvalho Chehab
<
mchehab@infradead.org
>
上级
c526ab91
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
62 addition
and
34 deletion
+62
-34
drivers/media/video/cx88/cx88-video.c
drivers/media/video/cx88/cx88-video.c
+54
-30
drivers/media/video/cx88/cx88.h
drivers/media/video/cx88/cx88.h
+8
-4
未找到文件。
drivers/media/video/cx88/cx88-video.c
浏览文件 @
54da49f5
...
...
@@ -86,7 +86,7 @@ static LIST_HEAD(cx8800_devlist);
/* ------------------------------------------------------------------- */
/* static data */
st
atic
struct
v4l2_tvnorm
tvnorms
[]
=
{
st
ruct
v4l2_tvnorm
cx88_
tvnorms
[]
=
{
{
.
name
=
"NTSC-M"
,
.
id
=
V4L2_STD_NTSC_M
,
...
...
@@ -125,6 +125,10 @@ static struct v4l2_tvnorm tvnorms[] = {
.
id
=
V4L2_STD_SECAM_DK
,
}
};
EXPORT_SYMBOL
(
cx88_tvnorms
);
unsigned
int
cx88_tvnormsize
=
ARRAY_SIZE
(
cx88_tvnorms
);
EXPORT_SYMBOL
(
cx88_tvnormsize
);
static
struct
v4l2_tvnorm
radionorms
[]
=
{
{
...
...
@@ -932,10 +936,8 @@ video_mmap(struct file *file, struct vm_area_struct * vma)
/* ------------------------------------------------------------------ */
/* VIDEO CTRL IOCTLS */
static
int
vidioc_g_ctrl
(
struct
file
*
file
,
void
*
priv
,
struct
v4l2_control
*
ctl
)
int
cx88_get_control
(
struct
cx88_core
*
core
,
struct
v4l2_control
*
ctl
)
{
struct
cx88_core
*
core
=
((
struct
cx8800_fh
*
)
priv
)
->
dev
->
core
;
struct
cx88_ctrl
*
c
=
NULL
;
u32
value
;
int
i
;
...
...
@@ -964,8 +966,9 @@ static int vidioc_g_ctrl (struct file *file, void *priv,
value
,
c
->
mask
,
c
->
sreg
?
" [shadowed]"
:
""
);
return
0
;
}
EXPORT_SYMBOL
(
cx88_get_control
);
static
int
set_control
(
struct
cx88_core
*
core
,
struct
v4l2_control
*
ctl
)
int
cx88_
set_control
(
struct
cx88_core
*
core
,
struct
v4l2_control
*
ctl
)
{
struct
cx88_ctrl
*
c
=
NULL
;
u32
value
,
mask
;
...
...
@@ -1019,6 +1022,7 @@ static int set_control(struct cx88_core *core, struct v4l2_control *ctl)
}
return
0
;
}
EXPORT_SYMBOL
(
cx88_set_control
);
static
void
init_controls
(
struct
cx88_core
*
core
)
{
...
...
@@ -1029,7 +1033,7 @@ static void init_controls(struct cx88_core *core)
ctrl
.
id
=
cx8800_ctls
[
i
].
v
.
id
;
ctrl
.
value
=
cx8800_ctls
[
i
].
v
.
default_value
;
set_control
(
core
,
&
ctrl
);
cx88_
set_control
(
core
,
&
ctrl
);
}
}
...
...
@@ -1179,7 +1183,6 @@ static int vidiocgmbuf (struct file *file, void *priv, struct video_mbuf *mbuf)
}
#endif
static
int
vidioc_reqbufs
(
struct
file
*
file
,
void
*
priv
,
struct
v4l2_requestbuffers
*
p
)
{
struct
cx8800_fh
*
fh
=
priv
;
...
...
@@ -1244,17 +1247,14 @@ static int vidioc_s_std (struct file *file, void *priv, unsigned int i)
struct
cx88_core
*
core
=
((
struct
cx8800_fh
*
)
priv
)
->
dev
->
core
;
mutex_lock
(
&
core
->
lock
);
cx88_set_tvnorm
(
core
,
&
tvnorms
[
i
]);
cx88_set_tvnorm
(
core
,
&
cx88_
tvnorms
[
i
]);
mutex_unlock
(
&
core
->
lock
);
return
0
;
}
/* only one input in this sample driver */
static
int
vidioc_enum_input
(
struct
file
*
file
,
void
*
priv
,
struct
v4l2_input
*
i
)
int
cx88_enum_input
(
struct
cx88_core
*
core
,
struct
v4l2_input
*
i
)
{
struct
cx88_core
*
core
=
((
struct
cx8800_fh
*
)
priv
)
->
dev
->
core
;
static
const
char
*
iname
[]
=
{
[
CX88_VMUX_COMPOSITE1
]
=
"Composite1"
,
[
CX88_VMUX_COMPOSITE2
]
=
"Composite2"
,
...
...
@@ -1280,10 +1280,18 @@ static int vidioc_enum_input (struct file *file, void *priv,
if
((
CX88_VMUX_TELEVISION
==
INPUT
(
n
)
->
type
)
||
(
CX88_VMUX_CABLE
==
INPUT
(
n
)
->
type
))
i
->
type
=
V4L2_INPUT_TYPE_TUNER
;
for
(
n
=
0
;
n
<
ARRAY_SIZE
(
tvnorms
);
n
++
)
i
->
std
|=
tvnorms
[
n
].
id
;
for
(
n
=
0
;
n
<
ARRAY_SIZE
(
cx88_
tvnorms
);
n
++
)
i
->
std
|=
cx88_
tvnorms
[
n
].
id
;
return
0
;
}
EXPORT_SYMBOL
(
cx88_enum_input
);
static
int
vidioc_enum_input
(
struct
file
*
file
,
void
*
priv
,
struct
v4l2_input
*
i
)
{
struct
cx88_core
*
core
=
((
struct
cx8800_fh
*
)
priv
)
->
dev
->
core
;
return
cx88_enum_input
(
core
,
i
);
}
static
int
vidioc_g_input
(
struct
file
*
file
,
void
*
priv
,
unsigned
int
*
i
)
{
...
...
@@ -1318,13 +1326,20 @@ static int vidioc_queryctrl (struct file *file, void *priv,
return
cx8800_ctrl_query
(
qctrl
);
}
static
int
vidioc_
s
_ctrl
(
struct
file
*
file
,
void
*
priv
,
static
int
vidioc_
g
_ctrl
(
struct
file
*
file
,
void
*
priv
,
struct
v4l2_control
*
ctl
)
{
struct
cx88_core
*
core
=
((
struct
cx8800_fh
*
)
priv
)
->
dev
->
core
;
return
cx88_get_control
(
core
,
ctl
);
}
static
int
vidioc_s_ctrl
(
struct
file
*
file
,
void
*
priv
,
struct
v4l2_control
*
ctl
)
{
struct
cx88_core
*
core
=
((
struct
cx8800_fh
*
)
priv
)
->
dev
->
core
;
return
set_control
(
core
,
ctl
);
cx88_
set_control
(
core
,
ctl
);
}
static
int
vidioc_g_tuner
(
struct
file
*
file
,
void
*
priv
,
...
...
@@ -1379,20 +1394,14 @@ static int vidioc_g_frequency (struct file *file, void *priv,
return
0
;
}
static
int
vidioc_s_frequency
(
struct
file
*
file
,
void
*
priv
,
int
cx88_set_freq
(
struct
cx88_core
*
core
,
struct
v4l2_frequency
*
f
)
{
struct
cx8800_fh
*
fh
=
priv
;
struct
cx88_core
*
core
=
fh
->
dev
->
core
;
if
(
unlikely
(
UNSET
==
core
->
tuner_type
))
return
-
EINVAL
;
if
(
unlikely
(
f
->
tuner
!=
0
))
return
-
EINVAL
;
if
(
unlikely
(
0
==
fh
->
radio
&&
f
->
type
!=
V4L2_TUNER_ANALOG_TV
))
return
-
EINVAL
;
if
(
unlikely
(
1
==
fh
->
radio
&&
f
->
type
!=
V4L2_TUNER_RADIO
))
return
-
EINVAL
;
mutex_lock
(
&
core
->
lock
);
core
->
freq
=
f
->
frequency
;
cx88_newstation
(
core
);
...
...
@@ -1403,8 +1412,25 @@ static int vidioc_s_frequency (struct file *file, void *priv,
cx88_set_tvaudio
(
core
);
mutex_unlock
(
&
core
->
lock
);
return
0
;
}
EXPORT_SYMBOL
(
cx88_set_freq
);
static
int
vidioc_s_frequency
(
struct
file
*
file
,
void
*
priv
,
struct
v4l2_frequency
*
f
)
{
struct
cx8800_fh
*
fh
=
priv
;
struct
cx88_core
*
core
=
fh
->
dev
->
core
;
if
(
unlikely
(
0
==
fh
->
radio
&&
f
->
type
!=
V4L2_TUNER_ANALOG_TV
))
return
-
EINVAL
;
if
(
unlikely
(
1
==
fh
->
radio
&&
f
->
type
!=
V4L2_TUNER_RADIO
))
return
-
EINVAL
;
return
cx88_set_freq
(
core
,
f
);
}
/* ----------------------------------------------------------- */
...
...
@@ -1677,8 +1703,8 @@ static struct video_device cx8800_video_template =
.
vidioc_s_tuner
=
vidioc_s_tuner
,
.
vidioc_g_frequency
=
vidioc_g_frequency
,
.
vidioc_s_frequency
=
vidioc_s_frequency
,
.
tvnorms
=
tvnorms
,
.
tvnormsize
=
ARRAY_SIZE
(
tvnorms
),
.
tvnorms
=
cx88_
tvnorms
,
.
tvnormsize
=
ARRAY_SIZE
(
cx88_
tvnorms
),
};
static
const
struct
file_operations
radio_fops
=
...
...
@@ -1789,7 +1815,7 @@ static int __devinit cx8800_initdev(struct pci_dev *pci_dev,
/* initialize driver struct */
spin_lock_init
(
&
dev
->
slock
);
core
->
tvnorm
=
tvnorms
;
core
->
tvnorm
=
cx88_
tvnorms
;
/* init video dma queues */
INIT_LIST_HEAD
(
&
dev
->
vidq
.
active
);
...
...
@@ -1870,7 +1896,7 @@ static int __devinit cx8800_initdev(struct pci_dev *pci_dev,
/* initial device configuration */
mutex_lock
(
&
core
->
lock
);
cx88_set_tvnorm
(
core
,
tvnorms
);
cx88_set_tvnorm
(
core
,
cx88_
tvnorms
);
init_controls
(
core
);
video_mux
(
core
,
0
);
mutex_unlock
(
&
core
->
lock
);
...
...
@@ -2041,8 +2067,6 @@ static void cx8800_fini(void)
module_init
(
cx8800_init
);
module_exit
(
cx8800_fini
);
EXPORT_SYMBOL
(
cx88_do_ioctl
);
/* ----------------------------------------------------------- */
/*
* Local variables:
...
...
drivers/media/video/cx88/cx88.h
浏览文件 @
54da49f5
...
...
@@ -629,12 +629,16 @@ int cx8802_suspend_common(struct pci_dev *pci_dev, pm_message_t state);
int
cx8802_resume_common
(
struct
pci_dev
*
pci_dev
);
/* ----------------------------------------------------------- */
/* cx88-video.c */
extern
int
cx88_do_ioctl
(
struct
inode
*
inode
,
struct
file
*
file
,
int
radio
,
struct
cx88_core
*
core
,
unsigned
int
cmd
,
void
*
arg
,
v4l2_kioctl
driver_ioctl
);
/* cx88-video.c*/
extern
unsigned
int
cx88_tvnormsize
;
extern
struct
v4l2_tvnorm
cx88_tvnorms
[];
extern
const
u32
cx88_user_ctrls
[];
extern
int
cx8800_ctrl_query
(
struct
v4l2_queryctrl
*
qctrl
);
int
cx88_enum_input
(
struct
cx88_core
*
core
,
struct
v4l2_input
*
i
);
int
cx88_set_freq
(
struct
cx88_core
*
core
,
struct
v4l2_frequency
*
f
);
int
cx88_get_control
(
struct
cx88_core
*
core
,
struct
v4l2_control
*
ctl
);
int
cx88_set_control
(
struct
cx88_core
*
core
,
struct
v4l2_control
*
ctl
);
int
cx88_video_mux
(
struct
cx88_core
*
core
,
unsigned
int
input
);
/* ----------------------------------------------------------- */
/* cx88-blackbird.c */
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录