diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-07-20 19:21:42 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-01-04 19:16:15 -0500 |
commit | 0ff4843218d15ccb76f0e17ea5203673d00cd50b (patch) | |
tree | ae3b916f83ece0ceb26286c58101f099ff61e133 /drivers/media/common/tuners | |
parent | 4dca4efc10af8e9c4d58d4c0165abf69187da726 (diff) |
[media] mt2063: Move code from mt2063_cfg.h
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/common/tuners')
-rw-r--r-- | drivers/media/common/tuners/mt2063.c | 129 | ||||
-rw-r--r-- | drivers/media/common/tuners/mt2063_cfg.h | 122 |
2 files changed, 129 insertions, 122 deletions
diff --git a/drivers/media/common/tuners/mt2063.c b/drivers/media/common/tuners/mt2063.c index 0d64eb839350..1d36e51c4048 100644 --- a/drivers/media/common/tuners/mt2063.c +++ b/drivers/media/common/tuners/mt2063.c | |||
@@ -13,6 +13,135 @@ | |||
13 | static unsigned int verbose; | 13 | static unsigned int verbose; |
14 | module_param(verbose, int, 0644); | 14 | module_param(verbose, int, 0644); |
15 | 15 | ||
16 | |||
17 | /*****************/ | ||
18 | /* From drivers/media/common/tuners/mt2063_cfg.h */ | ||
19 | |||
20 | static unsigned int mt2063_setTune(struct dvb_frontend *fe, UData_t f_in, | ||
21 | UData_t bw_in, | ||
22 | enum MTTune_atv_standard tv_type) | ||
23 | { | ||
24 | //return (int)MT_Tune_atv(h, f_in, bw_in, tv_type); | ||
25 | |||
26 | struct dvb_frontend_ops *frontend_ops = NULL; | ||
27 | struct dvb_tuner_ops *tuner_ops = NULL; | ||
28 | struct tuner_state t_state; | ||
29 | struct mt2063_state *mt2063State = fe->tuner_priv; | ||
30 | int err = 0; | ||
31 | |||
32 | t_state.frequency = f_in; | ||
33 | t_state.bandwidth = bw_in; | ||
34 | mt2063State->tv_type = tv_type; | ||
35 | if (&fe->ops) | ||
36 | frontend_ops = &fe->ops; | ||
37 | if (&frontend_ops->tuner_ops) | ||
38 | tuner_ops = &frontend_ops->tuner_ops; | ||
39 | if (tuner_ops->set_state) { | ||
40 | if ((err = | ||
41 | tuner_ops->set_state(fe, DVBFE_TUNER_FREQUENCY, | ||
42 | &t_state)) < 0) { | ||
43 | printk("%s: Invalid parameter\n", __func__); | ||
44 | return err; | ||
45 | } | ||
46 | } | ||
47 | |||
48 | return err; | ||
49 | } | ||
50 | |||
51 | static unsigned int mt2063_lockStatus(struct dvb_frontend *fe) | ||
52 | { | ||
53 | struct dvb_frontend_ops *frontend_ops = &fe->ops; | ||
54 | struct dvb_tuner_ops *tuner_ops = &frontend_ops->tuner_ops; | ||
55 | struct tuner_state t_state; | ||
56 | int err = 0; | ||
57 | |||
58 | if (&fe->ops) | ||
59 | frontend_ops = &fe->ops; | ||
60 | if (&frontend_ops->tuner_ops) | ||
61 | tuner_ops = &frontend_ops->tuner_ops; | ||
62 | if (tuner_ops->get_state) { | ||
63 | if ((err = | ||
64 | tuner_ops->get_state(fe, DVBFE_TUNER_REFCLOCK, | ||
65 | &t_state)) < 0) { | ||
66 | printk("%s: Invalid parameter\n", __func__); | ||
67 | return err; | ||
68 | } | ||
69 | } | ||
70 | return err; | ||
71 | } | ||
72 | |||
73 | static unsigned int tuner_MT2063_Open(struct dvb_frontend *fe) | ||
74 | { | ||
75 | struct dvb_frontend_ops *frontend_ops = &fe->ops; | ||
76 | struct dvb_tuner_ops *tuner_ops = &frontend_ops->tuner_ops; | ||
77 | struct tuner_state t_state; | ||
78 | int err = 0; | ||
79 | |||
80 | if (&fe->ops) | ||
81 | frontend_ops = &fe->ops; | ||
82 | if (&frontend_ops->tuner_ops) | ||
83 | tuner_ops = &frontend_ops->tuner_ops; | ||
84 | if (tuner_ops->set_state) { | ||
85 | if ((err = | ||
86 | tuner_ops->set_state(fe, DVBFE_TUNER_OPEN, | ||
87 | &t_state)) < 0) { | ||
88 | printk("%s: Invalid parameter\n", __func__); | ||
89 | return err; | ||
90 | } | ||
91 | } | ||
92 | |||
93 | return err; | ||
94 | } | ||
95 | |||
96 | static unsigned int tuner_MT2063_SoftwareShutdown(struct dvb_frontend *fe) | ||
97 | { | ||
98 | struct dvb_frontend_ops *frontend_ops = &fe->ops; | ||
99 | struct dvb_tuner_ops *tuner_ops = &frontend_ops->tuner_ops; | ||
100 | struct tuner_state t_state; | ||
101 | int err = 0; | ||
102 | |||
103 | if (&fe->ops) | ||
104 | frontend_ops = &fe->ops; | ||
105 | if (&frontend_ops->tuner_ops) | ||
106 | tuner_ops = &frontend_ops->tuner_ops; | ||
107 | if (tuner_ops->set_state) { | ||
108 | if ((err = | ||
109 | tuner_ops->set_state(fe, DVBFE_TUNER_SOFTWARE_SHUTDOWN, | ||
110 | &t_state)) < 0) { | ||
111 | printk("%s: Invalid parameter\n", __func__); | ||
112 | return err; | ||
113 | } | ||
114 | } | ||
115 | |||
116 | return err; | ||
117 | } | ||
118 | |||
119 | static unsigned int tuner_MT2063_ClearPowerMaskBits(struct dvb_frontend *fe) | ||
120 | { | ||
121 | struct dvb_frontend_ops *frontend_ops = &fe->ops; | ||
122 | struct dvb_tuner_ops *tuner_ops = &frontend_ops->tuner_ops; | ||
123 | struct tuner_state t_state; | ||
124 | int err = 0; | ||
125 | |||
126 | if (&fe->ops) | ||
127 | frontend_ops = &fe->ops; | ||
128 | if (&frontend_ops->tuner_ops) | ||
129 | tuner_ops = &frontend_ops->tuner_ops; | ||
130 | if (tuner_ops->set_state) { | ||
131 | if ((err = | ||
132 | tuner_ops->set_state(fe, DVBFE_TUNER_CLEAR_POWER_MASKBITS, | ||
133 | &t_state)) < 0) { | ||
134 | printk("%s: Invalid parameter\n", __func__); | ||
135 | return err; | ||
136 | } | ||
137 | } | ||
138 | |||
139 | return err; | ||
140 | } | ||
141 | |||
142 | /*****************/ | ||
143 | |||
144 | |||
16 | //i2c operation | 145 | //i2c operation |
17 | static int mt2063_writeregs(struct mt2063_state *state, u8 reg1, | 146 | static int mt2063_writeregs(struct mt2063_state *state, u8 reg1, |
18 | u8 * data, int len) | 147 | u8 * data, int len) |
diff --git a/drivers/media/common/tuners/mt2063_cfg.h b/drivers/media/common/tuners/mt2063_cfg.h deleted file mode 100644 index 5f80f02ed090..000000000000 --- a/drivers/media/common/tuners/mt2063_cfg.h +++ /dev/null | |||
@@ -1,122 +0,0 @@ | |||
1 | |||
2 | static unsigned int mt2063_setTune(struct dvb_frontend *fe, UData_t f_in, | ||
3 | UData_t bw_in, | ||
4 | enum MTTune_atv_standard tv_type) | ||
5 | { | ||
6 | //return (int)MT_Tune_atv(h, f_in, bw_in, tv_type); | ||
7 | |||
8 | struct dvb_frontend_ops *frontend_ops = NULL; | ||
9 | struct dvb_tuner_ops *tuner_ops = NULL; | ||
10 | struct tuner_state t_state; | ||
11 | struct mt2063_state *mt2063State = fe->tuner_priv; | ||
12 | int err = 0; | ||
13 | |||
14 | t_state.frequency = f_in; | ||
15 | t_state.bandwidth = bw_in; | ||
16 | mt2063State->tv_type = tv_type; | ||
17 | if (&fe->ops) | ||
18 | frontend_ops = &fe->ops; | ||
19 | if (&frontend_ops->tuner_ops) | ||
20 | tuner_ops = &frontend_ops->tuner_ops; | ||
21 | if (tuner_ops->set_state) { | ||
22 | if ((err = | ||
23 | tuner_ops->set_state(fe, DVBFE_TUNER_FREQUENCY, | ||
24 | &t_state)) < 0) { | ||
25 | printk("%s: Invalid parameter\n", __func__); | ||
26 | return err; | ||
27 | } | ||
28 | } | ||
29 | |||
30 | return err; | ||
31 | } | ||
32 | |||
33 | static unsigned int mt2063_lockStatus(struct dvb_frontend *fe) | ||
34 | { | ||
35 | struct dvb_frontend_ops *frontend_ops = &fe->ops; | ||
36 | struct dvb_tuner_ops *tuner_ops = &frontend_ops->tuner_ops; | ||
37 | struct tuner_state t_state; | ||
38 | int err = 0; | ||
39 | |||
40 | if (&fe->ops) | ||
41 | frontend_ops = &fe->ops; | ||
42 | if (&frontend_ops->tuner_ops) | ||
43 | tuner_ops = &frontend_ops->tuner_ops; | ||
44 | if (tuner_ops->get_state) { | ||
45 | if ((err = | ||
46 | tuner_ops->get_state(fe, DVBFE_TUNER_REFCLOCK, | ||
47 | &t_state)) < 0) { | ||
48 | printk("%s: Invalid parameter\n", __func__); | ||
49 | return err; | ||
50 | } | ||
51 | } | ||
52 | return err; | ||
53 | } | ||
54 | |||
55 | static unsigned int tuner_MT2063_Open(struct dvb_frontend *fe) | ||
56 | { | ||
57 | struct dvb_frontend_ops *frontend_ops = &fe->ops; | ||
58 | struct dvb_tuner_ops *tuner_ops = &frontend_ops->tuner_ops; | ||
59 | struct tuner_state t_state; | ||
60 | int err = 0; | ||
61 | |||
62 | if (&fe->ops) | ||
63 | frontend_ops = &fe->ops; | ||
64 | if (&frontend_ops->tuner_ops) | ||
65 | tuner_ops = &frontend_ops->tuner_ops; | ||
66 | if (tuner_ops->set_state) { | ||
67 | if ((err = | ||
68 | tuner_ops->set_state(fe, DVBFE_TUNER_OPEN, | ||
69 | &t_state)) < 0) { | ||
70 | printk("%s: Invalid parameter\n", __func__); | ||
71 | return err; | ||
72 | } | ||
73 | } | ||
74 | |||
75 | return err; | ||
76 | } | ||
77 | |||
78 | static unsigned int tuner_MT2063_SoftwareShutdown(struct dvb_frontend *fe) | ||
79 | { | ||
80 | struct dvb_frontend_ops *frontend_ops = &fe->ops; | ||
81 | struct dvb_tuner_ops *tuner_ops = &frontend_ops->tuner_ops; | ||
82 | struct tuner_state t_state; | ||
83 | int err = 0; | ||
84 | |||
85 | if (&fe->ops) | ||
86 | frontend_ops = &fe->ops; | ||
87 | if (&frontend_ops->tuner_ops) | ||
88 | tuner_ops = &frontend_ops->tuner_ops; | ||
89 | if (tuner_ops->set_state) { | ||
90 | if ((err = | ||
91 | tuner_ops->set_state(fe, DVBFE_TUNER_SOFTWARE_SHUTDOWN, | ||
92 | &t_state)) < 0) { | ||
93 | printk("%s: Invalid parameter\n", __func__); | ||
94 | return err; | ||
95 | } | ||
96 | } | ||
97 | |||
98 | return err; | ||
99 | } | ||
100 | |||
101 | static unsigned int tuner_MT2063_ClearPowerMaskBits(struct dvb_frontend *fe) | ||
102 | { | ||
103 | struct dvb_frontend_ops *frontend_ops = &fe->ops; | ||
104 | struct dvb_tuner_ops *tuner_ops = &frontend_ops->tuner_ops; | ||
105 | struct tuner_state t_state; | ||
106 | int err = 0; | ||
107 | |||
108 | if (&fe->ops) | ||
109 | frontend_ops = &fe->ops; | ||
110 | if (&frontend_ops->tuner_ops) | ||
111 | tuner_ops = &frontend_ops->tuner_ops; | ||
112 | if (tuner_ops->set_state) { | ||
113 | if ((err = | ||
114 | tuner_ops->set_state(fe, DVBFE_TUNER_CLEAR_POWER_MASKBITS, | ||
115 | &t_state)) < 0) { | ||
116 | printk("%s: Invalid parameter\n", __func__); | ||
117 | return err; | ||
118 | } | ||
119 | } | ||
120 | |||
121 | return err; | ||
122 | } | ||