mirror of
https://github.com/DigitalDevices/dddvb.git
synced 2025-03-01 10:35:23 +00:00
adapt dvb-core, includes and affected files to mainline 4.14-rc2
This commit is contained in:
@@ -1679,7 +1679,7 @@ static int get_stats(struct dvb_frontend *fe)
|
||||
}
|
||||
|
||||
|
||||
static int read_status(struct dvb_frontend *fe, fe_status_t *status)
|
||||
static int read_status(struct dvb_frontend *fe, enum fe_status *status)
|
||||
{
|
||||
struct cxd_state *state = fe->demodulator_priv;
|
||||
u8 rdata;
|
||||
@@ -2191,7 +2191,7 @@ static int read_ucblocks(struct dvb_frontend *fe, u32 *ucblocks)
|
||||
|
||||
static int tune(struct dvb_frontend *fe, bool re_tune,
|
||||
unsigned int mode_flags,
|
||||
unsigned int *delay, fe_status_t *status)
|
||||
unsigned int *delay, enum fe_status *status)
|
||||
{
|
||||
struct cxd_state *state = fe->demodulator_priv;
|
||||
int r;
|
||||
@@ -2217,7 +2217,7 @@ static enum dvbfe_search search(struct dvb_frontend *fe)
|
||||
{
|
||||
int r;
|
||||
u32 loops = 20, i;
|
||||
fe_status_t status;
|
||||
enum fe_status status;
|
||||
|
||||
r = set_parameters(fe);
|
||||
|
||||
@@ -2241,10 +2241,9 @@ static int get_algo(struct dvb_frontend *fe)
|
||||
return DVBFE_ALGO_HW;
|
||||
}
|
||||
|
||||
static int get_fe_t2(struct cxd_state *state)
|
||||
static int get_fe_t2(struct cxd_state *state, struct dtv_frontend_properties *p)
|
||||
{
|
||||
struct dvb_frontend *fe = &state->frontend;
|
||||
struct dtv_frontend_properties *p = &fe->dtv_property_cache;
|
||||
u8 ofdm[5], modcod[2];
|
||||
|
||||
freeze_regst(state);
|
||||
@@ -2345,10 +2344,9 @@ static int get_fe_t2(struct cxd_state *state)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_fe_t(struct cxd_state *state)
|
||||
static int get_fe_t(struct cxd_state *state, struct dtv_frontend_properties *p)
|
||||
{
|
||||
struct dvb_frontend *fe = &state->frontend;
|
||||
struct dtv_frontend_properties *p = &fe->dtv_property_cache;
|
||||
u8 tps[7];
|
||||
|
||||
read_tps(state, tps);
|
||||
@@ -2447,10 +2445,9 @@ static int get_fe_t(struct cxd_state *state)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_fe_c(struct cxd_state *state)
|
||||
static int get_fe_c(struct cxd_state *state, struct dtv_frontend_properties *p)
|
||||
{
|
||||
struct dvb_frontend *fe = &state->frontend;
|
||||
struct dtv_frontend_properties *p = &fe->dtv_property_cache;
|
||||
u8 qam;
|
||||
|
||||
freeze_regst(state);
|
||||
@@ -2460,7 +2457,7 @@ static int get_fe_c(struct cxd_state *state)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_frontend(struct dvb_frontend *fe)
|
||||
static int get_frontend(struct dvb_frontend *fe, struct dtv_frontend_properties *p)
|
||||
{
|
||||
struct cxd_state *state = fe->demodulator_priv;
|
||||
|
||||
@@ -2469,13 +2466,13 @@ static int get_frontend(struct dvb_frontend *fe)
|
||||
|
||||
switch (state->state) {
|
||||
case ActiveT:
|
||||
get_fe_t(state);
|
||||
get_fe_t(state, p);
|
||||
break;
|
||||
case ActiveT2:
|
||||
get_fe_t2(state);
|
||||
get_fe_t2(state, p);
|
||||
break;
|
||||
case ActiveC:
|
||||
get_fe_c(state);
|
||||
get_fe_c(state, p);
|
||||
break;
|
||||
case ActiveC2:
|
||||
break;
|
||||
|
||||
@@ -4892,14 +4892,14 @@ static int drxk_set_parameters (struct dvb_frontend *fe,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int drxk_c_get_frontend(struct dvb_frontend *fe)
|
||||
static int drxk_c_get_frontend(struct dvb_frontend *fe, struct dtv_frontend_properties *p)
|
||||
{
|
||||
//struct drxk_state *state = fe->demodulator_priv;
|
||||
//printk("%s\n", __FUNCTION__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int drxk_read_status(struct dvb_frontend *fe, fe_status_t *status)
|
||||
static int drxk_read_status(struct dvb_frontend *fe, enum fe_status *status)
|
||||
{
|
||||
struct drxk_state *state = fe->demodulator_priv;
|
||||
u32 stat;
|
||||
@@ -4986,7 +4986,7 @@ static int drxk_t_sleep(struct dvb_frontend* fe)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int drxk_t_get_frontend(struct dvb_frontend *fe)
|
||||
static int drxk_t_get_frontend(struct dvb_frontend *fe, struct dtv_frontend_properties *p)
|
||||
{
|
||||
//struct drxk_state *state = fe->demodulator_priv;
|
||||
//printk("%s\n", __FUNCTION__);
|
||||
|
||||
@@ -62,7 +62,7 @@ static int lnbh25_write_regs(struct lnbh25 *lnbh, int reg, int len)
|
||||
}
|
||||
|
||||
static int lnbh25_set_voltage(struct dvb_frontend *fe,
|
||||
fe_sec_voltage_t voltage)
|
||||
enum fe_sec_voltage voltage)
|
||||
{
|
||||
struct lnbh25 *lnbh = (struct lnbh25 *) fe->sec_priv;
|
||||
u8 oldreg0 = lnbh->reg[0];
|
||||
@@ -107,7 +107,7 @@ static int lnbh25_enable_high_lnb_voltage(struct dvb_frontend *fe, long arg)
|
||||
}
|
||||
|
||||
static int lnbh25_set_tone(struct dvb_frontend *fe,
|
||||
fe_sec_tone_mode_t tone)
|
||||
enum fe_sec_tone_mode tone)
|
||||
{
|
||||
/* struct lnbh25 *lnbh = (struct lnbh25 *) fe->sec_priv; */
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ struct lnbp21 {
|
||||
};
|
||||
|
||||
static int lnbp21_set_voltage(struct dvb_frontend *fe,
|
||||
fe_sec_voltage_t voltage)
|
||||
enum fe_sec_voltage voltage)
|
||||
{
|
||||
struct lnbp21 *lnbp21 = (struct lnbp21 *) fe->sec_priv;
|
||||
struct i2c_msg msg = { .addr = lnbp21->i2c_addr, .flags = 0,
|
||||
@@ -98,7 +98,7 @@ static int lnbp21_enable_high_lnb_voltage(struct dvb_frontend *fe, long arg)
|
||||
}
|
||||
|
||||
static int lnbp21_set_tone(struct dvb_frontend *fe,
|
||||
fe_sec_tone_mode_t tone)
|
||||
enum fe_sec_tone_mode tone)
|
||||
{
|
||||
struct lnbp21 *lnbp21 = (struct lnbp21 *) fe->sec_priv;
|
||||
struct i2c_msg msg = { .addr = lnbp21->i2c_addr, .flags = 0,
|
||||
|
||||
@@ -560,7 +560,7 @@ static int set_parameters(struct dvb_frontend *fe)
|
||||
|
||||
static int get_stats(struct dvb_frontend *fe);
|
||||
|
||||
static int read_status(struct dvb_frontend *fe, fe_status_t *status)
|
||||
static int read_status(struct dvb_frontend *fe, enum fe_status *status)
|
||||
{
|
||||
struct mxl *state = fe->demodulator_priv;
|
||||
|
||||
@@ -582,10 +582,10 @@ static int read_status(struct dvb_frontend *fe, fe_status_t *status)
|
||||
|
||||
static int tune(struct dvb_frontend *fe, bool re_tune,
|
||||
unsigned int mode_flags,
|
||||
unsigned int *delay, fe_status_t *status)
|
||||
unsigned int *delay, enum fe_status *status)
|
||||
{
|
||||
struct mxl *state = fe->demodulator_priv;
|
||||
struct dtv_frontend_properties *p = &fe->dtv_property_cache;
|
||||
/* struct dtv_frontend_properties *p = &fe->dtv_property_cache; */
|
||||
int r = 0;
|
||||
|
||||
*delay = HZ / 2;
|
||||
@@ -659,7 +659,7 @@ static int read_ber(struct dvb_frontend *fe, u32 *ber)
|
||||
{
|
||||
struct mxl *state = fe->demodulator_priv;
|
||||
struct dtv_frontend_properties *p = &fe->dtv_property_cache;
|
||||
u32 reg[8], reg2[4], n = 0, d = 0;
|
||||
u32 reg[8], reg2[4];
|
||||
int stat;
|
||||
|
||||
*ber = 0;
|
||||
@@ -748,7 +748,7 @@ static int get_stats(struct dvb_frontend *fe)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static fe_code_rate_t conv_fec(MXL_HYDRA_FEC_E fec)
|
||||
static enum fe_code_rate conv_fec(MXL_HYDRA_FEC_E fec)
|
||||
{
|
||||
enum fe_code_rate fec2fec[11] = {
|
||||
FEC_NONE, FEC_1_2, FEC_3_5, FEC_2_3,
|
||||
@@ -761,10 +761,9 @@ static fe_code_rate_t conv_fec(MXL_HYDRA_FEC_E fec)
|
||||
return fec2fec[fec];
|
||||
}
|
||||
|
||||
static int get_frontend(struct dvb_frontend *fe)
|
||||
static int get_frontend(struct dvb_frontend *fe, struct dtv_frontend_properties *p)
|
||||
{
|
||||
struct mxl *state = fe->demodulator_priv;
|
||||
struct dtv_frontend_properties *p = &fe->dtv_property_cache;
|
||||
u32 regData[MXL_DEMOD_CHAN_PARAMS_BUFF_SIZE];
|
||||
u32 freq;
|
||||
int stat;
|
||||
|
||||
@@ -58,7 +58,7 @@ enum EDemodState { Off, QAMSet, OFDMSet, QAMStarted, OFDMStarted };
|
||||
|
||||
struct stv_state {
|
||||
struct dvb_frontend frontend;
|
||||
fe_modulation_t modulation;
|
||||
enum fe_modulation modulation;
|
||||
u32 symbol_rate;
|
||||
u32 bandwidth;
|
||||
struct device *dev;
|
||||
@@ -1861,7 +1861,7 @@ static int OFDM_GetLockStatus(struct stv_state *state, LOCK_STATUS* pLockStatus,
|
||||
|
||||
#endif
|
||||
|
||||
static int read_status(struct dvb_frontend *fe, fe_status_t *status)
|
||||
static int read_status(struct dvb_frontend *fe, enum fe_status *status)
|
||||
{
|
||||
struct stv_state *state = fe->demodulator_priv;
|
||||
*status=0;
|
||||
|
||||
@@ -5072,10 +5072,9 @@ static int stv090x_set_gpio(struct dvb_frontend *fe, u8 gpio, u8 dir,
|
||||
return stv090x_write_reg(state, STV090x_GPIOxCFG(gpio), reg);
|
||||
}
|
||||
|
||||
static int stv090x_get_frontend(struct dvb_frontend *fe)
|
||||
static int stv090x_get_frontend(struct dvb_frontend *fe, struct dtv_frontend_properties *p)
|
||||
{
|
||||
struct stv090x_state *state = fe->demodulator_priv;
|
||||
struct dtv_frontend_properties *p = &fe->dtv_property_cache;
|
||||
u8 tmp;
|
||||
u32 reg = 0;
|
||||
|
||||
|
||||
@@ -849,10 +849,12 @@ static int init_search_param(struct stv *state)
|
||||
|
||||
read_reg(state, RSTV0910_P2_PDELCTRL1 + state->regoff, &tmp);
|
||||
tmp |= 0x20; // Filter_en (no effect if SIS=non-MIS
|
||||
tmp &= ~0x20; // Filter_en (no effect if SIS=non-MIS
|
||||
write_reg(state, RSTV0910_P2_PDELCTRL1 + state->regoff, tmp);
|
||||
|
||||
read_reg(state, RSTV0910_P2_PDELCTRL2 + state->regoff, &tmp);
|
||||
tmp &= ~0x02; // frame mode = 0
|
||||
tmp |= 0x80; // frame mode = 0
|
||||
write_reg(state, RSTV0910_P2_PDELCTRL2 + state->regoff, tmp);
|
||||
|
||||
write_reg(state, RSTV0910_P2_UPLCCST0 + state->regoff, 0xe0);
|
||||
@@ -1260,10 +1262,9 @@ static int get_frequency_offset(struct stv *state, s32 *off)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_frontend(struct dvb_frontend *fe)
|
||||
static int get_frontend(struct dvb_frontend *fe, struct dtv_frontend_properties *p)
|
||||
{
|
||||
struct stv *state = fe->demodulator_priv;
|
||||
struct dtv_frontend_properties *p = &fe->dtv_property_cache;
|
||||
u8 tmp;
|
||||
|
||||
if (state->receive_mode == RCVMODE_DVBS2) {
|
||||
@@ -1345,7 +1346,7 @@ static int read_snr(struct dvb_frontend *fe, u16 *snr);
|
||||
static int read_signal_strength(struct dvb_frontend *fe, u16 *strength);
|
||||
static int read_ber(struct dvb_frontend *fe, u32 *ber);
|
||||
|
||||
static int read_status(struct dvb_frontend *fe, fe_status_t *status)
|
||||
static int read_status(struct dvb_frontend *fe, enum fe_status *status)
|
||||
{
|
||||
struct stv *state = fe->demodulator_priv;
|
||||
struct dtv_frontend_properties *p = &fe->dtv_property_cache;
|
||||
@@ -1528,7 +1529,7 @@ get_stat:
|
||||
|
||||
static int tune(struct dvb_frontend *fe, bool re_tune,
|
||||
unsigned int mode_flags,
|
||||
unsigned int *delay, fe_status_t *status)
|
||||
unsigned int *delay, enum fe_status *status)
|
||||
{
|
||||
struct stv *state = fe->demodulator_priv;
|
||||
int r;
|
||||
@@ -1554,7 +1555,7 @@ static int get_algo(struct dvb_frontend *fe)
|
||||
return DVBFE_ALGO_HW;
|
||||
}
|
||||
|
||||
static int set_tone(struct dvb_frontend *fe, fe_sec_tone_mode_t tone)
|
||||
static int set_tone(struct dvb_frontend *fe, enum fe_sec_tone_mode tone)
|
||||
{
|
||||
struct stv *state = fe->demodulator_priv;
|
||||
u16 offs = state->nr ? 0x40 : 0;
|
||||
@@ -1608,7 +1609,7 @@ static int recv_slave_reply(struct dvb_frontend *fe,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int send_burst(struct dvb_frontend *fe, fe_sec_mini_cmd_t burst)
|
||||
static int send_burst(struct dvb_frontend *fe, enum fe_sec_mini_cmd burst)
|
||||
{
|
||||
#if 0
|
||||
struct stv *state = fe->demodulator_priv;
|
||||
|
||||
@@ -32,6 +32,9 @@
|
||||
#include "stv6110x.h"
|
||||
#include "stv6110x_priv.h"
|
||||
|
||||
/* Max transfer size done by I2C transfer functions */
|
||||
#define MAX_XFER_SIZE 64
|
||||
|
||||
static unsigned int verbose;
|
||||
module_param(verbose, int, 0644);
|
||||
MODULE_PARM_DESC(verbose, "Set Verbosity level");
|
||||
@@ -61,7 +64,8 @@ static int stv6110x_write_regs(struct stv6110x_state *stv6110x, int start, u8 da
|
||||
{
|
||||
int ret;
|
||||
const struct stv6110x_config *config = stv6110x->config;
|
||||
u8 buf[len + 1];
|
||||
u8 buf[MAX_XFER_SIZE];
|
||||
|
||||
struct i2c_msg msg = {
|
||||
.addr = config->addr,
|
||||
.flags = 0,
|
||||
@@ -69,6 +73,13 @@ static int stv6110x_write_regs(struct stv6110x_state *stv6110x, int start, u8 da
|
||||
.len = len + 1
|
||||
};
|
||||
|
||||
if (1 + len > sizeof(buf)) {
|
||||
printk(KERN_WARNING
|
||||
"%s: i2c wr: len=%d is too big!\n",
|
||||
KBUILD_MODNAME, len);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (start + len > 8)
|
||||
return -EINVAL;
|
||||
|
||||
@@ -324,17 +335,15 @@ static int stv6110x_get_status(struct dvb_frontend *fe, u32 *status)
|
||||
}
|
||||
|
||||
|
||||
static int stv6110x_release(struct dvb_frontend *fe)
|
||||
static void stv6110x_release(struct dvb_frontend *fe)
|
||||
{
|
||||
struct stv6110x_state *stv6110x = fe->tuner_priv;
|
||||
|
||||
fe->tuner_priv = NULL;
|
||||
kfree(stv6110x);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct dvb_tuner_ops stv6110x_ops = {
|
||||
static const struct dvb_tuner_ops stv6110x_ops = {
|
||||
.info = {
|
||||
.name = "STV6110(A) Silicon Tuner",
|
||||
.frequency_min = 950000,
|
||||
@@ -344,7 +353,7 @@ static struct dvb_tuner_ops stv6110x_ops = {
|
||||
.release = stv6110x_release
|
||||
};
|
||||
|
||||
static struct stv6110x_devctl stv6110x_ctl = {
|
||||
static const struct stv6110x_devctl stv6110x_ctl = {
|
||||
.tuner_init = stv6110x_init,
|
||||
.tuner_sleep = stv6110x_sleep,
|
||||
.tuner_set_mode = stv6110x_set_mode,
|
||||
@@ -358,7 +367,7 @@ static struct stv6110x_devctl stv6110x_ctl = {
|
||||
.tuner_get_status = stv6110x_get_status,
|
||||
};
|
||||
|
||||
struct stv6110x_devctl *stv6110x_attach(struct dvb_frontend *fe,
|
||||
const struct stv6110x_devctl *stv6110x_attach(struct dvb_frontend *fe,
|
||||
const struct stv6110x_config *config,
|
||||
struct i2c_adapter *i2c)
|
||||
{
|
||||
|
||||
@@ -53,14 +53,20 @@ struct stv6110x_devctl {
|
||||
};
|
||||
|
||||
|
||||
#if defined(CONFIG_DVB_STV6110x) || (defined(CONFIG_DVB_STV6110x_MODULE) && defined(MODULE))
|
||||
#include <linux/version.h>
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 1, 0))
|
||||
#define IS_REACHABLE(option) (config_enabled(option) || \
|
||||
(config_enabled(option##_MODULE) && config_enabled(MODULE)))
|
||||
#endif
|
||||
|
||||
extern struct stv6110x_devctl *stv6110x_attach(struct dvb_frontend *fe,
|
||||
#if IS_REACHABLE(CONFIG_DVB_STV6110x)
|
||||
|
||||
extern const struct stv6110x_devctl *stv6110x_attach(struct dvb_frontend *fe,
|
||||
const struct stv6110x_config *config,
|
||||
struct i2c_adapter *i2c);
|
||||
|
||||
#else
|
||||
static inline struct stv6110x_devctl *stv6110x_attach(struct dvb_frontend *fe,
|
||||
static inline const struct stv6110x_devctl *stv6110x_attach(struct dvb_frontend *fe,
|
||||
const struct stv6110x_config *config,
|
||||
struct i2c_adapter *i2c)
|
||||
{
|
||||
|
||||
@@ -70,7 +70,7 @@ struct stv6110x_state {
|
||||
const struct stv6110x_config *config;
|
||||
u8 regs[8];
|
||||
|
||||
struct stv6110x_devctl *devctl;
|
||||
const struct stv6110x_devctl *devctl;
|
||||
};
|
||||
|
||||
#endif /* __STV6110x_PRIV_H */
|
||||
|
||||
@@ -203,11 +203,10 @@ static int init(struct dvb_frontend *fe)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int release(struct dvb_frontend *fe)
|
||||
static void release(struct dvb_frontend *fe)
|
||||
{
|
||||
kfree(fe->tuner_priv);
|
||||
fe->tuner_priv = NULL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int set_bandwidth(struct dvb_frontend *fe, u32 CutOffFrequency)
|
||||
|
||||
@@ -790,11 +790,10 @@ static int init(struct dvb_frontend *fe)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int release(struct dvb_frontend *fe)
|
||||
static void release(struct dvb_frontend *fe)
|
||||
{
|
||||
kfree(fe->tuner_priv);
|
||||
fe->tuner_priv = NULL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int set_params(struct dvb_frontend *fe)
|
||||
|
||||
@@ -1144,11 +1144,10 @@ static int init(struct dvb_frontend *fe)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int release(struct dvb_frontend *fe)
|
||||
static void release(struct dvb_frontend *fe)
|
||||
{
|
||||
kfree(fe->tuner_priv);
|
||||
fe->tuner_priv = NULL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user