From bc9cd2736b34619b58961d506210fe0e6dfaa27d Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Tue, 20 Dec 2011 15:31:54 -0300 Subject: [media] Rename set_frontend fops to set_frontend_legacy Passing DVBv3 parameters to set_frontend is not fun, as the core doesn't have any way to know if the driver is using the v3 or v5 parameters. So, rename the callback and add a new one to allow distinguish between a mixed v3/v5 paramenter call from a pure v5 call. After having all frontends to use the new way, the legacy call can be removed. Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb/firewire/firedtv-fe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/media/dvb/firewire/firedtv-fe.c') diff --git a/drivers/media/dvb/firewire/firedtv-fe.c b/drivers/media/dvb/firewire/firedtv-fe.c index 8748a61be73d..a887abc13f66 100644 --- a/drivers/media/dvb/firewire/firedtv-fe.c +++ b/drivers/media/dvb/firewire/firedtv-fe.c @@ -173,7 +173,7 @@ void fdtv_frontend_init(struct firedtv *fdtv, const char *name) ops->init = fdtv_dvb_init; ops->sleep = fdtv_sleep; - ops->set_frontend = fdtv_set_frontend; + ops->set_frontend_legacy = fdtv_set_frontend; ops->get_frontend = fdtv_get_frontend; ops->get_property = fdtv_get_property; -- cgit v1.2.1 From a689e3657d7e82c2271008553c709fc79fb2e038 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Thu, 22 Dec 2011 14:47:48 -0300 Subject: [media] dvb-core: add support for a DVBv5 get_frontend() callback Creates a DVBv5 get_frontend call, renaming the DVBv3 one to get_frontend_legacy(), while not all frontends are converted. After the conversion for all drivers, get_frontend_legacy() will be removed. Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb/firewire/firedtv-fe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/media/dvb/firewire/firedtv-fe.c') diff --git a/drivers/media/dvb/firewire/firedtv-fe.c b/drivers/media/dvb/firewire/firedtv-fe.c index a887abc13f66..1eb5ad3a5dfa 100644 --- a/drivers/media/dvb/firewire/firedtv-fe.c +++ b/drivers/media/dvb/firewire/firedtv-fe.c @@ -174,7 +174,7 @@ void fdtv_frontend_init(struct firedtv *fdtv, const char *name) ops->sleep = fdtv_sleep; ops->set_frontend_legacy = fdtv_set_frontend; - ops->get_frontend = fdtv_get_frontend; + ops->get_frontend_legacy = fdtv_get_frontend; ops->get_property = fdtv_get_property; ops->set_property = fdtv_set_property; -- cgit v1.2.1 From e11eb28876867ea4d5837e79da0fc95dc042979b Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Mon, 26 Dec 2011 16:12:40 -0300 Subject: [media] firedtv: 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. Cc: Stefan Richter Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb/firewire/firedtv-fe.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'drivers/media/dvb/firewire/firedtv-fe.c') diff --git a/drivers/media/dvb/firewire/firedtv-fe.c b/drivers/media/dvb/firewire/firedtv-fe.c index 1eb5ad3a5dfa..e1705a903f5c 100644 --- a/drivers/media/dvb/firewire/firedtv-fe.c +++ b/drivers/media/dvb/firewire/firedtv-fe.c @@ -141,16 +141,16 @@ static int fdtv_read_uncorrected_blocks(struct dvb_frontend *fe, u32 *ucblocks) return -EOPNOTSUPP; } -static int fdtv_set_frontend(struct dvb_frontend *fe, - struct dvb_frontend_parameters *params) +static int fdtv_set_frontend(struct dvb_frontend *fe) { + struct dtv_frontend_properties *p = &fe->dtv_property_cache; struct firedtv *fdtv = fe->sec_priv; - return avc_tuner_dsd(fdtv, params); + return avc_tuner_dsd(fdtv, p); } static int fdtv_get_frontend(struct dvb_frontend *fe, - struct dvb_frontend_parameters *params) + struct dtv_frontend_properties *params) { return -EOPNOTSUPP; } @@ -173,8 +173,8 @@ void fdtv_frontend_init(struct firedtv *fdtv, const char *name) ops->init = fdtv_dvb_init; ops->sleep = fdtv_sleep; - ops->set_frontend_legacy = fdtv_set_frontend; - ops->get_frontend_legacy = fdtv_get_frontend; + ops->set_frontend = fdtv_set_frontend; + ops->get_frontend = fdtv_get_frontend; ops->get_property = fdtv_get_property; ops->set_property = fdtv_set_property; @@ -192,6 +192,7 @@ void fdtv_frontend_init(struct firedtv *fdtv, const char *name) switch (fdtv->type) { case FIREDTV_DVB_S: + ops->delsys[0] = SYS_DVBS; fi->type = FE_QPSK; fi->frequency_min = 950000; @@ -211,6 +212,8 @@ void fdtv_frontend_init(struct firedtv *fdtv, const char *name) break; case FIREDTV_DVB_S2: + ops->delsys[0] = SYS_DVBS; + ops->delsys[1] = SYS_DVBS; fi->type = FE_QPSK; fi->frequency_min = 950000; @@ -231,6 +234,7 @@ void fdtv_frontend_init(struct firedtv *fdtv, const char *name) break; case FIREDTV_DVB_C: + ops->delsys[0] = SYS_DVBC_ANNEX_A; fi->type = FE_QAM; fi->frequency_min = 47000000; @@ -249,6 +253,7 @@ void fdtv_frontend_init(struct firedtv *fdtv, const char *name) break; case FIREDTV_DVB_T: + ops->delsys[0] = SYS_DVBT; fi->type = FE_OFDM; fi->frequency_min = 49000000; -- cgit v1.2.1 From 7c61d80a9bcfc3fdec8ffd75756cad6a64678229 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Fri, 30 Dec 2011 11:30:21 -0300 Subject: [media] dvb: don't require a parameter for get_frontend Just like set_frontend, use the dvb cache properties for get_frontend. This is more consistent, as both functions are now symetric. Also, at the places get_frontend is called, it makes sense to update the cache. Most of this patch were generated by this small perl script: while (<>) { $file .= $_; } if ($file =~ m/\.get_frontend\s*=\s*([\d\w_]+)/) { my $get = $1; $file =~ s/($get)(\s*\([^\,\)]+)\,\s*struct\s+dtv_frontend_properties\s*\*\s*([_\d\w]+)\)\s*\{/\1\2)\n{\n\tstruct dtv_frontend_properties *\3 = &fe->dtv_property_cache;/g; } print $file; Of course, the changes at dvb_frontend.[ch] were made by hand, as well as the changes on a few other places, where get_frontend() is called internally inside the driver. On some places, get_frontend() were just a void function. Those occurrences were removed, as the DVB core handles such cases. Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb/firewire/firedtv-fe.c | 20 -------------------- 1 file changed, 20 deletions(-) (limited to 'drivers/media/dvb/firewire/firedtv-fe.c') diff --git a/drivers/media/dvb/firewire/firedtv-fe.c b/drivers/media/dvb/firewire/firedtv-fe.c index e1705a903f5c..39f5caafd2be 100644 --- a/drivers/media/dvb/firewire/firedtv-fe.c +++ b/drivers/media/dvb/firewire/firedtv-fe.c @@ -149,22 +149,6 @@ static int fdtv_set_frontend(struct dvb_frontend *fe) return avc_tuner_dsd(fdtv, p); } -static int fdtv_get_frontend(struct dvb_frontend *fe, - struct dtv_frontend_properties *params) -{ - return -EOPNOTSUPP; -} - -static int fdtv_get_property(struct dvb_frontend *fe, struct dtv_property *tvp) -{ - return 0; -} - -static int fdtv_set_property(struct dvb_frontend *fe, struct dtv_property *tvp) -{ - return 0; -} - void fdtv_frontend_init(struct firedtv *fdtv, const char *name) { struct dvb_frontend_ops *ops = &fdtv->fe.ops; @@ -174,10 +158,6 @@ void fdtv_frontend_init(struct firedtv *fdtv, const char *name) ops->sleep = fdtv_sleep; ops->set_frontend = fdtv_set_frontend; - ops->get_frontend = fdtv_get_frontend; - - ops->get_property = fdtv_get_property; - ops->set_property = fdtv_set_property; ops->read_status = fdtv_read_status; ops->read_ber = fdtv_read_ber; -- cgit v1.2.1 From 6225f18b88b9ba6c6643aa8c1c96f51a9ad24380 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Wed, 4 Jan 2012 23:10:19 -0200 Subject: [media] Don't test for ops->info.type inside drivers Now, ops->info.type is handled inside the dvb_frontend core, only for DVBv3 calls, and according with the delivery system. So, drivers should not care or use it, otherwise, it may have issues with DVBv5 calls. The drivers that were still using it were detected via this small temporary hack: --- a/include/linux/dvb/frontend.h +++ b/include/linux/dvb/frontend.h @@ -29,13 +29,16 @@ #include typedef enum fe_type { +#if defined(__DVB_CORE__) || !defined (__KERNEL__) FE_QPSK, FE_QAM, FE_OFDM, FE_ATSC +#else +FE_FOOO +#endif } fe_type_t; - typedef enum fe_caps { FE_IS_STUPID = 0, FE_CAN_INVERSION_AUTO = 0x1, Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb/firewire/firedtv-fe.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'drivers/media/dvb/firewire/firedtv-fe.c') diff --git a/drivers/media/dvb/firewire/firedtv-fe.c b/drivers/media/dvb/firewire/firedtv-fe.c index 39f5caafd2be..6fe9793b98b3 100644 --- a/drivers/media/dvb/firewire/firedtv-fe.c +++ b/drivers/media/dvb/firewire/firedtv-fe.c @@ -173,7 +173,6 @@ void fdtv_frontend_init(struct firedtv *fdtv, const char *name) switch (fdtv->type) { case FIREDTV_DVB_S: ops->delsys[0] = SYS_DVBS; - fi->type = FE_QPSK; fi->frequency_min = 950000; fi->frequency_max = 2150000; @@ -193,8 +192,7 @@ void fdtv_frontend_init(struct firedtv *fdtv, const char *name) case FIREDTV_DVB_S2: ops->delsys[0] = SYS_DVBS; - ops->delsys[1] = SYS_DVBS; - fi->type = FE_QPSK; + ops->delsys[1] = SYS_DVBS2; fi->frequency_min = 950000; fi->frequency_max = 2150000; @@ -215,7 +213,6 @@ void fdtv_frontend_init(struct firedtv *fdtv, const char *name) case FIREDTV_DVB_C: ops->delsys[0] = SYS_DVBC_ANNEX_A; - fi->type = FE_QAM; fi->frequency_min = 47000000; fi->frequency_max = 866000000; @@ -234,7 +231,6 @@ void fdtv_frontend_init(struct firedtv *fdtv, const char *name) case FIREDTV_DVB_T: ops->delsys[0] = SYS_DVBT; - fi->type = FE_OFDM; fi->frequency_min = 49000000; fi->frequency_max = 861000000; -- cgit v1.2.1