aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorAndreas Oberritter <obi@linuxtv.org>2011-05-08 19:03:41 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-05-20 18:53:31 -0400
commitbbe880b4a7c66ba14b67ee7acfbaaaa1c7be2d03 (patch)
treec0461e06aeb084a74cb8ae6dacdd8be87109c69a /drivers/media
parenta5959dbea37973a2440eeba39fba32c79d862ec2 (diff)
[media] DVB: allow to read back of detected parameters through S2API
Signed-off-by: Andreas Oberritter <obi@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/dvb/dvb-core/dvb_frontend.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/drivers/media/dvb/dvb-core/dvb_frontend.c b/drivers/media/dvb/dvb-core/dvb_frontend.c
index 3666529e2dd4..98278041d75f 100644
--- a/drivers/media/dvb/dvb-core/dvb_frontend.c
+++ b/drivers/media/dvb/dvb-core/dvb_frontend.c
@@ -1023,10 +1023,9 @@ static int is_legacy_delivery_system(fe_delivery_system_t s)
1023 * it's being used for the legacy or new API, reducing code and complexity. 1023 * it's being used for the legacy or new API, reducing code and complexity.
1024 */ 1024 */
1025static void dtv_property_cache_sync(struct dvb_frontend *fe, 1025static void dtv_property_cache_sync(struct dvb_frontend *fe,
1026 struct dvb_frontend_parameters *p) 1026 struct dtv_frontend_properties *c,
1027 const struct dvb_frontend_parameters *p)
1027{ 1028{
1028 struct dtv_frontend_properties *c = &fe->dtv_property_cache;
1029
1030 c->frequency = p->frequency; 1029 c->frequency = p->frequency;
1031 c->inversion = p->inversion; 1030 c->inversion = p->inversion;
1032 1031
@@ -1200,8 +1199,20 @@ static int dtv_property_process_get(struct dvb_frontend *fe,
1200 struct file *file) 1199 struct file *file)
1201{ 1200{
1202 const struct dtv_frontend_properties *c = &fe->dtv_property_cache; 1201 const struct dtv_frontend_properties *c = &fe->dtv_property_cache;
1202 struct dvb_frontend_private *fepriv = fe->frontend_priv;
1203 struct dtv_frontend_properties cdetected;
1203 int r; 1204 int r;
1204 1205
1206 /*
1207 * If the driver implements a get_frontend function, then convert
1208 * detected parameters to S2API properties.
1209 */
1210 if (fe->ops.get_frontend) {
1211 cdetected = *c;
1212 dtv_property_cache_sync(fe, &cdetected, &fepriv->parameters_out);
1213 c = &cdetected;
1214 }
1215
1205 switch(tvp->cmd) { 1216 switch(tvp->cmd) {
1206 case DTV_FREQUENCY: 1217 case DTV_FREQUENCY:
1207 tvp->u.data = c->frequency; 1218 tvp->u.data = c->frequency;
@@ -1812,7 +1823,7 @@ static int dvb_frontend_ioctl_legacy(struct file *file,
1812 1823
1813 memcpy (&fepriv->parameters_in, parg, 1824 memcpy (&fepriv->parameters_in, parg,
1814 sizeof (struct dvb_frontend_parameters)); 1825 sizeof (struct dvb_frontend_parameters));
1815 dtv_property_cache_sync(fe, &fepriv->parameters_in); 1826 dtv_property_cache_sync(fe, c, &fepriv->parameters_in);
1816 } 1827 }
1817 1828
1818 memset(&fetunesettings, 0, sizeof(struct dvb_frontend_tune_settings)); 1829 memset(&fetunesettings, 0, sizeof(struct dvb_frontend_tune_settings));