Skip to content

Commit 7379907

Browse files
committed
ASoC: fsl_xcvr: get channel status data in two cases
Merge series from Shengjiu Wang <[email protected]>: 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.
2 parents 1032fa5 + 6776ecc commit 7379907

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

sound/soc/fsl/fsl_xcvr.c

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1395,7 +1395,7 @@ static irqreturn_t irq0_isr(int irq, void *devid)
13951395
if (isr & FSL_XCVR_IRQ_NEW_CS) {
13961396
dev_dbg(dev, "Received new CS block\n");
13971397
isr_clr |= FSL_XCVR_IRQ_NEW_CS;
1398-
if (!xcvr->soc_data->spdif_only) {
1398+
if (xcvr->soc_data->fw_name) {
13991399
/* Data RAM is 4KiB, last two pages: 8 and 9. Select page 8. */
14001400
regmap_update_bits(xcvr->regmap, FSL_XCVR_EXT_CTRL,
14011401
FSL_XCVR_EXT_CTRL_PAGE_MASK,
@@ -1423,6 +1423,26 @@ static irqreturn_t irq0_isr(int irq, void *devid)
14231423
/* clear CS control register */
14241424
memset_io(reg_ctrl, 0, sizeof(val));
14251425
}
1426+
} else {
1427+
regmap_read(xcvr->regmap, FSL_XCVR_RX_CS_DATA_0,
1428+
(u32 *)&xcvr->rx_iec958.status[0]);
1429+
regmap_read(xcvr->regmap, FSL_XCVR_RX_CS_DATA_1,
1430+
(u32 *)&xcvr->rx_iec958.status[4]);
1431+
regmap_read(xcvr->regmap, FSL_XCVR_RX_CS_DATA_2,
1432+
(u32 *)&xcvr->rx_iec958.status[8]);
1433+
regmap_read(xcvr->regmap, FSL_XCVR_RX_CS_DATA_3,
1434+
(u32 *)&xcvr->rx_iec958.status[12]);
1435+
regmap_read(xcvr->regmap, FSL_XCVR_RX_CS_DATA_4,
1436+
(u32 *)&xcvr->rx_iec958.status[16]);
1437+
regmap_read(xcvr->regmap, FSL_XCVR_RX_CS_DATA_5,
1438+
(u32 *)&xcvr->rx_iec958.status[20]);
1439+
for (i = 0; i < 6; i++) {
1440+
val = *(u32 *)(xcvr->rx_iec958.status + i * 4);
1441+
*(u32 *)(xcvr->rx_iec958.status + i * 4) =
1442+
bitrev32(val);
1443+
}
1444+
regmap_set_bits(xcvr->regmap, FSL_XCVR_RX_DPTH_CTRL,
1445+
FSL_XCVR_RX_DPTH_CTRL_CSA);
14261446
}
14271447
}
14281448
if (isr & FSL_XCVR_IRQ_NEW_UD) {
@@ -1497,6 +1517,7 @@ static const struct fsl_xcvr_soc_data fsl_xcvr_imx93_data = {
14971517
};
14981518

14991519
static const struct fsl_xcvr_soc_data fsl_xcvr_imx95_data = {
1520+
.fw_name = "imx/xcvr/xcvr-imx95.bin",
15001521
.spdif_only = true,
15011522
.use_phy = true,
15021523
.use_edma = true,
@@ -1786,7 +1807,7 @@ static int fsl_xcvr_runtime_resume(struct device *dev)
17861807
}
17871808
}
17881809

1789-
if (xcvr->mode == FSL_XCVR_MODE_EARC) {
1810+
if (xcvr->soc_data->fw_name) {
17901811
ret = fsl_xcvr_load_firmware(xcvr);
17911812
if (ret) {
17921813
dev_err(dev, "failed to load firmware.\n");

0 commit comments

Comments
 (0)