Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b4d6046e authored by Olivier Grenie's avatar Olivier Grenie Committed by Mauro Carvalho Chehab
Browse files

[media] DiBxxxx: Codingstype updates



This patchs fix several conding-style violations.

Signed-off-by: default avatarOlivier Grenie <olivier.grenie@dibcom.fr>
Signed-off-by: default avatarPatrick Boettcher <patrick.boettcher@dibcom.fr>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent be9bae10
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -347,7 +347,8 @@ int dib0700_set_i2c_speed(struct dvb_usb_device *d, u16 scl_kHz)
	b[6] = (u8) (divider >> 8);
	b[7] = (u8) (divider & 0xff);

	deb_info("setting I2C speed: %04x %04x %04x (%d kHz).", (b[2] << 8) | (b[3]), (b[4] << 8) | b[5], (b[6] << 8) | b[7], scl_kHz);
	deb_info("setting I2C speed: %04x %04x %04x (%d kHz).",
		(b[2] << 8) | (b[3]), (b[4] << 8) | b[5], (b[6] << 8) | b[7], scl_kHz);
	return dib0700_ctrl_wr(d, b, 8);
}

@@ -484,14 +485,14 @@ int dib0700_streaming_ctrl(struct dvb_usb_adapter *adap, int onoff)
	deb_info("modifying (%d) streaming state for %d\n", onoff, adap->id);

	st->channel_state &= ~0x3;
	if ((adap->stream.props.endpoint != 2) && (adap->stream.props.endpoint != 3)) {
	if ((adap->stream.props.endpoint != 2)
			&& (adap->stream.props.endpoint != 3)) {
		deb_info("the endpoint number (%i) is not correct, use the adapter id instead", adap->stream.props.endpoint);
		if (onoff)
			st->channel_state |=	1 << (adap->id);
		else
			st->channel_state |=	1 << ~(adap->id);
	}
	else {
	} else {
		if (onoff)
			st->channel_state |=	1 << (adap->stream.props.endpoint-2);
		else
+131 −132
Original line number Diff line number Diff line
@@ -1518,7 +1518,6 @@ static int dib8096_set_param_override(struct dvb_frontend *fe,

	if (band == BAND_CBAND) {
		deb_info("tuning in CBAND - soft-AGC startup\n");
	/* TODO specific wbd target for dib0090 - needed for startup ? */
		dib0090_set_tune_state(fe, CT_AGC_START);
		do {
			ret = dib0090_gain_control(fe);
@@ -1608,7 +1607,7 @@ static int nim8096md_frontend_attach(struct dvb_usb_adapter *adap)
	struct dvb_frontend *fe_slave;

	dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 0);
	msleep(10);
	msleep(20);
	dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1);
	msleep(1000);
	dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1);
@@ -1619,9 +1618,9 @@ static int nim8096md_frontend_attach(struct dvb_usb_adapter *adap)

	dib0700_ctrl_clock(adap->dev, 72, 1);

	msleep(10);
	msleep(20);
	dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1);
	msleep(10);
	msleep(20);
	dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1);

	dib8000_i2c_enumeration(&adap->dev->i2c_adap, 2, 18, 0x80);
@@ -1832,7 +1831,7 @@ static int stk9090m_frontend_attach(struct dvb_usb_adapter *adap)
	dib0700_set_i2c_speed(adap->dev, 340);

	dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1);
	msleep(10);
	msleep(20);
	dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1);
	dib0700_set_gpio(adap->dev, GPIO4, GPIO_OUT, 1);
	dib0700_set_gpio(adap->dev, GPIO7, GPIO_OUT, 1);
@@ -1840,9 +1839,9 @@ static int stk9090m_frontend_attach(struct dvb_usb_adapter *adap)

	dib0700_ctrl_clock(adap->dev, 72, 1);

	msleep(10);
	msleep(20);
	dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1);
	msleep(10);
	msleep(20);
	dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1);

	dib9000_i2c_enumeration(&adap->dev->i2c_adap, 1, 0x10, 0x80);
@@ -1900,7 +1899,7 @@ static int nim9090md_frontend_attach(struct dvb_usb_adapter *adap)
	dib0700_set_i2c_speed(adap->dev, 340);

	dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1);
	msleep(10);
	msleep(20);
	dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1);
	dib0700_set_gpio(adap->dev, GPIO4, GPIO_OUT, 1);
	dib0700_set_gpio(adap->dev, GPIO7, GPIO_OUT, 1);
@@ -1908,9 +1907,9 @@ static int nim9090md_frontend_attach(struct dvb_usb_adapter *adap)

	dib0700_ctrl_clock(adap->dev, 72, 1);

	msleep(10);
	msleep(20);
	dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1);
	msleep(10);
	msleep(20);
	dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1);

	if (request_firmware(&state->frontend_firmware, "dib9090.fw", &adap->dev->udev->dev)) {
@@ -2053,9 +2052,9 @@ static int dib7090p_get_best_sampling(struct dvb_frontend *fe , struct dib7090p_
	}


	if(adc->pll_loopdiv == 0 && adc->pll_prediv == 0) {
	if (adc->pll_loopdiv == 0 && adc->pll_prediv == 0)
		return -EINVAL;
	} else
	else
		return 0;
}

