Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
a0813ea3
cloud-kernel
项目概览
openanolis
/
cloud-kernel
1 年多 前同步成功
通知
160
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看板
提交
a0813ea3
编写于
7月 20, 2011
作者:
M
Mauro Carvalho Chehab
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[media] mt2063: Remove most of the #if's
Signed-off-by:
N
Mauro Carvalho Chehab
<
mchehab@redhat.com
>
上级
cfde8925
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
4 addition
and
93 deletion
+4
-93
drivers/media/common/tuners/mt2063.c
drivers/media/common/tuners/mt2063.c
+4
-85
drivers/media/common/tuners/mt2063.h
drivers/media/common/tuners/mt2063.h
+0
-8
未找到文件。
drivers/media/common/tuners/mt2063.c
浏览文件 @
a0813ea3
...
...
@@ -247,16 +247,12 @@ u32 MT2063_WriteSub(void *hUserData,
*/
/* return status; */
//#if !TUNER_CONTROL_BY_DRXK_DRIVER
fe
->
ops
.
i2c_gate_ctrl
(
fe
,
1
);
//I2C bypass drxk3926 close i2c bridge
//#endif
if
(
mt2063_writeregs
(
state
,
subAddress
,
pData
,
cnt
)
<
0
)
{
status
=
MT2063_ERROR
;
}
//#if !TUNER_CONTROL_BY_DRXK_DRIVER
fe
->
ops
.
i2c_gate_ctrl
(
fe
,
0
);
//I2C bypass drxk3926 close i2c bridge
//#endif
return
(
status
);
}
...
...
@@ -314,9 +310,7 @@ u32 MT2063_ReadSub(void *hUserData,
struct
dvb_frontend
*
fe
=
hUserData
;
struct
mt2063_state
*
state
=
fe
->
tuner_priv
;
u32
i
=
0
;
//#if !TUNER_CONTROL_BY_DRXK_DRIVER
fe
->
ops
.
i2c_gate_ctrl
(
fe
,
1
);
//I2C bypass drxk3926 close i2c bridge
//#endif
for
(
i
=
0
;
i
<
cnt
;
i
++
)
{
if
(
mt2063_read_regs
(
state
,
subAddress
+
i
,
pData
+
i
,
1
)
<
0
)
{
...
...
@@ -325,9 +319,7 @@ u32 MT2063_ReadSub(void *hUserData,
}
}
//#if !TUNER_CONTROL_BY_DRXK_DRIVER
fe
->
ops
.
i2c_gate_ctrl
(
fe
,
0
);
//I2C bypass drxk3926 close i2c bridge
//#endif
return
(
status
);
}
...
...
@@ -364,8 +356,6 @@ void MT2063_Sleep(void *hUserData, u32 nMinDelayTime)
msleep
(
nMinDelayTime
);
}
#if defined(MT2060_CNT)
#if MT2060_CNT > 0
/*****************************************************************************
**
** Name: MT_TunerGain (MT2060 only)
...
...
@@ -407,8 +397,6 @@ u32 MT2060_TunerGain(void *hUserData, s32 * pMeas)
return
(
status
);
}
#endif
#endif
//end of mt2063_userdef.c
//=================================================================
//#################################################################
...
...
@@ -458,14 +446,6 @@ u32 MT2060_TunerGain(void *hUserData, s32 * pMeas)
**
*****************************************************************************/
#if !defined(MT2063_TUNER_CNT)
#error MT2063_TUNER_CNT is not defined (see mt_userdef.h)
#endif
#if MT2063_TUNER_CNT == 0
#error MT2063_TUNER_CNT must be updated in mt_userdef.h
#endif
/* Version of this module */
#define MT2063_SPUR_VERSION 10201
/* Version 01.21 */
...
...
@@ -1437,17 +1417,6 @@ u32 MT2063_AvoidSpursVersion(void)
** If the version is different, an updated file is needed from Microtune
*/
/* Expecting version 1.21 of the Spur Avoidance API */
#define EXPECTED_MT2063_AVOID_SPURS_INFO_VERSION 010201
#if MT2063_AVOID_SPURS_INFO_VERSION < EXPECTED_MT2063_AVOID_SPURS_INFO_VERSION
#error Contact Microtune for a newer version of MT_SpurAvoid.c
#elif MT2063_AVOID_SPURS_INFO_VERSION > EXPECTED_MT2063_AVOID_SPURS_INFO_VERSION
#error Contact Microtune for a newer version of mt2063.c
#endif
#ifndef MT2063_CNT
#error You must define MT2063_CNT in the "mt_userdef.h" file
#endif
typedef
enum
{
MT2063_SET_ATTEN
,
...
...
@@ -1493,9 +1462,9 @@ static const u32 MT2063_Num_Registers = MT2063_REG_END_REGS;
#define USE_GLOBAL_TUNER 0
static
u32
nMT2063MaxTuners
=
MT2063_CNT
;
static
struct
MT2063_Info_t
MT2063_Info
[
MT2063_CNT
];
static
struct
MT2063_Info_t
*
MT2063_Avail
[
MT2063_CNT
];
static
u32
nMT2063MaxTuners
=
1
;
static
struct
MT2063_Info_t
MT2063_Info
[
1
];
static
struct
MT2063_Info_t
*
MT2063_Avail
[
1
];
static
u32
nMT2063OpenTuners
=
0
;
/*
...
...
@@ -1591,51 +1560,6 @@ u32 MT2063_Open(u32 MT2063_Addr, void ** hMT2063, void *hUserData)
/* Default tuner handle to NULL. If successful, it will be reassigned */
#if USE_GLOBAL_TUNER
*
hMT2063
=
NULL
;
/*
** If this is our first tuner, initialize the address fields and
** the list of available control blocks.
*/
if
(
nMT2063OpenTuners
==
0
)
{
for
(
i
=
MT2063_CNT
-
1
;
i
>=
0
;
i
--
)
{
MT2063_Info
[
i
].
handle
=
NULL
;
MT2063_Info
[
i
].
address
=
MAX_UDATA
;
MT2063_Info
[
i
].
rcvr_mode
=
MT2063_CABLE_QAM
;
MT2063_Info
[
i
].
hUserData
=
NULL
;
MT2063_Avail
[
i
]
=
&
MT2063_Info
[
i
];
}
}
/*
** Look for an existing MT2063_State_t entry with this address.
*/
for
(
i
=
MT2063_CNT
-
1
;
i
>=
0
;
i
--
)
{
/*
** If an open'ed handle provided, we'll re-initialize that structure.
**
** We recognize an open tuner because the address and hUserData are
** the same as one that has already been opened
*/
if
((
MT2063_Info
[
i
].
address
==
MT2063_Addr
)
&&
(
MT2063_Info
[
i
].
hUserData
==
hUserData
))
{
pInfo
=
&
MT2063_Info
[
i
];
break
;
}
}
/* If not found, choose an empty spot. */
if
(
pInfo
==
NULL
)
{
/* Check to see that we're not over-allocating */
if
(
nMT2063OpenTuners
==
MT2063_CNT
)
{
return
MT2063_TUNER_CNT_ERR
;
}
/* Use the next available block from the list */
pInfo
=
MT2063_Avail
[
nMT2063OpenTuners
];
nMT2063OpenTuners
++
;
}
#else
if
(
state
->
MT2063_init
==
false
)
{
pInfo
=
kzalloc
(
sizeof
(
struct
MT2063_Info_t
),
GFP_KERNEL
);
if
(
pInfo
==
NULL
)
{
...
...
@@ -1648,7 +1572,6 @@ u32 MT2063_Open(u32 MT2063_Addr, void ** hMT2063, void *hUserData)
}
else
{
pInfo
=
*
hMT2063
;
}
#endif
if
(
MT2063_NO_ERROR
(
status
))
{
status
|=
MT2063_RegisterTuner
(
&
pInfo
->
AS_Data
);
...
...
@@ -1714,13 +1637,9 @@ u32 MT2063_Close(void *hMT2063)
pInfo
->
handle
=
NULL
;
pInfo
->
address
=
MAX_UDATA
;
pInfo
->
hUserData
=
NULL
;
#if USE_GLOBAL_TUNER
nMT2063OpenTuners
--
;
MT2063_Avail
[
nMT2063OpenTuners
]
=
pInfo
;
/* Return control block to available list */
#else
//kfree(pInfo);
//pInfo = NULL;
#endif
return
MT2063_OK
;
}
...
...
drivers/media/common/tuners/mt2063.h
浏览文件 @
a0813ea3
...
...
@@ -81,7 +81,6 @@
/*
* Data Types
*/
#define MT2060_CNT 10
#define MAX_UDATA (4294967295)
/* max value storable in u32 */
...
...
@@ -96,11 +95,8 @@
* #define MT2121_CNT (3)
*/
#define MT2063_CNT (1)
#if !defined( MT2063_TUNER_CNT )
#define MT2063_TUNER_CNT (1)
/* total num of MicroTuner tuners */
#endif
#define MT2063_I2C (0xC0)
u32
MT2063_WriteSub
(
void
*
hUserData
,
...
...
@@ -113,11 +109,7 @@ u32 MT2063_ReadSub(void *hUserData,
void
MT2063_Sleep
(
void
*
hUserData
,
u32
nMinDelayTime
);
#if defined(MT2060_CNT)
#if MT2060_CNT > 0
u32
MT2060_TunerGain
(
void
*
hUserData
,
s32
*
pMeas
);
#endif
#endif
/*
* Constant defining the version of the following structure
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录