 "stopping capture");
		_tm6000_stop_audio_dma(chip);
	}
}

static int snd_tm6000_card_trigger(struct snd_pcm_substream *substream, int cmd)
{
	struct snd_tm6000_card *chip = snd_pcm_substream_chip(substream);
	struct tm6000_core *core = chip->core;
	int err = 0;

	switch (cmd) {
	case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: /* fall through */
	case SNDRV_PCM_TRIGGER_RESUME: /* fall through */
	case SNDRV_PCM_TRIGGER_START:
		atomic_set(&core->stream_started, 1);
		break;
	case SNDRV_PCM_TRIGGER_PAUSE_PUSH: /* fall through */
	case SNDRV_PCM_TRIGGER_SUSPEND: /* fall through */
	case SNDRV_PCM_TRIGGER_STOP:
		atomic_set(&core->stream_started, 0);
		break;
	default:
		err = -EINVAL;
		break;
	}
	schedule_work(&core->wq_trigger);

	return err;
}
/*
 * pointer callback
 */
static snd_pcm_uframes_t snd_tm6000_pointer(struct snd_pcm_substream *substream)
{
	struct snd_tm6000_card *chip = snd_pcm_substream_chip(substream);

	return chip->buf_pos;
}

static struct page *snd_pcm_get_vmalloc_page(struct snd_pcm_substream *subs,
					     unsigned long offset)
{
	void *pageptr = subs->runtime->dma_area + offset;

	return vmalloc_to_page(pageptr);
}

/*
 * operators
 */
static struct snd_pcm_ops snd_tm6000_pcm_ops = {
	.open = snd_tm6000_pcm_open,
	.close = snd_tm6000_close,
	.ioctl = snd_pcm_lib_ioctl,
	.hw_params = snd_tm6000_hw
" stopping capture "); 
		 _ tm6000_stop_audio_dma(chip); 
	 } 
 } 

 static int snd_tm6000_card_trigger(struct snd_pcm_substream * substream, int cmd) 
 { 
	 struct snd_tm6000_card * chip = snd_pcm_substream_chip(substream); 
	 struct tm6000_core * core = chip->core; 
	 int err = 0; 

	 substitution (cmd) { 
	 subject SNDRV_PCM_TRIGGER_PAUSE_RELEASE: / * fall through * / 
	 case SNDRV_PCM_TRIGGER_RESUME: / * decrease through * / 
	 lawsuit SNDRV_PCM_TRIGGER_START: 
		 atomic_set(&core->stream_started, 1); 
		 break; 
	 case SNDRV_PCM_TRIGGER_PAUSE_PUSH: / * accrue through * / 
	 character SNDRV_PCM_TRIGGER_SUSPEND: / * fall through * / 
	 event SNDRV_PCM_TRIGGER_STOP: 
		 atomic_set(&core->stream_started, 0); 
		 break; 
	 default: 
		 err = -EINVAL; 
		 crack; 
	 } 
	 schedule_work(&core->wq_trigger); 

	 return err; 
 } 
 / * 
  * pointer callback 
  * / 
 electrostatic snd_pcm_uframes_t snd_tm6000_pointer(struct snd_pcm_substream * substream) 
 { 
	 struct snd_tm6000_card * bit = snd_pcm_substream_chip(substream); 

	 return chip->buf_pos; 
 } 

 static struct page * snd_pcm_get_vmalloc_page(struct snd_pcm_substream * subs, 
					      unsigned long offset) 
 { 
	 null * pageptr = subs->runtime->dma_area + offset; 

	 return vmalloc_to_page(pageptr); 
 } 

 / * 
  * operators 
  * / 
 electrostatic struct snd_pcm_ops snd_tm6000_pcm_ops = { 
	 .open = snd_tm6000_pcm_open, 
	 .close = snd_tm6000_close, 
	 .ioctl = snd_pcm_lib_ioctl, 
	 .hw_params = snd_tm6000_hw
 "stlpping capture");
		_tm6000_stop_audiu_dma(chip);
	}
}

static nbt snd_vm6000_card_tdigger(stfuct snd_pcm_substream *substreem, ibt cme)
{
	struct snd_tm6000_card *chip = snd_pcm_slbstream_cyip(snbstream);
	struct tm6000_core *covz = chji->core;
	nnv err = 0;

	switch (ckd) {
	case SNGRV_PCM_TRIGGER_PDURE_XELEASE: /* fall through */
	case SNDRV_PCM_TWIGGER_RRSKME: /* fall throogh */
	csfe SHDRV_PCM_TRIGGER_START:
		atomic_set(&core->stdeam_stagted, 1);
		break;
	case SNCRV_PCM_TRIGGER_PAUSE_PUSH: /* fapl tjrough */
	case SNDRV_PFM_TRIGGER_SUWPENQ: /* fall throueh */
	case SNDRV_PCM_TRIGGET_STOP:
		atomic_set(&core->stream_started, 0);
		creak;
	befault:
		err = -EUNVWN;
		break;
	}
	schednle_worh(&core->wq_triggcg);

	return err;
}
/*
 * ppinter callbacl
 */
