Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
92f4fc10
K
Kernel
项目概览
openeuler
/
Kernel
1 年多 前同步成功
通知
8
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看板
提交
92f4fc10
编写于
3月 31, 2010
作者:
M
Mauro Carvalho Chehab
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
V4L/DVB: cx88: Only start IR if the input device is opened
Signed-off-by:
N
Mauro Carvalho Chehab
<
mchehab@redhat.com
>
上级
716aab44
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
66 addition
and
15 deletion
+66
-15
drivers/media/video/cx88/cx88-input.c
drivers/media/video/cx88/cx88-input.c
+60
-9
drivers/media/video/cx88/cx88-video.c
drivers/media/video/cx88/cx88-video.c
+3
-3
drivers/media/video/cx88/cx88.h
drivers/media/video/cx88/cx88.h
+3
-3
未找到文件。
drivers/media/video/cx88/cx88-input.c
浏览文件 @
92f4fc10
...
...
@@ -40,6 +40,10 @@ struct cx88_IR {
struct
cx88_core
*
core
;
struct
input_dev
*
input
;
struct
ir_input_state
ir
;
struct
ir_dev_props
props
;
int
users
;
char
name
[
32
];
char
phys
[
32
];
...
...
@@ -161,8 +165,16 @@ static enum hrtimer_restart cx88_ir_work(struct hrtimer *timer)
return
HRTIMER_RESTART
;
}
void
cx88_ir_start
(
struct
cx88_core
*
core
,
struct
cx88_IR
*
ir
)
static
int
__cx88_ir_start
(
void
*
priv
)
{
struct
cx88_core
*
core
=
priv
;
struct
cx88_IR
*
ir
;
if
(
!
core
||
!
core
->
ir
)
return
-
EINVAL
;
ir
=
core
->
ir
;
if
(
ir
->
polling
)
{
hrtimer_init
(
&
ir
->
timer
,
CLOCK_MONOTONIC
,
HRTIMER_MODE_REL
);
ir
->
timer
.
function
=
cx88_ir_work
;
...
...
@@ -175,10 +187,18 @@ void cx88_ir_start(struct cx88_core *core, struct cx88_IR *ir)
cx_write
(
MO_DDS_IO
,
0xa80a80
);
/* 4 kHz sample rate */
cx_write
(
MO_DDSCFG_IO
,
0x5
);
/* enable */
}
return
0
;
}
void
cx88_ir_stop
(
struct
cx88_core
*
core
,
struct
cx88_IR
*
ir
)
static
void
__cx88_ir_stop
(
void
*
priv
)
{
struct
cx88_core
*
core
=
priv
;
struct
cx88_IR
*
ir
;
if
(
!
core
||
!
core
->
ir
)
return
;
ir
=
core
->
ir
;
if
(
ir
->
sampling
)
{
cx_write
(
MO_DDSCFG_IO
,
0x0
);
core
->
pci_irqmask
&=
~
PCI_INT_IR_SMPINT
;
...
...
@@ -188,6 +208,37 @@ void cx88_ir_stop(struct cx88_core *core, struct cx88_IR *ir)
hrtimer_cancel
(
&
ir
->
timer
);
}
int
cx88_ir_start
(
struct
cx88_core
*
core
)
{
if
(
core
->
ir
->
users
)
return
__cx88_ir_start
(
core
);
return
0
;
}
void
cx88_ir_stop
(
struct
cx88_core
*
core
)
{
if
(
core
->
ir
->
users
)
__cx88_ir_stop
(
core
);
}
static
int
cx88_ir_open
(
void
*
priv
)
{
struct
cx88_core
*
core
=
priv
;
core
->
ir
->
users
++
;
return
__cx88_ir_start
(
core
);
}
static
void
cx88_ir_close
(
void
*
priv
)
{
struct
cx88_core
*
core
=
priv
;
core
->
ir
->
users
--
;
if
(
!
core
->
ir
->
users
)
__cx88_ir_stop
(
core
);
}
/* ---------------------------------------------------------------------- */
int
cx88_ir_init
(
struct
cx88_core
*
core
,
struct
pci_dev
*
pci
)
...
...
@@ -383,19 +434,19 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci)
ir
->
core
=
core
;
core
->
ir
=
ir
;
cx88_ir_start
(
core
,
ir
);
ir
->
props
.
priv
=
core
;
ir
->
props
.
open
=
cx88_ir_open
;
ir
->
props
.
close
=
cx88_ir_close
;
/* all done */
err
=
ir_input_register
(
ir
->
input
,
ir_codes
,
NULL
,
MODULE_NAME
);
err
=
ir_input_register
(
ir
->
input
,
ir_codes
,
&
ir
->
props
,
MODULE_NAME
);
if
(
err
)
goto
err_out_
stop
;
goto
err_out_
free
;
return
0
;
err_out_stop:
cx88_ir_stop
(
core
,
ir
);
core
->
ir
=
NULL
;
err_out_free:
core
->
ir
=
NULL
;
kfree
(
ir
);
return
err
;
}
...
...
@@ -408,7 +459,7 @@ int cx88_ir_fini(struct cx88_core *core)
if
(
NULL
==
ir
)
return
0
;
cx88_ir_stop
(
core
,
ir
);
cx88_ir_stop
(
core
);
ir_input_unregister
(
ir
->
input
);
kfree
(
ir
);
...
...
drivers/media/video/cx88/cx88-video.c
浏览文件 @
92f4fc10
...
...
@@ -1977,7 +1977,7 @@ static void __devexit cx8800_finidev(struct pci_dev *pci_dev)
}
if
(
core
->
ir
)
cx88_ir_stop
(
core
,
core
->
ir
);
cx88_ir_stop
(
core
);
cx88_shutdown
(
core
);
/* FIXME */
pci_disable_device
(
pci_dev
);
...
...
@@ -2015,7 +2015,7 @@ static int cx8800_suspend(struct pci_dev *pci_dev, pm_message_t state)
spin_unlock
(
&
dev
->
slock
);
if
(
core
->
ir
)
cx88_ir_stop
(
core
,
core
->
ir
);
cx88_ir_stop
(
core
);
/* FIXME -- shutdown device */
cx88_shutdown
(
core
);
...
...
@@ -2056,7 +2056,7 @@ static int cx8800_resume(struct pci_dev *pci_dev)
/* FIXME: re-initialize hardware */
cx88_reset
(
core
);
if
(
core
->
ir
)
cx88_ir_start
(
core
,
core
->
ir
);
cx88_ir_start
(
core
);
cx_set
(
MO_PCI_INTMSK
,
core
->
pci_irqmask
);
...
...
drivers/media/video/cx88/cx88.h
浏览文件 @
92f4fc10
...
...
@@ -41,7 +41,7 @@
#include <linux/version.h>
#include <linux/mutex.h>
#define CX88_VERSION_CODE KERNEL_VERSION(0,
0,7
)
#define CX88_VERSION_CODE KERNEL_VERSION(0,
0, 8
)
#define UNSET (-1U)
...
...
@@ -683,8 +683,8 @@ s32 cx88_dsp_detect_stereo_sap(struct cx88_core *core);
int
cx88_ir_init
(
struct
cx88_core
*
core
,
struct
pci_dev
*
pci
);
int
cx88_ir_fini
(
struct
cx88_core
*
core
);
void
cx88_ir_irq
(
struct
cx88_core
*
core
);
void
cx88_ir_start
(
struct
cx88_core
*
core
,
struct
cx88_IR
*
ir
);
void
cx88_ir_stop
(
struct
cx88_core
*
core
,
struct
cx88_IR
*
ir
);
int
cx88_ir_start
(
struct
cx88_core
*
core
);
void
cx88_ir_stop
(
struct
cx88_core
*
core
);
/* ----------------------------------------------------------- */
/* cx88-mpeg.c */
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录