kernels/linux-2.4.0/drivers/media/video/tvaudio.c
/* ---------------------------------------------------------------------- */
/* kernel thread for doing i2c stuff asyncronly
 *   right now it is used only to check the audio mode (mono/stereo/whatever)
 *   some time after switching to another TV channel, then turn on stereo
 *   if available, ...
 */
kernel thread for doing i2c stuff asyncronly
right now it is used only to check the audio mode (mono/stereo/whatever)
some time after switching to another TV channel, then turn on stereo
if available.
kernel thread for doing i2c stuff asyncronly right now it is used only to check the audio mode ( mono / stereo / whatever ) some time after switching to another TV channel then turn on stereo if available .
static int chip_thread(void *data)
{
        struct CHIPSTATE *chip = data;
	struct CHIPDESC  *desc = chiplist + chip->type;
#ifdef CONFIG_SMP
	lock_kernel();
#endif
	daemonize();
	sigfillset(&current->blocked);
	strcpy(current->comm,chip->c.name);
	chip->thread = current;
#ifdef CONFIG_SMP
	unlock_kernel();
#endif
	dprintk("%s: thread started\n", chip->c.name);
	if(chip->notify != NULL)
		up(chip->notify);
	for (;;) {
		if (chip->done)
			break;
		if (!chip->wake) {
			interruptible_sleep_on(&chip->wq);
			dprintk("%s: thread wakeup\n", chip->c.name);
			if (chip->done || signal_pending(current))
				break;
		}
		chip->wake = 0;
		current->state   = TASK_INTERRUPTIBLE;
		schedule_timeout(HZ);
		if (signal_pending(current))
			break;
		if (chip->wake)
			continue;
		dprintk("%s: thread checkmode\n", chip->c.name);
		desc->checkmode(chip);
	}
	chip->thread = NULL;
	dprintk("%s: thread exiting\n", chip->c.name);
	if(chip->notify != NULL)
		up_and_exit(chip->notify,0);
	return 0;
}
static int chip_thread ( void * data ) { struct CHIPSTATE * chip = data ; struct CHIPDESC * desc = chiplist + chip -> type ; #ifdef CONFIG_SMP lock_kernel ( ) ; #endif daemonize ( ) ; sigfillset ( & current -> blocked ) ; strcpy ( current -> comm , chip -> c . name ) ; chip -> thread = current ; #ifdef CONFIG_SMP unlock_kernel ( ) ; #endif dprintk ( " \n " , chip -> c . name ) ; if ( chip -> notify != NULL ) up ( chip -> notify ) ; for ( ; ; ) { if ( chip -> done ) break ; if ( ! chip -> wake ) { interruptible_sleep_on ( & chip -> wq ) ; dprintk ( " \n " , chip -> c . name ) ; if ( chip -> done || signal_pending ( current ) ) break ; } chip -> wake = 0 ; current -> state = TASK_INTERRUPTIBLE ; schedule_timeout ( HZ ) ; if ( signal_pending ( current ) ) break ; if ( chip -> wake ) continue ; dprintk ( " \n " , chip -> c . name ) ; desc -> checkmode ( chip ) ; } chip -> thread = NULL ; dprintk ( " \n " , chip -> c . name ) ; if ( chip -> notify != NULL ) up_and_exit ( chip -> notify , 0 ) ; return 0 ; }
kernel thread for doing i2c stuff asyncronly
   right now it is used only to check the audio mode (mono/stereo/whatever)
   some time after switching to another TV channel, then turn on stereo
   if available, ...
kernel thread for doing i2c stuff asyncronly right now it is used only to check the audio mode ( mono / stereo / whatever ) some time after switching to another TV channel then turn on stereo if available ...
/* wait some time -- let the audio hardware
		   figure the current mode */