comparison driver/pt1_pci.c @ 108:bc173c443e4d

make sure that wait after set_sleepmode()
author Yoshiki Yazawa <yaz@honeyplanet.jp>
date Wed, 03 Mar 2010 03:54:05 +0900
parents 6e661e828b43
children 8a2a032bfa50
comparison
equal deleted inserted replaced
107:1ccbe20c4ce5 108:bc173c443e4d
1 /* -*- tab-width: 4; indent-tabs-mode: t -*- */
1 /* pt1-pci.c: A PT1 on PCI bus driver for Linux. */ 2 /* pt1-pci.c: A PT1 on PCI bus driver for Linux. */
2 #define DRV_NAME "pt1-pci" 3 #define DRV_NAME "pt1-pci"
3 #include "version.h" 4 #include "version.h"
4 5
5 #include <linux/module.h> 6 #include <linux/module.h>
345 346
346 /* wake tuner up */ 347 /* wake tuner up */
347 set_sleepmode(channel->ptr->regs, &channel->lock, 348 set_sleepmode(channel->ptr->regs, &channel->lock,
348 channel->address, channel->type, 349 channel->address, channel->type,
349 TYPE_WAKEUP); 350 TYPE_WAKEUP);
351 schedule_timeout_interruptible(msecs_to_jiffies(50));
350 352
351 channel->drop = 0 ; 353 channel->drop = 0 ;
352 channel->valid = TRUE ; 354 channel->valid = TRUE ;
353 channel->overflow = 0 ; 355 channel->overflow = 0 ;
354 channel->counetererr = 0 ; 356 channel->counetererr = 0 ;
388 mutex_unlock(&channel->ptr->lock); 390 mutex_unlock(&channel->ptr->lock);
389 391
390 /* send tuner to sleep */ 392 /* send tuner to sleep */
391 set_sleepmode(channel->ptr->regs, &channel->lock, 393 set_sleepmode(channel->ptr->regs, &channel->lock,
392 channel->address, channel->type, TYPE_SLEEP); 394 channel->address, channel->type, TYPE_SLEEP);
395 schedule_timeout_interruptible(msecs_to_jiffies(50));
393 396
394 return 0; 397 return 0;
395 } 398 }
396 399
397 static ssize_t pt1_read(struct file *file, char __user *buf, size_t cnt, loff_t * ppos) 400 static ssize_t pt1_read(struct file *file, char __user *buf, size_t cnt, loff_t * ppos)