You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
96 lines
3.1 KiB
96 lines
3.1 KiB
mxl5007t: add no_probe and no_reset parameters
|
|
|
|
partial backport of this patch by Jose Alberto Reguero:
|
|
https://patchwork.kernel.org/patch/1386131/
|
|
|
|
it should fix the problems with a particular revision of the a867 stick.
|
|
|
|
From: Gianluca Gennari <gennarone@gmail.com>
|
|
---
|
|
drivers/media/tuners/mxl5007t.c | 15 +++++++++++----
|
|
drivers/media/tuners/mxl5007t.h | 4 +++-
|
|
drivers/media/usb/dvb-usb-v2/af9035.c | 2 ++
|
|
3 files changed, 16 insertions(+), 5 deletions(-)
|
|
|
|
diff --git a/drivers/media/tuners/mxl5007t.c b/drivers/media/tuners/mxl5007t.c
|
|
index 69e453e..7886a5a 100644
|
|
--- a/drivers/media/tuners/mxl5007t.c
|
|
+++ b/drivers/media/tuners/mxl5007t.c
|
|
@@ -374,7 +374,6 @@ static struct reg_pair_t *mxl5007t_calc_init_regs(struct mxl5007t_state *state,
|
|
mxl5007t_set_if_freq_bits(state, cfg->if_freq_hz, cfg->invert_if);
|
|
mxl5007t_set_xtal_freq_bits(state, cfg->xtal_freq_hz);
|
|
|
|
- set_reg_bits(state->tab_init, 0x04, 0x01, cfg->loop_thru_enable);
|
|
set_reg_bits(state->tab_init, 0x03, 0x08, cfg->clk_out_enable << 3);
|
|
set_reg_bits(state->tab_init, 0x03, 0x07, cfg->clk_out_amp);
|
|
|
|
@@ -531,9 +530,12 @@ static int mxl5007t_tuner_init(struct mxl5007t_state *state,
|
|
struct reg_pair_t *init_regs;
|
|
int ret;
|
|
|
|
- ret = mxl5007t_soft_reset(state);
|
|
- if (mxl_fail(ret))
|
|
+ if (!state->config->no_reset) {
|
|
+ ret = mxl5007t_soft_reset(state);
|
|
+ if (mxl_fail(ret))
|
|
goto fail;
|
|
+ }
|
|
+
|
|
|
|
/* calculate initialization reg array */
|
|
init_regs = mxl5007t_calc_init_regs(state, mode);
|
|
@@ -887,7 +889,12 @@ struct dvb_frontend *mxl5007t_attach(struct dvb_frontend *fe,
|
|
if (fe->ops.i2c_gate_ctrl)
|
|
fe->ops.i2c_gate_ctrl(fe, 1);
|
|
|
|
- ret = mxl5007t_get_chip_id(state);
|
|
+ if (!state->config->no_probe)
|
|
+ ret = mxl5007t_get_chip_id(state);
|
|
+
|
|
+ ret = mxl5007t_write_reg(state, 0x04,
|
|
+ state->config->loop_thru_enable);
|
|
+
|
|
|
|
if (fe->ops.i2c_gate_ctrl)
|
|
fe->ops.i2c_gate_ctrl(fe, 0);
|
|
diff --git a/drivers/media/tuners/mxl5007t.h b/drivers/media/tuners/mxl5007t.h
|
|
index 37b0942..f47bb27 100644
|
|
--- a/drivers/media/tuners/mxl5007t.h
|
|
+++ b/drivers/media/tuners/mxl5007t.h
|
|
@@ -73,8 +73,10 @@ struct mxl5007t_config {
|
|
enum mxl5007t_xtal_freq xtal_freq_hz;
|
|
enum mxl5007t_if_freq if_freq_hz;
|
|
unsigned int invert_if:1;
|
|
- unsigned int loop_thru_enable:1;
|
|
+ unsigned int loop_thru_enable:3;
|
|
unsigned int clk_out_enable:1;
|
|
+ unsigned int no_probe:1;
|
|
+ unsigned int no_reset:1;
|
|
};
|
|
|
|
#if IS_ENABLED(CONFIG_MEDIA_TUNER_MXL5007T)
|
|
diff --git a/drivers/media/usb/dvb-usb-v2/af9035.c b/drivers/media/usb/dvb-usb-v2/af9035.c
|
|
index f11cc42..d366d34 100644
|
|
--- a/drivers/media/usb/dvb-usb-v2/af9035.c
|
|
+++ b/drivers/media/usb/dvb-usb-v2/af9035.c
|
|
@@ -886,6 +886,8 @@ static struct mxl5007t_config af9035_mxl5007t_config[] = {
|
|
.loop_thru_enable = 0,
|
|
.clk_out_enable = 0,
|
|
.clk_out_amp = MxL_CLKOUT_AMP_0_94V,
|
|
+ .no_probe = 1,
|
|
+ .no_reset = 1,
|
|
}, {
|
|
.xtal_freq_hz = MxL_XTAL_24_MHZ,
|
|
.if_freq_hz = MxL_IF_4_57_MHZ,
|
|
@@ -893,6 +895,8 @@ static struct mxl5007t_config af9035_mxl5007t_config[] = {
|
|
.loop_thru_enable = 1,
|
|
.clk_out_enable = 1,
|
|
.clk_out_amp = MxL_CLKOUT_AMP_0_94V,
|
|
+ .no_probe = 1,
|
|
+ .no_reset = 1,
|
|
}
|
|
};
|
|
|
|
--
|
|
1.7.9.5
|
|
|
|
|