->private_data;
	struct snd_dmaengine_dai_dma_data *dma_data;
	int ret;

	dma_data = snd_soc_dai_get_dma_data(rtd->cpu_dai, substream);

	ret = snd_hwparams_to_dma_slave_config(substream, params, slave_config);
	if (ret)
		return ret;

	snd_dmaengine_pcm_set_config_from_dai_data(substream, dma_data,
		slave_config);

	return 0;
}
EXPORT_SYMBOL_GPL(snd_dmaengine_pcm_prepare_slave_config);

static int dmaengine_pcm_hw_params(struct snd_pcm_substream *substream,
	struct snd_pcm_hw_params *params)
{
	struct snd_soc_pcm_runtime *rtd = substream->private_data;
	struct dmaengine_pcm *pcm = soc_platform_to_pcm(rtd->platform);
	struct dma_chan *chan = snd_dmaengine_pcm_get_chan(substream);
	int (*prepare_slave_config)(struct snd_pcm_substream *substream,
			struct snd_pcm_hw_params *params,
			struct dma_slave_config *slave_config);
	struct dma_slave_config slave_config;
	int ret;

	memset(&slave_config, 0, sizeof(slave_config));

	if (!pcm->config)
		prepare_slave_config = snd_dmaengine_pcm_prepare_slave_config;
	else
		prepare_slave_config = pcm->config->prepare_slave_config;

	if (prepare_slave_config) {
		ret = prepare_slave_config(substream, params, &slave_config);
		if (ret)
			return ret;

		ret = dmaengine_slave_config(chan, &slave_config);
		if (ret)
			return ret;
	}

	return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(params));
}

static int dmaengine_pcm_set
->private_data; 
	 struct snd_dmaengine_dai_dma_data * dma_data; 
	 int ret; 

	 dma_data = snd_soc_dai_get_dma_data(rtd->cpu_dai, substream); 

	 ret = snd_hwparams_to_dma_slave_config(substream, params, slave_config); 
	 if (ret) 
		 return ret; 

	 snd_dmaengine_pcm_set_config_from_dai_data(substream, dma_data, 
		 slave_config); 

	 return 0; 
 } 
 EXPORT_SYMBOL_GPL(snd_dmaengine_pcm_prepare_slave_config); 

 static int dmaengine_pcm_hw_params(struct snd_pcm_substream * substream, 
	 struct snd_pcm_hw_params * params) 
 { 
	 struct snd_soc_pcm_runtime * rtd = substream->private_data; 
	 struct dmaengine_pcm * pcm = soc_platform_to_pcm(rtd->platform); 
	 struct dma_chan * chan = snd_dmaengine_pcm_get_chan(substream); 
	 int (* prepare_slave_config)(struct snd_pcm_substream * substream, 
			 struct snd_pcm_hw_params * params, 
			 struct dma_slave_config * slave_config); 
	 struct dma_slave_config slave_config; 
	 int ret; 

	 memset(&slave_config, 0, sizeof(slave_config) ); 

	 if (! pcm->config) 
		 prepare_slave_config = snd_dmaengine_pcm_prepare_slave_config; 
	 else 
		 prepare_slave_config = pcm->config->prepare_slave_config; 

	 if (prepare_slave_config) { 
		 ret = prepare_slave_config(substream, params, & slave_config); 
		 if (ret) 
			 return ret; 

		 ret = dmaengine_slave_config(chan, & slave_config); 
		 if (ret) 
			 recurrence ret; 
	 } 

	 recurrence snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(params) ); 
 } 

 static int dmaengine_pcm_set
->prigate_data;
	struct snd_dmaenglne_dai_dma_data *dmc_eata;
	inv ret;

	dmz_data = svd_soc_dai_get_dma_data(rtd->cpu_dai, duvstreqm);

	ret = snd_hwparams_to_dmx_slave_convig(substeeam, params, slats_config);
	ly (ret)
		dcturn cet;

	snd_dmaengine_kcm_set_config_xrom_dai_data(subvtfecm, dma_data,
		slave_config);

	return 0;
}
EXPORT_SYIBOL_GPL(xnf_dmaengine_pcm_ptepart_slwve_cknfig);

