Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
0ff48432
Commit
0ff48432
authored
Jul 20, 2011
by
Mauro Carvalho Chehab
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[media] mt2063: Move code from mt2063_cfg.h
Signed-off-by:
Mauro Carvalho Chehab
<
mchehab@redhat.com
>
parent
4dca4efc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
129 additions
and
122 deletions
+129
-122
drivers/media/common/tuners/mt2063.c
drivers/media/common/tuners/mt2063.c
+129
-0
drivers/media/common/tuners/mt2063_cfg.h
drivers/media/common/tuners/mt2063_cfg.h
+0
-122
No files found.
drivers/media/common/tuners/mt2063.c
View file @
0ff48432
...
...
@@ -13,6 +13,135 @@
static
unsigned
int
verbose
;
module_param
(
verbose
,
int
,
0644
);
/*****************/
/* From drivers/media/common/tuners/mt2063_cfg.h */
static
unsigned
int
mt2063_setTune
(
struct
dvb_frontend
*
fe
,
UData_t
f_in
,
UData_t
bw_in
,
enum
MTTune_atv_standard
tv_type
)
{
//return (int)MT_Tune_atv(h, f_in, bw_in, tv_type);
struct
dvb_frontend_ops
*
frontend_ops
=
NULL
;
struct
dvb_tuner_ops
*
tuner_ops
=
NULL
;
struct
tuner_state
t_state
;
struct
mt2063_state
*
mt2063State
=
fe
->
tuner_priv
;
int
err
=
0
;
t_state
.
frequency
=
f_in
;
t_state
.
bandwidth
=
bw_in
;
mt2063State
->
tv_type
=
tv_type
;
if
(
&
fe
->
ops
)
frontend_ops
=
&
fe
->
ops
;
if
(
&
frontend_ops
->
tuner_ops
)
tuner_ops
=
&
frontend_ops
->
tuner_ops
;
if
(
tuner_ops
->
set_state
)
{
if
((
err
=
tuner_ops
->
set_state
(
fe
,
DVBFE_TUNER_FREQUENCY
,
&
t_state
))
<
0
)
{
printk
(
"%s: Invalid parameter
\n
"
,
__func__
);
return
err
;
}
}
return
err
;
}
static
unsigned
int
mt2063_lockStatus
(
struct
dvb_frontend
*
fe
)
{
struct
dvb_frontend_ops
*
frontend_ops
=
&
fe
->
ops
;
struct
dvb_tuner_ops
*
tuner_ops
=
&
frontend_ops
->
tuner_ops
;
struct
tuner_state
t_state
;
int
err
=
0
;
if
(
&
fe
->
ops
)
frontend_ops
=
&
fe
->
ops
;
if
(
&
frontend_ops
->
tuner_ops
)
tuner_ops
=
&
frontend_ops
->
tuner_ops
;
if
(
tuner_ops
->
get_state
)
{
if
((
err
=
tuner_ops
->
get_state
(
fe
,
DVBFE_TUNER_REFCLOCK
,
&
t_state
))
<
0
)
{
printk
(
"%s: Invalid parameter
\n
"
,
__func__
);
return
err
;
}
}
return
err
;
}
static
unsigned
int
tuner_MT2063_Open
(
struct
dvb_frontend
*
fe
)
{
struct
dvb_frontend_ops
*
frontend_ops
=
&
fe
->
ops
;
struct
dvb_tuner_ops
*
tuner_ops
=
&
frontend_ops
->
tuner_ops
;
struct
tuner_state
t_state
;
int
err
=
0
;
if
(
&
fe
->
ops
)
frontend_ops
=
&
fe
->
ops
;
if
(
&
frontend_ops
->
tuner_ops
)
tuner_ops
=
&
frontend_ops
->
tuner_ops
;
if
(
tuner_ops
->
set_state
)
{
if
((
err
=
tuner_ops
->
set_state
(
fe
,
DVBFE_TUNER_OPEN
,
&
t_state
))
<
0
)
{
printk
(
"%s: Invalid parameter
\n
"
,
__func__
);
return
err
;
}
}
return
err
;
}
static
unsigned
int
tuner_MT2063_SoftwareShutdown
(
struct
dvb_frontend
*
fe
)
{
struct
dvb_frontend_ops
*
frontend_ops
=
&
fe
->
ops
;
struct
dvb_tuner_ops
*
tuner_ops
=
&
frontend_ops
->
tuner_ops
;
struct
tuner_state
t_state
;
int
err
=
0
;
if
(
&
fe
->
ops
)
frontend_ops
=
&
fe
->
ops
;
if
(
&
frontend_ops
->
tuner_ops
)
tuner_ops
=
&
frontend_ops
->
tuner_ops
;
if
(
tuner_ops
->
set_state
)
{
if
((
err
=
tuner_ops
->
set_state
(
fe
,
DVBFE_TUNER_SOFTWARE_SHUTDOWN
,
&
t_state
))
<
0
)
{
printk
(
"%s: Invalid parameter
\n
"
,
__func__
);
return
err
;
}
}
return
err
;
}
static
unsigned
int
tuner_MT2063_ClearPowerMaskBits
(
struct
dvb_frontend
*
fe
)
{
struct
dvb_frontend_ops
*
frontend_ops
=
&
fe
->
ops
;
struct
dvb_tuner_ops
*
tuner_ops
=
&
frontend_ops
->
tuner_ops
;
struct
tuner_state
t_state
;
int
err
=
0
;
if
(
&
fe
->
ops
)
frontend_ops
=
&
fe
->
ops
;
if
(
&
frontend_ops
->
tuner_ops
)
tuner_ops
=
&
frontend_ops
->
tuner_ops
;
if
(
tuner_ops
->
set_state
)
{
if
((
err
=
tuner_ops
->
set_state
(
fe
,
DVBFE_TUNER_CLEAR_POWER_MASKBITS
,
&
t_state
))
<
0
)
{
printk
(
"%s: Invalid parameter
\n
"
,
__func__
);
return
err
;
}
}
return
err
;
}
/*****************/
//i2c operation
static
int
mt2063_writeregs
(
struct
mt2063_state
*
state
,
u8
reg1
,
u8
*
data
,
int
len
)
...
...
drivers/media/common/tuners/mt2063_cfg.h
deleted
100644 → 0
View file @
4dca4efc
static
unsigned
int
mt2063_setTune
(
struct
dvb_frontend
*
fe
,
UData_t
f_in
,
UData_t
bw_in
,
enum
MTTune_atv_standard
tv_type
)
{
//return (int)MT_Tune_atv(h, f_in, bw_in, tv_type);
struct
dvb_frontend_ops
*
frontend_ops
=
NULL
;
struct
dvb_tuner_ops
*
tuner_ops
=
NULL
;
struct
tuner_state
t_state
;
struct
mt2063_state
*
mt2063State
=
fe
->
tuner_priv
;
int
err
=
0
;
t_state
.
frequency
=
f_in
;
t_state
.
bandwidth
=
bw_in
;
mt2063State
->
tv_type
=
tv_type
;
if
(
&
fe
->
ops
)
frontend_ops
=
&
fe
->
ops
;
if
(
&
frontend_ops
->
tuner_ops
)
tuner_ops
=
&
frontend_ops
->
tuner_ops
;
if
(
tuner_ops
->
set_state
)
{
if
((
err
=
tuner_ops
->
set_state
(
fe
,
DVBFE_TUNER_FREQUENCY
,
&
t_state
))
<
0
)
{
printk
(
"%s: Invalid parameter
\n
"
,
__func__
);
return
err
;
}
}
return
err
;
}
static
unsigned
int
mt2063_lockStatus
(
struct
dvb_frontend
*
fe
)
{
struct
dvb_frontend_ops
*
frontend_ops
=
&
fe
->
ops
;
struct
dvb_tuner_ops
*
tuner_ops
=
&
frontend_ops
->
tuner_ops
;
struct
tuner_state
t_state
;
int
err
=
0
;
if
(
&
fe
->
ops
)
frontend_ops
=
&
fe
->
ops
;
if
(
&
frontend_ops
->
tuner_ops
)
tuner_ops
=
&
frontend_ops
->
tuner_ops
;
if
(
tuner_ops
->
get_state
)
{
if
((
err
=
tuner_ops
->
get_state
(
fe
,
DVBFE_TUNER_REFCLOCK
,
&
t_state
))
<
0
)
{
printk
(
"%s: Invalid parameter
\n
"
,
__func__
);
return
err
;
}
}
return
err
;
}
static
unsigned
int
tuner_MT2063_Open
(
struct
dvb_frontend
*
fe
)
{
struct
dvb_frontend_ops
*
frontend_ops
=
&
fe
->
ops
;
struct
dvb_tuner_ops
*
tuner_ops
=
&
frontend_ops
->
tuner_ops
;
struct
tuner_state
t_state
;
int
err
=
0
;
if
(
&
fe
->
ops
)
frontend_ops
=
&
fe
->
ops
;
if
(
&
frontend_ops
->
tuner_ops
)
tuner_ops
=
&
frontend_ops
->
tuner_ops
;
if
(
tuner_ops
->
set_state
)
{
if
((
err
=
tuner_ops
->
set_state
(
fe
,
DVBFE_TUNER_OPEN
,
&
t_state
))
<
0
)
{
printk
(
"%s: Invalid parameter
\n
"
,
__func__
);
return
err
;
}
}
return
err
;
}
static
unsigned
int
tuner_MT2063_SoftwareShutdown
(
struct
dvb_frontend
*
fe
)
{
struct
dvb_frontend_ops
*
frontend_ops
=
&
fe
->
ops
;
struct
dvb_tuner_ops
*
tuner_ops
=
&
frontend_ops
->
tuner_ops
;
struct
tuner_state
t_state
;
int
err
=
0
;
if
(
&
fe
->
ops
)
frontend_ops
=
&
fe
->
ops
;
if
(
&
frontend_ops
->
tuner_ops
)
tuner_ops
=
&
frontend_ops
->
tuner_ops
;
if
(
tuner_ops
->
set_state
)
{
if
((
err
=
tuner_ops
->
set_state
(
fe
,
DVBFE_TUNER_SOFTWARE_SHUTDOWN
,
&
t_state
))
<
0
)
{
printk
(
"%s: Invalid parameter
\n
"
,
__func__
);
return
err
;
}
}
return
err
;
}
static
unsigned
int
tuner_MT2063_ClearPowerMaskBits
(
struct
dvb_frontend
*
fe
)
{
struct
dvb_frontend_ops
*
frontend_ops
=
&
fe
->
ops
;
struct
dvb_tuner_ops
*
tuner_ops
=
&
frontend_ops
->
tuner_ops
;
struct
tuner_state
t_state
;
int
err
=
0
;
if
(
&
fe
->
ops
)
frontend_ops
=
&
fe
->
ops
;
if
(
&
frontend_ops
->
tuner_ops
)
tuner_ops
=
&
frontend_ops
->
tuner_ops
;
if
(
tuner_ops
->
set_state
)
{
if
((
err
=
tuner_ops
->
set_state
(
fe
,
DVBFE_TUNER_CLEAR_POWER_MASKBITS
,
&
t_state
))
<
0
)
{
printk
(
"%s: Invalid parameter
\n
"
,
__func__
);
return
err
;
}
}
return
err
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment