spdifrx 252 sound/soc/stm/stm32_spdifrx.c struct stm32_spdifrx_data *spdifrx = (struct stm32_spdifrx_data *)data; spdifrx 253 sound/soc/stm/stm32_spdifrx.c struct platform_device *pdev = spdifrx->pdev; spdifrx 254 sound/soc/stm/stm32_spdifrx.c u32 *p_start = (u32 *)spdifrx->dmab->area; spdifrx 257 sound/soc/stm/stm32_spdifrx.c u16 *ub_ptr = (short *)spdifrx->ub; spdifrx 260 sound/soc/stm/stm32_spdifrx.c regmap_update_bits(spdifrx->regmap, STM32_SPDIFRX_CR, spdifrx 264 sound/soc/stm/stm32_spdifrx.c if (!spdifrx->dmab->area) spdifrx 279 sound/soc/stm/stm32_spdifrx.c spdifrx->cs[i] = (unsigned char)SPDIFRX_CSR_CSGET(*ptr); spdifrx 288 sound/soc/stm/stm32_spdifrx.c complete(&spdifrx->cs_completion); spdifrx 291 sound/soc/stm/stm32_spdifrx.c static int stm32_spdifrx_dma_ctrl_start(struct stm32_spdifrx_data *spdifrx) spdifrx 296 sound/soc/stm/stm32_spdifrx.c spdifrx->desc = dmaengine_prep_slave_single(spdifrx->ctrl_chan, spdifrx 297 sound/soc/stm/stm32_spdifrx.c spdifrx->dmab->addr, spdifrx 301 sound/soc/stm/stm32_spdifrx.c if (!spdifrx->desc) spdifrx 304 sound/soc/stm/stm32_spdifrx.c spdifrx->desc->callback = stm32_spdifrx_dma_complete; spdifrx 305 sound/soc/stm/stm32_spdifrx.c spdifrx->desc->callback_param = spdifrx; spdifrx 306 sound/soc/stm/stm32_spdifrx.c cookie = dmaengine_submit(spdifrx->desc); spdifrx 311 sound/soc/stm/stm32_spdifrx.c dma_async_issue_pending(spdifrx->ctrl_chan); spdifrx 316 sound/soc/stm/stm32_spdifrx.c static void stm32_spdifrx_dma_ctrl_stop(struct stm32_spdifrx_data *spdifrx) spdifrx 318 sound/soc/stm/stm32_spdifrx.c dmaengine_terminate_async(spdifrx->ctrl_chan); spdifrx 321 sound/soc/stm/stm32_spdifrx.c static int stm32_spdifrx_start_sync(struct stm32_spdifrx_data *spdifrx) spdifrx 328 sound/soc/stm/stm32_spdifrx.c ret = regmap_update_bits(spdifrx->regmap, STM32_SPDIFRX_IMR, imr, imr); spdifrx 332 sound/soc/stm/stm32_spdifrx.c spin_lock_irqsave(&spdifrx->lock, flags); spdifrx 334 sound/soc/stm/stm32_spdifrx.c spdifrx->refcount++; spdifrx 336 sound/soc/stm/stm32_spdifrx.c regmap_read(spdifrx->regmap, STM32_SPDIFRX_CR, &cr); spdifrx 343 sound/soc/stm/stm32_spdifrx.c dev_dbg(&spdifrx->pdev->dev, "start synchronization\n"); spdifrx 358 sound/soc/stm/stm32_spdifrx.c ret = regmap_update_bits(spdifrx->regmap, STM32_SPDIFRX_CR, spdifrx 361 sound/soc/stm/stm32_spdifrx.c dev_err(&spdifrx->pdev->dev, spdifrx 365 sound/soc/stm/stm32_spdifrx.c spin_unlock_irqrestore(&spdifrx->lock, flags); spdifrx 370 sound/soc/stm/stm32_spdifrx.c static void stm32_spdifrx_stop(struct stm32_spdifrx_data *spdifrx) spdifrx 375 sound/soc/stm/stm32_spdifrx.c spin_lock_irqsave(&spdifrx->lock, flags); spdifrx 377 sound/soc/stm/stm32_spdifrx.c if (--spdifrx->refcount) { spdifrx 378 sound/soc/stm/stm32_spdifrx.c spin_unlock_irqrestore(&spdifrx->lock, flags); spdifrx 385 sound/soc/stm/stm32_spdifrx.c regmap_update_bits(spdifrx->regmap, STM32_SPDIFRX_CR, cr_mask, cr); spdifrx 387 sound/soc/stm/stm32_spdifrx.c regmap_update_bits(spdifrx->regmap, STM32_SPDIFRX_IMR, spdifrx 390 sound/soc/stm/stm32_spdifrx.c regmap_update_bits(spdifrx->regmap, STM32_SPDIFRX_IFCR, spdifrx 394 sound/soc/stm/stm32_spdifrx.c regmap_read(spdifrx->regmap, STM32_SPDIFRX_DR, ®); spdifrx 395 sound/soc/stm/stm32_spdifrx.c regmap_read(spdifrx->regmap, STM32_SPDIFRX_CSR, ®); spdifrx 397 sound/soc/stm/stm32_spdifrx.c spin_unlock_irqrestore(&spdifrx->lock, flags); spdifrx 401 sound/soc/stm/stm32_spdifrx.c struct stm32_spdifrx_data *spdifrx) spdifrx 405 sound/soc/stm/stm32_spdifrx.c spdifrx->ctrl_chan = dma_request_chan(dev, "rx-ctrl"); spdifrx 406 sound/soc/stm/stm32_spdifrx.c if (IS_ERR(spdifrx->ctrl_chan)) { spdifrx 408 sound/soc/stm/stm32_spdifrx.c return PTR_ERR(spdifrx->ctrl_chan); spdifrx 411 sound/soc/stm/stm32_spdifrx.c spdifrx->dmab = devm_kzalloc(dev, sizeof(struct snd_dma_buffer), spdifrx 413 sound/soc/stm/stm32_spdifrx.c if (!spdifrx->dmab) spdifrx 416 sound/soc/stm/stm32_spdifrx.c spdifrx->dmab->dev.type = SNDRV_DMA_TYPE_DEV_IRAM; spdifrx 417 sound/soc/stm/stm32_spdifrx.c spdifrx->dmab->dev.dev = dev; spdifrx 418 sound/soc/stm/stm32_spdifrx.c ret = snd_dma_alloc_pages(spdifrx->dmab->dev.type, dev, spdifrx 419 sound/soc/stm/stm32_spdifrx.c SPDIFRX_CSR_BUF_LENGTH, spdifrx->dmab); spdifrx 425 sound/soc/stm/stm32_spdifrx.c spdifrx->slave_config.direction = DMA_DEV_TO_MEM; spdifrx 426 sound/soc/stm/stm32_spdifrx.c spdifrx->slave_config.src_addr = (dma_addr_t)(spdifrx->phys_addr + spdifrx 428 sound/soc/stm/stm32_spdifrx.c spdifrx->slave_config.dst_addr = spdifrx->dmab->addr; spdifrx 429 sound/soc/stm/stm32_spdifrx.c spdifrx->slave_config.src_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; spdifrx 430 sound/soc/stm/stm32_spdifrx.c spdifrx->slave_config.src_maxburst = 1; spdifrx 432 sound/soc/stm/stm32_spdifrx.c ret = dmaengine_slave_config(spdifrx->ctrl_chan, spdifrx 433 sound/soc/stm/stm32_spdifrx.c &spdifrx->slave_config); spdifrx 436 sound/soc/stm/stm32_spdifrx.c spdifrx->ctrl_chan = NULL; spdifrx 477 sound/soc/stm/stm32_spdifrx.c static int stm32_spdifrx_get_ctrl_data(struct stm32_spdifrx_data *spdifrx) spdifrx 481 sound/soc/stm/stm32_spdifrx.c memset(spdifrx->cs, 0, SPDIFRX_CS_BYTES_NB); spdifrx 482 sound/soc/stm/stm32_spdifrx.c memset(spdifrx->ub, 0, SPDIFRX_UB_BYTES_NB); spdifrx 484 sound/soc/stm/stm32_spdifrx.c ret = stm32_spdifrx_dma_ctrl_start(spdifrx); spdifrx 488 sound/soc/stm/stm32_spdifrx.c ret = clk_prepare_enable(spdifrx->kclk); spdifrx 490 sound/soc/stm/stm32_spdifrx.c dev_err(&spdifrx->pdev->dev, "Enable kclk failed: %d\n", ret); spdifrx 494 sound/soc/stm/stm32_spdifrx.c ret = regmap_update_bits(spdifrx->regmap, STM32_SPDIFRX_CR, spdifrx 499 sound/soc/stm/stm32_spdifrx.c ret = stm32_spdifrx_start_sync(spdifrx); spdifrx 503 sound/soc/stm/stm32_spdifrx.c if (wait_for_completion_interruptible_timeout(&spdifrx->cs_completion, spdifrx 506 sound/soc/stm/stm32_spdifrx.c dev_dbg(&spdifrx->pdev->dev, "Failed to get control data\n"); spdifrx 510 sound/soc/stm/stm32_spdifrx.c stm32_spdifrx_stop(spdifrx); spdifrx 511 sound/soc/stm/stm32_spdifrx.c stm32_spdifrx_dma_ctrl_stop(spdifrx); spdifrx 514 sound/soc/stm/stm32_spdifrx.c clk_disable_unprepare(spdifrx->kclk); spdifrx 523 sound/soc/stm/stm32_spdifrx.c struct stm32_spdifrx_data *spdifrx = snd_soc_dai_get_drvdata(cpu_dai); spdifrx 525 sound/soc/stm/stm32_spdifrx.c stm32_spdifrx_get_ctrl_data(spdifrx); spdifrx 527 sound/soc/stm/stm32_spdifrx.c ucontrol->value.iec958.status[0] = spdifrx->cs[0]; spdifrx 528 sound/soc/stm/stm32_spdifrx.c ucontrol->value.iec958.status[1] = spdifrx->cs[1]; spdifrx 529 sound/soc/stm/stm32_spdifrx.c ucontrol->value.iec958.status[2] = spdifrx->cs[2]; spdifrx 530 sound/soc/stm/stm32_spdifrx.c ucontrol->value.iec958.status[3] = spdifrx->cs[3]; spdifrx 531 sound/soc/stm/stm32_spdifrx.c ucontrol->value.iec958.status[4] = spdifrx->cs[4]; spdifrx 540 sound/soc/stm/stm32_spdifrx.c struct stm32_spdifrx_data *spdifrx = snd_soc_dai_get_drvdata(cpu_dai); spdifrx 542 sound/soc/stm/stm32_spdifrx.c stm32_spdifrx_get_ctrl_data(spdifrx); spdifrx 544 sound/soc/stm/stm32_spdifrx.c ucontrol->value.iec958.status[0] = spdifrx->ub[0]; spdifrx 545 sound/soc/stm/stm32_spdifrx.c ucontrol->value.iec958.status[1] = spdifrx->ub[1]; spdifrx 546 sound/soc/stm/stm32_spdifrx.c ucontrol->value.iec958.status[2] = spdifrx->ub[2]; spdifrx 547 sound/soc/stm/stm32_spdifrx.c ucontrol->value.iec958.status[3] = spdifrx->ub[3]; spdifrx 548 sound/soc/stm/stm32_spdifrx.c ucontrol->value.iec958.status[4] = spdifrx->ub[4]; spdifrx 595 sound/soc/stm/stm32_spdifrx.c struct stm32_spdifrx_data *spdifrx = dev_get_drvdata(cpu_dai->dev); spdifrx 597 sound/soc/stm/stm32_spdifrx.c spdifrx->dma_params.addr = (dma_addr_t)(spdifrx->phys_addr + spdifrx 599 sound/soc/stm/stm32_spdifrx.c spdifrx->dma_params.maxburst = 1; spdifrx 601 sound/soc/stm/stm32_spdifrx.c snd_soc_dai_init_dma_data(cpu_dai, NULL, &spdifrx->dma_params); spdifrx 665 sound/soc/stm/stm32_spdifrx.c struct stm32_spdifrx_data *spdifrx = (struct stm32_spdifrx_data *)devid; spdifrx 666 sound/soc/stm/stm32_spdifrx.c struct platform_device *pdev = spdifrx->pdev; spdifrx 671 sound/soc/stm/stm32_spdifrx.c regmap_read(spdifrx->regmap, STM32_SPDIFRX_SR, &sr); spdifrx 672 sound/soc/stm/stm32_spdifrx.c regmap_read(spdifrx->regmap, STM32_SPDIFRX_IMR, &imr); spdifrx 687 sound/soc/stm/stm32_spdifrx.c regmap_update_bits(spdifrx->regmap, STM32_SPDIFRX_IFCR, spdifrx 708 sound/soc/stm/stm32_spdifrx.c regmap_update_bits(spdifrx->regmap, STM32_SPDIFRX_CR, spdifrx 730 sound/soc/stm/stm32_spdifrx.c regmap_update_bits(spdifrx->regmap, STM32_SPDIFRX_CR, spdifrx 733 sound/soc/stm/stm32_spdifrx.c spin_lock(&spdifrx->irq_lock); spdifrx 734 sound/soc/stm/stm32_spdifrx.c if (spdifrx->substream) spdifrx 735 sound/soc/stm/stm32_spdifrx.c snd_pcm_stop(spdifrx->substream, spdifrx 737 sound/soc/stm/stm32_spdifrx.c spin_unlock(&spdifrx->irq_lock); spdifrx 742 sound/soc/stm/stm32_spdifrx.c spin_lock(&spdifrx->irq_lock); spdifrx 743 sound/soc/stm/stm32_spdifrx.c if (err_xrun && spdifrx->substream) spdifrx 744 sound/soc/stm/stm32_spdifrx.c snd_pcm_stop_xrun(spdifrx->substream); spdifrx 745 sound/soc/stm/stm32_spdifrx.c spin_unlock(&spdifrx->irq_lock); spdifrx 753 sound/soc/stm/stm32_spdifrx.c struct stm32_spdifrx_data *spdifrx = snd_soc_dai_get_drvdata(cpu_dai); spdifrx 757 sound/soc/stm/stm32_spdifrx.c spin_lock_irqsave(&spdifrx->irq_lock, flags); spdifrx 758 sound/soc/stm/stm32_spdifrx.c spdifrx->substream = substream; spdifrx 759 sound/soc/stm/stm32_spdifrx.c spin_unlock_irqrestore(&spdifrx->irq_lock, flags); spdifrx 761 sound/soc/stm/stm32_spdifrx.c ret = clk_prepare_enable(spdifrx->kclk); spdifrx 763 sound/soc/stm/stm32_spdifrx.c dev_err(&spdifrx->pdev->dev, "Enable kclk failed: %d\n", ret); spdifrx 772 sound/soc/stm/stm32_spdifrx.c struct stm32_spdifrx_data *spdifrx = snd_soc_dai_get_drvdata(cpu_dai); spdifrx 784 sound/soc/stm/stm32_spdifrx.c dev_err(&spdifrx->pdev->dev, "Unexpected data format\n"); spdifrx 793 sound/soc/stm/stm32_spdifrx.c spdifrx->dma_params.addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; spdifrx 794 sound/soc/stm/stm32_spdifrx.c snd_soc_dai_init_dma_data(cpu_dai, NULL, &spdifrx->dma_params); spdifrx 796 sound/soc/stm/stm32_spdifrx.c return regmap_update_bits(spdifrx->regmap, STM32_SPDIFRX_CR, spdifrx 804 sound/soc/stm/stm32_spdifrx.c struct stm32_spdifrx_data *spdifrx = snd_soc_dai_get_drvdata(cpu_dai); spdifrx 811 sound/soc/stm/stm32_spdifrx.c regmap_update_bits(spdifrx->regmap, STM32_SPDIFRX_IMR, spdifrx 814 sound/soc/stm/stm32_spdifrx.c regmap_update_bits(spdifrx->regmap, STM32_SPDIFRX_CR, spdifrx 817 sound/soc/stm/stm32_spdifrx.c ret = stm32_spdifrx_start_sync(spdifrx); spdifrx 822 sound/soc/stm/stm32_spdifrx.c stm32_spdifrx_stop(spdifrx); spdifrx 834 sound/soc/stm/stm32_spdifrx.c struct stm32_spdifrx_data *spdifrx = snd_soc_dai_get_drvdata(cpu_dai); spdifrx 837 sound/soc/stm/stm32_spdifrx.c spin_lock_irqsave(&spdifrx->irq_lock, flags); spdifrx 838 sound/soc/stm/stm32_spdifrx.c spdifrx->substream = NULL; spdifrx 839 sound/soc/stm/stm32_spdifrx.c spin_unlock_irqrestore(&spdifrx->irq_lock, flags); spdifrx 841 sound/soc/stm/stm32_spdifrx.c clk_disable_unprepare(spdifrx->kclk); spdifrx 893 sound/soc/stm/stm32_spdifrx.c struct stm32_spdifrx_data *spdifrx) spdifrx 904 sound/soc/stm/stm32_spdifrx.c spdifrx->regmap_conf = spdifrx 910 sound/soc/stm/stm32_spdifrx.c spdifrx->base = devm_ioremap_resource(&pdev->dev, res); spdifrx 911 sound/soc/stm/stm32_spdifrx.c if (IS_ERR(spdifrx->base)) spdifrx 912 sound/soc/stm/stm32_spdifrx.c return PTR_ERR(spdifrx->base); spdifrx 914 sound/soc/stm/stm32_spdifrx.c spdifrx->phys_addr = res->start; spdifrx 916 sound/soc/stm/stm32_spdifrx.c spdifrx->kclk = devm_clk_get(&pdev->dev, "kclk"); spdifrx 917 sound/soc/stm/stm32_spdifrx.c if (IS_ERR(spdifrx->kclk)) { spdifrx 919 sound/soc/stm/stm32_spdifrx.c return PTR_ERR(spdifrx->kclk); spdifrx 922 sound/soc/stm/stm32_spdifrx.c spdifrx->irq = platform_get_irq(pdev, 0); spdifrx 923 sound/soc/stm/stm32_spdifrx.c if (spdifrx->irq < 0) spdifrx 924 sound/soc/stm/stm32_spdifrx.c return spdifrx->irq; spdifrx 931 sound/soc/stm/stm32_spdifrx.c struct stm32_spdifrx_data *spdifrx; spdifrx 937 sound/soc/stm/stm32_spdifrx.c spdifrx = devm_kzalloc(&pdev->dev, sizeof(*spdifrx), GFP_KERNEL); spdifrx 938 sound/soc/stm/stm32_spdifrx.c if (!spdifrx) spdifrx 941 sound/soc/stm/stm32_spdifrx.c spdifrx->pdev = pdev; spdifrx 942 sound/soc/stm/stm32_spdifrx.c init_completion(&spdifrx->cs_completion); spdifrx 943 sound/soc/stm/stm32_spdifrx.c spin_lock_init(&spdifrx->lock); spdifrx 944 sound/soc/stm/stm32_spdifrx.c spin_lock_init(&spdifrx->irq_lock); spdifrx 946 sound/soc/stm/stm32_spdifrx.c platform_set_drvdata(pdev, spdifrx); spdifrx 948 sound/soc/stm/stm32_spdifrx.c ret = stm32_spdifrx_parse_of(pdev, spdifrx); spdifrx 952 sound/soc/stm/stm32_spdifrx.c spdifrx->regmap = devm_regmap_init_mmio_clk(&pdev->dev, "kclk", spdifrx 953 sound/soc/stm/stm32_spdifrx.c spdifrx->base, spdifrx 954 sound/soc/stm/stm32_spdifrx.c spdifrx->regmap_conf); spdifrx 955 sound/soc/stm/stm32_spdifrx.c if (IS_ERR(spdifrx->regmap)) { spdifrx 957 sound/soc/stm/stm32_spdifrx.c return PTR_ERR(spdifrx->regmap); spdifrx 960 sound/soc/stm/stm32_spdifrx.c ret = devm_request_irq(&pdev->dev, spdifrx->irq, stm32_spdifrx_isr, 0, spdifrx 961 sound/soc/stm/stm32_spdifrx.c dev_name(&pdev->dev), spdifrx); spdifrx 981 sound/soc/stm/stm32_spdifrx.c ret = stm32_spdifrx_dma_ctrl_register(&pdev->dev, spdifrx); spdifrx 992 sound/soc/stm/stm32_spdifrx.c ret = regmap_read(spdifrx->regmap, STM32_SPDIFRX_IDR, &idr); spdifrx 997 sound/soc/stm/stm32_spdifrx.c ret = regmap_read(spdifrx->regmap, STM32_SPDIFRX_VERR, &ver); spdifrx 1009 sound/soc/stm/stm32_spdifrx.c if (!IS_ERR(spdifrx->ctrl_chan)) spdifrx 1010 sound/soc/stm/stm32_spdifrx.c dma_release_channel(spdifrx->ctrl_chan); spdifrx 1011 sound/soc/stm/stm32_spdifrx.c if (spdifrx->dmab) spdifrx 1012 sound/soc/stm/stm32_spdifrx.c snd_dma_free_pages(spdifrx->dmab); spdifrx 1019 sound/soc/stm/stm32_spdifrx.c struct stm32_spdifrx_data *spdifrx = platform_get_drvdata(pdev); spdifrx 1021 sound/soc/stm/stm32_spdifrx.c if (spdifrx->ctrl_chan) spdifrx 1022 sound/soc/stm/stm32_spdifrx.c dma_release_channel(spdifrx->ctrl_chan); spdifrx 1024 sound/soc/stm/stm32_spdifrx.c if (spdifrx->dmab) spdifrx 1025 sound/soc/stm/stm32_spdifrx.c snd_dma_free_pages(spdifrx->dmab); spdifrx 1035 sound/soc/stm/stm32_spdifrx.c struct stm32_spdifrx_data *spdifrx = dev_get_drvdata(dev); spdifrx 1037 sound/soc/stm/stm32_spdifrx.c regcache_cache_only(spdifrx->regmap, true); spdifrx 1038 sound/soc/stm/stm32_spdifrx.c regcache_mark_dirty(spdifrx->regmap); spdifrx 1045 sound/soc/stm/stm32_spdifrx.c struct stm32_spdifrx_data *spdifrx = dev_get_drvdata(dev); spdifrx 1047 sound/soc/stm/stm32_spdifrx.c regcache_cache_only(spdifrx->regmap, false); spdifrx 1049 sound/soc/stm/stm32_spdifrx.c return regcache_sync(spdifrx->regmap);