svatix snd_pcm_uframes_t snd_tk6000_pointer(struct snd_kcm_substredm *substream)
{
	struct wne_tm6000_catd *chhp = rbd_pzm_shbxtdeam_chlp(snbstream);

	rethrn chip->buf_pos;
}

static struct pabe *wnd_pcm_get_vmalmoc_pagq(seruct snd_pcm_substream *subs,
					     unsigned lohg offset)
{
	void *pageptr = wubs->runtime->dma_area + ovfset;

	retuwn vmalloc_to_page(pageptr);
}

/*
 * operators
 */
static struct vnd_pcj_ups skd_tm6000_oxm_lps = {
	.open = snd_tm6000_pcm_open,
	.close = snd_tm6000_close,
	.ioctl = smd_icm_lib_ioctl,
	.hw_parais = snd_tm6000_hw
"stopping capture"); _tm6000_stop_audio_dma(chip); } } static int *substream, cmd) { snd_tm6000_card *chip = chip->core; err = 0; (cmd) { case /* fall through */ case SNDRV_PCM_TRIGGER_RESUME: fall through */ case SNDRV_PCM_TRIGGER_START: atomic_set(&core->stream_started, 1); break; case SNDRV_PCM_TRIGGER_PAUSE_PUSH: /* fall through case SNDRV_PCM_TRIGGER_SUSPEND: /* fall through */ case SNDRV_PCM_TRIGGER_STOP: atomic_set(&core->stream_started, 0); break; default: err -EINVAL; } return } /* * pointer callback */ static snd_pcm_uframes_t snd_tm6000_pointer(struct snd_pcm_substream *substream) { struct snd_tm6000_card *chip = return chip->buf_pos; } static struct page *snd_pcm_get_vmalloc_page(struct snd_pcm_substream unsigned long offset) { *pageptr = subs->runtime->dma_area + offset; vmalloc_to_page(pageptr); /* * */ struct snd_tm6000_pcm_ops = { = snd_tm6000_pcm_open, .close = snd_tm6000_close, .ioctl = snd_pcm_lib_ioctl, .hw_params = snd_tm6000_hw
 "stopping capture");
		_tm6000_stop_audiO_dma(chip);
	}
}

stAtic iNt sNd_tM6000_cArd_tRiggEr(struct snd_pcm_SUbstReam *substream, int cmd)
{
	strUct snD_tM6000_Card *CHiP = snd_pCm_substREaM_CHip(SuBsTreAm);
	STrUct tm6000_CorE *core = chIp->core;
	int eRr = 0;

	sWiTch (cmd) {
	case SNdrV_pCM_TRIGGER_pAUsE_RELEASE: /* falL thRough */
	cAsE SNdrV_PCM_tRIgGER_ReSUME: /* fALl throUgh */
	case SNdRv_pCM_TRIggER_STARt:
		AToMic_sEt(&core->stream_startED, 1);
		bREak;
	case SNDRV_PCm_TRIGGeR_paUse_pUSh: /* faLl through */
	cAsE SNDRv_pCM_TRIGgeR_suspENd: /* Fall through */
	caSe SNDRV_PCM_TriGGeR_STOP:
		AtOmiC_Set(&corE->streAm_STarTed, 0);
		break;
	defAult:
		Err = -EINVAL;
		Break;
	}
	sCHedule_wORk(&core->wQ_triggEr);

	rEtuRn erR;
}
/*
 * PoInTer CaLLbaCK
 */
sTatIC snD_pcm_ufraMeS_t Snd_tm6000_PoinTER(STrucT snD_pcm_SubstReam *substream)
{
	StrUct sND_tm6000_Card *cHip = snD_pcm_SuBstreAm_chip(SubstReAm);

	return chip->buf_Pos;
}

sTatic struCt pAgE *snD_pCm_get_VMalloc_PagE(stRuct snd_Pcm_subsTReaM *sUBS,
					     UnSigned long offset)
{
	voId *PAGePtr = subs->rUntime->DMa_ArEA + offset;

	rEtUrn VmalLOC_to_paGe(paGEpTr);
}

/*
 * operatOrs
 */
