From db00788c842e8f2eb3363799da479ecb0ab985eb Mon Sep 17 00:00:00 2001 From: Johannes Stezenbach Date: Mon, 12 May 2003 16:15:08 +0000 Subject: added support for FE_DISEQC_SEND_MASTER_CMD (patch supplied by Volker Cordes) --- linux/drivers/media/dvb/frontends/cx24110.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'linux/drivers/media/dvb/frontends/cx24110.c') diff --git a/linux/drivers/media/dvb/frontends/cx24110.c b/linux/drivers/media/dvb/frontends/cx24110.c index ed2441cdd..87d26398b 100644 --- a/linux/drivers/media/dvb/frontends/cx24110.c +++ b/linux/drivers/media/dvb/frontends/cx24110.c @@ -467,6 +467,17 @@ int cx24110_set_voltage (struct dvb_i2c_bus *i2c, fe_sec_voltage_t voltage) }; } +static void sendDiSEqCMessage(struct dvb_i2c_bus *i2c, struct dvb_diseqc_master_cmd *pCmd) { + int i, rv; + for (i = 0; i < pCmd->msg_len; i++) + cx24110_writereg(i2c, 0x79 + i, pCmd->msg[i]); + + rv = cx24110_readreg(i2c, 0x76); + + cx24110_writereg(i2c, 0x76, ((rv & 0x90) | 0x40) | ((pCmd->msg_len-3) & 3)); + for(i=500;i-->0&&!(cx24110_readreg(i2c,0x76)&0x40);); /* wait for LNB ready */ +} + static int cx24110_ioctl (struct dvb_frontend *fe, unsigned int cmd, void *arg) @@ -617,6 +628,12 @@ int cx24110_ioctl (struct dvb_frontend *fe, unsigned int cmd, void *arg) case FE_SET_VOLTAGE: return cx24110_set_voltage (i2c, (fe_sec_voltage_t) arg); + case FE_DISEQC_SEND_MASTER_CMD: + { + sendDiSEqCMessage(i2c, (struct dvb_diseqc_master_cmd*) arg); + return 0; + } + default: return -EOPNOTSUPP; }; -- cgit v1.2.3