Lines Matching +full:playback +full:- +full:channels
1 // SPDX-License-Identifier: GPL-2.0
3 // Renesas RZ/G2L ASoC Serial Sound Interface (SSIF-2) Driver
74 #define SSI_RATES SNDRV_PCM_RATE_8000_48000 /* 8k-44.1kHz */
117 * The SSI supports full-duplex transmission and reception.
120 * So it is better to use as half-duplex (playing and recording
121 * should be done on separate channels).
123 struct rz_ssi_stream playback; member
138 unsigned int channels; member
148 writel(data, (priv->base + reg)); in rz_ssi_reg_writel()
153 return readl(priv->base + reg); in rz_ssi_reg_readl()
161 val = readl(priv->base + reg); in rz_ssi_reg_mask_setl()
163 writel(val, (priv->base + reg)); in rz_ssi_reg_mask_setl()
177 return substream->stream == SNDRV_PCM_STREAM_PLAYBACK; in rz_ssi_stream_is_play()
183 struct rz_ssi_stream *stream = &ssi->playback; in rz_ssi_stream_get()
185 if (substream->stream != SNDRV_PCM_STREAM_PLAYBACK) in rz_ssi_stream_get()
186 stream = &ssi->capture; in rz_ssi_stream_get()
193 return (ssi->playback.dma_ch && (ssi->dma_rt || ssi->capture.dma_ch)); in rz_ssi_is_dma_enabled()
199 struct rz_ssi_priv *ssi = strm->priv; in rz_ssi_set_substream()
202 spin_lock_irqsave(&ssi->lock, flags); in rz_ssi_set_substream()
203 strm->substream = substream; in rz_ssi_set_substream()
204 spin_unlock_irqrestore(&ssi->lock, flags); in rz_ssi_set_substream()
213 spin_lock_irqsave(&ssi->lock, flags); in rz_ssi_stream_is_valid()
214 ret = strm->substream && strm->substream->runtime; in rz_ssi_stream_is_valid()
215 spin_unlock_irqrestore(&ssi->lock, flags); in rz_ssi_stream_is_valid()
222 return strm->substream && strm->running; in rz_ssi_is_stream_running()
228 struct snd_pcm_runtime *runtime = substream->runtime; in rz_ssi_stream_init()
231 strm->sample_width = samples_to_bytes(runtime, 1); in rz_ssi_stream_init()
232 strm->dma_buffer_pos = 0; in rz_ssi_stream_init()
233 strm->period_counter = 0; in rz_ssi_stream_init()
234 strm->buffer_pos = 0; in rz_ssi_stream_init()
236 strm->oerr_num = 0; in rz_ssi_stream_init()
237 strm->uerr_num = 0; in rz_ssi_stream_init()
238 strm->running = 0; in rz_ssi_stream_init()
241 strm->fifo_sample_size = SSI_FIFO_DEPTH; in rz_ssi_stream_init()
247 struct snd_soc_dai *dai = rz_ssi_get_dai(strm->substream); in rz_ssi_stream_quit()
251 if (strm->oerr_num > 0) in rz_ssi_stream_quit()
252 dev_info(dai->dev, "overrun = %d\n", strm->oerr_num); in rz_ssi_stream_quit()
254 if (strm->uerr_num > 0) in rz_ssi_stream_quit()
255 dev_info(dai->dev, "underrun = %d\n", strm->uerr_num); in rz_ssi_stream_quit()
259 unsigned int channels) in rz_ssi_clk_setup() argument
262 6, 12, 24, 48, 96, -1, -1, -1 }; in rz_ssi_clk_setup()
264 unsigned long bclk_rate = rate * channels * channel_bits; in rz_ssi_clk_setup()
275 if (ssi->audio_clk_1 && ssi->audio_clk_2) { in rz_ssi_clk_setup()
276 if (ssi->audio_clk_1 % bclk_rate) in rz_ssi_clk_setup()
277 ssi->audio_mck = ssi->audio_clk_2; in rz_ssi_clk_setup()
279 ssi->audio_mck = ssi->audio_clk_1; in rz_ssi_clk_setup()
284 if (ssi->audio_mck == ssi->audio_clk_1) in rz_ssi_clk_setup()
286 if (ssi->bckp_rise) in rz_ssi_clk_setup()
288 if (ssi->lrckp_fsync_fall) in rz_ssi_clk_setup()
293 div = ssi->audio_mck / bclk_rate; in rz_ssi_clk_setup()
303 dev_err(ssi->dev, "Rate not divisible by audio clock source\n"); in rz_ssi_clk_setup()
304 return -EINVAL; in rz_ssi_clk_setup()
336 while (--timeout) { in rz_ssi_set_idle()
343 dev_info(ssi->dev, "timeout waiting for SSI idle\n"); in rz_ssi_set_idle()
352 bool is_play = rz_ssi_stream_is_play(ssi, strm->substream); in rz_ssi_start()
356 is_full_duplex = rz_ssi_is_stream_running(&ssi->playback) || in rz_ssi_start()
357 rz_ssi_is_stream_running(&ssi->capture); in rz_ssi_start()
373 SSISCR_TDES(strm->fifo_sample_size / 2 - 1) | in rz_ssi_start()
397 strm->running = 1; in rz_ssi_start()
410 strm->running = 0; in rz_ssi_stop()
412 if (rz_ssi_is_stream_running(&ssi->playback) || in rz_ssi_stop()
413 rz_ssi_is_stream_running(&ssi->capture)) in rz_ssi_stop()
421 dmaengine_terminate_async(strm->dma_ch); in rz_ssi_stop()
430 struct snd_pcm_substream *substream = strm->substream; in rz_ssi_pointer_update()
434 if (!strm->running || !substream || !substream->runtime) in rz_ssi_pointer_update()
437 runtime = substream->runtime; in rz_ssi_pointer_update()
438 strm->buffer_pos += frames; in rz_ssi_pointer_update()
439 WARN_ON(strm->buffer_pos > runtime->buffer_size); in rz_ssi_pointer_update()
442 if (strm->buffer_pos == runtime->buffer_size) in rz_ssi_pointer_update()
443 strm->buffer_pos = 0; in rz_ssi_pointer_update()
445 current_period = strm->buffer_pos / runtime->period_size; in rz_ssi_pointer_update()
446 if (strm->period_counter != current_period) { in rz_ssi_pointer_update()
447 snd_pcm_period_elapsed(strm->substream); in rz_ssi_pointer_update()
448 strm->period_counter = current_period; in rz_ssi_pointer_update()
454 struct snd_pcm_substream *substream = strm->substream; in rz_ssi_pio_recv()
463 return -EINVAL; in rz_ssi_pio_recv()
465 runtime = substream->runtime; in rz_ssi_pio_recv()
469 frames_left = runtime->period_size - in rz_ssi_pio_recv()
470 (strm->buffer_pos % runtime->period_size); in rz_ssi_pio_recv()
472 frames_left = runtime->period_size; in rz_ssi_pio_recv()
480 while (frames_left && (fifo_samples >= runtime->channels)) { in rz_ssi_pio_recv()
481 samples += runtime->channels; in rz_ssi_pio_recv()
482 fifo_samples -= runtime->channels; in rz_ssi_pio_recv()
483 frames_left--; in rz_ssi_pio_recv()
491 buf = (u16 *)runtime->dma_area; in rz_ssi_pio_recv()
492 buf += strm->buffer_pos * runtime->channels; in rz_ssi_pio_recv()
494 /* Note, only supports 16-bit samples */ in rz_ssi_pio_recv()
499 rz_ssi_pointer_update(strm, samples / runtime->channels); in rz_ssi_pio_recv()
500 } while (!frames_left && fifo_samples >= runtime->channels); in rz_ssi_pio_recv()
507 struct snd_pcm_substream *substream = strm->substream; in rz_ssi_pio_send()
508 struct snd_pcm_runtime *runtime = substream->runtime; in rz_ssi_pio_send()
517 return -EINVAL; in rz_ssi_pio_send()
520 frames_left = runtime->period_size - (strm->buffer_pos % in rz_ssi_pio_send()
521 runtime->period_size); in rz_ssi_pio_send()
523 frames_left = runtime->period_size; in rz_ssi_pio_send()
525 sample_space = strm->fifo_sample_size; in rz_ssi_pio_send()
527 sample_space -= (ssifsr >> SSIFSR_TDC_SHIFT) & SSIFSR_TDC_MASK; in rz_ssi_pio_send()
530 while (frames_left && (sample_space >= runtime->channels)) { in rz_ssi_pio_send()
531 samples += runtime->channels; in rz_ssi_pio_send()
532 sample_space -= runtime->channels; in rz_ssi_pio_send()
533 frames_left--; in rz_ssi_pio_send()
541 buf = (u16 *)(runtime->dma_area); in rz_ssi_pio_send()
542 buf += strm->buffer_pos * runtime->channels; in rz_ssi_pio_send()
544 /* Note, only supports 16-bit samples */ in rz_ssi_pio_send()
549 rz_ssi_pointer_update(strm, samples / runtime->channels); in rz_ssi_pio_send()
561 if (ssi->playback.substream) in rz_ssi_interrupt()
562 strm_playback = &ssi->playback; in rz_ssi_interrupt()
563 if (ssi->capture.substream) in rz_ssi_interrupt()
564 strm_capture = &ssi->capture; in rz_ssi_interrupt()
569 if (irq == ssi->irq_int) { /* error or idle */ in rz_ssi_interrupt()
581 if (ssi->capture.substream && is_stopped) { in rz_ssi_interrupt()
583 strm_capture->uerr_num++; in rz_ssi_interrupt()
585 strm_capture->oerr_num++; in rz_ssi_interrupt()
590 if (ssi->playback.substream && is_stopped) { in rz_ssi_interrupt()
592 strm_playback->uerr_num++; in rz_ssi_interrupt()
594 strm_playback->oerr_num++; in rz_ssi_interrupt()
604 if (ssi->capture.substream && is_stopped) { in rz_ssi_interrupt()
606 strm_capture->transfer(ssi, strm_capture); in rz_ssi_interrupt()
609 if (ssi->playback.substream && is_stopped) { in rz_ssi_interrupt()
611 strm_playback->transfer(ssi, strm_playback); in rz_ssi_interrupt()
615 if (ssi->playback.substream && is_stopped) in rz_ssi_interrupt()
616 rz_ssi_start(ssi, &ssi->playback); in rz_ssi_interrupt()
617 if (ssi->capture.substream && is_stopped) in rz_ssi_interrupt()
618 rz_ssi_start(ssi, &ssi->capture); in rz_ssi_interrupt()
621 if (!rz_ssi_is_stream_running(&ssi->playback) && in rz_ssi_interrupt()
622 !rz_ssi_is_stream_running(&ssi->capture)) in rz_ssi_interrupt()
626 if (irq == ssi->irq_tx && rz_ssi_is_stream_running(&ssi->playback)) in rz_ssi_interrupt()
627 strm_playback->transfer(ssi, &ssi->playback); in rz_ssi_interrupt()
630 if (irq == ssi->irq_rx && rz_ssi_is_stream_running(&ssi->capture)) { in rz_ssi_interrupt()
631 strm_capture->transfer(ssi, &ssi->capture); in rz_ssi_interrupt()
635 if (irq == ssi->irq_rt) { in rz_ssi_interrupt()
636 if (ssi->playback.substream) { in rz_ssi_interrupt()
637 strm_playback->transfer(ssi, &ssi->playback); in rz_ssi_interrupt()
639 strm_capture->transfer(ssi, &ssi->capture); in rz_ssi_interrupt()
655 cfg.dst_addr = ssi->phys + SSIFTDR; in rz_ssi_dma_slave_config()
656 cfg.src_addr = ssi->phys + SSIFRDR; in rz_ssi_dma_slave_config()
666 struct snd_pcm_substream *substream = strm->substream; in rz_ssi_dma_transfer()
674 return -EINVAL; in rz_ssi_dma_transfer()
676 runtime = substream->runtime; in rz_ssi_dma_transfer()
677 if (runtime->state == SNDRV_PCM_STATE_DRAINING) in rz_ssi_dma_transfer()
688 amount = runtime->period_size; in rz_ssi_dma_transfer()
691 dma_paddr = runtime->dma_addr + frames_to_bytes(runtime, in rz_ssi_dma_transfer()
692 strm->dma_buffer_pos); in rz_ssi_dma_transfer()
694 desc = dmaengine_prep_slave_single(strm->dma_ch, dma_paddr, dma_size, in rz_ssi_dma_transfer()
698 dev_err(ssi->dev, "dmaengine_prep_slave_single() fail\n"); in rz_ssi_dma_transfer()
699 return -ENOMEM; in rz_ssi_dma_transfer()
702 desc->callback = rz_ssi_dma_complete; in rz_ssi_dma_transfer()
703 desc->callback_param = strm; in rz_ssi_dma_transfer()
706 dev_err(ssi->dev, "dmaengine_submit() fail\n"); in rz_ssi_dma_transfer()
707 return -EIO; in rz_ssi_dma_transfer()
711 strm->dma_buffer_pos += amount; in rz_ssi_dma_transfer()
712 if (strm->dma_buffer_pos >= runtime->buffer_size) in rz_ssi_dma_transfer()
713 strm->dma_buffer_pos = 0; in rz_ssi_dma_transfer()
716 dma_async_issue_pending(strm->dma_ch); in rz_ssi_dma_transfer()
725 if (!strm->running || !strm->substream || !strm->substream->runtime) in rz_ssi_dma_complete()
729 rz_ssi_pointer_update(strm, strm->substream->runtime->period_size); in rz_ssi_dma_complete()
732 rz_ssi_dma_transfer(strm->priv, strm); in rz_ssi_dma_complete()
737 if (ssi->playback.dma_ch) { in rz_ssi_release_dma_channels()
738 dma_release_channel(ssi->playback.dma_ch); in rz_ssi_release_dma_channels()
739 ssi->playback.dma_ch = NULL; in rz_ssi_release_dma_channels()
740 if (ssi->dma_rt) in rz_ssi_release_dma_channels()
741 ssi->dma_rt = false; in rz_ssi_release_dma_channels()
744 if (ssi->capture.dma_ch) { in rz_ssi_release_dma_channels()
745 dma_release_channel(ssi->capture.dma_ch); in rz_ssi_release_dma_channels()
746 ssi->capture.dma_ch = NULL; in rz_ssi_release_dma_channels()
752 ssi->playback.dma_ch = dma_request_chan(dev, "tx"); in rz_ssi_dma_request()
753 if (IS_ERR(ssi->playback.dma_ch)) in rz_ssi_dma_request()
754 ssi->playback.dma_ch = NULL; in rz_ssi_dma_request()
756 ssi->capture.dma_ch = dma_request_chan(dev, "rx"); in rz_ssi_dma_request()
757 if (IS_ERR(ssi->capture.dma_ch)) in rz_ssi_dma_request()
758 ssi->capture.dma_ch = NULL; in rz_ssi_dma_request()
760 if (!ssi->playback.dma_ch && !ssi->capture.dma_ch) { in rz_ssi_dma_request()
761 ssi->playback.dma_ch = dma_request_chan(dev, "rt"); in rz_ssi_dma_request()
762 if (IS_ERR(ssi->playback.dma_ch)) { in rz_ssi_dma_request()
763 ssi->playback.dma_ch = NULL; in rz_ssi_dma_request()
767 ssi->dma_rt = true; in rz_ssi_dma_request()
773 if (ssi->playback.dma_ch && in rz_ssi_dma_request()
774 (rz_ssi_dma_slave_config(ssi, ssi->playback.dma_ch, true) < 0)) in rz_ssi_dma_request()
777 if (ssi->capture.dma_ch && in rz_ssi_dma_request()
778 (rz_ssi_dma_slave_config(ssi, ssi->capture.dma_ch, false) < 0)) in rz_ssi_dma_request()
786 return -ENODEV; in rz_ssi_dma_request()
799 if (!rz_ssi_is_stream_running(&ssi->playback) && in rz_ssi_dai_trigger()
800 !rz_ssi_is_stream_running(&ssi->capture)) { in rz_ssi_dai_trigger()
808 if (ssi->dma_rt) { in rz_ssi_dai_trigger()
812 ret = rz_ssi_dma_slave_config(ssi, ssi->playback.dma_ch, in rz_ssi_dai_trigger()
816 ssi->playback.transfer = rz_ssi_pio_send; in rz_ssi_dai_trigger()
817 ssi->capture.transfer = rz_ssi_pio_recv; in rz_ssi_dai_trigger()
827 ret = strm->transfer(ssi, strm); in rz_ssi_dai_trigger()
852 dev_err(ssi->dev, "Codec should be clk and frame consumer\n"); in rz_ssi_dai_set_fmt()
853 return -EINVAL; in rz_ssi_dai_set_fmt()
864 ssi->bckp_rise = false; in rz_ssi_dai_set_fmt()
865 ssi->lrckp_fsync_fall = false; in rz_ssi_dai_set_fmt()
868 ssi->bckp_rise = false; in rz_ssi_dai_set_fmt()
869 ssi->lrckp_fsync_fall = true; in rz_ssi_dai_set_fmt()
872 ssi->bckp_rise = true; in rz_ssi_dai_set_fmt()
873 ssi->lrckp_fsync_fall = false; in rz_ssi_dai_set_fmt()
876 ssi->bckp_rise = true; in rz_ssi_dai_set_fmt()
877 ssi->lrckp_fsync_fall = true; in rz_ssi_dai_set_fmt()
880 return -EINVAL; in rz_ssi_dai_set_fmt()
888 dev_err(ssi->dev, "Only I2S mode is supported.\n"); in rz_ssi_dai_set_fmt()
889 return -EINVAL; in rz_ssi_dai_set_fmt()
896 unsigned int channels, in rz_ssi_is_valid_hw_params() argument
900 if (ssi->hw_params_cache.rate != rate || in rz_ssi_is_valid_hw_params()
901 ssi->hw_params_cache.channels != channels || in rz_ssi_is_valid_hw_params()
902 ssi->hw_params_cache.sample_width != sample_width || in rz_ssi_is_valid_hw_params()
903 ssi->hw_params_cache.sample_bits != sample_bits) in rz_ssi_is_valid_hw_params()
910 unsigned int channels, in rz_ssi_cache_hw_params() argument
914 ssi->hw_params_cache.rate = rate; in rz_ssi_cache_hw_params()
915 ssi->hw_params_cache.channels = channels; in rz_ssi_cache_hw_params()
916 ssi->hw_params_cache.sample_width = sample_width; in rz_ssi_cache_hw_params()
917 ssi->hw_params_cache.sample_bits = sample_bits; in rz_ssi_cache_hw_params()
927 SNDRV_PCM_HW_PARAM_SAMPLE_BITS)->min; in rz_ssi_dai_hw_params()
928 unsigned int channels = params_channels(params); in rz_ssi_dai_hw_params() local
932 dev_err(ssi->dev, "Unsupported sample width: %d\n", in rz_ssi_dai_hw_params()
934 return -EINVAL; in rz_ssi_dai_hw_params()
937 if (channels != 2) { in rz_ssi_dai_hw_params()
938 dev_err(ssi->dev, "Number of channels not matched: %d\n", in rz_ssi_dai_hw_params()
939 channels); in rz_ssi_dai_hw_params()
940 return -EINVAL; in rz_ssi_dai_hw_params()
943 if (rz_ssi_is_stream_running(&ssi->playback) || in rz_ssi_dai_hw_params()
944 rz_ssi_is_stream_running(&ssi->capture)) { in rz_ssi_dai_hw_params()
945 if (rz_ssi_is_valid_hw_params(ssi, rate, channels, in rz_ssi_dai_hw_params()
946 strm->sample_width, sample_bits)) in rz_ssi_dai_hw_params()
949 dev_err(ssi->dev, "Full duplex needs same HW params\n"); in rz_ssi_dai_hw_params()
950 return -EINVAL; in rz_ssi_dai_hw_params()
953 rz_ssi_cache_hw_params(ssi, rate, channels, strm->sample_width, in rz_ssi_dai_hw_params()
956 return rz_ssi_clk_setup(ssi, rate, channels); in rz_ssi_dai_hw_params()
984 return snd_pcm_hw_constraint_integer(substream->runtime, in rz_ssi_pcm_open()
995 return strm->buffer_pos; in rz_ssi_pcm_pointer()
1001 snd_pcm_set_managed_buffer_all(rtd->pcm, SNDRV_DMA_TYPE_DEV, in rz_ssi_pcm_new()
1002 rtd->card->snd_card->dev, in rz_ssi_pcm_new()
1009 .name = "rz-ssi-dai",
1010 .playback = {
1027 .name = "rz-ssi",
1041 ssi = devm_kzalloc(&pdev->dev, sizeof(*ssi), GFP_KERNEL); in rz_ssi_probe()
1043 return -ENOMEM; in rz_ssi_probe()
1045 ssi->pdev = pdev; in rz_ssi_probe()
1046 ssi->dev = &pdev->dev; in rz_ssi_probe()
1047 ssi->base = devm_platform_get_and_ioremap_resource(pdev, 0, &res); in rz_ssi_probe()
1048 if (IS_ERR(ssi->base)) in rz_ssi_probe()
1049 return PTR_ERR(ssi->base); in rz_ssi_probe()
1051 ssi->phys = res->start; in rz_ssi_probe()
1052 ssi->clk = devm_clk_get(&pdev->dev, "ssi"); in rz_ssi_probe()
1053 if (IS_ERR(ssi->clk)) in rz_ssi_probe()
1054 return PTR_ERR(ssi->clk); in rz_ssi_probe()
1056 ssi->sfr_clk = devm_clk_get(&pdev->dev, "ssi_sfr"); in rz_ssi_probe()
1057 if (IS_ERR(ssi->sfr_clk)) in rz_ssi_probe()
1058 return PTR_ERR(ssi->sfr_clk); in rz_ssi_probe()
1060 audio_clk = devm_clk_get(&pdev->dev, "audio_clk1"); in rz_ssi_probe()
1062 return dev_err_probe(&pdev->dev, PTR_ERR(audio_clk), in rz_ssi_probe()
1065 ssi->audio_clk_1 = clk_get_rate(audio_clk); in rz_ssi_probe()
1066 audio_clk = devm_clk_get(&pdev->dev, "audio_clk2"); in rz_ssi_probe()
1068 return dev_err_probe(&pdev->dev, PTR_ERR(audio_clk), in rz_ssi_probe()
1071 ssi->audio_clk_2 = clk_get_rate(audio_clk); in rz_ssi_probe()
1072 if (!(ssi->audio_clk_1 || ssi->audio_clk_2)) in rz_ssi_probe()
1073 return dev_err_probe(&pdev->dev, -EINVAL, in rz_ssi_probe()
1076 ssi->audio_mck = ssi->audio_clk_1 ? ssi->audio_clk_1 : ssi->audio_clk_2; in rz_ssi_probe()
1079 ret = rz_ssi_dma_request(ssi, &pdev->dev); in rz_ssi_probe()
1081 dev_warn(&pdev->dev, "DMA not available, using PIO\n"); in rz_ssi_probe()
1082 ssi->playback.transfer = rz_ssi_pio_send; in rz_ssi_probe()
1083 ssi->capture.transfer = rz_ssi_pio_recv; in rz_ssi_probe()
1085 dev_info(&pdev->dev, "DMA enabled"); in rz_ssi_probe()
1086 ssi->playback.transfer = rz_ssi_dma_transfer; in rz_ssi_probe()
1087 ssi->capture.transfer = rz_ssi_dma_transfer; in rz_ssi_probe()
1090 ssi->playback.priv = ssi; in rz_ssi_probe()
1091 ssi->capture.priv = ssi; in rz_ssi_probe()
1093 spin_lock_init(&ssi->lock); in rz_ssi_probe()
1094 dev_set_drvdata(&pdev->dev, ssi); in rz_ssi_probe()
1097 ssi->irq_int = platform_get_irq_byname(pdev, "int_req"); in rz_ssi_probe()
1098 if (ssi->irq_int < 0) { in rz_ssi_probe()
1100 return ssi->irq_int; in rz_ssi_probe()
1103 ret = devm_request_irq(&pdev->dev, ssi->irq_int, &rz_ssi_interrupt, in rz_ssi_probe()
1104 0, dev_name(&pdev->dev), ssi); in rz_ssi_probe()
1107 return dev_err_probe(&pdev->dev, ret, in rz_ssi_probe()
1113 ssi->irq_tx = platform_get_irq_byname(pdev, "dma_tx"); in rz_ssi_probe()
1114 ssi->irq_rx = platform_get_irq_byname(pdev, "dma_rx"); in rz_ssi_probe()
1115 if (ssi->irq_tx == -ENXIO && ssi->irq_rx == -ENXIO) { in rz_ssi_probe()
1116 ssi->irq_rt = platform_get_irq_byname(pdev, "dma_rt"); in rz_ssi_probe()
1117 if (ssi->irq_rt < 0) in rz_ssi_probe()
1118 return ssi->irq_rt; in rz_ssi_probe()
1120 ret = devm_request_irq(&pdev->dev, ssi->irq_rt, in rz_ssi_probe()
1122 dev_name(&pdev->dev), ssi); in rz_ssi_probe()
1124 return dev_err_probe(&pdev->dev, ret, in rz_ssi_probe()
1127 if (ssi->irq_tx < 0) in rz_ssi_probe()
1128 return ssi->irq_tx; in rz_ssi_probe()
1130 if (ssi->irq_rx < 0) in rz_ssi_probe()
1131 return ssi->irq_rx; in rz_ssi_probe()
1133 ret = devm_request_irq(&pdev->dev, ssi->irq_tx, in rz_ssi_probe()
1135 dev_name(&pdev->dev), ssi); in rz_ssi_probe()
1137 return dev_err_probe(&pdev->dev, ret, in rz_ssi_probe()
1140 ret = devm_request_irq(&pdev->dev, ssi->irq_rx, in rz_ssi_probe()
1142 dev_name(&pdev->dev), ssi); in rz_ssi_probe()
1144 return dev_err_probe(&pdev->dev, ret, in rz_ssi_probe()
1149 ssi->rstc = devm_reset_control_get_exclusive(&pdev->dev, NULL); in rz_ssi_probe()
1150 if (IS_ERR(ssi->rstc)) { in rz_ssi_probe()
1151 ret = PTR_ERR(ssi->rstc); in rz_ssi_probe()
1155 reset_control_deassert(ssi->rstc); in rz_ssi_probe()
1156 pm_runtime_enable(&pdev->dev); in rz_ssi_probe()
1157 ret = pm_runtime_resume_and_get(&pdev->dev); in rz_ssi_probe()
1159 dev_err(&pdev->dev, "pm_runtime_resume_and_get failed\n"); in rz_ssi_probe()
1163 ret = devm_snd_soc_register_component(&pdev->dev, &rz_ssi_soc_component, in rz_ssi_probe()
1167 dev_err(&pdev->dev, "failed to register snd component\n"); in rz_ssi_probe()
1174 pm_runtime_put(ssi->dev); in rz_ssi_probe()
1176 pm_runtime_disable(ssi->dev); in rz_ssi_probe()
1177 reset_control_assert(ssi->rstc); in rz_ssi_probe()
1186 struct rz_ssi_priv *ssi = dev_get_drvdata(&pdev->dev); in rz_ssi_remove()
1190 pm_runtime_put(ssi->dev); in rz_ssi_remove()
1191 pm_runtime_disable(ssi->dev); in rz_ssi_remove()
1192 reset_control_assert(ssi->rstc); in rz_ssi_remove()
1196 { .compatible = "renesas,rz-ssi", },
1203 .name = "rz-ssi-pcm-audio",