@@ -2090,8 +2089,8 @@ static int dib7090_agc_startup(struct dvb_frontend *fe, struct dvb_frontend_para
static struct dib0090_wbd_slope dib7090_wbd_table[] = {
	{ 380,   81, 850, 64, 540,  4},
	{ 860,   51, 866, 21,  375, 4},
	{1700,    0, 250, 0,   100, 6}, //LBAND Predefinition , NOT tested Yet
	{2600,    0, 250, 0,   100, 6}, //SBAND Predefinition , NOT tested Yet
	{1700,    0, 250, 0,   100, 6},
	{2600,    0, 250, 0,   100, 6},
	{ 0xFFFF, 0,   0, 0,   0,   0},
};

@@ -2100,91 +2099,91 @@ struct dibx000_agc_config dib7090_agc_config[2] = {
		.band_caps      = BAND_UHF,
		/* P_agc_use_sd_mod1=0, P_agc_use_sd_mod2=0, P_agc_freq_pwm_div=1, P_agc_inv_pwm1=0, P_agc_inv_pwm2=0,
		* P_agc_inh_dc_rv_est=0, P_agc_time_est=3, P_agc_freeze=0, P_agc_nb_est=5, P_agc_write=0 */
		.setup          = (0 << 15) | (0 << 14) | (5 << 11) | (0 << 10) | (0 << 9) | (0 << 8) | (3 << 5) | (0 << 4) | (5 << 1) | (0 << 0), // setup

		.inv_gain       = 687,// inv_gain = 1/ 95.4dB // no boost, lower gain due to ramp quantification
		.time_stabiliz  = 10,  // time_stabiliz

		.alpha_level    = 0,  // alpha_level
		.thlock         = 118,  // thlock
		.setup          = (0 << 15) | (0 << 14) | (5 << 11) | (0 << 10) | (0 << 9) | (0 << 8) | (3 << 5) | (0 << 4) | (5 << 1) | (0 << 0),

		.wbd_inv        = 0,     // wbd_inv
		.wbd_ref        = 1200,  // wbd_ref
		.wbd_sel        = 3,     // wbd_sel
		.wbd_alpha      = 5,     // wbd_alpha
		.inv_gain       = 687,
		.time_stabiliz  = 10,

		.agc1_max       = 65535,  // agc1_max
		.agc1_min       = 0,  // agc1_min
		.alpha_level    = 0,
		.thlock         = 118,

		.agc2_max       = 65535,  // agc2_max
		.agc2_min       = 0,      // agc2_min
		.wbd_inv        = 0,
		.wbd_ref        = 1200,
		.wbd_sel        = 3,
		.wbd_alpha      = 5,

		.agc1_pt1       = 0,      // agc1_pt1
		.agc1_pt2       = 32,     // agc1_pt2
		.agc1_pt3       = 114,    // agc1_pt3  // 40.4dB
		.agc1_slope1    = 143,    // agc1_slope1
		.agc1_slope2    = 144,    // agc1_slope2
		.agc2_pt1       = 114,    // agc2_pt1
		.agc2_pt2       = 227,    // agc2_pt2
		.agc2_slope1    = 116,    // agc2_slope1
		.agc2_slope2    = 117,    // agc2_slope2
		.agc1_max       = 65535,
		.agc1_min       = 0,

		.alpha_mant     = 18,  // alpha_mant // 5Hz with 95.4dB
		.alpha_exp      = 0,   // alpha_exp
		.beta_mant      = 20,  // beta_mant
		.beta_exp       = 59,  // beta_exp
		.agc2_max       = 65535,
		.agc2_min       = 0,

		.perform_agc_softsplit = 0,  // perform_agc_softsplit
		.agc1_pt1       = 0,
		.agc1_pt2       = 32,
		.agc1_pt3       = 114,
		.agc1_slope1    = 143,
		.agc1_slope2    = 144,
		.agc2_pt1       = 114,
		.agc2_pt2       = 227,
		.agc2_slope1    = 116,
		.agc2_slope2    = 117,

		.alpha_mant     = 18,
		.alpha_exp      = 0,
		.beta_mant      = 20,
		.beta_exp       = 59,

		.perform_agc_softsplit = 0,
	} , {
		.band_caps      = BAND_FM | BAND_VHF | BAND_CBAND,
		/* P_agc_use_sd_mod1=0, P_agc_use_sd_mod2=0, P_agc_freq_pwm_div=1, P_agc_inv_pwm1=0, P_agc_inv_pwm2=0,
		* P_agc_inh_dc_rv_est=0, P_agc_time_est=3, P_agc_freeze=0, P_agc_nb_est=5, P_agc_write=0 */
		.setup          = (0 << 15) | (0 << 14) | (5 << 11) | (0 << 10) | (0 << 9) | (0 << 8) | (3 << 5) | (0 << 4) | (5 << 1) | (0 << 0), // setup
		.setup          = (0 << 15) | (0 << 14) | (5 << 11) | (0 << 10) | (0 << 9) | (0 << 8) | (3 << 5) | (0 << 4) | (5 << 1) | (0 << 0),

		.inv_gain       = 732,// inv_gain = 1/ 89.5dB // no boost, lower gain due to ramp quantification
		.time_stabiliz  = 10,  // time_stabiliz
		.inv_gain       = 732,
		.time_stabiliz  = 10,

		.alpha_level    = 0,  // alpha_level
		.thlock         = 118,  // thlock
		.alpha_level    = 0,
		.thlock         = 118,

		.wbd_inv        = 0,     // wbd_inv
		.wbd_ref        = 1200,  // wbd_ref
		.wbd_sel        = 3,     // wbd_sel
		.wbd_alpha      = 5,     // wbd_alpha
		.wbd_inv        = 0,
		.wbd_ref        = 1200,
		.wbd_sel        = 3,
		.wbd_alpha      = 5,

		.agc1_max       = 65535,  // agc1_max : 1
		.agc1_min       = 0,      // agc1_min
		.agc1_max       = 65535,
		.agc1_min       = 0,

		.agc2_max       = 65535,  // agc2_max
		.agc2_min       = 0,      // agc2_min
		.agc2_max       = 65535,
		.agc2_min       = 0,

		.agc1_pt1       = 0,      // agc1_pt1
		.agc1_pt2       = 0,      // agc1_pt2
		.agc1_pt3       = 98,     // agc1_pt3  // 34.5dB CBAND P1G + 55dB BB boost = 89.5dB
		.agc1_slope1    = 0,      // agc1_slope1
		.agc1_slope2    = 167,    // agc1_slope2 = Dy/Dx * 2**6 * 2**8 = 1/98 * 2**6 *2**8 : Dy = 1
		.agc1_pt1       = 98,     // agc2_pt1
		.agc2_pt2       = 255,    // agc2_pt2
		.agc2_slope1    = 104,    // agc2_slope1 = Dy/Dx * 2**6 * 2**8 = 1/(255-98) * 2**6 *2**8
		.agc2_slope2    = 0,      // agc2_slope2
		.agc1_pt1       = 0,
		.agc1_pt2       = 0,
		.agc1_pt3       = 98,
		.agc1_slope1    = 0,
		.agc1_slope2    = 167,
		.agc1_pt1       = 98,
		.agc2_pt2       = 255,
		.agc2_slope1    = 104,
		.agc2_slope2    = 0,

		.alpha_mant     = 18,  // alpha_mant // 5Hz with 95.4dB
		.alpha_exp      = 0,   // alpha_exp
		.beta_mant      = 20,  // beta_mant
		.beta_exp       = 59,  // beta_exp
		.alpha_mant     = 18,
		.alpha_exp      = 0,
		.beta_mant      = 20,
		.beta_exp       = 59,

		.perform_agc_softsplit = 0,  // perform_agc_softsplit
		.perform_agc_softsplit = 0,
	}
};

