diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-12-26 14:00:42 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-12-31 06:57:16 -0500 |
commit | e4b40030bf14986b8b295b4bdebe252b6a512528 (patch) | |
tree | 60ecfb998ce520a584493760adb7b6b51701d4c6 | |
parent | 4fa102d5cc5b412fa3bc7cc8c24e4d9052e4f693 (diff) |
[media] vp7045-fe: convert set_fontend to use DVBv5 parameters
Instead of using dvb_frontend_parameters struct, that were
designed for a subset of the supported standards, use the DVBv5
cache information.
Also, fill the supported delivery systems at dvb_frontend_ops
struct.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r-- | drivers/media/dvb/dvb-usb/vp7045-fe.c | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/drivers/media/dvb/dvb-usb/vp7045-fe.c b/drivers/media/dvb/dvb-usb/vp7045-fe.c index f8b5d8c86d7b..ecbd62384a68 100644 --- a/drivers/media/dvb/dvb-usb/vp7045-fe.c +++ b/drivers/media/dvb/dvb-usb/vp7045-fe.c | |||
@@ -103,9 +103,9 @@ static int vp7045_fe_get_tune_settings(struct dvb_frontend* fe, struct dvb_front | |||
103 | return 0; | 103 | return 0; |
104 | } | 104 | } |
105 | 105 | ||
106 | static int vp7045_fe_set_frontend(struct dvb_frontend* fe, | 106 | static int vp7045_fe_set_frontend(struct dvb_frontend *fe) |
107 | struct dvb_frontend_parameters *fep) | ||
108 | { | 107 | { |
108 | struct dtv_frontend_properties *fep = &fe->dtv_property_cache; | ||
109 | struct vp7045_fe_state *state = fe->demodulator_priv; | 109 | struct vp7045_fe_state *state = fe->demodulator_priv; |
110 | u8 buf[5]; | 110 | u8 buf[5]; |
111 | u32 freq = fep->frequency / 1000; | 111 | u32 freq = fep->frequency / 1000; |
@@ -115,25 +115,24 @@ static int vp7045_fe_set_frontend(struct dvb_frontend* fe, | |||
115 | buf[2] = freq & 0xff; | 115 | buf[2] = freq & 0xff; |
116 | buf[3] = 0; | 116 | buf[3] = 0; |
117 | 117 | ||
118 | switch (fep->u.ofdm.bandwidth) { | 118 | switch (fep->bandwidth_hz) { |
119 | case BANDWIDTH_8_MHZ: buf[4] = 8; break; | 119 | case 8000000: |
120 | case BANDWIDTH_7_MHZ: buf[4] = 7; break; | 120 | buf[4] = 8; |
121 | case BANDWIDTH_6_MHZ: buf[4] = 6; break; | 121 | break; |
122 | case BANDWIDTH_AUTO: return -EOPNOTSUPP; | 122 | case 7000000: |
123 | default: | 123 | buf[4] = 7; |
124 | return -EINVAL; | 124 | break; |
125 | case 6000000: | ||
126 | buf[4] = 6; | ||
127 | break; | ||
128 | default: | ||
129 | return -EINVAL; | ||
125 | } | 130 | } |
126 | 131 | ||
127 | vp7045_usb_op(state->d,LOCK_TUNER_COMMAND,buf,5,NULL,0,200); | 132 | vp7045_usb_op(state->d,LOCK_TUNER_COMMAND,buf,5,NULL,0,200); |
128 | return 0; | 133 | return 0; |
129 | } | 134 | } |
130 | 135 | ||
131 | static int vp7045_fe_get_frontend(struct dvb_frontend* fe, | ||
132 | struct dvb_frontend_parameters *fep) | ||
133 | { | ||
134 | return 0; | ||
135 | } | ||
136 | |||
137 | static void vp7045_fe_release(struct dvb_frontend* fe) | 136 | static void vp7045_fe_release(struct dvb_frontend* fe) |
138 | { | 137 | { |
139 | struct vp7045_fe_state *state = fe->demodulator_priv; | 138 | struct vp7045_fe_state *state = fe->demodulator_priv; |
@@ -159,6 +158,7 @@ error: | |||
159 | 158 | ||
160 | 159 | ||
161 | static struct dvb_frontend_ops vp7045_fe_ops = { | 160 | static struct dvb_frontend_ops vp7045_fe_ops = { |
161 | .delsys = { SYS_DVBT }, | ||
162 | .info = { | 162 | .info = { |
163 | .name = "Twinhan VP7045/46 USB DVB-T", | 163 | .name = "Twinhan VP7045/46 USB DVB-T", |
164 | .type = FE_OFDM, | 164 | .type = FE_OFDM, |
@@ -180,8 +180,7 @@ static struct dvb_frontend_ops vp7045_fe_ops = { | |||
180 | .init = vp7045_fe_init, | 180 | .init = vp7045_fe_init, |
181 | .sleep = vp7045_fe_sleep, | 181 | .sleep = vp7045_fe_sleep, |
182 | 182 | ||
183 | .set_frontend_legacy = vp7045_fe_set_frontend, | 183 | .set_frontend = vp7045_fe_set_frontend, |
184 | .get_frontend_legacy = vp7045_fe_get_frontend, | ||
185 | .get_tune_settings = vp7045_fe_get_tune_settings, | 184 | .get_tune_settings = vp7045_fe_get_tune_settings, |
186 | 185 | ||
187 | .read_status = vp7045_fe_read_status, | 186 | .read_status = vp7045_fe_read_status, |