mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/2] ASoC: fsl_xcvr: get channel status data in two cases
@ 2025-07-10  3:04 Shengjiu Wang
  2025-07-10  3:04 ` [PATCH 1/2] ASoC: fsl_xcvr: get channel status data when PHY is not exists Shengjiu Wang
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Shengjiu Wang @ 2025-07-10  3:04 UTC (permalink / raw)
  To: shengjiu.wang, Xiubo.Lee, festevam, nicoleotsuka, lgirdwood,
	broonie, perex, tiwai, linux-sound, linuxppc-dev, linux-kernel

There is two different cases for getting channel status data:
1. With PHY exists, there is firmware running on M core, the firmware
should fill the channel status to RAM space, driver need to read them
from RAM.
2. Without PHY, the channel status need to be obtained from registers.

Shengjiu Wang (2):
  ASoC: fsl_xcvr: get channel status data when PHY is not exists
  ASoC: fsl_xcvr: get channel status data with firmware exists

 sound/soc/fsl/fsl_xcvr.c | 25 +++++++++++++++++++++++--
 1 file changed, 23 insertions(+), 2 deletions(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/2] ASoC: fsl_xcvr: get channel status data when PHY is not exists
  2025-07-10  3:04 [PATCH 0/2] ASoC: fsl_xcvr: get channel status data in two cases Shengjiu Wang
@ 2025-07-10  3:04 ` Shengjiu Wang
  2025-07-10  3:04 ` [PATCH 2/2] ASoC: fsl_xcvr: get channel status data with firmware exists Shengjiu Wang
  2025-07-24 23:11 ` [PATCH 0/2] ASoC: fsl_xcvr: get channel status data in two cases Mark Brown
  2 siblings, 0 replies; 4+ messages in thread
From: Shengjiu Wang @ 2025-07-10  3:04 UTC (permalink / raw)
  To: shengjiu.wang, Xiubo.Lee, festevam, nicoleotsuka, lgirdwood,
	broonie, perex, tiwai, linux-sound, linuxppc-dev, linux-kernel

There is no PHY for the XCVR module on i.MX93, the channel status needs
to be obtained from FSL_XCVR_RX_CS_DATA_* registers. And channel status
acknowledge (CSA) bit should be set once channel status is processed.

Fixes: e240b9329a30 ("ASoC: fsl_xcvr: Add support for i.MX93 platform")
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
---
 sound/soc/fsl/fsl_xcvr.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/sound/soc/fsl/fsl_xcvr.c b/sound/soc/fsl/fsl_xcvr.c
index e3111dd80be4..405433144515 100644
--- a/sound/soc/fsl/fsl_xcvr.c
+++ b/sound/soc/fsl/fsl_xcvr.c
@@ -1423,6 +1423,26 @@ static irqreturn_t irq0_isr(int irq, void *devid)
 				/* clear CS control register */
 				memset_io(reg_ctrl, 0, sizeof(val));
 			}