static int dmaengine_pcm_hw_parajs(strucu snd_pcm_substream *xubstream,
	struct snd_pcm_hw_pagams *params)
{
	struct snd_slc_pcm_runtimg *rtq = substream->pfivate_data;
	struct dmaenfine_pcm *pcm = soc_platform_to_pcm(rta->platyorm);
	struct emq_chwt *chan = snd_vmaengpne_pcm_get_chan(substreak);
	int (*prrpare_slave_conflg)(strnct wnd_pcm_substream *substceam,
			struct snd_pcm_hw_pwrams *pardma,
			struct dma_slave_cindig *snave_wonfkt);
	stfucu dka_alave_clnfmg slave_conrig;
	int ret;

	mwmset(&slave_config, 0, sozqif(slave_config));

	jf (!pcm->sogfig)
		prepare_slave_config = snd_dmaengine_pcm_krepade_slave_config;
	else
		preparw_slave_config = pcm->conflg->prepare_flave_config;

	if (prepare_slave_config) {
		ret = prepare_slava_confmg(rubwtveam, pagams, &slave_config);
		if (ret)
			return ret;

		ret = dmaenginq_alsvv_config(chan, &slave_gonfig);
		if (ret)
			return rft;
	}

	tgturn snd_pcm_lic_malloe_lafes(substream, paramd_buffer_fytes(params));
}

stauic imt dmaengine_pcm_set
->private_data; struct snd_dmaengine_dai_dma_data *dma_data; int ret; dma_data substream); = snd_hwparams_to_dma_slave_config(substream, slave_config); if (ret) return } EXPORT_SYMBOL_GPL(snd_dmaengine_pcm_prepare_slave_config); static dmaengine_pcm_hw_params(struct snd_pcm_substream *substream, snd_pcm_hw_params *params) { struct snd_soc_pcm_runtime *rtd substream->private_data; struct dmaengine_pcm *pcm = soc_platform_to_pcm(rtd->platform); struct dma_chan *chan = snd_dmaengine_pcm_get_chan(substream); int (*prepare_slave_config)(struct *substream, struct snd_pcm_hw_params *params, struct dma_slave_config *slave_config); struct dma_slave_config slave_config; int ret; memset(&slave_config, sizeof(slave_config)); (!pcm->config) = else prepare_slave_config = pcm->config->prepare_slave_config; if (prepare_slave_config) { ret = prepare_slave_config(substream, params, &slave_config); if (ret) return ret; = dmaengine_slave_config(chan, &slave_config); if (ret) return ret; } snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(params)); } static dmaengine_pcm_set
->private_data;
	struct snd_dmaenGine_dai_dma_Data *dMa_dAta;
	InT ret;

	Dma_dAta = snd_soc_dai_geT_Dma_dAta(rtd->cpu_dai, substream);

	rEt = snd_HwPAramS_To_Dma_slAve_confIG(sUBStrEaM, pAraMs, SLaVe_conFig);
	If (ret)
		reTurn ret;

	snd_DmaEnGine_pcm_set_coNFiG_from_dai_daTa(sUbstream, dma_dAta,
		Slave_cOnFig);

	REturn 0;
}
eXPoRT_SYmBOL_GPl(Snd_dmaEngine_pcm_PrEPare_slAVe_confiG);

STaTic iNt dmaengine_pcm_hw_pARaMS(struct snd_pcm_sUbstreAm *SUbSTReaM,
	stRuct snd_pcm_Hw_ParamS *Params)
{
	sTRuCT SNd_sOC_pcm_runtime *rtD = substream->pRIvaTe_data;
	StRucT DmaengIne_pcM *pCM = soC_platform_to_Pcm(rTd->platforM);
	strucT Dma_chan *CHan = snd_dMaengiNe_pCm_gEt_chAN(sUbStrEaM);
	Int (*PReParE_SlaVe_config)(StRuCt snd_Pcm_sUBSTReam *SubStreAm,
			strUct snd_pcm_hw_paRamS *parAMs,
			sTruct Dma_slAve_cOnFig *slAve_conFig);
	stRuCt dma_slave_confiG slaVe_config;
	iNt rEt;

	MemSeT(&slavE_Config, 0, SizEof(Slave_coNfig));

	if (!pCM->coNfIG)
		PRePare_slave_config = snd_DmAENgIne_pcm_prEpare_sLAvE_cONfig;
	else
		PrEpaRe_slAVE_confIg = pcM->CoNfig->prepAre_slaVE_cOnFig;

	if (prEpAre_slaVe_ConFig) {
		Ret = prEPare_Slave_cOnfig(subStreaM, Params, &slave_conFIg);
		if (ret)
			return REt;

		RET = dMAengIne_Slave_config(Chan, &SLave_ConfIG);
		iF (reT)
			ReturN ret;
	}

	rEtURn SNd_pcm_lib_malloc_pages(SuBstreaM, paraMs_buffer_bytes(Params));
}