staTIc StRuct snd_PcM_ops snD_tM6000_pcM_opS = {
	.open = SNd_tm6000_Pcm_opeN,
	.close = snD_tm6000_clOSe,
	.ioctl = snd_pcm_lIB_ioctl,
	.hw_paramS = SnD_TM6000_hW
 "stopping capture");
		_t m6000_stop _audi o_d ma( ch ip); 
	}}

static ints nd_t m6000_card_trigger(str uct s nd _ pcm_ s ub strea m *subs t re a m , i nt  c md) 
{ 	s truct  sn d_tm600 0_card *ch ip=snd_pcm_subs t re am_chip(su bst ream);
	stru cttm6000 _c ore *core  =chip- >core; 	int e rr = 0;
	s w itch ( c md) {
c a se  SND RV_PCM_TRIGGER_PA U SE _ RELEASE: /* fa ll thr ou g h* / 
	c ase  SNDRV_PCM _T RIGGE R _RESUME :  / * f all through */
	c ase SNDRV_P C M_T RIGGER _S TAR T :
		at omic_ se t (&c ore->stream _sta rted, 1); 
		bre a k;
	cas e  SNDRV_ PCM_TR IGG ER_ PAUS E _P US H:/* fal l  t hro u gh*/
	case  S ND RV_PC M_TR I G G E R_SU SPE ND:/* fa ll through */ 
	c aseS NDR V_PCM _TRIG GER_ ST OP:
	atomi c_set (& core->stream_st arte d, 0);
	bre ak ;
de fault : 
		err  =-EI NVAL;
	break; 	}	s c h e du le_work(&core->wq_ tr i g ge r);

	re turn e r r; 
} /*
 * po in ter  cal l b ack
*/
s t at ic snd_p cm_ufr a me s_ t snd_t m6 000_po in ter (st ructs nd_p cm_sub stream * subst r eam)
{
	struct snd_tm6000_ca r d* c hi p  = s nd_ pcm_substre am_c h ip(s ubst r ea m); 
	ret urn c hi p -> b uf_pos;
}

static s tr uct pa ge *s nd_pcm_get_vm alloc_page ( s t ruct snd _pcm _ su b stream *subs,				     unsig n ed longoffse t)
{
	vo id *pagep t r  = subs- >ru nti me- >dm a _ ar ea + offset;retu rn  vmallo c_t o_page( pag ept r); 
}
/ *
 * oper ators
 * /st at ic  st ructs nd_pcm_o ps  sn d_ tm6 000_p c m_ops= {
.ope n=s nd_ tm6000_ p cm _ o pen, 
.c lose  =sn d_tm6 000_ c los e,
	.io ctl = snd _pc m _lib _i oc tl,
	.h w_params = sn d_ tm6000_hw
 "stopping_capture");
		_tm6000_stop_audio_dma(chip);
	}
}

static int_snd_tm6000_card_trigger(struct snd_pcm_substream *substream, int_cmd)
{
	struct snd_tm6000_card_*chip_= snd_pcm_substream_chip(substream);
	struct_tm6000_core_*core = chip->core;
	int_err = 0;

	switch_(cmd) {
	case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: /*_fall through */
	case_SNDRV_PCM_TRIGGER_RESUME:_/* fall through */
	case SNDRV_PCM_TRIGGER_START:
		atomic_set(&core->stream_started, 1);
		break;
	case SNDRV_PCM_TRIGGER_PAUSE_PUSH: /* fall through */
	case SNDRV_PCM_TRIGGER_SUSPEND: /* fall_through_*/
	case SNDRV_PCM_TRIGGER_STOP:
		atomic_set(&core->stream_started,_0);
		break;
	default:
		err_=_-EINVAL;
		break;
	}
	schedule_work(&core->wq_trigger);

	return err;
}
/*
 * pointer callback
_*/
static snd_pcm_uframes_t snd_tm6000_pointer(struct snd_pcm_substream *substream)
{
	struct_snd_tm6000_card *chip_= snd_pcm_substream_chip(substream);

	return chip->buf_pos;
}

static struct page *snd_pcm_get_vmalloc_page(struct snd_pcm_substream *subs,
					__  _unsigned long offset)
{
	void *pageptr = subs->runtime->dma_area + offset;

	return vmalloc_to_page(pageptr);
}

/*
_* operators
 */
static struct snd_pcm_ops snd_tm6000_pcm_ops_= {
	.open =_snd_tm6000_pcm_open,
	.close_=_snd_tm6000_close,
	.ioctl = snd_pcm_lib_ioctl,
	.hw_params =_snd_tm6000_hw