diff options
Diffstat (limited to 'drivers/media/dvb-frontends')
-rw-r--r-- | drivers/media/dvb-frontends/af9013.c | 2 | ||||
-rw-r--r-- | drivers/media/dvb-frontends/drxk_hard.c | 3 | ||||
-rw-r--r-- | drivers/media/dvb-frontends/lg2160.c | 2 | ||||
-rw-r--r-- | drivers/media/dvb-frontends/m88ds3103.c | 2 | ||||
-rw-r--r-- | drivers/media/dvb-frontends/mb86a16.c | 7 | ||||
-rw-r--r-- | drivers/media/dvb-frontends/mxl5xx.c | 1 | ||||
-rw-r--r-- | drivers/media/dvb-frontends/rtl2832_sdr.c | 1 | ||||
-rw-r--r-- | drivers/media/dvb-frontends/tda10021.c | 40 | ||||
-rw-r--r-- | drivers/media/dvb-frontends/tda10086.c | 22 | ||||
-rw-r--r-- | drivers/media/dvb-frontends/tda18271c2dd.c | 41 | ||||
-rw-r--r-- | drivers/media/dvb-frontends/tda18271c2dd_maps.h | 22 | ||||
-rw-r--r-- | drivers/media/dvb-frontends/zd1301_demod.h | 6 |
12 files changed, 73 insertions, 76 deletions
diff --git a/drivers/media/dvb-frontends/af9013.c b/drivers/media/dvb-frontends/af9013.c index 7281899bd7ae..7d7c341b2bd8 100644 --- a/drivers/media/dvb-frontends/af9013.c +++ b/drivers/media/dvb-frontends/af9013.c @@ -597,7 +597,7 @@ static int af9013_read_status(struct dvb_frontend *fe, enum fe_status *status) state->strength_en = 2; break; } - /* Fall through */ + fallthrough; case 1: if (time_is_after_jiffies(state->strength_jiffies + msecs_to_jiffies(2000))) break; diff --git a/drivers/media/dvb-frontends/drxk_hard.c b/drivers/media/dvb-frontends/drxk_hard.c index 32f9346deb3e..a57470bf71bf 100644 --- a/drivers/media/dvb-frontends/drxk_hard.c +++ b/drivers/media/dvb-frontends/drxk_hard.c @@ -1011,8 +1011,7 @@ static int hi_command(struct drxk_state *state, u16 cmd, u16 *p_result) retry_count += 1; status = read16(state, SIO_HI_RA_RAM_CMD__A, &wait_cmd); - } while ((status < 0) && (retry_count < DRXK_MAX_RETRIES) - && (wait_cmd != 0)); + } while ((status < 0 || wait_cmd) && (retry_count < DRXK_MAX_RETRIES)); if (status < 0) goto error; status = read16(state, SIO_HI_RA_RAM_RES__A, p_result); diff --git a/drivers/media/dvb-frontends/lg2160.c b/drivers/media/dvb-frontends/lg2160.c index 10c152f461dd..f343066c297e 100644 --- a/drivers/media/dvb-frontends/lg2160.c +++ b/drivers/media/dvb-frontends/lg2160.c @@ -1408,7 +1408,7 @@ struct dvb_frontend *lg2160_attach(const struct lg2160_config *config, switch (config->lg_chip) { default: lg_warn("invalid chip requested, defaulting to LG2160"); - /* fall-thru */ + fallthrough; case LG2160: memcpy(&state->frontend.ops, &lg2160_ops, sizeof(struct dvb_frontend_ops)); diff --git a/drivers/media/dvb-frontends/m88ds3103.c b/drivers/media/dvb-frontends/m88ds3103.c index f204e715bc59..ad6d9d564a87 100644 --- a/drivers/media/dvb-frontends/m88ds3103.c +++ b/drivers/media/dvb-frontends/m88ds3103.c @@ -906,7 +906,7 @@ static int m88ds3103_set_frontend(struct dvb_frontend *fe) if (ret) goto err; } - /* fall through */ + fallthrough; default: u16tmp = DIV_ROUND_UP(target_mclk, dev->cfg->ts_clk); u8tmp1 = u16tmp / 2 - 1; diff --git a/drivers/media/dvb-frontends/mb86a16.c b/drivers/media/dvb-frontends/mb86a16.c index 3843181bba16..2505f1e5794e 100644 --- a/drivers/media/dvb-frontends/mb86a16.c +++ b/drivers/media/dvb-frontends/mb86a16.c @@ -1452,11 +1452,8 @@ static int mb86a16_set_fe(struct mb86a16_state *state) wait_t = (786432 + state->srate / 2) / state->srate; else wait_t = (1572864 + state->srate / 2) / state->srate; - if (state->srate < 5000) - /* FIXME ! , should be a long wait ! */ - msleep_interruptible(wait_t); - else - msleep_interruptible(wait_t); + + msleep_interruptible(wait_t); if (sync_chk(state, &junk) == 0) { iq_vt_set(state, 1); diff --git a/drivers/media/dvb-frontends/mxl5xx.c b/drivers/media/dvb-frontends/mxl5xx.c index 4404ace82981..0b00a23436ed 100644 --- a/drivers/media/dvb-frontends/mxl5xx.c +++ b/drivers/media/dvb-frontends/mxl5xx.c @@ -27,7 +27,6 @@ #include <linux/delay.h> #include <linux/firmware.h> #include <linux/i2c.h> -#include <linux/version.h> #include <linux/mutex.h> #include <linux/vmalloc.h> #include <asm/div64.h> diff --git a/drivers/media/dvb-frontends/rtl2832_sdr.c b/drivers/media/dvb-frontends/rtl2832_sdr.c index 720756728f2d..ef6feb299d46 100644 --- a/drivers/media/dvb-frontends/rtl2832_sdr.c +++ b/drivers/media/dvb-frontends/rtl2832_sdr.c @@ -1411,6 +1411,7 @@ static int rtl2832_sdr_probe(struct platform_device *pdev) default: v4l2_ctrl_handler_init(&dev->hdl, 0); dev_err(&pdev->dev, "Unsupported tuner\n"); + ret = -ENODEV; goto err_v4l2_ctrl_handler_free; } if (dev->hdl.error) { diff --git a/drivers/media/dvb-frontends/tda10021.c b/drivers/media/dvb-frontends/tda10021.c index 9fb207b41576..faa6e54b3372 100644 --- a/drivers/media/dvb-frontends/tda10021.c +++ b/drivers/media/dvb-frontends/tda10021.c @@ -137,26 +137,36 @@ static int tda10021_set_symbolrate (struct tda10021_state* state, u32 symbolrate { s32 BDR; s32 BDRI; - s16 SFIL=0; + s16 SFIL = 0; u16 NDEC = 0; u32 tmp, ratio; - if (symbolrate > XIN/2) - symbolrate = XIN/2; - if (symbolrate < 500000) + if (symbolrate > XIN / 2) + symbolrate = XIN / 2; + else if (symbolrate < 500000) symbolrate = 500000; - if (symbolrate < XIN/16) NDEC = 1; - if (symbolrate < XIN/32) NDEC = 2; - if (symbolrate < XIN/64) NDEC = 3; - - if (symbolrate < (u32)(XIN/12.3)) SFIL = 1; - if (symbolrate < (u32)(XIN/16)) SFIL = 0; - if (symbolrate < (u32)(XIN/24.6)) SFIL = 1; - if (symbolrate < (u32)(XIN/32)) SFIL = 0; - if (symbolrate < (u32)(XIN/49.2)) SFIL = 1; - if (symbolrate < (u32)(XIN/64)) SFIL = 0; - if (symbolrate < (u32)(XIN/98.4)) SFIL = 1; + if (symbolrate < XIN / 16) + NDEC = 1; + if (symbolrate < XIN / 32) + NDEC = 2; + if (symbolrate < XIN / 64) + NDEC = 3; + + if (symbolrate < XIN * 10 / 123) + SFIL = 1; + if (symbolrate < XIN * 10 / 160) + SFIL = 0; + if (symbolrate < XIN * 10 / 246) + SFIL = 1; + if (symbolrate < XIN * 10 / 320) + SFIL = 0; + if (symbolrate < XIN * 10 / 492) + SFIL = 1; + if (symbolrate < XIN * 10 / 640) + SFIL = 0; + if (symbolrate < XIN * 10 / 984) + SFIL = 1; symbolrate <<= NDEC; ratio = (symbolrate << 4) / FIN; diff --git a/drivers/media/dvb-frontends/tda10086.c b/drivers/media/dvb-frontends/tda10086.c index be6b40138f6e..cdcf97664bba 100644 --- a/drivers/media/dvb-frontends/tda10086.c +++ b/drivers/media/dvb-frontends/tda10086.c @@ -17,7 +17,7 @@ #include <media/dvb_frontend.h> #include "tda10086.h" -#define SACLK 96000000 +#define SACLK 96000000U struct tda10086_state { struct i2c_adapter* i2c; @@ -297,34 +297,34 @@ static int tda10086_set_symbol_rate(struct tda10086_state *state, dprintk ("%s %i\n", __func__, symbol_rate); /* setup the decimation and anti-aliasing filters.. */ - if (symbol_rate < (u32) (SACLK * 0.0137)) { + if (symbol_rate < SACLK / 10000 * 137) { dfn=4; afs=1; - } else if (symbol_rate < (u32) (SACLK * 0.0208)) { + } else if (symbol_rate < SACLK / 10000 * 208) { dfn=4; afs=0; - } else if (symbol_rate < (u32) (SACLK * 0.0270)) { + } else if (symbol_rate < SACLK / 10000 * 270) { dfn=3; afs=1; - } else if (symbol_rate < (u32) (SACLK * 0.0416)) { + } else if (symbol_rate < SACLK / 10000 * 416) { dfn=3; afs=0; - } else if (symbol_rate < (u32) (SACLK * 0.0550)) { + } else if (symbol_rate < SACLK / 10000 * 550) { dfn=2; afs=1; - } else if (symbol_rate < (u32) (SACLK * 0.0833)) { + } else if (symbol_rate < SACLK / 10000 * 833) { dfn=2; afs=0; - } else if (symbol_rate < (u32) (SACLK * 0.1100)) { + } else if (symbol_rate < SACLK / 10000 * 1100) { dfn=1; afs=1; - } else if (symbol_rate < (u32) (SACLK * 0.1666)) { + } else if (symbol_rate < SACLK / 10000 * 1666) { dfn=1; afs=0; - } else if (symbol_rate < (u32) (SACLK * 0.2200)) { + } else if (symbol_rate < SACLK / 10000 * 2200) { dfn=0; afs=1; - } else if (symbol_rate < (u32) (SACLK * 0.3333)) { + } else if (symbol_rate < SACLK / 10000 * 3333) { dfn=0; afs=0; } else { diff --git a/drivers/media/dvb-frontends/tda18271c2dd.c b/drivers/media/dvb-frontends/tda18271c2dd.c index 43312bba1aec..a34834487943 100644 --- a/drivers/media/dvb-frontends/tda18271c2dd.c +++ b/drivers/media/dvb-frontends/tda18271c2dd.c @@ -198,58 +198,55 @@ static void reset(struct tda_state *state) state->m_bFMInput = (ulFMInput == 2); } -static bool SearchMap1(struct SMap Map[], - u32 Frequency, u8 *pParam) +static bool SearchMap1(const struct SMap map[], u32 frequency, u8 *param) { int i = 0; - while ((Map[i].m_Frequency != 0) && (Frequency > Map[i].m_Frequency)) + while ((map[i].m_Frequency != 0) && (frequency > map[i].m_Frequency)) i += 1; - if (Map[i].m_Frequency == 0) + if (map[i].m_Frequency == 0) return false; - *pParam = Map[i].m_Param; + *param = map[i].m_Param; return true; } -static bool SearchMap2(struct SMapI Map[], - u32 Frequency, s32 *pParam) +static bool SearchMap2(const struct SMapI map[], u32 frequency, s32 *param) { int i = 0; - while ((Map[i].m_Frequency != 0) && - (Frequency > Map[i].m_Frequency)) + while ((map[i].m_Frequency != 0) && + (frequency > map[i].m_Frequency)) i += 1; - if (Map[i].m_Frequency == 0) + if (map[i].m_Frequency == 0) return false; - *pParam = Map[i].m_Param; + *param = map[i].m_Param; return true; } -static bool SearchMap3(struct SMap2 Map[], u32 Frequency, - u8 *pParam1, u8 *pParam2) +static bool SearchMap3(const struct SMap2 map[], u32 frequency, u8 *param1, + u8 *param2) { int i = 0; - while ((Map[i].m_Frequency != 0) && - (Frequency > Map[i].m_Frequency)) + while ((map[i].m_Frequency != 0) && + (frequency > map[i].m_Frequency)) i += 1; - if (Map[i].m_Frequency == 0) + if (map[i].m_Frequency == 0) return false; - *pParam1 = Map[i].m_Param1; - *pParam2 = Map[i].m_Param2; + *param1 = map[i].m_Param1; + *param2 = map[i].m_Param2; return true; } -static bool SearchMap4(struct SRFBandMap Map[], - u32 Frequency, u8 *pRFBand) +static bool SearchMap4(const struct SRFBandMap map[], u32 frequency, u8 *rfband) { int i = 0; - while (i < 7 && (Frequency > Map[i].m_RF_max)) + while (i < 7 && (frequency > map[i].m_RF_max)) i += 1; if (i == 7) return false; - *pRFBand = i; + *rfband = i; return true; } diff --git a/drivers/media/dvb-frontends/tda18271c2dd_maps.h b/drivers/media/dvb-frontends/tda18271c2dd_maps.h index 5f75516bc0cb..82218e02d77d 100644 --- a/drivers/media/dvb-frontends/tda18271c2dd_maps.h +++ b/drivers/media/dvb-frontends/tda18271c2dd_maps.h @@ -6,7 +6,7 @@ enum HF_S { HF_DVBC_8MHZ, HF_DVBC }; -static struct SStandardParam m_StandardTable[] = { +static const struct SStandardParam m_StandardTable[] = { { 0, 0, 0x00, 0x00 }, /* HF_None */ { 6000000, 7000000, 0x1D, 0x2C }, /* HF_B, */ { 6900000, 8000000, 0x1E, 0x2C }, /* HF_DK, */ @@ -28,7 +28,7 @@ static struct SStandardParam m_StandardTable[] = { { 0, 0, 0x00, 0x00 }, /* HF_DVBC (Unused) */ }; -static struct SMap m_BP_Filter_Map[] = { +static const struct SMap m_BP_Filter_Map[] = { { 62000000, 0x00 }, { 84000000, 0x01 }, { 100000000, 0x02 }, @@ -39,7 +39,7 @@ static struct SMap m_BP_Filter_Map[] = { { 0, 0x00 }, /* Table End */ }; -static struct SMapI m_RF_Cal_Map[] = { +static const struct SMapI m_RF_Cal_Map[] = { { 41000000, 0x0F }, { 43000000, 0x1C }, { 45000000, 0x2F }, @@ -481,7 +481,7 @@ static struct SMapI m_RF_Cal_Map[] = { }; -static struct SMap2 m_KM_Map[] = { +static const struct SMap2 m_KM_Map[] = { { 47900000, 3, 2 }, { 61100000, 3, 1 }, { 350000000, 3, 0 }, @@ -490,7 +490,7 @@ static struct SMap2 m_KM_Map[] = { { 0, 0x00 }, /* Table End */ }; -static struct SMap2 m_Main_PLL_Map[] = { +static const struct SMap2 m_Main_PLL_Map[] = { { 33125000, 0x57, 0xF0 }, { 35500000, 0x56, 0xE0 }, { 38188000, 0x55, 0xD0 }, @@ -534,7 +534,7 @@ static struct SMap2 m_Main_PLL_Map[] = { { 0, 0x00, 0x00 }, /* Table End */ }; -static struct SMap2 m_Cal_PLL_Map[] = { +static const struct SMap2 m_Cal_PLL_Map[] = { { 33813000, 0xDD, 0xD0 }, { 36625000, 0xDC, 0xC0 }, { 39938000, 0xDB, 0xB0 }, @@ -572,7 +572,7 @@ static struct SMap2 m_Cal_PLL_Map[] = { { 0, 0x00, 0x00 }, /* Table End */ }; -static struct SMap m_GainTaper_Map[] = { +static const struct SMap m_GainTaper_Map[] = { { 45400000, 0x1F }, { 45800000, 0x1E }, { 46200000, 0x1D }, @@ -661,7 +661,7 @@ static struct SMap m_GainTaper_Map[] = { { 0, 0x00 }, /* Table End */ }; -static struct SMap m_RF_Cal_DC_Over_DT_Map[] = { +static const struct SMap m_RF_Cal_DC_Over_DT_Map[] = { { 47900000, 0x00 }, { 55000000, 0x00 }, { 61100000, 0x0A }, @@ -767,14 +767,14 @@ static struct SMap m_RF_Cal_DC_Over_DT_Map[] = { }; -static struct SMap m_IR_Meas_Map[] = { +static const struct SMap m_IR_Meas_Map[] = { { 200000000, 0x05 }, { 400000000, 0x06 }, { 865000000, 0x07 }, { 0, 0x00 }, /* Table End */ }; -static struct SMap2 m_CID_Target_Map[] = { +static const struct SMap2 m_CID_Target_Map[] = { { 46000000, 0x04, 18 }, { 52200000, 0x0A, 15 }, { 70100000, 0x01, 40 }, @@ -790,7 +790,7 @@ static struct SMap2 m_CID_Target_Map[] = { { 0, 0x00, 0 }, /* Table End */ }; -static struct SRFBandMap m_RF_Band_Map[7] = { +static const struct SRFBandMap m_RF_Band_Map[7] = { { 47900000, 46000000, 0, 0}, { 61100000, 52200000, 0, 0}, { 152600000, 70100000, 136800000, 0}, diff --git a/drivers/media/dvb-frontends/zd1301_demod.h b/drivers/media/dvb-frontends/zd1301_demod.h index d56196f5c801..01eaacf76a13 100644 --- a/drivers/media/dvb-frontends/zd1301_demod.h +++ b/drivers/media/dvb-frontends/zd1301_demod.h @@ -43,12 +43,6 @@ struct i2c_adapter *zd1301_demod_get_i2c_adapter(struct platform_device *pdev); #else -/** - * zd1301_demod_get_dvb_frontend() - Attach a zd1301 frontend - * @dev: Pointer to platform device - * - * Return: Pointer to %struct dvb_frontend or NULL if attach fails. - */ static inline struct dvb_frontend *zd1301_demod_get_dvb_frontend(struct platform_device *dev) { printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__); |