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/frontends/dib9000.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/media/dvb/frontends/dib9000.c') diff --git a/drivers/media/dvb/frontends/dib9000.c b/drivers/media/dvb/frontends/dib9000.c index 660f80661ed4..c7b4910a4e0e 100644 --- a/drivers/media/dvb/frontends/dib9000.c +++ b/drivers/media/dvb/frontends/dib9000.c @@ -2513,7 +2513,7 @@ static struct dvb_frontend_ops dib9000_ops = { .init = dib9000_wakeup, .sleep = dib9000_sleep, - .set_frontend = dib9000_set_frontend, + .set_frontend_legacy = dib9000_set_frontend, .get_tune_settings = dib9000_fe_get_tune_settings, .get_frontend = dib9000_get_frontend, -- cgit v1.2.3 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/frontends/dib9000.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/media/dvb/frontends/dib9000.c') diff --git a/drivers/media/dvb/frontends/dib9000.c b/drivers/media/dvb/frontends/dib9000.c index c7b4910a4e0e..4d82a4ab44a0 100644 --- a/drivers/media/dvb/frontends/dib9000.c +++ b/drivers/media/dvb/frontends/dib9000.c @@ -1883,7 +1883,7 @@ static int dib9000_get_frontend(struct dvb_frontend *fe, struct dvb_frontend_par dprintk("TPS lock on the slave%i", index_frontend); /* synchronize the cache with the other frontends */ - state->fe[index_frontend]->ops.get_frontend(state->fe[index_frontend], fep); + state->fe[index_frontend]->ops.get_frontend_legacy(state->fe[index_frontend], fep); for (sub_index_frontend = 0; (sub_index_frontend < MAX_NUMBER_OF_FRONTENDS) && (state->fe[sub_index_frontend] != NULL); sub_index_frontend++) { if (sub_index_frontend != index_frontend) { @@ -2515,7 +2515,7 @@ static struct dvb_frontend_ops dib9000_ops = { .set_frontend_legacy = dib9000_set_frontend, .get_tune_settings = dib9000_fe_get_tune_settings, - .get_frontend = dib9000_get_frontend, + .get_frontend_legacy = dib9000_get_frontend, .read_status = dib9000_read_status, .read_ber = dib9000_read_ber, -- cgit v1.2.3 From 759e236c5f58dcf72ebc722e5241c01da2918a61 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Thu, 22 Dec 2011 19:54:08 -0300 Subject: [media] dib9000: remove unused parameters Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb/frontends/dib9000.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'drivers/media/dvb/frontends/dib9000.c') diff --git a/drivers/media/dvb/frontends/dib9000.c b/drivers/media/dvb/frontends/dib9000.c index 4d82a4ab44a0..0488068b2c89 100644 --- a/drivers/media/dvb/frontends/dib9000.c +++ b/drivers/media/dvb/frontends/dib9000.c @@ -1136,7 +1136,7 @@ static int dib9000_fw_init(struct dib9000_state *state) return 0; } -static void dib9000_fw_set_channel_head(struct dib9000_state *state, struct dvb_frontend_parameters *ch) +static void dib9000_fw_set_channel_head(struct dib9000_state *state) { u8 b[9]; u32 freq = state->fe[0]->dtv_property_cache.frequency / 1000; @@ -1157,7 +1157,7 @@ static void dib9000_fw_set_channel_head(struct dib9000_state *state, struct dvb_ dib9000_risc_mem_write(state, FE_MM_W_CHANNEL_HEAD, b); } -static int dib9000_fw_get_channel(struct dvb_frontend *fe, struct dvb_frontend_parameters *channel) +static int dib9000_fw_get_channel(struct dvb_frontend *fe) { struct dib9000_state *state = fe->demodulator_priv; struct dibDVBTChannel { @@ -1462,7 +1462,7 @@ static int dib9000_fw_tune(struct dvb_frontend *fe, struct dvb_frontend_paramete switch (state->tune_state) { case CT_DEMOD_START: - dib9000_fw_set_channel_head(state, ch); + dib9000_fw_set_channel_head(state); /* write the channel context - a channel is initialized to 0, so it is OK */ dib9000_risc_mem_write(state, FE_MM_W_CHANNEL_CONTEXT, (u8 *) fe_info); @@ -1911,7 +1911,7 @@ static int dib9000_get_frontend(struct dvb_frontend *fe, struct dvb_frontend_par } /* get the channel from master chip */ - ret = dib9000_fw_get_channel(fe, fep); + ret = dib9000_fw_get_channel(fe); if (ret != 0) goto return_value; -- cgit v1.2.3 From 9e9c5bf73ffa8bbd870139589e5e490f1b02a283 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Thu, 22 Dec 2011 20:12:18 -0300 Subject: [media] dib9000: Get rid of the remaining DVBv3 legacy stuff dib9000 is almost ok, with regards to the usage of DVBv5 parameters. It has just a few stuff using the old way, at set_frontend. Replace them by the DVBv5 way, and add the delivery system. Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb/frontends/dib9000.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'drivers/media/dvb/frontends/dib9000.c') diff --git a/drivers/media/dvb/frontends/dib9000.c b/drivers/media/dvb/frontends/dib9000.c index 0488068b2c89..a3a9fb1869e1 100644 --- a/drivers/media/dvb/frontends/dib9000.c +++ b/drivers/media/dvb/frontends/dib9000.c @@ -1867,7 +1867,7 @@ static int dib9000_fe_get_tune_settings(struct dvb_frontend *fe, struct dvb_fron return 0; } -static int dib9000_get_frontend(struct dvb_frontend *fe, struct dvb_frontend_parameters *fep) +static int dib9000_get_frontend(struct dvb_frontend *fe, struct dtv_frontend_properties *c) { struct dib9000_state *state = fe->demodulator_priv; u8 index_frontend, sub_index_frontend; @@ -1883,7 +1883,7 @@ static int dib9000_get_frontend(struct dvb_frontend *fe, struct dvb_frontend_par dprintk("TPS lock on the slave%i", index_frontend); /* synchronize the cache with the other frontends */ - state->fe[index_frontend]->ops.get_frontend_legacy(state->fe[index_frontend], fep); + state->fe[index_frontend]->ops.get_frontend(state->fe[index_frontend], c); for (sub_index_frontend = 0; (sub_index_frontend < MAX_NUMBER_OF_FRONTENDS) && (state->fe[sub_index_frontend] != NULL); sub_index_frontend++) { if (sub_index_frontend != index_frontend) { @@ -1958,7 +1958,7 @@ static int dib9000_set_channel_status(struct dvb_frontend *fe, struct dvb_fronte return 0; } -static int dib9000_set_frontend(struct dvb_frontend *fe, struct dvb_frontend_parameters *fep) +static int dib9000_set_frontend(struct dvb_frontend *fe) { struct dib9000_state *state = fe->demodulator_priv; int sleep_time, sleep_time_slave; @@ -1983,8 +1983,10 @@ static int dib9000_set_frontend(struct dvb_frontend *fe, struct dvb_frontend_par fe->dtv_property_cache.delivery_system = SYS_DVBT; /* set the master status */ - if (fep->u.ofdm.transmission_mode == TRANSMISSION_MODE_AUTO || - fep->u.ofdm.guard_interval == GUARD_INTERVAL_AUTO || fep->u.ofdm.constellation == QAM_AUTO || fep->u.ofdm.code_rate_HP == FEC_AUTO) { + if (state->fe[0]->dtv_property_cache.transmission_mode == TRANSMISSION_MODE_AUTO || + state->fe[0]->dtv_property_cache.guard_interval == GUARD_INTERVAL_AUTO || + state->fe[0]->dtv_property_cache.modulation == QAM_AUTO || + state->fe[0]->dtv_property_cache.code_rate_HP == FEC_AUTO) { /* no channel specified, autosearch the channel */ state->channel_status.status = CHANNEL_STATUS_PARAMETERS_UNKNOWN; } else @@ -2052,7 +2054,7 @@ static int dib9000_set_frontend(struct dvb_frontend *fe, struct dvb_frontend_par /* synchronize all the channel cache */ state->get_frontend_internal = 1; - dib9000_get_frontend(state->fe[0], fep); + dib9000_get_frontend(state->fe[0], &state->fe[0]->dtv_property_cache); state->get_frontend_internal = 0; /* retune the other frontends with the found channel */ @@ -2495,6 +2497,7 @@ error: EXPORT_SYMBOL(dib9000_attach); static struct dvb_frontend_ops dib9000_ops = { + .delsys = { SYS_DVBT }, .info = { .name = "DiBcom 9000", .type = FE_OFDM, @@ -2513,9 +2516,9 @@ static struct dvb_frontend_ops dib9000_ops = { .init = dib9000_wakeup, .sleep = dib9000_sleep, - .set_frontend_legacy = dib9000_set_frontend, + .set_frontend = dib9000_set_frontend, .get_tune_settings = dib9000_fe_get_tune_settings, - .get_frontend_legacy = dib9000_get_frontend, + .get_frontend = dib9000_get_frontend, .read_status = dib9000_read_status, .read_ber = dib9000_read_ber, -- cgit v1.2.3 From f20b12ecb44d0f07f0cbc36016f089274b387969 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Thu, 22 Dec 2011 20:42:12 -0300 Subject: [media] dib9000: get rid of unused dvb_frontend_parameters This parameter is passed as NULL, and it is never used. Just remove it. Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb/frontends/dib9000.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'drivers/media/dvb/frontends/dib9000.c') diff --git a/drivers/media/dvb/frontends/dib9000.c b/drivers/media/dvb/frontends/dib9000.c index a3a9fb1869e1..974c2b7dc201 100644 --- a/drivers/media/dvb/frontends/dib9000.c +++ b/drivers/media/dvb/frontends/dib9000.c @@ -1309,7 +1309,7 @@ error: return ret; } -static int dib9000_fw_set_channel_union(struct dvb_frontend *fe, struct dvb_frontend_parameters *channel) +static int dib9000_fw_set_channel_union(struct dvb_frontend *fe) { struct dib9000_state *state = fe->demodulator_priv; struct dibDVBTChannel { @@ -1454,7 +1454,7 @@ static int dib9000_fw_set_channel_union(struct dvb_frontend *fe, struct dvb_fron return 0; } -static int dib9000_fw_tune(struct dvb_frontend *fe, struct dvb_frontend_parameters *ch) +static int dib9000_fw_tune(struct dvb_frontend *fe) { struct dib9000_state *state = fe->demodulator_priv; int ret = 10, search = state->channel_status.status == CHANNEL_STATUS_PARAMETERS_UNKNOWN; @@ -1471,7 +1471,7 @@ static int dib9000_fw_tune(struct dvb_frontend *fe, struct dvb_frontend_paramete if (search) dib9000_mbx_send(state, OUT_MSG_FE_CHANNEL_SEARCH, NULL, 0); else { - dib9000_fw_set_channel_union(fe, ch); + dib9000_fw_set_channel_union(fe); dib9000_mbx_send(state, OUT_MSG_FE_CHANNEL_TUNE, NULL, 0); } state->tune_state = CT_DEMOD_STEP_1; @@ -2010,9 +2010,9 @@ static int dib9000_set_frontend(struct dvb_frontend *fe) exit_condition = 0; /* 0: tune pending; 1: tune failed; 2:tune success */ index_frontend_success = 0; do { - sleep_time = dib9000_fw_tune(state->fe[0], NULL); + sleep_time = dib9000_fw_tune(state->fe[0]); for (index_frontend = 1; (index_frontend < MAX_NUMBER_OF_FRONTENDS) && (state->fe[index_frontend] != NULL); index_frontend++) { - sleep_time_slave = dib9000_fw_tune(state->fe[index_frontend], NULL); + sleep_time_slave = dib9000_fw_tune(state->fe[index_frontend]); if (sleep_time == FE_CALLBACK_TIME_NEVER) sleep_time = sleep_time_slave; else if ((sleep_time_slave != FE_CALLBACK_TIME_NEVER) && (sleep_time_slave > sleep_time)) @@ -2070,7 +2070,7 @@ static int dib9000_set_frontend(struct dvb_frontend *fe) sleep_time = FE_CALLBACK_TIME_NEVER; for (index_frontend = 0; (index_frontend < MAX_NUMBER_OF_FRONTENDS) && (state->fe[index_frontend] != NULL); index_frontend++) { if (index_frontend != index_frontend_success) { - sleep_time_slave = dib9000_fw_tune(state->fe[index_frontend], NULL); + sleep_time_slave = dib9000_fw_tune(state->fe[index_frontend]); if (sleep_time == FE_CALLBACK_TIME_NEVER) sleep_time = sleep_time_slave; else if ((sleep_time_slave != FE_CALLBACK_TIME_NEVER) && (sleep_time_slave > sleep_time)) -- cgit v1.2.3 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/frontends/dib9000.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers/media/dvb/frontends/dib9000.c') diff --git a/drivers/media/dvb/frontends/dib9000.c b/drivers/media/dvb/frontends/dib9000.c index 974c2b7dc201..2312b4d20d4a 100644 --- a/drivers/media/dvb/frontends/dib9000.c +++ b/drivers/media/dvb/frontends/dib9000.c @@ -1867,7 +1867,7 @@ static int dib9000_fe_get_tune_settings(struct dvb_frontend *fe, struct dvb_fron return 0; } -static int dib9000_get_frontend(struct dvb_frontend *fe, struct dtv_frontend_properties *c) +static int dib9000_get_frontend(struct dvb_frontend *fe) { struct dib9000_state *state = fe->demodulator_priv; u8 index_frontend, sub_index_frontend; @@ -1883,7 +1883,7 @@ static int dib9000_get_frontend(struct dvb_frontend *fe, struct dtv_frontend_pro dprintk("TPS lock on the slave%i", index_frontend); /* synchronize the cache with the other frontends */ - state->fe[index_frontend]->ops.get_frontend(state->fe[index_frontend], c); + state->fe[index_frontend]->ops.get_frontend(state->fe[index_frontend]); for (sub_index_frontend = 0; (sub_index_frontend < MAX_NUMBER_OF_FRONTENDS) && (state->fe[sub_index_frontend] != NULL); sub_index_frontend++) { if (sub_index_frontend != index_frontend) { @@ -2054,7 +2054,7 @@ static int dib9000_set_frontend(struct dvb_frontend *fe) /* synchronize all the channel cache */ state->get_frontend_internal = 1; - dib9000_get_frontend(state->fe[0], &state->fe[0]->dtv_property_cache); + dib9000_get_frontend(state->fe[0]); state->get_frontend_internal = 0; /* retune the other frontends with the found channel */ -- cgit v1.2.3 From 7581e61d8d7a3ed89a3fdac2235231cd36548f78 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Sun, 1 Jan 2012 16:11:18 -0300 Subject: [media] dvb: Remove ops->info.type from frontends Now that this field is deprecated, and core generates it for DVBv3 calls, remove it from the drivers. It also adds .delsys on the few drivers where this were missed. Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb/frontends/dib9000.c | 1 - 1 file changed, 1 deletion(-) (limited to 'drivers/media/dvb/frontends/dib9000.c') diff --git a/drivers/media/dvb/frontends/dib9000.c b/drivers/media/dvb/frontends/dib9000.c index 2312b4d20d4a..863ef3cfab9f 100644 --- a/drivers/media/dvb/frontends/dib9000.c +++ b/drivers/media/dvb/frontends/dib9000.c @@ -2500,7 +2500,6 @@ static struct dvb_frontend_ops dib9000_ops = { .delsys = { SYS_DVBT }, .info = { .name = "DiBcom 9000", - .type = FE_OFDM, .frequency_min = 44250000, .frequency_max = 867250000, .frequency_stepsize = 62500, -- cgit v1.2.3