Lines Matching refs:mdata
85 struct machine_data *mdata = in p1022_ds_machine_probe() local
104 guts_set_dmuxcr(guts, mdata->dma_id[0], mdata->dma_channel_id[0], in p1022_ds_machine_probe()
107 guts_set_dmuxcr(guts, mdata->dma_id[1], mdata->dma_channel_id[1], in p1022_ds_machine_probe()
125 struct machine_data *mdata = in p1022_ds_startup() local
131 ret = snd_soc_dai_set_fmt(asoc_rtd_to_codec(rtd, 0), mdata->dai_format); in p1022_ds_startup()
141 ret = snd_soc_dai_set_sysclk(asoc_rtd_to_codec(rtd, 0), 0, mdata->clk_frequency, in p1022_ds_startup()
142 mdata->codec_clk_direction); in p1022_ds_startup()
159 struct machine_data *mdata = in p1022_ds_machine_remove() local
172 guts_set_dmuxcr(guts, mdata->dma_id[0], mdata->dma_channel_id[0], 0); in p1022_ds_machine_remove()
173 guts_set_dmuxcr(guts, mdata->dma_id[1], mdata->dma_channel_id[1], 0); in p1022_ds_machine_remove()
201 struct machine_data *mdata; in p1022_ds_probe() local
214 mdata = kzalloc(sizeof(struct machine_data), GFP_KERNEL); in p1022_ds_probe()
215 if (!mdata) { in p1022_ds_probe()
226 mdata->dai[0].cpus = &comp[0]; in p1022_ds_probe()
227 mdata->dai[0].codecs = &comp[1]; in p1022_ds_probe()
228 mdata->dai[0].platforms = &comp[2]; in p1022_ds_probe()
230 mdata->dai[0].num_cpus = 1; in p1022_ds_probe()
231 mdata->dai[0].num_codecs = 1; in p1022_ds_probe()
232 mdata->dai[0].num_platforms = 1; in p1022_ds_probe()
234 mdata->dai[1].cpus = &comp[3]; in p1022_ds_probe()
235 mdata->dai[1].codecs = &comp[4]; in p1022_ds_probe()
236 mdata->dai[1].platforms = &comp[5]; in p1022_ds_probe()
238 mdata->dai[1].num_cpus = 1; in p1022_ds_probe()
239 mdata->dai[1].num_codecs = 1; in p1022_ds_probe()
240 mdata->dai[1].num_platforms = 1; in p1022_ds_probe()
243 mdata->dai[0].cpus->dai_name = dev_name(&ssi_pdev->dev); in p1022_ds_probe()
244 mdata->dai[0].ops = &p1022_ds_ops; in p1022_ds_probe()
247 mdata->dai[0].codecs->of_node = codec_np; in p1022_ds_probe()
253 memcpy(&mdata->dai[1], &mdata->dai[0], sizeof(struct snd_soc_dai_link)); in p1022_ds_probe()
256 mdata->dai[0].codecs->dai_name = "wm8776-hifi-playback"; in p1022_ds_probe()
257 mdata->dai[1].codecs->dai_name = "wm8776-hifi-capture"; in p1022_ds_probe()
266 mdata->ssi_id = be32_to_cpup(iprop); in p1022_ds_probe()
277 mdata->dai_format = SND_SOC_DAIFMT_NB_NF | in p1022_ds_probe()
279 mdata->codec_clk_direction = SND_SOC_CLOCK_OUT; in p1022_ds_probe()
280 mdata->cpu_clk_direction = SND_SOC_CLOCK_IN; in p1022_ds_probe()
293 mdata->clk_frequency = be32_to_cpup(iprop); in p1022_ds_probe()
295 mdata->dai_format = SND_SOC_DAIFMT_NB_NF | in p1022_ds_probe()
297 mdata->codec_clk_direction = SND_SOC_CLOCK_IN; in p1022_ds_probe()
298 mdata->cpu_clk_direction = SND_SOC_CLOCK_OUT; in p1022_ds_probe()
300 mdata->dai_format = SND_SOC_DAIFMT_NB_NF | in p1022_ds_probe()
302 mdata->codec_clk_direction = SND_SOC_CLOCK_OUT; in p1022_ds_probe()
303 mdata->cpu_clk_direction = SND_SOC_CLOCK_IN; in p1022_ds_probe()
305 mdata->dai_format = SND_SOC_DAIFMT_NB_NF | in p1022_ds_probe()
307 mdata->codec_clk_direction = SND_SOC_CLOCK_IN; in p1022_ds_probe()
308 mdata->cpu_clk_direction = SND_SOC_CLOCK_OUT; in p1022_ds_probe()
310 mdata->dai_format = SND_SOC_DAIFMT_NB_NF | in p1022_ds_probe()
312 mdata->codec_clk_direction = SND_SOC_CLOCK_OUT; in p1022_ds_probe()
313 mdata->cpu_clk_direction = SND_SOC_CLOCK_IN; in p1022_ds_probe()
315 mdata->dai_format = SND_SOC_DAIFMT_NB_NF | in p1022_ds_probe()
317 mdata->codec_clk_direction = SND_SOC_CLOCK_IN; in p1022_ds_probe()
318 mdata->cpu_clk_direction = SND_SOC_CLOCK_OUT; in p1022_ds_probe()
320 mdata->dai_format = SND_SOC_DAIFMT_NB_NF | in p1022_ds_probe()
322 mdata->codec_clk_direction = SND_SOC_CLOCK_OUT; in p1022_ds_probe()
323 mdata->cpu_clk_direction = SND_SOC_CLOCK_IN; in p1022_ds_probe()
325 mdata->dai_format = SND_SOC_DAIFMT_NB_NF | in p1022_ds_probe()
327 mdata->codec_clk_direction = SND_SOC_CLOCK_IN; in p1022_ds_probe()
328 mdata->cpu_clk_direction = SND_SOC_CLOCK_OUT; in p1022_ds_probe()
336 if (!mdata->clk_frequency) { in p1022_ds_probe()
343 mdata->dai[0].platforms->name = mdata->platform_name[0]; in p1022_ds_probe()
344 ret = fsl_asoc_get_dma_channel(np, "fsl,playback-dma", &mdata->dai[0], in p1022_ds_probe()
345 &mdata->dma_channel_id[0], in p1022_ds_probe()
346 &mdata->dma_id[0]); in p1022_ds_probe()
353 mdata->dai[1].platforms->name = mdata->platform_name[1]; in p1022_ds_probe()
354 ret = fsl_asoc_get_dma_channel(np, "fsl,capture-dma", &mdata->dai[1], in p1022_ds_probe()
355 &mdata->dma_channel_id[1], in p1022_ds_probe()
356 &mdata->dma_id[1]); in p1022_ds_probe()
363 mdata->dai[0].stream_name = "playback"; in p1022_ds_probe()
364 mdata->dai[1].stream_name = "capture"; in p1022_ds_probe()
365 mdata->dai[0].name = mdata->dai[0].stream_name; in p1022_ds_probe()
366 mdata->dai[1].name = mdata->dai[1].stream_name; in p1022_ds_probe()
368 mdata->card.probe = p1022_ds_machine_probe; in p1022_ds_probe()
369 mdata->card.remove = p1022_ds_machine_remove; in p1022_ds_probe()
370 mdata->card.name = pdev->name; /* The platform driver name */ in p1022_ds_probe()
371 mdata->card.owner = THIS_MODULE; in p1022_ds_probe()
372 mdata->card.dev = &pdev->dev; in p1022_ds_probe()
373 mdata->card.num_links = 2; in p1022_ds_probe()
374 mdata->card.dai_link = mdata->dai; in p1022_ds_probe()
377 ret = snd_soc_register_card(&mdata->card); in p1022_ds_probe()
388 kfree(mdata); in p1022_ds_probe()
402 struct machine_data *mdata = in p1022_ds_remove() local
406 kfree(mdata); in p1022_ds_remove()