Lines Matching +full:pll +full:- +full:reset +full:- +full:mode
1 // SPDX-License-Identifier: GPL-2.0
12 #include <linux/reset.h>
19 #include "imx-pcm.h"
46 struct reset_control *reset; member
48 u32 mode; member
71 * HDMI2.1 spec defines 6- and 12-channels layout for one bit audio
109 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; in fsl_xcvr_arc_mode_put()
110 unsigned int *item = ucontrol->value.enumerated.item; in fsl_xcvr_arc_mode_put()
112 xcvr->arc_mode = snd_soc_enum_item_to_val(e, item[0]); in fsl_xcvr_arc_mode_put()
123 ucontrol->value.enumerated.item[0] = xcvr->arc_mode; in fsl_xcvr_arc_mode_get()
136 SOC_ENUM_EXT("ARC Mode", fsl_xcvr_arc_mode_enum,
143 uinfo->type = SNDRV_CTL_ELEM_TYPE_BYTES; in fsl_xcvr_type_capds_bytes_info()
144 uinfo->count = FSL_XCVR_CAPDS_SIZE; in fsl_xcvr_type_capds_bytes_info()
155 memcpy(ucontrol->value.bytes.data, xcvr->cap_ds, FSL_XCVR_CAPDS_SIZE); in fsl_xcvr_capds_get()
166 memcpy(xcvr->cap_ds, ucontrol->value.bytes.data, FSL_XCVR_CAPDS_SIZE); in fsl_xcvr_capds_put()
183 struct snd_soc_card *card = dai->component->card; in fsl_xcvr_activate_ctl()
187 lockdep_assert_held(&card->snd_card->controls_rwsem); in fsl_xcvr_activate_ctl()
191 return -ENOENT; in fsl_xcvr_activate_ctl()
193 enabled = ((kctl->vd[0].access & SNDRV_CTL_ELEM_ACCESS_WRITE) != 0); in fsl_xcvr_activate_ctl()
198 kctl->vd[0].access |= SNDRV_CTL_ELEM_ACCESS_WRITE; in fsl_xcvr_activate_ctl()
200 kctl->vd[0].access &= ~SNDRV_CTL_ELEM_ACCESS_WRITE; in fsl_xcvr_activate_ctl()
202 snd_ctl_notify(card->snd_card, SNDRV_CTL_EVENT_MASK_INFO, &kctl->id); in fsl_xcvr_activate_ctl()
212 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; in fsl_xcvr_mode_put()
213 unsigned int *item = ucontrol->value.enumerated.item; in fsl_xcvr_mode_put()
214 struct snd_soc_card *card = dai->component->card; in fsl_xcvr_mode_put()
217 xcvr->mode = snd_soc_enum_item_to_val(e, item[0]); in fsl_xcvr_mode_put()
220 (xcvr->mode == FSL_XCVR_MODE_ARC)); in fsl_xcvr_mode_put()
222 (xcvr->mode == FSL_XCVR_MODE_EARC)); in fsl_xcvr_mode_put()
224 rtd = snd_soc_get_pcm_runtime(card, card->dai_link); in fsl_xcvr_mode_put()
225 rtd->pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream_count = in fsl_xcvr_mode_put()
226 (xcvr->mode == FSL_XCVR_MODE_SPDIF ? 1 : 0); in fsl_xcvr_mode_put()
236 ucontrol->value.enumerated.item[0] = xcvr->mode; in fsl_xcvr_mode_get()
245 SOC_ENUM_EXT("XCVR Mode", fsl_xcvr_mode_enum,
248 /** phy: true => phy, false => pll */
251 struct device *dev = &xcvr->pdev->dev; in fsl_xcvr_ai_write()
258 regmap_write(xcvr->regmap, FSL_XCVR_PHY_AI_CTRL_CLR, 0xFF); in fsl_xcvr_ai_write()
259 regmap_write(xcvr->regmap, FSL_XCVR_PHY_AI_CTRL_SET, reg); in fsl_xcvr_ai_write()
260 regmap_write(xcvr->regmap, FSL_XCVR_PHY_AI_WDATA, data); in fsl_xcvr_ai_write()
261 regmap_write(xcvr->regmap, FSL_XCVR_PHY_AI_CTRL_TOG, idx); in fsl_xcvr_ai_write()
263 ret = regmap_read_poll_timeout(xcvr->regmap, FSL_XCVR_PHY_AI_CTRL, val, in fsl_xcvr_ai_write()
268 phy ? "PHY" : "PLL", reg, data); in fsl_xcvr_ai_write()
274 struct device *dev = &xcvr->pdev->dev; in fsl_xcvr_en_phy_pll()
278 if (!xcvr->soc_data->use_phy) in fsl_xcvr_en_phy_pll()
289 return -EINVAL; in fsl_xcvr_en_phy_pll()
293 /* Release AI interface from reset */ in fsl_xcvr_en_phy_pll()
294 ret = regmap_write(xcvr->regmap, FSL_XCVR_PHY_AI_CTRL_SET, in fsl_xcvr_en_phy_pll()
301 switch (xcvr->soc_data->pll_ver) { in fsl_xcvr_en_phy_pll()
303 /* PLL: BANDGAP_SET: EN_VBG (enable bandgap) */ in fsl_xcvr_en_phy_pll()
307 /* PLL: CTRL0: DIV_INTEGER */ in fsl_xcvr_en_phy_pll()
309 /* PLL: NUMERATOR: MFN */ in fsl_xcvr_en_phy_pll()
311 /* PLL: DENOMINATOR: MFD */ in fsl_xcvr_en_phy_pll()
313 /* PLL: CTRL0_SET: HOLD_RING_OFF, POWER_UP */ in fsl_xcvr_en_phy_pll()
317 /* PLL: CTRL0: Clear Hold Ring Off */ in fsl_xcvr_en_phy_pll()
322 /* PLL: POSTDIV: PDIV0 */ in fsl_xcvr_en_phy_pll()
325 /* PLL: CTRL_SET: CLKMUX0_EN */ in fsl_xcvr_en_phy_pll()
328 } else if (xcvr->mode == FSL_XCVR_MODE_EARC) { /* eARC RX */ in fsl_xcvr_en_phy_pll()
329 /* PLL: POSTDIV: PDIV1 */ in fsl_xcvr_en_phy_pll()
332 /* PLL: CTRL_SET: CLKMUX1_EN */ in fsl_xcvr_en_phy_pll()
336 /* PLL: POSTDIV: PDIV2 */ in fsl_xcvr_en_phy_pll()
339 /* PLL: CTRL_SET: CLKMUX2_EN */ in fsl_xcvr_en_phy_pll()
355 dev_err(dev, "Error for PLL version %d\n", xcvr->soc_data->pll_ver); in fsl_xcvr_en_phy_pll()
356 return -EINVAL; in fsl_xcvr_en_phy_pll()
359 if (xcvr->mode == FSL_XCVR_MODE_EARC) { /* eARC mode */ in fsl_xcvr_en_phy_pll()
367 } else if (!tx) { /* SPDIF / ARC RX mode */ in fsl_xcvr_en_phy_pll()
368 if (xcvr->mode == FSL_XCVR_MODE_SPDIF) in fsl_xcvr_en_phy_pll()
376 fsl_xcvr_phy_arc_cfg[xcvr->arc_mode], 1); in fsl_xcvr_en_phy_pll()
379 dev_dbg(dev, "PLL Fexp: %u, Fout: %u, mfi: %u, mfn: %u, mfd: %d, div: %u, pdiv0: %u\n", in fsl_xcvr_en_phy_pll()
387 struct device *dev = &xcvr->pdev->dev; in fsl_xcvr_en_aud_pll()
390 freq = xcvr->soc_data->spdif_only ? freq / 5 : freq; in fsl_xcvr_en_aud_pll()
391 clk_disable_unprepare(xcvr->phy_clk); in fsl_xcvr_en_aud_pll()
392 fsl_asoc_reparent_pll_clocks(dev, xcvr->phy_clk, in fsl_xcvr_en_aud_pll()
393 xcvr->pll8k_clk, xcvr->pll11k_clk, freq); in fsl_xcvr_en_aud_pll()
394 ret = clk_set_rate(xcvr->phy_clk, freq); in fsl_xcvr_en_aud_pll()
396 dev_err(dev, "Error while setting AUD PLL rate: %d\n", ret); in fsl_xcvr_en_aud_pll()
399 ret = clk_prepare_enable(xcvr->phy_clk); in fsl_xcvr_en_aud_pll()
405 if (!xcvr->soc_data->use_phy) in fsl_xcvr_en_aud_pll()
407 /* Release AI interface from reset */ in fsl_xcvr_en_aud_pll()
408 ret = regmap_write(xcvr->regmap, FSL_XCVR_PHY_AI_CTRL_SET, in fsl_xcvr_en_aud_pll()
415 if (xcvr->mode == FSL_XCVR_MODE_EARC) { /* eARC mode */ in fsl_xcvr_en_aud_pll()
423 } else { /* SPDIF mode */ in fsl_xcvr_en_aud_pll()
430 dev_dbg(dev, "PLL Fexp: %u\n", freq); in fsl_xcvr_en_aud_pll()
440 bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; in fsl_xcvr_prepare()
442 u32 r = substream->runtime->rate, ch = substream->runtime->channels; in fsl_xcvr_prepare()
446 switch (xcvr->mode) { in fsl_xcvr_prepare()
448 if (xcvr->soc_data->spdif_only && tx) { in fsl_xcvr_prepare()
449 ret = regmap_update_bits(xcvr->regmap, FSL_XCVR_TX_DPTH_CTRL_SET, in fsl_xcvr_prepare()
453 dev_err(dai->dev, "Failed to set bypass fem: %d\n", ret); in fsl_xcvr_prepare()
462 dev_err(dai->dev, "Failed to set TX freq %u: %d\n", in fsl_xcvr_prepare()
467 ret = regmap_write(xcvr->regmap, FSL_XCVR_TX_DPTH_CTRL_SET, in fsl_xcvr_prepare()
470 dev_err(dai->dev, "Failed to set TX_DPTH: %d\n", ret); in fsl_xcvr_prepare()
475 * set SPDIF MODE - this flag is used to gate in fsl_xcvr_prepare()
483 * disable eARC related HW mode detects in fsl_xcvr_prepare()
485 ret = regmap_write(xcvr->regmap, FSL_XCVR_RX_DPTH_CTRL_SET, in fsl_xcvr_prepare()
491 dev_err(dai->dev, "Failed to set RX_DPTH: %d\n", ret); in fsl_xcvr_prepare()
497 dev_err(dai->dev, "Failed to set RX freq %u: %d\n", in fsl_xcvr_prepare()
506 ret = regmap_write(xcvr->regmap, FSL_XCVR_RX_DPTH_CTRL_SET, in fsl_xcvr_prepare()
510 dev_err(dai->dev, "Failed to set RX_DPTH: %d\n", ret); in fsl_xcvr_prepare()
514 /** Enable eARC related HW mode detects */ in fsl_xcvr_prepare()
515 ret = regmap_write(xcvr->regmap, FSL_XCVR_RX_DPTH_CTRL_CLR, in fsl_xcvr_prepare()
519 dev_err(dai->dev, "Failed to clr TX_DPTH: %d\n", ret); in fsl_xcvr_prepare()
524 /* clear CMDC RESET */ in fsl_xcvr_prepare()
532 ret = regmap_update_bits(xcvr->regmap, FSL_XCVR_EXT_CTRL, m_ctl, v_ctl); in fsl_xcvr_prepare()
534 dev_err(dai->dev, "Error while setting EXT_CTRL: %d\n", ret); in fsl_xcvr_prepare()
545 struct snd_pcm_runtime *rt = substream->runtime; in fsl_xcvr_constr()
565 bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; in fsl_xcvr_startup()
568 if (xcvr->streams & BIT(substream->stream)) { in fsl_xcvr_startup()
569 dev_err(dai->dev, "%sX busy\n", tx ? "T" : "R"); in fsl_xcvr_startup()
570 return -EBUSY; in fsl_xcvr_startup()
577 if (xcvr->soc_data->use_edma) in fsl_xcvr_startup()
578 snd_pcm_hw_constraint_step(substream->runtime, 0, in fsl_xcvr_startup()
580 tx ? xcvr->dma_prms_tx.maxburst : in fsl_xcvr_startup()
581 xcvr->dma_prms_rx.maxburst); in fsl_xcvr_startup()
583 switch (xcvr->mode) { in fsl_xcvr_startup()
597 xcvr->streams |= BIT(substream->stream); in fsl_xcvr_startup()
599 if (!xcvr->soc_data->spdif_only) { in fsl_xcvr_startup()
600 struct snd_soc_card *card = dai->component->card; in fsl_xcvr_startup()
603 down_read(&card->snd_card->controls_rwsem); in fsl_xcvr_startup()
607 up_read(&card->snd_card->controls_rwsem); in fsl_xcvr_startup()
617 bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; in fsl_xcvr_shutdown()
621 xcvr->streams &= ~BIT(substream->stream); in fsl_xcvr_shutdown()
624 if (!xcvr->streams) { in fsl_xcvr_shutdown()
625 if (!xcvr->soc_data->spdif_only) { in fsl_xcvr_shutdown()
626 struct snd_soc_card *card = dai->component->card; in fsl_xcvr_shutdown()
628 down_read(&card->snd_card->controls_rwsem); in fsl_xcvr_shutdown()
631 (xcvr->mode == FSL_XCVR_MODE_ARC)); in fsl_xcvr_shutdown()
633 (xcvr->mode == FSL_XCVR_MODE_EARC)); in fsl_xcvr_shutdown()
634 up_read(&card->snd_card->controls_rwsem); in fsl_xcvr_shutdown()
636 ret = regmap_update_bits(xcvr->regmap, FSL_XCVR_EXT_IER0, in fsl_xcvr_shutdown()
639 dev_err(dai->dev, "Failed to set IER0: %d\n", ret); in fsl_xcvr_shutdown()
643 /* clear SPDIF MODE */ in fsl_xcvr_shutdown()
644 if (xcvr->mode == FSL_XCVR_MODE_SPDIF) in fsl_xcvr_shutdown()
648 if (xcvr->mode == FSL_XCVR_MODE_EARC) { in fsl_xcvr_shutdown()
649 /* set CMDC RESET */ in fsl_xcvr_shutdown()
654 ret = regmap_update_bits(xcvr->regmap, FSL_XCVR_EXT_CTRL, mask, val); in fsl_xcvr_shutdown()
656 dev_err(dai->dev, "Err setting DPATH RESET: %d\n", ret); in fsl_xcvr_shutdown()
665 bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; in fsl_xcvr_trigger()
672 /* set DPATH RESET */ in fsl_xcvr_trigger()
673 ret = regmap_update_bits(xcvr->regmap, FSL_XCVR_EXT_CTRL, in fsl_xcvr_trigger()
677 dev_err(dai->dev, "Failed to set DPATH RESET: %d\n", ret); in fsl_xcvr_trigger()
682 switch (xcvr->mode) { in fsl_xcvr_trigger()
685 ret = regmap_write(xcvr->regmap, in fsl_xcvr_trigger()
689 dev_err(dai->dev, "err updating isr %d\n", ret); in fsl_xcvr_trigger()
694 ret = regmap_write(xcvr->regmap, in fsl_xcvr_trigger()
698 dev_err(dai->dev, "Failed to start DATA_TX: %d\n", ret); in fsl_xcvr_trigger()
706 ret = regmap_update_bits(xcvr->regmap, FSL_XCVR_EXT_CTRL, in fsl_xcvr_trigger()
709 dev_err(dai->dev, "Failed to enable DMA: %d\n", ret); in fsl_xcvr_trigger()
713 ret = regmap_update_bits(xcvr->regmap, FSL_XCVR_EXT_IER0, in fsl_xcvr_trigger()
716 dev_err(dai->dev, "Error while setting IER0: %d\n", ret); in fsl_xcvr_trigger()
720 /* clear DPATH RESET */ in fsl_xcvr_trigger()
721 ret = regmap_update_bits(xcvr->regmap, FSL_XCVR_EXT_CTRL, in fsl_xcvr_trigger()
725 dev_err(dai->dev, "Failed to clear DPATH RESET: %d\n", ret); in fsl_xcvr_trigger()
734 ret = regmap_update_bits(xcvr->regmap, FSL_XCVR_EXT_CTRL, in fsl_xcvr_trigger()
738 dev_err(dai->dev, "Failed to disable DMA: %d\n", ret); in fsl_xcvr_trigger()
742 ret = regmap_update_bits(xcvr->regmap, FSL_XCVR_EXT_IER0, in fsl_xcvr_trigger()
745 dev_err(dai->dev, "Failed to clear IER0: %d\n", ret); in fsl_xcvr_trigger()
750 switch (xcvr->mode) { in fsl_xcvr_trigger()
752 ret = regmap_write(xcvr->regmap, in fsl_xcvr_trigger()
756 dev_err(dai->dev, "Failed to stop DATA_TX: %d\n", ret); in fsl_xcvr_trigger()
759 if (xcvr->soc_data->spdif_only) in fsl_xcvr_trigger()
765 ret = regmap_write(xcvr->regmap, in fsl_xcvr_trigger()
769 dev_err(dai->dev, in fsl_xcvr_trigger()
778 return -EINVAL; in fsl_xcvr_trigger()
786 struct device *dev = &xcvr->pdev->dev; in fsl_xcvr_load_firmware()
791 ret = request_firmware(&fw, xcvr->soc_data->fw_name, dev); in fsl_xcvr_load_firmware()
797 rem = fw->size; in fsl_xcvr_load_firmware()
803 return -ENOMEM; in fsl_xcvr_load_firmware()
807 ret = regmap_update_bits(xcvr->regmap, FSL_XCVR_EXT_CTRL, in fsl_xcvr_load_firmware()
821 memcpy_toio(xcvr->ram_addr, fw->data + off, out); in fsl_xcvr_load_firmware()
822 rem -= out; in fsl_xcvr_load_firmware()
826 memset_io(xcvr->ram_addr + out, 0, size - out); in fsl_xcvr_load_firmware()
830 memset_io(xcvr->ram_addr, 0, size); in fsl_xcvr_load_firmware()
850 ret = regmap_update_bits(xcvr->regmap, FSL_XCVR_EXT_CTRL, mask, val); in fsl_xcvr_load_firmware()
857 memcpy_toio(xcvr->ram_addr + FSL_XCVR_CAP_DATA_STR, xcvr->cap_ds, in fsl_xcvr_load_firmware()
865 uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958; in fsl_xcvr_type_iec958_info()
866 uinfo->count = 1; in fsl_xcvr_type_iec958_info()
874 uinfo->type = SNDRV_CTL_ELEM_TYPE_BYTES; in fsl_xcvr_type_iec958_bytes_info()
875 uinfo->count = sizeof_field(struct snd_aes_iec958, status); in fsl_xcvr_type_iec958_bytes_info()
886 memcpy(ucontrol->value.iec958.status, xcvr->rx_iec958.status, 24); in fsl_xcvr_rx_cs_get()
897 memcpy(ucontrol->value.iec958.status, xcvr->tx_iec958.status, 24); in fsl_xcvr_tx_cs_get()
908 memcpy(xcvr->tx_iec958.status, ucontrol->value.iec958.status, 24); in fsl_xcvr_tx_cs_put()
957 snd_soc_dai_init_dma_data(dai, &xcvr->dma_prms_tx, &xcvr->dma_prms_rx); in fsl_xcvr_dai_probe()
959 if (xcvr->soc_data->spdif_only) in fsl_xcvr_dai_probe()
960 xcvr->mode = FSL_XCVR_MODE_SPDIF; in fsl_xcvr_dai_probe()
984 .stream_name = "CPU-Playback",
993 .stream_name = "CPU-Capture",
1004 .name = "fsl-xcvr-dai",
1062 if (!xcvr->soc_data->use_phy) in fsl_xcvr_readable_reg()
1135 if (!xcvr->soc_data->use_phy) in fsl_xcvr_writeable_reg()
1204 struct device *dev = &xcvr->pdev->dev; in irq0_isr()
1205 struct regmap *regmap = xcvr->regmap; in irq0_isr()
1214 if (!xcvr->soc_data->spdif_only) { in irq0_isr()
1216 regmap_update_bits(xcvr->regmap, FSL_XCVR_EXT_CTRL, in irq0_isr()
1221 reg_ctrl = xcvr->ram_addr + FSL_XCVR_RX_CS_CTRL_0; in irq0_isr()
1222 reg_buff = xcvr->ram_addr + FSL_XCVR_RX_CS_BUFF_0; in irq0_isr()
1225 reg_ctrl = xcvr->ram_addr + FSL_XCVR_RX_CS_CTRL_1; in irq0_isr()
1226 reg_buff = xcvr->ram_addr + FSL_XCVR_RX_CS_BUFF_1; in irq0_isr()
1232 memcpy_fromio(&xcvr->rx_iec958.status, reg_buff, in irq0_isr()
1233 sizeof(xcvr->rx_iec958.status)); in irq0_isr()
1235 val = *(u32 *)(xcvr->rx_iec958.status + i*4); in irq0_isr()
1236 *(u32 *)(xcvr->rx_iec958.status + i*4) = in irq0_isr()
1257 dev_dbg(dev, "CMDC SM falls out of eARC mode\n"); in irq0_isr()
1278 .fw_name = "imx/xcvr/xcvr-imx8mp.bin",
1296 { .compatible = "fsl,imx8mp-xcvr", .data = &fsl_xcvr_imx8mp_data },
1297 { .compatible = "fsl,imx93-xcvr", .data = &fsl_xcvr_imx93_data},
1298 { .compatible = "fsl,imx95-xcvr", .data = &fsl_xcvr_imx95_data},
1305 struct device *dev = &pdev->dev; in fsl_xcvr_probe()
1313 return -ENOMEM; in fsl_xcvr_probe()
1315 xcvr->pdev = pdev; in fsl_xcvr_probe()
1316 xcvr->soc_data = of_device_get_match_data(&pdev->dev); in fsl_xcvr_probe()
1318 xcvr->ipg_clk = devm_clk_get(dev, "ipg"); in fsl_xcvr_probe()
1319 if (IS_ERR(xcvr->ipg_clk)) { in fsl_xcvr_probe()
1321 return PTR_ERR(xcvr->ipg_clk); in fsl_xcvr_probe()
1324 xcvr->phy_clk = devm_clk_get(dev, "phy"); in fsl_xcvr_probe()
1325 if (IS_ERR(xcvr->phy_clk)) { in fsl_xcvr_probe()
1327 return PTR_ERR(xcvr->phy_clk); in fsl_xcvr_probe()
1330 xcvr->spba_clk = devm_clk_get(dev, "spba"); in fsl_xcvr_probe()
1331 if (IS_ERR(xcvr->spba_clk)) { in fsl_xcvr_probe()
1333 return PTR_ERR(xcvr->spba_clk); in fsl_xcvr_probe()
1336 xcvr->pll_ipg_clk = devm_clk_get(dev, "pll_ipg"); in fsl_xcvr_probe()
1337 if (IS_ERR(xcvr->pll_ipg_clk)) { in fsl_xcvr_probe()
1339 return PTR_ERR(xcvr->pll_ipg_clk); in fsl_xcvr_probe()
1342 fsl_asoc_get_pll_clocks(dev, &xcvr->pll8k_clk, in fsl_xcvr_probe()
1343 &xcvr->pll11k_clk); in fsl_xcvr_probe()
1345 xcvr->ram_addr = devm_platform_ioremap_resource_byname(pdev, "ram"); in fsl_xcvr_probe()
1346 if (IS_ERR(xcvr->ram_addr)) in fsl_xcvr_probe()
1347 return PTR_ERR(xcvr->ram_addr); in fsl_xcvr_probe()
1353 xcvr->regmap = devm_regmap_init_mmio_clk(dev, NULL, regs, in fsl_xcvr_probe()
1355 if (IS_ERR(xcvr->regmap)) { in fsl_xcvr_probe()
1357 PTR_ERR(xcvr->regmap)); in fsl_xcvr_probe()
1358 return PTR_ERR(xcvr->regmap); in fsl_xcvr_probe()
1361 xcvr->reset = devm_reset_control_get_optional_exclusive(dev, NULL); in fsl_xcvr_probe()
1362 if (IS_ERR(xcvr->reset)) { in fsl_xcvr_probe()
1363 dev_err(dev, "failed to get XCVR reset control\n"); in fsl_xcvr_probe()
1364 return PTR_ERR(xcvr->reset); in fsl_xcvr_probe()
1372 ret = devm_request_irq(dev, irq, irq0_isr, 0, pdev->name, xcvr); in fsl_xcvr_probe()
1382 return -EINVAL; in fsl_xcvr_probe()
1384 xcvr->dma_prms_rx.chan_name = "rx"; in fsl_xcvr_probe()
1385 xcvr->dma_prms_tx.chan_name = "tx"; in fsl_xcvr_probe()
1386 xcvr->dma_prms_rx.addr = rx_res->start; in fsl_xcvr_probe()
1387 xcvr->dma_prms_tx.addr = tx_res->start; in fsl_xcvr_probe()
1388 xcvr->dma_prms_rx.maxburst = FSL_XCVR_MAXBURST_RX; in fsl_xcvr_probe()
1389 xcvr->dma_prms_tx.maxburst = FSL_XCVR_MAXBURST_TX; in fsl_xcvr_probe()
1393 regcache_cache_only(xcvr->regmap, true); in fsl_xcvr_probe()
1419 pm_runtime_disable(&pdev->dev); in fsl_xcvr_remove()
1427 if (!xcvr->soc_data->spdif_only) { in fsl_xcvr_runtime_suspend()
1428 /* Assert M0+ reset */ in fsl_xcvr_runtime_suspend()
1429 ret = regmap_update_bits(xcvr->regmap, FSL_XCVR_EXT_CTRL, in fsl_xcvr_runtime_suspend()
1436 regcache_cache_only(xcvr->regmap, true); in fsl_xcvr_runtime_suspend()
1438 clk_disable_unprepare(xcvr->spba_clk); in fsl_xcvr_runtime_suspend()
1439 clk_disable_unprepare(xcvr->phy_clk); in fsl_xcvr_runtime_suspend()
1440 clk_disable_unprepare(xcvr->pll_ipg_clk); in fsl_xcvr_runtime_suspend()
1441 clk_disable_unprepare(xcvr->ipg_clk); in fsl_xcvr_runtime_suspend()
1451 ret = reset_control_assert(xcvr->reset); in fsl_xcvr_runtime_resume()
1453 dev_err(dev, "Failed to assert M0+ reset: %d\n", ret); in fsl_xcvr_runtime_resume()
1457 ret = clk_prepare_enable(xcvr->ipg_clk); in fsl_xcvr_runtime_resume()
1463 ret = clk_prepare_enable(xcvr->pll_ipg_clk); in fsl_xcvr_runtime_resume()
1465 dev_err(dev, "failed to start PLL IPG clock.\n"); in fsl_xcvr_runtime_resume()
1469 ret = clk_prepare_enable(xcvr->phy_clk); in fsl_xcvr_runtime_resume()
1475 ret = clk_prepare_enable(xcvr->spba_clk); in fsl_xcvr_runtime_resume()
1481 regcache_cache_only(xcvr->regmap, false); in fsl_xcvr_runtime_resume()
1482 regcache_mark_dirty(xcvr->regmap); in fsl_xcvr_runtime_resume()
1483 ret = regcache_sync(xcvr->regmap); in fsl_xcvr_runtime_resume()
1490 if (xcvr->soc_data->spdif_only) in fsl_xcvr_runtime_resume()
1493 ret = reset_control_deassert(xcvr->reset); in fsl_xcvr_runtime_resume()
1495 dev_err(dev, "failed to deassert M0+ reset.\n"); in fsl_xcvr_runtime_resume()
1505 /* Release M0+ reset */ in fsl_xcvr_runtime_resume()
1506 ret = regmap_update_bits(xcvr->regmap, FSL_XCVR_EXT_CTRL, in fsl_xcvr_runtime_resume()
1519 clk_disable_unprepare(xcvr->spba_clk); in fsl_xcvr_runtime_resume()
1521 clk_disable_unprepare(xcvr->phy_clk); in fsl_xcvr_runtime_resume()
1523 clk_disable_unprepare(xcvr->pll_ipg_clk); in fsl_xcvr_runtime_resume()
1525 clk_disable_unprepare(xcvr->ipg_clk); in fsl_xcvr_runtime_resume()
1539 .name = "fsl,imx8mp-audio-xcvr",