V4L/DVB (4479): LNB voltage control was inverted for the benefit of geniatech cards...
authorYeasah Pell <yeasah@schwide.com>
Tue, 26 Sep 2006 15:30:14 +0000 (12:30 -0300)
committerMauro Carvalho Chehab <mchehab@infradead.org>
Tue, 26 Sep 2006 15:30:14 +0000 (12:30 -0300)
1) It sets LNBDCPol differently based on the card type. Now it should
work properly for both the kworld and geniatech cards.
2) It stops returning an error for the SEC_VOLTAGE_OFF voltage command
(the cx88-dvb level handles the actual voltage on/off, but it still
passes the ioctl down to the cx24123 level, which previously rejected
the OFF as invalid so the ioctl would report failure)

Acked-by: Manu Abraham <manu@linuxtv.org>
Signed-off-by: Yeasah Pell <yeasah@schwide.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
drivers/media/dvb/frontends/cx24123.c
drivers/media/dvb/frontends/cx24123.h
drivers/media/video/cx88/cx88-dvb.c

index f77b2d59955ca654d15ccc2a517e97e5d0e72b3d..62d69a6ea699269e2a937c1a764fd28e1cc3976c 100644 (file)
@@ -661,6 +661,10 @@ static int cx24123_initfe(struct dvb_frontend* fe)
        for (i = 0; i < sizeof(cx24123_regdata) / sizeof(cx24123_regdata[0]); i++)
                cx24123_writereg(state, cx24123_regdata[i].reg, cx24123_regdata[i].data);
 
+       /* Set the LNB polarity */
+       if(state->config->lnb_polarity)
+               cx24123_writereg(state, 0x32, cx24123_readreg(state, 0x32) | 0x02);
+
        return 0;
 }
 
@@ -678,6 +682,9 @@ static int cx24123_set_voltage(struct dvb_frontend* fe, fe_sec_voltage_t voltage
        case SEC_VOLTAGE_18:
                dprintk("%s: setting voltage 18V\n", __FUNCTION__);
                return cx24123_writereg(state, 0x29, val | 0x80);
+       case SEC_VOLTAGE_OFF:
+               /* already handled in cx88-dvb */
+               return 0;
        default:
                return -EINVAL;
        };
index 6a8cb4c41adfb76d21145cd6e359bfcd400f106e..57a1dae1dc40a5bc1c61434f614401f638f84b69 100644 (file)
@@ -30,6 +30,9 @@ struct cx24123_config
 
        /* Need to set device param for start_dma */
        int (*set_ts_params)(struct dvb_frontend* fe, int is_punctured);
+
+       /* 0 = LNB voltage normal, 1 = LNB voltage inverted */
+       int lnb_polarity;
 };
 
 #if defined(CONFIG_DVB_CX24123) || defined(CONFIG_DVB_CX24123_MODULE)
index ebbf540771328a4bd4fb4247589e263e0d7b0b6d..0771acbed74dd031ba4a2632a848f7d5d1fe51ba 100644 (file)
@@ -498,6 +498,7 @@ static struct cx24123_config hauppauge_novas_config = {
 static struct cx24123_config kworld_dvbs_100_config = {
        .demod_address = 0x15,
        .set_ts_params = cx24123_set_ts_param,
+       .lnb_polarity  = 1,
 };
 
 static int dvb_register(struct cx8802_dev *dev)