diff 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
line wrap: on
line diff
--- a/driver/pt1_pci.c	Sun Feb 14 22:12:10 2010 +0900
+++ b/driver/pt1_pci.c	Wed Feb 24 22:44:06 2010 +0900
@@ -342,6 +342,12 @@
 						mutex_unlock(&device[lp]->lock);
 						return -EIO ;
 					}
+
+					/* wake tuner up */
+					set_sleepmode(channel->ptr->regs, &channel->lock,
+								  channel->address, channel->type,
+								  TYPE_WAKEUP);
+
 					channel->drop  = 0 ;
 					channel->valid = TRUE ;
 					channel->overflow = 0 ;
@@ -380,6 +386,11 @@
 		wake_up(&channel->ptr->dma_wait_q);
 	}
 	mutex_unlock(&channel->ptr->lock);
+
+	/* send tuner to sleep */
+	set_sleepmode(channel->ptr->regs, &channel->lock,
+				  channel->address, channel->type, TYPE_SLEEP);
+
 	return 0;
 }
 
@@ -447,17 +458,19 @@
 #if 0
 				printk(KERN_INFO "clockmargin = (%x)\n", (tmcc.clockmargin & 0xFF));
 				printk(KERN_INFO "carriermargin  = (%x)\n", (tmcc.carriermargin & 0xFF));
-
-				for(lp = 0 ; lp < MAX_BS_TS_ID ; lp++){
-					if(tmcc.ts_id[lp].ts_id == 0xFFFF){
-						continue ;
+				{
+					int lp;
+					for(lp = 0 ; lp < MAX_BS_TS_ID ; lp++){
+						if(tmcc.ts_id[lp].ts_id == 0xFFFF){
+							continue ;
+						}
+						printk(KERN_INFO "Slot(%d:%x)\n", lp, tmcc.ts_id[lp].ts_id);
+						printk(KERN_INFO "mode (low/high) = (%x:%x)\n",
+							   tmcc.ts_id[lp].low_mode, tmcc.ts_id[lp].high_mode);
+						printk(KERN_INFO "slot (low/high) = (%x:%x)\n",
+							   tmcc.ts_id[lp].low_slot,
+							   tmcc.ts_id[lp].high_slot);
 					}
-					printk(KERN_INFO "Slot(%d:%x)\n", lp, tmcc.ts_id[lp].ts_id);
-					printk(KERN_INFO "mode (low/high) = (%x:%x)\n",
-							tmcc.ts_id[lp].low_mode, tmcc.ts_id[lp].high_mode);
-					printk(KERN_INFO "slot (low/high) = (%x:%x)\n",
-							tmcc.ts_id[lp].low_slot,
-							tmcc.ts_id[lp].high_slot);
 				}
 #endif
 				ts_lock(channel->ptr->regs,