Mercurial > pt1.oyama
comparison driver/pt1_pci.c @ 102:6e661e828b43
send tuners to sleep mode when they are inactive
author | Yoshiki Yazawa <yaz@honeyplanet.jp> |
---|---|
date | Wed, 24 Feb 2010 22:44:06 +0900 |
parents | a201531113ca |
children | bc173c443e4d |
comparison
equal
deleted
inserted
replaced
101:3f7288b0672c | 102:6e661e828b43 |
---|---|
340 if(channel->minor == minor){ | 340 if(channel->minor == minor){ |
341 if(channel->valid == TRUE){ | 341 if(channel->valid == TRUE){ |
342 mutex_unlock(&device[lp]->lock); | 342 mutex_unlock(&device[lp]->lock); |
343 return -EIO ; | 343 return -EIO ; |
344 } | 344 } |
345 | |
346 /* wake tuner up */ | |
347 set_sleepmode(channel->ptr->regs, &channel->lock, | |
348 channel->address, channel->type, | |
349 TYPE_WAKEUP); | |
350 | |
345 channel->drop = 0 ; | 351 channel->drop = 0 ; |
346 channel->valid = TRUE ; | 352 channel->valid = TRUE ; |
347 channel->overflow = 0 ; | 353 channel->overflow = 0 ; |
348 channel->counetererr = 0 ; | 354 channel->counetererr = 0 ; |
349 channel->transerr = 0 ; | 355 channel->transerr = 0 ; |
378 if(channel->req_dma == TRUE){ | 384 if(channel->req_dma == TRUE){ |
379 channel->req_dma = FALSE ; | 385 channel->req_dma = FALSE ; |
380 wake_up(&channel->ptr->dma_wait_q); | 386 wake_up(&channel->ptr->dma_wait_q); |
381 } | 387 } |
382 mutex_unlock(&channel->ptr->lock); | 388 mutex_unlock(&channel->ptr->lock); |
389 | |
390 /* send tuner to sleep */ | |
391 set_sleepmode(channel->ptr->regs, &channel->lock, | |
392 channel->address, channel->type, TYPE_SLEEP); | |
393 | |
383 return 0; | 394 return 0; |
384 } | 395 } |
385 | 396 |
386 static ssize_t pt1_read(struct file *file, char __user *buf, size_t cnt, loff_t * ppos) | 397 static ssize_t pt1_read(struct file *file, char __user *buf, size_t cnt, loff_t * ppos) |
387 { | 398 { |
445 } | 456 } |
446 | 457 |
447 #if 0 | 458 #if 0 |
448 printk(KERN_INFO "clockmargin = (%x)\n", (tmcc.clockmargin & 0xFF)); | 459 printk(KERN_INFO "clockmargin = (%x)\n", (tmcc.clockmargin & 0xFF)); |
449 printk(KERN_INFO "carriermargin = (%x)\n", (tmcc.carriermargin & 0xFF)); | 460 printk(KERN_INFO "carriermargin = (%x)\n", (tmcc.carriermargin & 0xFF)); |
450 | 461 { |
451 for(lp = 0 ; lp < MAX_BS_TS_ID ; lp++){ | 462 int lp; |
452 if(tmcc.ts_id[lp].ts_id == 0xFFFF){ | 463 for(lp = 0 ; lp < MAX_BS_TS_ID ; lp++){ |
453 continue ; | 464 if(tmcc.ts_id[lp].ts_id == 0xFFFF){ |
465 continue ; | |
466 } | |
467 printk(KERN_INFO "Slot(%d:%x)\n", lp, tmcc.ts_id[lp].ts_id); | |
468 printk(KERN_INFO "mode (low/high) = (%x:%x)\n", | |
469 tmcc.ts_id[lp].low_mode, tmcc.ts_id[lp].high_mode); | |
470 printk(KERN_INFO "slot (low/high) = (%x:%x)\n", | |
471 tmcc.ts_id[lp].low_slot, | |
472 tmcc.ts_id[lp].high_slot); | |
454 } | 473 } |
455 printk(KERN_INFO "Slot(%d:%x)\n", lp, tmcc.ts_id[lp].ts_id); | |
456 printk(KERN_INFO "mode (low/high) = (%x:%x)\n", | |
457 tmcc.ts_id[lp].low_mode, tmcc.ts_id[lp].high_mode); | |
458 printk(KERN_INFO "slot (low/high) = (%x:%x)\n", | |
459 tmcc.ts_id[lp].low_slot, | |
460 tmcc.ts_id[lp].high_slot); | |
461 } | 474 } |
462 #endif | 475 #endif |
463 ts_lock(channel->ptr->regs, | 476 ts_lock(channel->ptr->regs, |
464 &channel->ptr->lock, | 477 &channel->ptr->lock, |
465 channel->address, | 478 channel->address, |