Lines Matching refs:player
64 struct uniperif *player = dev_id; in uni_player_irq_handler() local
68 spin_lock(&player->irq_lock); in uni_player_irq_handler()
69 if (!player->substream) in uni_player_irq_handler()
72 snd_pcm_stream_lock(player->substream); in uni_player_irq_handler()
73 if (player->state == UNIPERIF_STATE_STOPPED) in uni_player_irq_handler()
77 status = GET_UNIPERIF_ITS(player); in uni_player_irq_handler()
78 SET_UNIPERIF_ITS_BCLR(player, status); in uni_player_irq_handler()
81 if (unlikely(status & UNIPERIF_ITS_FIFO_ERROR_MASK(player))) { in uni_player_irq_handler()
82 dev_err(player->dev, "FIFO underflow error detected\n"); in uni_player_irq_handler()
85 if (player->underflow_enabled) { in uni_player_irq_handler()
87 player->state = UNIPERIF_STATE_UNDERFLOW; in uni_player_irq_handler()
91 SET_UNIPERIF_ITM_BCLR_FIFO_ERROR(player); in uni_player_irq_handler()
94 snd_pcm_stop(player->substream, SNDRV_PCM_STATE_XRUN); in uni_player_irq_handler()
101 if (unlikely(status & UNIPERIF_ITS_DMA_ERROR_MASK(player))) { in uni_player_irq_handler()
102 dev_err(player->dev, "DMA error detected\n"); in uni_player_irq_handler()
105 SET_UNIPERIF_ITM_BCLR_DMA_ERROR(player); in uni_player_irq_handler()
108 snd_pcm_stop(player->substream, SNDRV_PCM_STATE_XRUN); in uni_player_irq_handler()
114 if (unlikely(status & UNIPERIF_ITM_UNDERFLOW_REC_DONE_MASK(player))) { in uni_player_irq_handler()
115 if (!player->underflow_enabled) { in uni_player_irq_handler()
116 dev_err(player->dev, in uni_player_irq_handler()
122 tmp = GET_UNIPERIF_STATUS_1_UNDERFLOW_DURATION(player); in uni_player_irq_handler()
123 dev_dbg(player->dev, "Underflow recovered (%d LR clocks max)\n", in uni_player_irq_handler()
127 SET_UNIPERIF_BIT_CONTROL_CLR_UNDERFLOW_DURATION(player); in uni_player_irq_handler()
130 player->state = UNIPERIF_STATE_STARTED; in uni_player_irq_handler()
137 UNIPERIF_ITM_UNDERFLOW_REC_FAILED_MASK(player))) { in uni_player_irq_handler()
138 dev_err(player->dev, "Underflow recovery failed\n"); in uni_player_irq_handler()
141 snd_pcm_stop(player->substream, SNDRV_PCM_STATE_XRUN); in uni_player_irq_handler()
147 snd_pcm_stream_unlock(player->substream); in uni_player_irq_handler()
149 spin_unlock(&player->irq_lock); in uni_player_irq_handler()
154 static int uni_player_clk_set_rate(struct uniperif *player, unsigned long rate) in uni_player_clk_set_rate() argument
157 int adjustment = player->clk_adj; in uni_player_clk_set_rate()
190 ret = clk_set_rate(player->clk, rate_adjusted); in uni_player_clk_set_rate()
194 rate_achieved = clk_get_rate(player->clk); in uni_player_clk_set_rate()
214 player->clk_adj = adjustment; in uni_player_clk_set_rate()
218 static void uni_player_set_channel_status(struct uniperif *player, in uni_player_set_channel_status() argument
232 player->stream_settings.iec958.status[3] = in uni_player_set_channel_status()
236 player->stream_settings.iec958.status[3] = in uni_player_set_channel_status()
240 player->stream_settings.iec958.status[3] = in uni_player_set_channel_status()
244 player->stream_settings.iec958.status[3] = in uni_player_set_channel_status()
248 player->stream_settings.iec958.status[3] = in uni_player_set_channel_status()
252 player->stream_settings.iec958.status[3] = in uni_player_set_channel_status()
256 player->stream_settings.iec958.status[3] = in uni_player_set_channel_status()
260 player->stream_settings.iec958.status[3] = in uni_player_set_channel_status()
264 player->stream_settings.iec958.status[3] = in uni_player_set_channel_status()
269 player->stream_settings.iec958.status[3] = in uni_player_set_channel_status()
278 if (player->stream_settings.iec958.status[0] & IEC958_AES0_NONAUDIO) in uni_player_set_channel_status()
279 player->stream_settings.encoding_mode = in uni_player_set_channel_status()
282 player->stream_settings.encoding_mode = in uni_player_set_channel_status()
285 if (player->stream_settings.encoding_mode == in uni_player_set_channel_status()
288 SET_UNIPERIF_USER_VALIDITY_VALIDITY_LR(player, 0); in uni_player_set_channel_status()
291 SET_UNIPERIF_USER_VALIDITY_VALIDITY_LR(player, 1); in uni_player_set_channel_status()
296 player->stream_settings.iec958.status[0 + (n * 4)] & 0xf; in uni_player_set_channel_status()
298 player->stream_settings.iec958.status[1 + (n * 4)] << 8; in uni_player_set_channel_status()
300 player->stream_settings.iec958.status[2 + (n * 4)] << 16; in uni_player_set_channel_status()
302 player->stream_settings.iec958.status[3 + (n * 4)] << 24; in uni_player_set_channel_status()
303 SET_UNIPERIF_CHANNEL_STA_REGN(player, n, status); in uni_player_set_channel_status()
307 if (player->ver < SND_ST_UNIPERIF_VERSION_UNI_PLR_TOP_1_0) in uni_player_set_channel_status()
308 SET_UNIPERIF_CONFIG_CHL_STS_UPDATE(player); in uni_player_set_channel_status()
310 SET_UNIPERIF_BIT_CONTROL_CHL_STS_UPDATE(player); in uni_player_set_channel_status()
313 static int uni_player_prepare_iec958(struct uniperif *player, in uni_player_prepare_iec958() argument
318 clk_div = player->mclk / runtime->rate; in uni_player_prepare_iec958()
322 dev_err(player->dev, "%s: invalid clk_div %d\n", in uni_player_prepare_iec958()
330 SET_UNIPERIF_CONFIG_MEM_FMT_16_16(player); in uni_player_prepare_iec958()
332 SET_UNIPERIF_I2S_FMT_NBIT_32(player); in uni_player_prepare_iec958()
334 SET_UNIPERIF_I2S_FMT_DATA_SIZE_16(player); in uni_player_prepare_iec958()
338 SET_UNIPERIF_CONFIG_MEM_FMT_16_0(player); in uni_player_prepare_iec958()
340 SET_UNIPERIF_I2S_FMT_NBIT_32(player); in uni_player_prepare_iec958()
342 SET_UNIPERIF_I2S_FMT_DATA_SIZE_24(player); in uni_player_prepare_iec958()
345 dev_err(player->dev, "format not supported\n"); in uni_player_prepare_iec958()
350 SET_UNIPERIF_CONFIG_PARITY_CNTR_BY_HW(player); in uni_player_prepare_iec958()
353 SET_UNIPERIF_CONFIG_CHANNEL_STA_CNTR_BY_HW(player); in uni_player_prepare_iec958()
356 SET_UNIPERIF_CONFIG_USER_DAT_CNTR_BY_HW(player); in uni_player_prepare_iec958()
359 SET_UNIPERIF_CONFIG_VALIDITY_DAT_CNTR_BY_HW(player); in uni_player_prepare_iec958()
362 SET_UNIPERIF_CONFIG_SPDIF_SW_CTRL_DISABLE(player); in uni_player_prepare_iec958()
364 SET_UNIPERIF_CTRL_ZERO_STUFF_HW(player); in uni_player_prepare_iec958()
366 mutex_lock(&player->ctrl_lock); in uni_player_prepare_iec958()
368 uni_player_set_channel_status(player, runtime); in uni_player_prepare_iec958()
369 mutex_unlock(&player->ctrl_lock); in uni_player_prepare_iec958()
372 SET_UNIPERIF_USER_VALIDITY_VALIDITY_LR(player, 0); in uni_player_prepare_iec958()
375 SET_UNIPERIF_CONFIG_ONE_BIT_AUD_DISABLE(player); in uni_player_prepare_iec958()
378 SET_UNIPERIF_CONFIG_REPEAT_CHL_STS_ENABLE(player); in uni_player_prepare_iec958()
381 SET_UNIPERIF_CONFIG_SUBFRAME_SEL_SUBF1_SUBF0(player); in uni_player_prepare_iec958()
384 SET_UNIPERIF_I2S_FMT_ORDER_MSB(player); in uni_player_prepare_iec958()
386 if (player->stream_settings.encoding_mode == in uni_player_prepare_iec958()
388 SET_UNIPERIF_CTRL_EXIT_STBY_ON_EOBLOCK_ON(player); in uni_player_prepare_iec958()
390 SET_UNIPERIF_CTRL_EXIT_STBY_ON_EOBLOCK_OFF(player); in uni_player_prepare_iec958()
392 SET_UNIPERIF_I2S_FMT_NUM_CH(player, runtime->channels / 2); in uni_player_prepare_iec958()
395 SET_UNIPERIF_CTRL_ROUNDING_OFF(player); in uni_player_prepare_iec958()
398 SET_UNIPERIF_CTRL_DIVIDER(player, clk_div / 128); in uni_player_prepare_iec958()
401 SET_UNIPERIF_CTRL_SPDIF_LAT_OFF(player); in uni_player_prepare_iec958()
408 if (player->ver < SND_ST_UNIPERIF_VERSION_UNI_PLR_TOP_1_0) in uni_player_prepare_iec958()
409 SET_UNIPERIF_CTRL_SPDIF_FMT_OFF(player); in uni_player_prepare_iec958()
411 SET_UNIPERIF_CTRL_SPDIF_FMT_ON(player); in uni_player_prepare_iec958()
416 static int uni_player_prepare_pcm(struct uniperif *player, in uni_player_prepare_pcm() argument
422 if ((player->daifmt & SND_SOC_DAIFMT_FORMAT_MASK) == in uni_player_prepare_pcm()
430 clk_div = player->mclk / runtime->rate; in uni_player_prepare_pcm()
436 dev_err(player->dev, "%s: invalid clk_div\n", __func__); in uni_player_prepare_pcm()
441 dev_err(player->dev, "%s: invalid clk_div\n", __func__); in uni_player_prepare_pcm()
451 SET_UNIPERIF_I2S_FMT_NBIT_32(player); in uni_player_prepare_pcm()
452 SET_UNIPERIF_I2S_FMT_DATA_SIZE_32(player); in uni_player_prepare_pcm()
455 SET_UNIPERIF_I2S_FMT_NBIT_16(player); in uni_player_prepare_pcm()
456 SET_UNIPERIF_I2S_FMT_DATA_SIZE_16(player); in uni_player_prepare_pcm()
459 dev_err(player->dev, "subframe format not supported\n"); in uni_player_prepare_pcm()
467 SET_UNIPERIF_CONFIG_MEM_FMT_16_16(player); in uni_player_prepare_pcm()
475 SET_UNIPERIF_CONFIG_MEM_FMT_16_0(player); in uni_player_prepare_pcm()
479 dev_err(player->dev, "format not supported\n"); in uni_player_prepare_pcm()
484 SET_UNIPERIF_CTRL_ROUNDING_OFF(player); in uni_player_prepare_pcm()
487 SET_UNIPERIF_CTRL_DIVIDER(player, clk_div / (2 * output_frame_size)); in uni_player_prepare_pcm()
492 dev_err(player->dev, "%s: invalid nb of channels\n", __func__); in uni_player_prepare_pcm()
496 SET_UNIPERIF_I2S_FMT_NUM_CH(player, runtime->channels / 2); in uni_player_prepare_pcm()
499 SET_UNIPERIF_CONFIG_ONE_BIT_AUD_DISABLE(player); in uni_player_prepare_pcm()
501 SET_UNIPERIF_I2S_FMT_ORDER_MSB(player); in uni_player_prepare_pcm()
504 SET_UNIPERIF_CTRL_SPDIF_FMT_OFF(player); in uni_player_prepare_pcm()
509 static int uni_player_prepare_tdm(struct uniperif *player, in uni_player_prepare_tdm() argument
520 sti_uniperiph_get_unip_tdm_frame_size(player); in uni_player_prepare_tdm()
525 SET_UNIPERIF_CONFIG_MEM_FMT_16_0(player); in uni_player_prepare_tdm()
526 SET_UNIPERIF_I2S_FMT_DATA_SIZE_32(player); in uni_player_prepare_tdm()
529 SET_UNIPERIF_I2S_FMT_NUM_CH(player, user_frame_size / 4 / 2); in uni_player_prepare_tdm()
531 SET_UNIPERIF_I2S_FMT_ORDER_MSB(player); in uni_player_prepare_tdm()
532 SET_UNIPERIF_I2S_FMT_ALIGN_LEFT(player); in uni_player_prepare_tdm()
535 SET_UNIPERIF_TDM_ENABLE_TDM_ENABLE(player); in uni_player_prepare_tdm()
538 SET_UNIPERIF_TDM_FS_REF_DIV_NUM_TIMESLOT(player, tdm_frame_size); in uni_player_prepare_tdm()
541 sti_uniperiph_get_tdm_word_pos(player, word_pos); in uni_player_prepare_tdm()
542 SET_UNIPERIF_TDM_WORD_POS(player, 1_2, word_pos[WORD_1_2]); in uni_player_prepare_tdm()
543 SET_UNIPERIF_TDM_WORD_POS(player, 3_4, word_pos[WORD_3_4]); in uni_player_prepare_tdm()
544 SET_UNIPERIF_TDM_WORD_POS(player, 5_6, word_pos[WORD_5_6]); in uni_player_prepare_tdm()
545 SET_UNIPERIF_TDM_WORD_POS(player, 7_8, word_pos[WORD_7_8]); in uni_player_prepare_tdm()
549 mutex_lock(&player->ctrl_lock); in uni_player_prepare_tdm()
550 ret = uni_player_clk_set_rate(player, freq); in uni_player_prepare_tdm()
552 player->mclk = freq; in uni_player_prepare_tdm()
553 mutex_unlock(&player->ctrl_lock); in uni_player_prepare_tdm()
575 struct uniperif *player = priv->dai_data.uni; in uni_player_ctl_iec958_get() local
576 struct snd_aes_iec958 *iec958 = &player->stream_settings.iec958; in uni_player_ctl_iec958_get()
578 mutex_lock(&player->ctrl_lock); in uni_player_ctl_iec958_get()
583 mutex_unlock(&player->ctrl_lock); in uni_player_ctl_iec958_get()
592 struct uniperif *player = priv->dai_data.uni; in uni_player_ctl_iec958_put() local
593 struct snd_aes_iec958 *iec958 = &player->stream_settings.iec958; in uni_player_ctl_iec958_put()
596 mutex_lock(&player->ctrl_lock); in uni_player_ctl_iec958_put()
602 spin_lock_irqsave(&player->irq_lock, flags); in uni_player_ctl_iec958_put()
603 if (player->substream && player->substream->runtime) in uni_player_ctl_iec958_put()
604 uni_player_set_channel_status(player, in uni_player_ctl_iec958_put()
605 player->substream->runtime); in uni_player_ctl_iec958_put()
607 uni_player_set_channel_status(player, NULL); in uni_player_ctl_iec958_put()
609 spin_unlock_irqrestore(&player->irq_lock, flags); in uni_player_ctl_iec958_put()
610 mutex_unlock(&player->ctrl_lock); in uni_player_ctl_iec958_put()
643 struct uniperif *player = priv->dai_data.uni; in snd_sti_clk_adjustment_get() local
645 mutex_lock(&player->ctrl_lock); in snd_sti_clk_adjustment_get()
646 ucontrol->value.integer.value[0] = player->clk_adj; in snd_sti_clk_adjustment_get()
647 mutex_unlock(&player->ctrl_lock); in snd_sti_clk_adjustment_get()
657 struct uniperif *player = priv->dai_data.uni; in snd_sti_clk_adjustment_put() local
664 mutex_lock(&player->ctrl_lock); in snd_sti_clk_adjustment_put()
665 player->clk_adj = ucontrol->value.integer.value[0]; in snd_sti_clk_adjustment_put()
667 if (player->mclk) in snd_sti_clk_adjustment_put()
668 ret = uni_player_clk_set_rate(player, player->mclk); in snd_sti_clk_adjustment_put()
669 mutex_unlock(&player->ctrl_lock); in snd_sti_clk_adjustment_put()
695 struct uniperif *player = priv->dai_data.uni; in uni_player_startup() local
699 spin_lock_irqsave(&player->irq_lock, flags); in uni_player_startup()
700 player->substream = substream; in uni_player_startup()
701 spin_unlock_irqrestore(&player->irq_lock, flags); in uni_player_startup()
703 player->clk_adj = 0; in uni_player_startup()
705 if (!UNIPERIF_TYPE_IS_TDM(player)) in uni_player_startup()
712 player, SNDRV_PCM_HW_PARAM_CHANNELS, in uni_player_startup()
720 player, SNDRV_PCM_HW_PARAM_FORMAT, in uni_player_startup()
728 struct uniperif *player = priv->dai_data.uni; in uni_player_set_sysclk() local
731 if (UNIPERIF_TYPE_IS_TDM(player) || (dir == SND_SOC_CLOCK_IN)) in uni_player_set_sysclk()
737 mutex_lock(&player->ctrl_lock); in uni_player_set_sysclk()
738 ret = uni_player_clk_set_rate(player, freq); in uni_player_set_sysclk()
740 player->mclk = freq; in uni_player_set_sysclk()
741 mutex_unlock(&player->ctrl_lock); in uni_player_set_sysclk()
750 struct uniperif *player = priv->dai_data.uni; in uni_player_prepare() local
756 if (player->state != UNIPERIF_STATE_STOPPED) { in uni_player_prepare()
757 dev_err(player->dev, "%s: invalid player state %d\n", __func__, in uni_player_prepare()
758 player->state); in uni_player_prepare()
763 if (player->type == SND_ST_UNIPERIF_TYPE_TDM) { in uni_player_prepare()
772 if (player->ver < SND_ST_UNIPERIF_VERSION_UNI_PLR_TOP_1_0) { in uni_player_prepare()
785 (trigger_limit > UNIPERIF_CONFIG_DMA_TRIG_LIMIT_MASK(player))) { in uni_player_prepare()
786 dev_err(player->dev, "invalid trigger limit %d\n", in uni_player_prepare()
791 SET_UNIPERIF_CONFIG_DMA_TRIG_LIMIT(player, trigger_limit); in uni_player_prepare()
794 switch (player->type) { in uni_player_prepare()
796 ret = uni_player_prepare_iec958(player, runtime); in uni_player_prepare()
799 ret = uni_player_prepare_pcm(player, runtime); in uni_player_prepare()
802 ret = uni_player_prepare_iec958(player, runtime); in uni_player_prepare()
805 ret = uni_player_prepare_tdm(player, runtime); in uni_player_prepare()
808 dev_err(player->dev, "invalid player type\n"); in uni_player_prepare()
815 switch (player->daifmt & SND_SOC_DAIFMT_INV_MASK) { in uni_player_prepare()
817 SET_UNIPERIF_I2S_FMT_LR_POL_LOW(player); in uni_player_prepare()
818 SET_UNIPERIF_I2S_FMT_SCLK_EDGE_RISING(player); in uni_player_prepare()
821 SET_UNIPERIF_I2S_FMT_LR_POL_HIG(player); in uni_player_prepare()
822 SET_UNIPERIF_I2S_FMT_SCLK_EDGE_RISING(player); in uni_player_prepare()
825 SET_UNIPERIF_I2S_FMT_LR_POL_LOW(player); in uni_player_prepare()
826 SET_UNIPERIF_I2S_FMT_SCLK_EDGE_FALLING(player); in uni_player_prepare()
829 SET_UNIPERIF_I2S_FMT_LR_POL_HIG(player); in uni_player_prepare()
830 SET_UNIPERIF_I2S_FMT_SCLK_EDGE_FALLING(player); in uni_player_prepare()
834 switch (player->daifmt & SND_SOC_DAIFMT_FORMAT_MASK) { in uni_player_prepare()
836 SET_UNIPERIF_I2S_FMT_ALIGN_LEFT(player); in uni_player_prepare()
837 SET_UNIPERIF_I2S_FMT_PADDING_I2S_MODE(player); in uni_player_prepare()
840 SET_UNIPERIF_I2S_FMT_ALIGN_LEFT(player); in uni_player_prepare()
841 SET_UNIPERIF_I2S_FMT_PADDING_SONY_MODE(player); in uni_player_prepare()
844 SET_UNIPERIF_I2S_FMT_ALIGN_RIGHT(player); in uni_player_prepare()
845 SET_UNIPERIF_I2S_FMT_PADDING_SONY_MODE(player); in uni_player_prepare()
848 dev_err(player->dev, "format not supported\n"); in uni_player_prepare()
852 SET_UNIPERIF_I2S_FMT_NO_OF_SAMPLES_TO_READ(player, 0); in uni_player_prepare()
855 return sti_uniperiph_reset(player); in uni_player_prepare()
858 static int uni_player_start(struct uniperif *player) in uni_player_start() argument
863 if (player->state != UNIPERIF_STATE_STOPPED) { in uni_player_start()
864 dev_err(player->dev, "%s: invalid player state\n", __func__); in uni_player_start()
868 ret = clk_prepare_enable(player->clk); in uni_player_start()
870 dev_err(player->dev, "%s: Failed to enable clock\n", __func__); in uni_player_start()
875 SET_UNIPERIF_ITS_BCLR(player, GET_UNIPERIF_ITS(player)); in uni_player_start()
878 SET_UNIPERIF_ITM_BSET_DMA_ERROR(player); in uni_player_start()
879 SET_UNIPERIF_ITM_BSET_FIFO_ERROR(player); in uni_player_start()
882 if (player->underflow_enabled) { in uni_player_start()
883 SET_UNIPERIF_ITM_BSET_UNDERFLOW_REC_DONE(player); in uni_player_start()
884 SET_UNIPERIF_ITM_BSET_UNDERFLOW_REC_FAILED(player); in uni_player_start()
887 ret = sti_uniperiph_reset(player); in uni_player_start()
889 clk_disable_unprepare(player->clk); in uni_player_start()
900 SET_UNIPERIF_CTRL_OPERATION_PCM_DATA(player); in uni_player_start()
907 if (player->ver < SND_ST_UNIPERIF_VERSION_UNI_PLR_TOP_1_0) in uni_player_start()
908 if (UNIPERIF_TYPE_IS_IEC958(player)) in uni_player_start()
909 SET_UNIPERIF_CTRL_SPDIF_FMT_ON(player); in uni_player_start()
912 if (player->ver < SND_ST_UNIPERIF_VERSION_UNI_PLR_TOP_1_0) in uni_player_start()
913 SET_UNIPERIF_CONFIG_CHL_STS_UPDATE(player); in uni_player_start()
915 SET_UNIPERIF_BIT_CONTROL_CHL_STS_UPDATE(player); in uni_player_start()
918 player->state = UNIPERIF_STATE_STARTED; in uni_player_start()
923 static int uni_player_stop(struct uniperif *player) in uni_player_stop() argument
928 if (player->state == UNIPERIF_STATE_STOPPED) { in uni_player_stop()
929 dev_err(player->dev, "%s: invalid player state\n", __func__); in uni_player_stop()
934 SET_UNIPERIF_CTRL_OPERATION_OFF(player); in uni_player_stop()
936 ret = sti_uniperiph_reset(player); in uni_player_stop()
941 SET_UNIPERIF_ITM_BCLR(player, GET_UNIPERIF_ITM(player)); in uni_player_stop()
944 clk_disable_unprepare(player->clk); in uni_player_stop()
947 player->state = UNIPERIF_STATE_STOPPED; in uni_player_stop()
952 int uni_player_resume(struct uniperif *player) in uni_player_resume() argument
957 if (player->clk_sel) { in uni_player_resume()
958 ret = regmap_field_write(player->clk_sel, 1); in uni_player_resume()
960 dev_err(player->dev, in uni_player_resume()
967 SET_UNIPERIF_CONFIG_BACK_STALL_REQ_DISABLE(player); in uni_player_resume()
968 SET_UNIPERIF_CTRL_ROUNDING_OFF(player); in uni_player_resume()
969 SET_UNIPERIF_CTRL_SPDIF_LAT_OFF(player); in uni_player_resume()
970 SET_UNIPERIF_CONFIG_IDLE_MOD_DISABLE(player); in uni_player_resume()
980 struct uniperif *player = priv->dai_data.uni; in uni_player_trigger() local
984 return uni_player_start(player); in uni_player_trigger()
986 return uni_player_stop(player); in uni_player_trigger()
988 return uni_player_resume(player); in uni_player_trigger()
998 struct uniperif *player = priv->dai_data.uni; in uni_player_shutdown() local
1001 spin_lock_irqsave(&player->irq_lock, flags); in uni_player_shutdown()
1002 if (player->state != UNIPERIF_STATE_STOPPED) in uni_player_shutdown()
1004 uni_player_stop(player); in uni_player_shutdown()
1006 player->substream = NULL; in uni_player_shutdown()
1007 spin_unlock_irqrestore(&player->irq_lock, flags); in uni_player_shutdown()
1011 struct uniperif *player) in uni_player_parse_dt_audio_glue() argument
1018 8 + player->id, in uni_player_parse_dt_audio_glue()
1019 8 + player->id), in uni_player_parse_dt_audio_glue()
1031 player->clk_sel = regmap_field_alloc(regmap, regfield[0]); in uni_player_parse_dt_audio_glue()
1032 player->valid_sel = regmap_field_alloc(regmap, regfield[1]); in uni_player_parse_dt_audio_glue()
1050 struct uniperif *player) in uni_player_init() argument
1054 player->dev = &pdev->dev; in uni_player_init()
1055 player->state = UNIPERIF_STATE_STOPPED; in uni_player_init()
1056 player->dai_ops = &uni_player_dai_ops; in uni_player_init()
1059 ret = uni_player_parse_dt_audio_glue(pdev, player); in uni_player_init()
1062 dev_err(player->dev, "Failed to parse DeviceTree\n"); in uni_player_init()
1067 if (player->ver >= SND_ST_UNIPERIF_VERSION_UNI_PLR_TOP_1_0) in uni_player_init()
1068 player->underflow_enabled = 1; in uni_player_init()
1070 if (UNIPERIF_TYPE_IS_TDM(player)) in uni_player_init()
1071 player->hw = &uni_tdm_hw; in uni_player_init()
1073 player->hw = &uni_player_pcm_hw; in uni_player_init()
1076 player->clk = of_clk_get(pdev->dev.of_node, 0); in uni_player_init()
1077 if (IS_ERR(player->clk)) { in uni_player_init()
1078 dev_err(player->dev, "Failed to get clock\n"); in uni_player_init()
1079 return PTR_ERR(player->clk); in uni_player_init()
1083 if (player->clk_sel) { in uni_player_init()
1084 ret = regmap_field_write(player->clk_sel, 1); in uni_player_init()
1086 dev_err(player->dev, in uni_player_init()
1094 if (player->valid_sel && in uni_player_init()
1095 (player->id == UNIPERIF_PLAYER_I2S_OUT)) { in uni_player_init()
1096 ret = regmap_field_write(player->valid_sel, player->id); in uni_player_init()
1098 dev_err(player->dev, in uni_player_init()
1104 ret = devm_request_irq(&pdev->dev, player->irq, in uni_player_init()
1106 dev_name(&pdev->dev), player); in uni_player_init()
1108 dev_err(player->dev, "unable to request IRQ %d\n", player->irq); in uni_player_init()
1112 mutex_init(&player->ctrl_lock); in uni_player_init()
1113 spin_lock_init(&player->irq_lock); in uni_player_init()
1116 SET_UNIPERIF_CONFIG_BACK_STALL_REQ_DISABLE(player); in uni_player_init()
1117 SET_UNIPERIF_CTRL_ROUNDING_OFF(player); in uni_player_init()
1118 SET_UNIPERIF_CTRL_SPDIF_LAT_OFF(player); in uni_player_init()
1119 SET_UNIPERIF_CONFIG_IDLE_MOD_DISABLE(player); in uni_player_init()
1121 if (UNIPERIF_TYPE_IS_IEC958(player)) { in uni_player_init()
1125 player->stream_settings.iec958.status[0] = 0x00; in uni_player_init()
1127 player->stream_settings.iec958.status[1] = in uni_player_init()
1130 player->stream_settings.iec958.status[2] = in uni_player_init()
1133 player->stream_settings.iec958.status[3] = in uni_player_init()
1136 player->stream_settings.iec958.status[4] = in uni_player_init()
1140 player->num_ctrls = ARRAY_SIZE(snd_sti_iec_ctl); in uni_player_init()
1141 player->snd_ctrls = snd_sti_iec_ctl[0]; in uni_player_init()
1143 player->num_ctrls = ARRAY_SIZE(snd_sti_pcm_ctl); in uni_player_init()
1144 player->snd_ctrls = snd_sti_pcm_ctl[0]; in uni_player_init()