Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
c0c46826
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看板
提交
c0c46826
编写于
9月 22, 2010
作者:
M
Mauro Carvalho Chehab
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
V4L/DVB: bttv: Move PV951 IR to the right driver
Signed-off-by:
N
Mauro Carvalho Chehab
<
mchehab@redhat.com
>
上级
8403472f
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
87 addition
and
79 deletion
+87
-79
drivers/media/video/bt8xx/bttv-i2c.c
drivers/media/video/bt8xx/bttv-i2c.c
+0
-38
drivers/media/video/bt8xx/bttv-input.c
drivers/media/video/bt8xx/bttv-input.c
+77
-7
drivers/media/video/bt8xx/bttv.h
drivers/media/video/bt8xx/bttv.h
+0
-1
drivers/media/video/bt8xx/bttvp.h
drivers/media/video/bt8xx/bttvp.h
+10
-3
drivers/media/video/ir-kbd-i2c.c
drivers/media/video/ir-kbd-i2c.c
+0
-29
include/media/ir-kbd-i2c.h
include/media/ir-kbd-i2c.h
+0
-1
未找到文件。
drivers/media/video/bt8xx/bttv-i2c.c
浏览文件 @
c0c46826
...
...
@@ -390,41 +390,3 @@ int __devinit init_bttv_i2c(struct bttv *btv)
return
btv
->
i2c_rc
;
}
/* Instantiate the I2C IR receiver device, if present */
void
__devinit
init_bttv_i2c_ir
(
struct
bttv
*
btv
)
{
if
(
0
==
btv
->
i2c_rc
)
{
struct
i2c_board_info
info
;
/* The external IR receiver is at i2c address 0x34 (0x35 for
reads). Future Hauppauge cards will have an internal
receiver at 0x30 (0x31 for reads). In theory, both can be
fitted, and Hauppauge suggest an external overrides an
internal.
That's why we probe 0x1a (~0x34) first. CB
*/
const
unsigned
short
addr_list
[]
=
{
0x1a
,
0x18
,
0x4b
,
0x64
,
0x30
,
0x71
,
I2C_CLIENT_END
};
memset
(
&
info
,
0
,
sizeof
(
struct
i2c_board_info
));
strlcpy
(
info
.
type
,
"ir_video"
,
I2C_NAME_SIZE
);
i2c_new_probed_device
(
&
btv
->
c
.
i2c_adap
,
&
info
,
addr_list
,
NULL
);
}
}
int
__devexit
fini_bttv_i2c
(
struct
bttv
*
btv
)
{
if
(
0
!=
btv
->
i2c_rc
)
return
0
;
return
i2c_del_adapter
(
&
btv
->
c
.
i2c_adap
);
}
/*
* Local variables:
* c-basic-offset: 8
* End:
*/
drivers/media/video/bt8xx/bttv-input.c
浏览文件 @
c0c46826
...
...
@@ -245,6 +245,83 @@ static void bttv_ir_stop(struct bttv *btv)
}
}
/*
* Get_key functions used by I2C remotes
*/
static
int
get_key_pv951
(
struct
IR_i2c
*
ir
,
u32
*
ir_key
,
u32
*
ir_raw
)
{
unsigned
char
b
;
/* poll IR chip */
if
(
1
!=
i2c_master_recv
(
ir
->
c
,
&
b
,
1
))
{
dprintk
(
KERN_INFO
DEVNAME
": read error
\n
"
);
return
-
EIO
;
}
/* ignore 0xaa */
if
(
b
==
0xaa
)
return
0
;
dprintk
(
KERN_INFO
DEVNAME
": key %02x
\n
"
,
b
);
*
ir_key
=
b
;
*
ir_raw
=
b
;
return
1
;
}
/* Instantiate the I2C IR receiver device, if present */
void
__devinit
init_bttv_i2c_ir
(
struct
bttv
*
btv
)
{
const
unsigned
short
addr_list
[]
=
{
0x1a
,
0x18
,
0x64
,
0x30
,
0x71
,
I2C_CLIENT_END
};
struct
i2c_board_info
info
;
if
(
0
!=
btv
->
i2c_rc
)
return
;
memset
(
&
info
,
0
,
sizeof
(
struct
i2c_board_info
));
memset
(
&
btv
->
init_data
,
0
,
sizeof
(
btv
->
init_data
));
strlcpy
(
info
.
type
,
"ir_video"
,
I2C_NAME_SIZE
);
switch
(
btv
->
c
.
type
)
{
case
BTTV_BOARD_PV951
:
btv
->
init_data
.
name
=
"PV951"
;
btv
->
init_data
.
get_key
=
get_key_pv951
;
btv
->
init_data
.
ir_codes
=
RC_MAP_PV951
;
btv
->
init_data
.
type
=
IR_TYPE_OTHER
;
info
.
addr
=
0x4b
;
break
;
default:
/*
* The external IR receiver is at i2c address 0x34 (0x35 for
* reads). Future Hauppauge cards will have an internal
* receiver at 0x30 (0x31 for reads). In theory, both can be
* fitted, and Hauppauge suggest an external overrides an
* internal.
* That's why we probe 0x1a (~0x34) first. CB
*/
i2c_new_probed_device
(
&
btv
->
c
.
i2c_adap
,
&
info
,
addr_list
,
NULL
);
return
;
}
if
(
btv
->
init_data
.
name
)
info
.
platform_data
=
&
btv
->
init_data
;
i2c_new_device
(
&
btv
->
c
.
i2c_adap
,
&
info
);
return
;
}
int
__devexit
fini_bttv_i2c
(
struct
bttv
*
btv
)
{
if
(
0
!=
btv
->
i2c_rc
)
return
0
;
return
i2c_del_adapter
(
&
btv
->
c
.
i2c_adap
);
}
int
bttv_input_init
(
struct
bttv
*
btv
)
{
struct
card_ir
*
ir
;
...
...
@@ -420,10 +497,3 @@ void bttv_input_fini(struct bttv *btv)
kfree
(
btv
->
remote
);
btv
->
remote
=
NULL
;
}
/*
* Local variables:
* c-basic-offset: 8
* End:
*/
drivers/media/video/bt8xx/bttv.h
浏览文件 @
c0c46826
...
...
@@ -18,7 +18,6 @@
#include <linux/i2c.h>
#include <media/v4l2-device.h>
#include <media/ir-common.h>
#include <media/ir-kbd-i2c.h>
#include <media/i2c-addr.h>
#include <media/tuner.h>
...
...
drivers/media/video/bt8xx/bttvp.h
浏览文件 @
c0c46826
...
...
@@ -42,7 +42,7 @@
#include <media/videobuf-dma-sg.h>
#include <media/tveeprom.h>
#include <media/ir-common.h>
#include <media/ir-kbd-i2c.h>
#include "bt848.h"
#include "bttv.h"
...
...
@@ -270,6 +270,12 @@ int bttv_sub_del_devices(struct bttv_core *core);
extern
int
no_overlay
;
/* ---------------------------------------------------------- */
/* bttv-input.c */
extern
void
init_bttv_i2c_ir
(
struct
bttv
*
btv
);
extern
int
fini_bttv_i2c
(
struct
bttv
*
btv
);
/* ---------------------------------------------------------- */
/* bttv-driver.c */
...
...
@@ -279,8 +285,6 @@ extern unsigned int bttv_debug;
extern
unsigned
int
bttv_gpio
;
extern
void
bttv_gpio_tracking
(
struct
bttv
*
btv
,
char
*
comment
);
extern
int
init_bttv_i2c
(
struct
bttv
*
btv
);
extern
void
init_bttv_i2c_ir
(
struct
bttv
*
btv
);
extern
int
fini_bttv_i2c
(
struct
bttv
*
btv
);
#define bttv_printk if (bttv_verbose) printk
#define dprintk if (bttv_debug >= 1) printk
...
...
@@ -366,6 +370,9 @@ struct bttv {
int
has_remote
;
struct
card_ir
*
remote
;
/* I2C remote data */
struct
IR_i2c_init_data
init_data
;
/* locking */
spinlock_t
s_lock
;
struct
mutex
lock
;
...
...
drivers/media/video/ir-kbd-i2c.c
浏览文件 @
c0c46826
...
...
@@ -146,26 +146,6 @@ static int get_key_pixelview(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw)
return
1
;
}
static
int
get_key_pv951
(
struct
IR_i2c
*
ir
,
u32
*
ir_key
,
u32
*
ir_raw
)
{
unsigned
char
b
;
/* poll IR chip */
if
(
1
!=
i2c_master_recv
(
ir
->
c
,
&
b
,
1
))
{
dprintk
(
1
,
"read error
\n
"
);
return
-
EIO
;
}
/* ignore 0xaa */
if
(
b
==
0xaa
)
return
0
;
dprintk
(
2
,
"key %02x
\n
"
,
b
);
*
ir_key
=
b
;
*
ir_raw
=
b
;
return
1
;
}
static
int
get_key_fusionhdtv
(
struct
IR_i2c
*
ir
,
u32
*
ir_key
,
u32
*
ir_raw
)
{
unsigned
char
buf
[
4
];
...
...
@@ -321,12 +301,6 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id)
ir_type
=
IR_TYPE_OTHER
;
ir_codes
=
RC_MAP_EMPTY
;
break
;
case
0x4b
:
name
=
"PV951"
;
ir
->
get_key
=
get_key_pv951
;
ir_type
=
IR_TYPE_OTHER
;
ir_codes
=
RC_MAP_PV951
;
break
;
case
0x18
:
case
0x1f
:
case
0x1a
:
...
...
@@ -396,9 +370,6 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id)
case
IR_KBD_GET_KEY_PIXELVIEW
:
ir
->
get_key
=
get_key_pixelview
;
break
;
case
IR_KBD_GET_KEY_PV951
:
ir
->
get_key
=
get_key_pv951
;
break
;
case
IR_KBD_GET_KEY_HAUP
:
ir
->
get_key
=
get_key_haup
;
break
;
...
...
include/media/ir-kbd-i2c.h
浏览文件 @
c0c46826
...
...
@@ -24,7 +24,6 @@ struct IR_i2c {
enum
ir_kbd_get_key_fn
{
IR_KBD_GET_KEY_CUSTOM
=
0
,
IR_KBD_GET_KEY_PIXELVIEW
,
IR_KBD_GET_KEY_PV951
,
IR_KBD_GET_KEY_HAUP
,
IR_KBD_GET_KEY_KNC1
,
IR_KBD_GET_KEY_FUSIONHDTV
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录