#if 0 printk("TRIGGER: what[%x] on(%d)\n", what, (cmd == SNDRV_PCM_TRIGGER_START)); #endif  
static int snd_cs4231_trigger(snd_pcm_substream_t *substream, int cmd){	cs4231_t *chip = snd_pcm_substream_chip(substream);	int result = 0;	switch (cmd) {	case SNDRV_PCM_TRIGGER_START:	case SNDRV_PCM_TRIGGER_STOP:	{		unsigned int what = 0;		snd_pcm_substream_t *s;		struct list_head *pos;		unsigned long flags;		snd_pcm_group_for_each(pos, substream) {			s = snd_pcm_group_substream_entry(pos);			if (s == chip->playback_substream) {				what |= CS4231_PLAYBACK_ENABLE;				snd_pcm_trigger_done(s, substream);			} else if (s == chip->capture_substream) {				what |= CS4231_RECORD_ENABLE;				snd_pcm_trigger_done(s, substream);			}		}#if 0		printk("TRIGGER: what[%x] on(%d)\n",		       what, (cmd == SNDRV_PCM_TRIGGER_START));#endif		spin_lock_irqsave(&chip->lock, flags);		if (cmd == SNDRV_PCM_TRIGGER_START) {			cs4231_dma_trigger(chip, what, 1);			chip->image[CS4231_IFACE_CTRL] |= what;			if (what & CS4231_PLAYBACK_ENABLE) {				snd_cs4231_out(chip, CS4231_PLY_LWR_CNT, 0xff);				snd_cs4231_out(chip, CS4231_PLY_UPR_CNT, 0xff);			}			if (what & CS4231_RECORD_ENABLE) {				snd_cs4231_out(chip, CS4231_REC_LWR_CNT, 0xff);				snd_cs4231_out(chip, CS4231_REC_UPR_CNT, 0xff);			}		} else {			cs4231_dma_trigger(chip, what, 0);			chip->image[CS4231_IFACE_CTRL] &= ~what;		}		snd_cs4231_out(chip, CS4231_IFACE_CTRL,			       chip->image[CS4231_IFACE_CTRL]);		spin_unlock_irqrestore(&chip->lock, flags);		break;	}	default:		result = -EINVAL;		break;	}#if 0	snd_cs4231_debug(chip);#endif	return result;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/a131430c200f6bda313bf5d0a8e238c41afdfe0a/cs4231.c/clean/sound/sparc/cs4231.c