module_param(debug, int, 0644);
MODULE_PARM_DESC(debug, "enable verbose debug messages");
+static int no_imr_cal;
+module_param(no_imr_cal, int, 0444);
+MODULE_PARM_DESC(no_imr_cal, "Disable IMR calibration at module init");
+
+
/*
* enums and structures
*/
u32 int_freq;
u8 fil_cal_code;
bool imr_done;
-
+ bool has_lock;
+ bool init_done;
struct r820t_sect_type imr_data[NUM_IMR];
/* Store current mode */
enum v4l2_tuner_type type;
v4l2_std_id std;
u32 bw; /* in MHz */
-
- bool has_lock;
};
struct r820t_freq_range {
int rc, i;
int xtal_cap = 0;
- if (priv->imr_done)
+ if (priv->init_done)
return 0;
/* Initialize registers */
priv->xtal_cap_sel = xtal_cap;
}
+ /*
+ * Disables IMR callibration. That emulates the same behaviour
+ * as what is done by rtl-sdr userspace library. Useful for testing
+ */
+ if (no_imr_cal) {
+ priv->init_done = true;
+
+ return 0;
+ }
+
/* Initialize registers */
rc = r820t_write(priv, 0x05,
r820t_init_array, sizeof(r820t_init_array));
if (rc < 0)
return rc;
+ priv->init_done = true;
priv->imr_done = true;
return 0;