diff options
Diffstat (limited to 'drivers/media/dvb-frontends/lgdt3306a.c')
| -rw-r--r-- | drivers/media/dvb-frontends/lgdt3306a.c | 60 |
1 files changed, 13 insertions, 47 deletions
diff --git a/drivers/media/dvb-frontends/lgdt3306a.c b/drivers/media/dvb-frontends/lgdt3306a.c index d3c330e035c4..6ab9d4de65ce 100644 --- a/drivers/media/dvb-frontends/lgdt3306a.c +++ b/drivers/media/dvb-frontends/lgdt3306a.c @@ -12,7 +12,7 @@ #include <asm/div64.h> #include <linux/kernel.h> #include <linux/dvb/frontend.h> -#include <media/dvb_math.h> +#include <linux/int_log.h> #include "lgdt3306a.h" #include <linux/i2c-mux.h> @@ -711,39 +711,6 @@ static int lgdt3306a_set_inversion_auto(struct lgdt3306a_state *state, return ret; } -static int lgdt3306a_spectral_inversion(struct lgdt3306a_state *state, - struct dtv_frontend_properties *p, - int inversion) -{ - int ret = 0; - - dbg_info("(%d)\n", inversion); -#if 0 - /* - * FGR - spectral_inversion defaults already set for VSB and QAM; - * can enable later if desired - */ - - ret = lgdt3306a_set_inversion(state, inversion); - - switch (p->modulation) { - case VSB_8: - /* Manual only for VSB */ - ret = lgdt3306a_set_inversion_auto(state, 0); - break; - case QAM_64: - case QAM_256: - case QAM_AUTO: - /* Auto ok for QAM */ - ret = lgdt3306a_set_inversion_auto(state, 1); - break; - default: - ret = -EINVAL; - } -#endif - return ret; -} - static int lgdt3306a_set_if(struct lgdt3306a_state *state, struct dtv_frontend_properties *p) { @@ -768,7 +735,7 @@ static int lgdt3306a_set_if(struct lgdt3306a_state *state, default: pr_warn("IF=%d KHz is not supported, 3250 assumed\n", if_freq_khz); - /* fallthrough */ + fallthrough; case 3250: /* 3.25Mhz */ nco1 = 0x34; nco2 = 0x00; @@ -1048,10 +1015,7 @@ static int lgdt3306a_set_parameters(struct dvb_frontend *fe) if (lg_chkerr(ret)) goto fail; - ret = lgdt3306a_spectral_inversion(state, p, - state->cfg->spectral_inversion ? 1 : 0); - if (lg_chkerr(ret)) - goto fail; + /* spectral_inversion defaults already set for VSB and QAM */ ret = lgdt3306a_mpeg_mode(state, state->cfg->mpeg_mode); if (lg_chkerr(ret)) @@ -1895,7 +1859,7 @@ fail: kfree(state); return NULL; } -EXPORT_SYMBOL(lgdt3306a_attach); +EXPORT_SYMBOL_GPL(lgdt3306a_attach); #ifdef DBG_DUMP @@ -2205,14 +2169,18 @@ static int lgdt3306a_deselect(struct i2c_mux_core *muxc, u32 chan) return lgdt3306a_i2c_gate_ctrl(&state->frontend, 0); } -static int lgdt3306a_probe(struct i2c_client *client, - const struct i2c_device_id *id) +static int lgdt3306a_probe(struct i2c_client *client) { struct lgdt3306a_config *config; struct lgdt3306a_state *state; struct dvb_frontend *fe; int ret; + if (!client->dev.platform_data) { + dev_err(&client->dev, "platform data is mandatory\n"); + return -EINVAL; + } + config = kmemdup(client->dev.platform_data, sizeof(struct lgdt3306a_config), GFP_KERNEL); if (config == NULL) { @@ -2240,7 +2208,7 @@ static int lgdt3306a_probe(struct i2c_client *client, goto err_kfree; } state->muxc->priv = client; - ret = i2c_mux_add_adapter(state->muxc, 0, 0, 0); + ret = i2c_mux_add_adapter(state->muxc, 0, 0); if (ret) goto err_kfree; @@ -2262,7 +2230,7 @@ fail: return ret; } -static int lgdt3306a_remove(struct i2c_client *client) +static void lgdt3306a_remove(struct i2c_client *client) { struct lgdt3306a_state *state = i2c_get_clientdata(client); @@ -2273,12 +2241,10 @@ static int lgdt3306a_remove(struct i2c_client *client) kfree(state->cfg); kfree(state); - - return 0; } static const struct i2c_device_id lgdt3306a_id_table[] = { - {"lgdt3306a", 0}, + { "lgdt3306a" }, {} }; MODULE_DEVICE_TABLE(i2c, lgdt3306a_id_table); |