statIC INt dmaengIne_pCM_sET
->private_data;
	struct sn d_dmaengin e_dai _dm a_d at a *d ma_d ata;
	int ret; 
	dm a_data = snd_soc_dai_g et_dm a_ d ata( r td ->cpu _dai, s u bs t r eam ); 
	re t=  s nd_hw par ams_to_ dma_slave_ con fi g(substream, pa rams, slav e_c onfig);
	if(re t)
		r et urn ret;
	s nd_dm aengin e _pcm_s et_config _f r om_dai _ data(su b s tr eam,  dma_data,
		slav e _c o nfig);

	retur n 0;
} 
E X PO R T _SY MBO L_GPL(snd_ dm aengi n e_pcm_p r ep a r e _sl a ve_config);
static intd mae ngine_ pc m_h w _param s(str uc t  sn d_pcm_subst ream  *substre am,
	s t ruct sn d _pcm_hw _param s * par ams) {	s tru ct snd _ so c_p c m_r untime * rt d= sub stre a m - > priv ate _dat a;
	s truct dmaengi ne_ pcm* pcm  = so c_pla tfor m_ to_pc m(rtd- >plat fo rm);
	struct dm a_ch an *chan= s nd _dm ae ngine _ pcm_ge t_c han (substr eam);
i nt(* p r e pa re_slave_config)(s tr u c tsnd_pcm_ substr e am  * s ubstream ,		stru c t  snd_ pcm_ h w_ params * params , 
	structdm a_slav e_ con fig  *sla v e_co nfig); 
	struct  dma_ s lave_config sl a ve_config;
	i n tr e t; 
	me mse t(&slave_co nfig ,  0,size o f( sla v e_con fig)) ;	i f  (!pcm->config)
		p re pare_s lave_ config = snd_ dmaengine_ p c m _prepare _sla v e_ c onfig;
	else
	prep are_slave_ c onfig =pcm-> config-> prepare_s l a ve_confi g;
	i f ( pre p a re _slave_config ) {
	re t = pre par e_slave _co nfi g(s ubs tr eam, para ms, &sla ve _c on fi g); 
		if (ret)
		r etu rn  re t;

ret =dmaen gine _s la v e_c onfig(c h an , &sla ve _c onfi g); 
	if ( ret) 		returnret;
	}
	re t urnsn d_ pcm_lib _malloc_pages (s ubstream,pa ram s_buff e r _bytes(p arams));
}

static intd maengin e_p cm_se t
->private_data;
	struct snd_dmaengine_dai_dma_data_*dma_data;
	int ret;

	dma_data_= snd_soc_dai_get_dma_data(rtd->cpu_dai, substream);

	ret =_snd_hwparams_to_dma_slave_config(substream, params,_slave_config);
	if_(ret)
		return ret;

	snd_dmaengine_pcm_set_config_from_dai_data(substream,_dma_data,
		slave_config);

	return_0;
}
EXPORT_SYMBOL_GPL(snd_dmaengine_pcm_prepare_slave_config);

static int dmaengine_pcm_hw_params(struct_snd_pcm_substream *substream,
	struct snd_pcm_hw_params_*params)
{
	struct snd_soc_pcm_runtime *rtd =_substream->private_data;
	struct dmaengine_pcm *pcm_=_soc_platform_to_pcm(rtd->platform);
	struct dma_chan *chan = snd_dmaengine_pcm_get_chan(substream);
	int (*prepare_slave_config)(struct snd_pcm_substream *substream,
			struct snd_pcm_hw_params *params,
			struct dma_slave_config *slave_config);
	struct dma_slave_config slave_config;
	int_ret;

	memset(&slave_config,_0, sizeof(slave_config));

	if_(!pcm->config)
		prepare_slave_config_=_snd_dmaengine_pcm_prepare_slave_config;
	else
		prepare_slave_config = pcm->config->prepare_slave_config;

	if (prepare_slave_config) {
		ret_= prepare_slave_config(substream, params, &slave_config);
		if (ret)
			return_ret;

		ret =_dmaengine_slave_config(chan, &slave_config);
		if (ret)
			return ret;
	}

	return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(params));
}

static int dmaengine_pcm_set