[linux-dvb] [PATCH] support for KWorld DVB-S 100

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Nov 21, 2005, Vadim Catana wrote:
> These patches add support for KWorld DVB-S 100. The card is based
> on the same chips as Hauppauge Nova-S Plus (CX23883/CX24123/CX24109),
> but does not have the Intersil ISL6421, which is used for LNB control.
> On this card LNB voltage and tone are controled by LNBDC and LNBTone
> bits from register 0x29 of the CX24123 demodulator. The MO_GP0_IO
> register from CX23883 is used to turn LNB power on and off.

Nice, but can we avoid to add board specific code to the demod driver?

> +     case CX88_BOARD_KWORLD_DVBS_100:
> +
> +         val = cx24123_readreg(state, 0x29);
> +
> +         switch (voltage) {
> +         case SEC_VOLTAGE_13:
> +             dprintk("%s: setting voltage 13V\n", __FUNCTION__);
> +             if (state->config->enable_lnb_voltage) state->config->enable_lnb_voltage(fe, 1);

+		if (state->config->enable_lnb_voltage)
			state->config->enable_lnb_voltage(fe, 1);


> +             return cx24123_writereg(state, 0x29, val | 0x80);
> +         case SEC_VOLTAGE_18:
> +             dprintk("%s: setting voltage 18V\n", __FUNCTION__);
> +             if (state->config->enable_lnb_voltage) state->config->enable_lnb_voltage(fe, 1);
> +             return cx24123_writereg(state, 0x29, val & 0x7f);
> +         case SEC_VOLTAGE_OFF:
> +             dprintk("%s: setting voltage off\n", __FUNCTION__);
> +             if (state->config->enable_lnb_voltage) state->config->enable_lnb_voltage(fe, 0);
> +             return 0;
> +         default:
> +             return -EINVAL;
> +         };
> +     }

indent one tab, please

> +/* these are taken from v4l-kernel */
> +#define CX88_BOARD_HAUPPAUGE_NOVASPLUS_S1  37
> +#define CX88_BOARD_HAUPPAUGE_NOVASE2_S1    38
> +#define CX88_BOARD_KWORLD_DVBS_100         39

won't these lead to conflicts? better get rid of this

> +
>  struct cx24123_config
>  {
>  	/* the demodulator's i2c address */
>  	u8 demod_address;
>  
> +	/* "KWorld DVB-S 100" or "Hauppauge Nova-S Plus" */
> +	int card_type;
> +

maybe better:
	int use_isl6421;	/* LNB / tone control via Intersil ISL6421 */

> +static void enable_lnb_voltage(struct dvb_frontend* fe, int on)
> +{
> +    struct cx8802_dev *dev= fe->dvb->priv;
> +    struct cx88_core *core = dev->core;
> +
> +    if ( on == 1 ) {
> +	cx_write(MO_GP0_IO, 0x000006f9);
> +    } else {
> +	cx_write(MO_GP0_IO, 0x000006fB);
> +    }
> +}
> +

indent one tab, please

>  static struct cx24123_config hauppauge_novas_config = {
> +	.card_type = CX88_BOARD_HAUPPAUGE_NOVASE2_S1,

	.use_isl6421 = 1,

>  	.demod_address = 0x55,
>  	.set_ts_params = cx24123_set_ts_param,
>  };
> +
> +static struct cx24123_config kworld_dvbs_100_config = {
> +	.card_type = CX88_BOARD_KWORLD_DVBS_100,

	.use_isl6421 = 0,

> +	.demod_address = 0x15,
> +	.set_ts_params = cx24123_set_ts_param,
> +	.enable_lnb_voltage = enable_lnb_voltage,
> +};
>  #endif
>  

Can you send an updated patch, please?

Thanks,
Johannes


[Index of Archives]     [Linux Media]     [Video 4 Linux]     [Asterisk]     [Samba]     [Xorg]     [Xfree86]     [Linux USB]

  Powered by Linux