comparison driver/pt1_pci.c @ 80:f336fd2dcf28

make LNB voltage can be specified from user application
author Yoshiki Yazawa <yaz@honeyplanet.jp>
date Sat, 12 Dec 2009 22:29:30 +0900
parents 3c2123189edf
children cfb2da5ee428
comparison
equal deleted inserted replaced
79:3c2123189edf 80:f336fd2dcf28
485 { 485 {
486 PT1_CHANNEL *channel = file->private_data; 486 PT1_CHANNEL *channel = file->private_data;
487 int signal ; 487 int signal ;
488 unsigned long dummy; 488 unsigned long dummy;
489 void *arg = (void *)arg0; 489 void *arg = (void *)arg0;
490 int lnb_eff, lnb_usr;
491 char *voltage[] = {"0V", "11V", "15V"};
490 492
491 switch(cmd){ 493 switch(cmd){
492 case SET_CHANNEL: 494 case SET_CHANNEL:
493 { 495 {
494 FREQUENCY freq ; 496 FREQUENCY freq ;
517 break ; 519 break ;
518 } 520 }
519 dummy = copy_to_user(arg, &signal, sizeof(int)); 521 dummy = copy_to_user(arg, &signal, sizeof(int));
520 return 0 ; 522 return 0 ;
521 case LNB_ENABLE: 523 case LNB_ENABLE:
522 if(lnb){ 524 lnb_usr = (int)arg0;
523 settuner_reset(channel->ptr->regs, channel->ptr->cardtype, lnb, TUNER_POWER_ON_RESET_DISABLE); 525 lnb_eff = lnb_usr ? lnb_usr : lnb;
524 } 526 settuner_reset(channel->ptr->regs, channel->ptr->cardtype, lnb_eff, TUNER_POWER_ON_RESET_DISABLE);
527 printk(KERN_INFO "PT1:LNB = %s\n", voltage[lnb_eff]);
525 return 0 ; 528 return 0 ;
526 case LNB_DISABLE: 529 case LNB_DISABLE:
527 if(lnb){ 530 settuner_reset(channel->ptr->regs, channel->ptr->cardtype, LNB_OFF, TUNER_POWER_ON_RESET_DISABLE);
528 settuner_reset(channel->ptr->regs, channel->ptr->cardtype, LNB_OFF, TUNER_POWER_ON_RESET_DISABLE);
529 }
530 return 0 ; 531 return 0 ;
531 } 532 }
532 return -EINVAL; 533 return -EINVAL;
533 } 534 }
534 535