static struct dibx000_bandwidth_config dib7090_clock_config_12_mhz = {
	60000, 15000, // internal, sampling
	1, 5, 0, 0, 0, // pll_cfg: prediv, ratio, range, reset, bypass
	0, 0, 1, 1, 2, // misc: refdiv, bypclk_div, IO_CLK_en_core, ADClkSrc, modulo
	(3 << 14) | (1 << 12) | (524 << 0), // sad_cfg: refsel, sel, freq_15k
	(0 << 25) | 0, // ifreq = 0.000000 MHz
	20452225, // timf
	15000000, // xtal_hz
	60000, 15000,
	1, 5, 0, 0, 0,
	0, 0, 1, 1, 2,
	(3 << 14) | (1 << 12) | (524 << 0),
	(0 << 25) | 0,
	20452225,
	15000000,
};

static struct dib7000p_config nim7090_dib7000p_config = {
@@ -2378,15 +2377,15 @@ static const struct dib0090_config tfe7090pvr_dib0090_config[2] = {
static int nim7090_frontend_attach(struct dvb_usb_adapter *adap)
{
	dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1);
	msleep(10);
	msleep(20);
	dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1);
	dib0700_set_gpio(adap->dev, GPIO4, GPIO_OUT, 1);
	dib0700_set_gpio(adap->dev, GPIO7, GPIO_OUT, 1);
	dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0);

	msleep(10);
	msleep(20);
	dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1);
	msleep(10);
	msleep(20);
	dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1);

	if (dib7000p_i2c_enumeration(&adap->dev->i2c_adap, 1, 0x10, &nim7090_dib7000p_config) != 0) {
@@ -2421,15 +2420,15 @@ static int tfe7090pvr_frontend0_attach(struct dvb_usb_adapter *adap)
	st->disable_streaming_master_mode = 1;

	dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1);
	msleep(10);
	msleep(20);
	dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1);
	dib0700_set_gpio(adap->dev, GPIO4, GPIO_OUT, 1);
	dib0700_set_gpio(adap->dev, GPIO7, GPIO_OUT, 1);
	dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0);

	msleep(10);
	msleep(20);
	dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1);
	msleep(10);
	msleep(20);
	dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1);

	/* initialize IC 0 */
Loading