+		} else {
+			regmap_read(xcvr->regmap, FSL_XCVR_RX_CS_DATA_0,
+				    (u32 *)&xcvr->rx_iec958.status[0]);
+			regmap_read(xcvr->regmap, FSL_XCVR_RX_CS_DATA_1,
+				    (u32 *)&xcvr->rx_iec958.status[4]);
+			regmap_read(xcvr->regmap, FSL_XCVR_RX_CS_DATA_2,
+				    (u32 *)&xcvr->rx_iec958.status[8]);
+			regmap_read(xcvr->regmap, FSL_XCVR_RX_CS_DATA_3,
+				    (u32 *)&xcvr->rx_iec958.status[12]);
+			regmap_read(xcvr->regmap, FSL_XCVR_RX_CS_DATA_4,
+				    (u32 *)&xcvr->rx_iec958.status[16]);
+			regmap_read(xcvr->regmap, FSL_XCVR_RX_CS_DATA_5,
+				    (u32 *)&xcvr->rx_iec958.status[20]);
+			for (i = 0; i < 6; i++) {
+				val = *(u32 *)(xcvr->rx_iec958.status + i * 4);
+				*(u32 *)(xcvr->rx_iec958.status + i * 4) =
+					bitrev32(val);
+			}
+			regmap_set_bits(xcvr->regmap, FSL_XCVR_RX_DPTH_CTRL,
+					FSL_XCVR_RX_DPTH_CTRL_CSA);
 		}
 	}
 	if (isr & FSL_XCVR_IRQ_NEW_UD) {
-- 
2.34.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 2/2] ASoC: fsl_xcvr: get channel status data with firmware exists
  2025-07-10  3:04 [PATCH 0/2] ASoC: fsl_xcvr: get channel status data in two cases Shengjiu Wang
  2025-07-10  3:04 ` [PATCH 1/2] ASoC: fsl_xcvr: get channel status data when PHY is not exists Shengjiu Wang
@ 2025-07-10  3:04 ` Shengjiu Wang
  2025-07-24 23:11 ` [PATCH 0/2] ASoC: fsl_xcvr: get channel status data in two cases Mark Brown
  2 siblings, 0 replies; 4+ messages in thread
From: Shengjiu Wang @ 2025-07-10  3:04 UTC (permalink / raw)
  To: shengjiu.wang, Xiubo.Lee, festevam, nicoleotsuka, lgirdwood,
	broonie, perex, tiwai, linux-sound, linuxppc-dev, linux-kernel

For the XCVR module on i.MX95, even though it only supports SPDIF, the
channel status needs to be obtained from RAM space, which is processed
by firmware. Firmware is necessary to trigger the FSL_XCVR_IRQ_NEW_CS
interrupt.

This change also applies for the SPDIF & ARC function on i.MX8MP which
has the firmware.

Fixes: e6a9750a346b ("ASoC: fsl_xcvr: Add suspend and resume support")
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
---
 sound/soc/fsl/fsl_xcvr.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/sound/soc/fsl/fsl_xcvr.c b/sound/soc/fsl/fsl_xcvr.c
index 405433144515..5d804860f7d8 100644
--- a/sound/soc/fsl/fsl_xcvr.c
+++ b/sound/soc/fsl/fsl_xcvr.c
@@ -1395,7 +1395,7 @@ static irqreturn_t irq0_isr(int irq, void *devid)
 	if (isr & FSL_XCVR_IRQ_NEW_CS) {
 		dev_dbg(dev, "Received new CS block\n");
 		isr_clr |= FSL_XCVR_IRQ_NEW_CS;
-		if (!xcvr->soc_data->spdif_only) {
+		if (xcvr->soc_data->fw_name) {
 			/* Data RAM is 4KiB, last two pages: 8 and 9. Select page 8. */
 			regmap_update_bits(xcvr->regmap, FSL_XCVR_EXT_CTRL,
 					   FSL_XCVR_EXT_CTRL_PAGE_MASK,
@@ -1517,6 +1517,7 @@ static const struct fsl_xcvr_soc_data fsl_xcvr_imx93_data = {
 };
 
 static const struct fsl_xcvr_soc_data fsl_xcvr_imx95_data = {
+	.fw_name = "imx/xcvr/xcvr-imx95.bin",
 	.spdif_only = true,
 	.use_phy = true,
 	.use_edma = true,
@@ -1806,7 +1807,7 @@ static int fsl_xcvr_runtime_resume(struct device *dev)
 		}
 	}
 
-	if (xcvr->mode == FSL_XCVR_MODE_EARC) {
+	if (xcvr->soc_data->fw_name) {
 		ret = fsl_xcvr_load_firmware(xcvr);
 		if (ret) {
 			dev_err(dev, "failed to load firmware.\n");
-- 
2.34.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 0/2] ASoC: fsl_xcvr: get channel status data in two cases
  2025-07-10  3:04 [PATCH 0/2] ASoC: fsl_xcvr: get channel status data in two cases Shengjiu Wang
  2025-07-10  3:04 ` [PATCH 1/2] ASoC: fsl_xcvr: get channel status data when PHY is not exists Shengjiu Wang
  2025-07-10  3:04 ` [PATCH 2/2] ASoC: fsl_xcvr: get channel status data with firmware exists Shengjiu Wang
@ 2025-07-24 23:11 ` Mark Brown
  2 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2025-07-24 23:11 UTC (permalink / raw)
  To: shengjiu.wang, Xiubo.Lee, festevam, nicoleotsuka, lgirdwood,
	perex, tiwai, linux-sound, linuxppc-dev, linux-kernel,
	Shengjiu Wang

On Thu, 10 Jul 2025 11:04:03 +0800, Shengjiu Wang wrote:
> There is two different cases for getting channel status data:
> 1. With PHY exists, there is firmware running on M core, the firmware
> should fill the channel status to RAM space, driver need to read them
> from RAM.
> 2. Without PHY, the channel status need to be obtained from registers.
> 
> Shengjiu Wang (2):
>   ASoC: fsl_xcvr: get channel status data when PHY is not exists
>   ASoC: fsl_xcvr: get channel status data with firmware exists
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/2] ASoC: fsl_xcvr: get channel status data when PHY is not exists
      commit: ca592e20659e0304ebd8f4dabb273da4f9385848
[2/2] ASoC: fsl_xcvr: get channel status data with firmware exists
      commit: 6776ecc9dd587c08a6bb334542f9f8821a091013

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-07-24 23:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-07-10  3:04 [PATCH 0/2] ASoC: fsl_xcvr: get channel status data in two cases Shengjiu Wang
2025-07-10  3:04 ` [PATCH 1/2] ASoC: fsl_xcvr: get channel status data when PHY is not exists Shengjiu Wang
2025-07-10  3:04 ` [PATCH 2/2] ASoC: fsl_xcvr: get channel status data with firmware exists Shengjiu Wang
2025-07-24 23:11 ` [PATCH 0/2] ASoC: fsl_xcvr: get channel status data in two cases Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®