summaryrefslogtreecommitdiff
path: root/linux/drivers/media
diff options
context:
space:
mode:
authorRoberto Ragusa <devnull@localhost>2003-12-06 00:38:04 +0000
committerRoberto Ragusa <devnull@localhost>2003-12-06 00:38:04 +0000
commit4b3830c616d398b5fde74f4d807a6b5857394b77 (patch)
tree8b23ab226e89592e171a5f115c0e60394ac78347 /linux/drivers/media
parent105076a838a2fd64c5ee8552d503d8eab22474f6 (diff)
downloadmediapointer-dvb-s2-4b3830c616d398b5fde74f4d807a6b5857394b77.tar.gz
mediapointer-dvb-s2-4b3830c616d398b5fde74f4d807a6b5857394b77.tar.bz2
Readded skystar2 diseqc from Vincenzo Di Massa.
Diffstat (limited to 'linux/drivers/media')
-rw-r--r--linux/drivers/media/dvb/b2c2/skystar2.c208
-rw-r--r--linux/drivers/media/dvb/ttusb-dec/ttusb_dec.c2
2 files changed, 110 insertions, 100 deletions
diff --git a/linux/drivers/media/dvb/b2c2/skystar2.c b/linux/drivers/media/dvb/b2c2/skystar2.c
index 75ce9140f..c2219700a 100644
--- a/linux/drivers/media/dvb/b2c2/skystar2.c
+++ b/linux/drivers/media/dvb/b2c2/skystar2.c
@@ -10,7 +10,7 @@
*
* IMP: Converted to Linux coding style
* Roberto Ragusa, r.ragusa at libero.it
- *
+ *
* Added hardware filtering support,
* Niklas Peinecke, peinecke at gdv.uni-hannover.de
*
@@ -29,6 +29,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
+
#include <linux/module.h>
#include <linux/delay.h>
#include <linux/pci.h>
@@ -2121,139 +2122,148 @@ static void set_tuner_polarity(struct adapter *adapter, u8 polarity)
write_reg_dw(adapter, 0x204, var);
}
-static int flexcop_diseqc_ioctl(struct dvb_frontend *fe, unsigned int cmd, void *arg)
+static void diseqc_send_bit (struct adapter *adapter, int data)
{
- struct adapter *adapter = fe->before_after_data;
+ set_tuner_tone(adapter, 1);
+ udelay(data ? 500 : 1000);
+ set_tuner_tone(adapter, 0);
+ udelay(data ? 1000 : 500);
+}
- struct dvb_frontend_info info;
-
- switch (cmd) {
-
- case FE_DISEQC_SEND_BURST:
- {
- u8 count;
- fe_sec_mini_cmd_t b = (fe_sec_mini_cmd_t) arg;
- dprintk("%s: FE_SEND_BURST ", __FUNCTION__);
- switch ( b )
- {
- case SEC_MINI_A:
- {
- dprintk("SEC_MINI_A\n");
- set_tuner_tone(adapter, 1); // This lines are needed
- udelay(500*25); // to do a down-step
- set_tuner_tone(adapter, 0);
- udelay(500*25);
- break;
- }
- case SEC_MINI_B:
- {
- dprintk("SEC_MINI_B\n");
- set_tuner_tone(adapter, 0);
- udelay(1000*15);
- for (count=0;count<9; count++)
- {
- set_tuner_tone(adapter, 1);
- udelay(500);
- set_tuner_tone(adapter, 0);
- udelay(1000);
- }
- udelay(1000*15);
- break;
- }
- default:
- break;
- };
- return 0;
- }
-
- case FE_SLEEP:
- {
- dprintk("%s: FE_SLEEP\n", __FUNCTION__);
+static void diseqc_send_byte (struct adapter *adapter, int data)
+{
+ int i, par=1, d;
- set_tuner_polarity(adapter, 0);
+ for (i=7; i>=0; i--) {
+ d = (data>>i)&1;
+ par ^= d;
+ diseqc_send_bit(adapter, d);
+ }
- // return -EOPNOTSUPP, to make DVB core also send "FE_SLEEP" command to frontend.
- return -EOPNOTSUPP;
- }
+ diseqc_send_bit(adapter, par);
+}
- case FE_SET_VOLTAGE:
- {
- dprintk("%s: FE_SET_VOLTAGE\n", __FUNCTION__);
- switch ((fe_sec_voltage_t) arg)
- {
- case SEC_VOLTAGE_13:
+static int send_diseqc_msg (struct adapter *adapter, int len, u8 *msg, unsigned long burst)
+{
+ int i;
- dprintk("%s: SEC_VOLTAGE_13, %x\n", __FUNCTION__, SEC_VOLTAGE_13);
+ set_tuner_tone(adapter, 0);
+ mdelay(16);
- set_tuner_polarity(adapter, 1);
+ for (i=0; i<len; i++)
+ diseqc_send_byte(adapter, msg[i]);
- return 0;
+ mdelay(16);
- case SEC_VOLTAGE_18:
+ if (burst!=-1) {
+ if (burst)
+ diseqc_send_byte(adapter, 0xff);
+ else {
+ set_tuner_tone(adapter, 1);
+ udelay(12500);
+ set_tuner_tone(adapter, 0);
+ }
+ dvb_delay(20);
+ }
- dprintk("%s: SEC_VOLTAGE_18, %x\n", __FUNCTION__, SEC_VOLTAGE_18);
+ return 0;
+}
- set_tuner_polarity(adapter, 2);
- return 0;
+int soft_diseqc (struct adapter *adapter, unsigned int cmd, void *arg)
+{
+ switch (cmd) {
+ case FE_SET_TONE:
+ switch ((fe_sec_tone_mode_t) arg) {
+ case SEC_TONE_ON:
+ set_tuner_tone(adapter, 1);
+ break;
+ case SEC_TONE_OFF:
+ set_tuner_tone(adapter, 0);
+ break;
+ default:
+ return -EINVAL;
+ };
+ break;
+
+ case FE_DISEQC_SEND_MASTER_CMD:
+ {
+ struct dvb_diseqc_master_cmd *cmd = arg;
+
+ send_diseqc_msg (adapter, cmd->msg_len, cmd->msg, 0);
+ break;
+ }
- default:
+ case FE_DISEQC_SEND_BURST:
+ send_diseqc_msg (adapter, 0, NULL, (unsigned long)arg);
+ break;
- return -EINVAL;
- };
+ default:
+ return -EOPNOTSUPP;
+ };
- }
+ return 0;
+}
- case FE_SET_TONE:
- {
- dprintk("%s: FE_SET_TONE\n", __FUNCTION__);
+static int flexcop_diseqc_ioctl(struct dvb_frontend *fe, unsigned int cmd, void *arg)
+{
+ struct adapter *adapter = fe->before_after_data;
- fe->ioctl(fe, FE_GET_INFO, &info);
+ struct dvb_frontend_info info;
+
+ fe->ioctl(fe, FE_GET_INFO, &info);
- if ( strcmp(info.name, "Zarlink MT312") == 0)
- {
- dprintk("%s: FE_SET_TONE for %s frontend\n", __FUNCTION__, info.name);
-
- switch ((fe_sec_tone_mode_t) arg)
- {
- case SEC_TONE_ON:
+ // we must use different DiSEqC hw
+
+ if ( strcmp(info.name, "Zarlink MT312") == 0){
+ //VP310 using mt312 driver for tuning only: diseqc not wired
+ //use FCII instead
+ if (!soft_diseqc(adapter,cmd,arg))
+ return 0;
+ }
+
+ switch (cmd) {
+ case FE_SLEEP:
+ {
+ dprintk("%s: FE_SLEEP\n", __FUNCTION__);
- dprintk("%s: SEC_TONE_ON, %x\n", __FUNCTION__, SEC_TONE_ON);
+ set_tuner_polarity(adapter, 0);
- set_tuner_tone(adapter, 1);
+ // return -EOPNOTSUPP, to make DVB core also send "FE_SLEEP" command to frontend.
+ return -EOPNOTSUPP;
+ }
- return 0;
+ case FE_SET_VOLTAGE:
+ {
+ dprintk("%s: FE_SET_VOLTAGE\n", __FUNCTION__);
- case SEC_TONE_OFF:
+ switch ((fe_sec_voltage_t) arg)
+ {
+ case SEC_VOLTAGE_13:
- dprintk("%s: SEC_TONE_OFF, %x\n", __FUNCTION__, SEC_TONE_OFF);
+ dprintk("%s: SEC_VOLTAGE_13, %x\n", __FUNCTION__, SEC_VOLTAGE_13);
- set_tuner_tone(adapter, 0);
+ set_tuner_polarity(adapter, 1);
- return 0;
+ return 0;
- default:
+ case SEC_VOLTAGE_18:
- return -EINVAL;
- };
+ dprintk("%s: SEC_VOLTAGE_18, %x\n", __FUNCTION__, SEC_VOLTAGE_18);
- };
-
- if ( strcmp(info.name, "STV0299/TSA5059/SL1935 based") == 0)
- {
- dprintk("%s: FE_SET_TONE for %s frontend\n", __FUNCTION__, info.name);
+ set_tuner_polarity(adapter, 2);
- /* allow the frontend driver to handle this command*/
- return -EOPNOTSUPP;
- };
+ return 0;
- printk("%s: FE_SET_TONE unknown frontend : %s\n", __FUNCTION__, info.name);
+ default:
- return -EINVAL;
+ return -EINVAL;
+ };
}
+
default:
return -EOPNOTSUPP;
diff --git a/linux/drivers/media/dvb/ttusb-dec/ttusb_dec.c b/linux/drivers/media/dvb/ttusb-dec/ttusb_dec.c
index 9acc56895..66fe0e6d5 100644
--- a/linux/drivers/media/dvb/ttusb-dec/ttusb_dec.c
+++ b/linux/drivers/media/dvb/ttusb-dec/ttusb_dec.c
@@ -20,7 +20,6 @@
*/
#include <asm/semaphore.h>
-#include <linux/interrupt.h>
#include <linux/list.h>
#include <linux/module.h>
#include <linux/pci.h>
@@ -28,6 +27,7 @@
#include <linux/spinlock.h>
#include <linux/usb.h>
#include <linux/version.h>
+#include <linux/interrupt.h>
#include "dmxdev.h"
#include "dvb_demux.h"