# HG changeset patch # User Yoshiki Yazawa # Date 1260624570 -32400 # Node ID f336fd2dcf28b4aca8daba9a0e7ca0149d36f5e5 # Parent 3c2123189edfc324366638d755331333a410afd1 make LNB voltage can be specified from user application diff -r 3c2123189edf -r f336fd2dcf28 driver/pt1_ioctl.h --- a/driver/pt1_ioctl.h Mon Dec 07 15:01:57 2009 +0900 +++ b/driver/pt1_ioctl.h Sat Dec 12 22:29:30 2009 +0900 @@ -15,6 +15,6 @@ #define START_REC _IO(0x8D, 0x02) #define STOP_REC _IO(0x8D, 0x03) #define GET_SIGNAL_STRENGTH _IOR(0x8D, 0x04, int *) -#define LNB_ENABLE _IO(0x8D, 0x05) +#define LNB_ENABLE _IOW(0x8D, 0x05, int) #define LNB_DISABLE _IO(0x8D, 0x06) #endif diff -r 3c2123189edf -r f336fd2dcf28 driver/pt1_pci.c --- a/driver/pt1_pci.c Mon Dec 07 15:01:57 2009 +0900 +++ b/driver/pt1_pci.c Sat Dec 12 22:29:30 2009 +0900 @@ -487,6 +487,8 @@ int signal ; unsigned long dummy; void *arg = (void *)arg0; + int lnb_eff, lnb_usr; + char *voltage[] = {"0V", "11V", "15V"}; switch(cmd){ case SET_CHANNEL: @@ -519,14 +521,13 @@ dummy = copy_to_user(arg, &signal, sizeof(int)); return 0 ; case LNB_ENABLE: - if(lnb){ - settuner_reset(channel->ptr->regs, channel->ptr->cardtype, lnb, TUNER_POWER_ON_RESET_DISABLE); - } + lnb_usr = (int)arg0; + lnb_eff = lnb_usr ? lnb_usr : lnb; + settuner_reset(channel->ptr->regs, channel->ptr->cardtype, lnb_eff, TUNER_POWER_ON_RESET_DISABLE); + printk(KERN_INFO "PT1:LNB = %s\n", voltage[lnb_eff]); return 0 ; case LNB_DISABLE: - if(lnb){ - settuner_reset(channel->ptr->regs, channel->ptr->cardtype, LNB_OFF, TUNER_POWER_ON_RESET_DISABLE); - } + settuner_reset(channel->ptr->regs, channel->ptr->cardtype, LNB_OFF, TUNER_POWER_ON_RESET_DISABLE); return 0 ; } return -EINVAL;