Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
e3ee9e5e
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看板
提交
e3ee9e5e
编写于
2月 08, 2010
作者:
M
Mauro Carvalho Chehab
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
V4L/DVB: tm6000: move board-specific init to tm6000-cards
Signed-off-by:
N
Mauro Carvalho Chehab
<
mchehab@redhat.com
>
上级
591a0d35
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
77 addition
and
47 deletion
+77
-47
drivers/staging/tm6000/tm6000-cards.c
drivers/staging/tm6000/tm6000-cards.c
+72
-0
drivers/staging/tm6000/tm6000-core.c
drivers/staging/tm6000/tm6000-core.c
+2
-47
drivers/staging/tm6000/tm6000.h
drivers/staging/tm6000/tm6000.h
+3
-0
未找到文件。
drivers/staging/tm6000/tm6000-cards.c
浏览文件 @
e3ee9e5e
...
...
@@ -297,6 +297,78 @@ int tm6000_tuner_callback(void *ptr, int component, int command, int arg)
return
(
rc
);
}
int
tm6000_cards_setup
(
struct
tm6000_core
*
dev
)
{
int
i
,
rc
;
/*
* Board-specific initialization sequence. Handles all GPIO
* initialization sequences that are board-specific.
* Up to now, all found devices use GPIO1 and GPIO4 at the same way.
* Probably, they're all based on some reference device. Due to that,
* there's a common routine at the end to handle those GPIO's. Devices
* that use different pinups or init sequences can just return at
* the board-specific session.
*/
switch
(
dev
->
model
)
{
case
TM6010_BOARD_HAUPPAUGE_900H
:
/* Turn xceive 3028 on */
tm6000_set_reg
(
dev
,
REQ_03_SET_GET_MCU_PIN
,
TM6010_GPIO_3
,
0x01
);
msleep
(
11
);
break
;
default:
break
;
}
/*
* Default initialization. Most of the devices seem to use GPIO1
* and GPIO4.on the same way, so, this handles the common sequence
* used by most devices.
* If a device uses a different sequence or different GPIO pins for
* reset, just add the code at the board-specific part
*/
for
(
i
=
0
;
i
<
2
;
i
++
)
{
rc
=
tm6000_set_reg
(
dev
,
REQ_03_SET_GET_MCU_PIN
,
dev
->
tuner_reset_gpio
,
0x00
);
if
(
rc
<
0
)
{
printk
(
KERN_ERR
"Error %i doing GPIO1 reset
\n
"
,
rc
);
return
rc
;
}
msleep
(
10
);
/* Just to be conservative */
rc
=
tm6000_set_reg
(
dev
,
REQ_03_SET_GET_MCU_PIN
,
dev
->
tuner_reset_gpio
,
0x01
);
if
(
rc
<
0
)
{
printk
(
KERN_ERR
"Error %i doing GPIO1 reset
\n
"
,
rc
);
return
rc
;
}
msleep
(
10
);
rc
=
tm6000_set_reg
(
dev
,
REQ_03_SET_GET_MCU_PIN
,
TM6000_GPIO_4
,
0
);
if
(
rc
<
0
)
{
printk
(
KERN_ERR
"Error %i doing GPIO4 reset
\n
"
,
rc
);
return
rc
;
}
msleep
(
10
);
rc
=
tm6000_set_reg
(
dev
,
REQ_03_SET_GET_MCU_PIN
,
TM6000_GPIO_4
,
1
);
if
(
rc
<
0
)
{
printk
(
KERN_ERR
"Error %i doing GPIO4 reset
\n
"
,
rc
);
return
rc
;
}
if
(
!
i
)
{
rc
=
tm6000_get_reg16
(
dev
,
0x40
,
0
,
0
);
if
(
rc
>=
0
)
printk
(
KERN_DEBUG
"board=%d
\n
"
,
rc
);
}
}
msleep
(
50
);
return
0
;
};
static
void
tm6000_config_tuner
(
struct
tm6000_core
*
dev
)
{
struct
tuner_setup
tun_setup
;
...
...
drivers/staging/tm6000/tm6000-core.c
浏览文件 @
e3ee9e5e
...
...
@@ -453,54 +453,9 @@ int tm6000_init (struct tm6000_core *dev)
printk
(
KERN_ERR
"Error %i while retrieving board version
\n
"
,
board
);
}
if
(
dev
->
dev_type
==
TM6010
)
{
/* Turn xceive 3028 on */
tm6000_set_reg
(
dev
,
REQ_03_SET_GET_MCU_PIN
,
TM6010_GPIO_3
,
0x01
);
msleep
(
11
);
}
/* Reset GPIO1 and GPIO4. */
for
(
i
=
0
;
i
<
2
;
i
++
)
{
rc
=
tm6000_set_reg
(
dev
,
REQ_03_SET_GET_MCU_PIN
,
dev
->
tuner_reset_gpio
,
0x00
);
if
(
rc
<
0
)
{
printk
(
KERN_ERR
"Error %i doing GPIO1 reset
\n
"
,
rc
);
return
rc
;
}
msleep
(
10
);
/* Just to be conservative */
rc
=
tm6000_set_reg
(
dev
,
REQ_03_SET_GET_MCU_PIN
,
dev
->
tuner_reset_gpio
,
0x01
);
if
(
rc
<
0
)
{
printk
(
KERN_ERR
"Error %i doing GPIO1 reset
\n
"
,
rc
);
return
rc
;
}
msleep
(
10
);
rc
=
tm6000_set_reg
(
dev
,
REQ_03_SET_GET_MCU_PIN
,
TM6000_GPIO_4
,
0
);
if
(
rc
<
0
)
{
printk
(
KERN_ERR
"Error %i doing GPIO4 reset
\n
"
,
rc
);
return
rc
;
}
msleep
(
10
);
rc
=
tm6000_set_reg
(
dev
,
REQ_03_SET_GET_MCU_PIN
,
TM6000_GPIO_4
,
1
);
if
(
rc
<
0
)
{
printk
(
KERN_ERR
"Error %i doing GPIO4 reset
\n
"
,
rc
);
return
rc
;
}
rc
=
tm6000_cards_setup
(
dev
);
if
(
!
i
)
{
rc
=
tm6000_get_reg16
(
dev
,
0x40
,
0
,
0
);
if
(
rc
>=
0
)
{
printk
(
"board=%d
\n
"
,
rc
);
}
}
}
msleep
(
50
);
return
0
;
return
rc
;
}
int
tm6000_set_audio_bitrate
(
struct
tm6000_core
*
dev
,
int
bitrate
)
...
...
drivers/staging/tm6000/tm6000.h
浏览文件 @
e3ee9e5e
...
...
@@ -206,11 +206,14 @@ struct tm6000_fh {
/* In tm6000-cards.c */
int
tm6000_tuner_callback
(
void
*
ptr
,
int
component
,
int
command
,
int
arg
);
int
tm6000_cards_setup
(
struct
tm6000_core
*
dev
);
/* In tm6000-core.c */
int
tm6000_read_write_usb
(
struct
tm6000_core
*
dev
,
u8
reqtype
,
u8
req
,
u16
value
,
u16
index
,
u8
*
buf
,
u16
len
);
int
tm6000_get_reg
(
struct
tm6000_core
*
dev
,
u8
req
,
u16
value
,
u16
index
);
int
tm6000_get_reg16
(
struct
tm6000_core
*
dev
,
u8
req
,
u16
value
,
u16
index
);
int
tm6000_set_reg
(
struct
tm6000_core
*
dev
,
u8
req
,
u16
value
,
u16
index
);
int
tm6000_init
(
struct
tm6000_core
*
dev
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录