Skip to content

Commit 6a8c6f5

Browse files
TE-N-ShengjiuWangbroonie
authored andcommitted
ASoC: fsl_asrc: Add support for i.MX952 platform
Add a compatible string, clock mapping table and enable the option 'start_before_dma' to support ASRC on the i.MX952 platform. The clock mapping table is to map the clock sources on i.MX952 to the clock ids in the driver, the clock ids are for all the clock sources on all supported platforms. Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com> Reviewed-by: Frank Li <Frank.Li@nxp.com> Link: https://patch.msgid.link/20260206014805.3897764-4-shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 83447a3 commit 6a8c6f5

2 files changed

Lines changed: 30 additions & 0 deletions

File tree

sound/soc/fsl/fsl_asrc.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,12 @@ static unsigned char clk_map_imx8qxp[2][ASRC_CLK_MAP_LEN] = {
106106
},
107107
};
108108

109+
static unsigned char clk_map_imx952[ASRC_CLK_MAP_LEN] = {
110+
0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0x0,
111+
0x0, 0x1, 0x2, 0x3, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0x4, 0x5, 0x6, 0x8, 0xf, 0xf,
112+
0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0x7, 0x9, 0xa, 0xb, 0xc, 0xd, 0xf, 0xf, 0xf, 0xf,
113+
};
114+
109115
/*
110116
* According to RM, the divider range is 1 ~ 8,
111117
* prescaler is power of 2 from 1 ~ 128.
@@ -1337,6 +1343,9 @@ static int fsl_asrc_probe(struct platform_device *pdev)
13371343
asrc_priv->clk_map[IN] = clk_map_imx8qxp[map_idx];
13381344
asrc_priv->clk_map[OUT] = clk_map_imx8qxp[map_idx];
13391345
}
1346+
} else if (of_device_is_compatible(np, "fsl,imx952-asrc")) {
1347+
asrc_priv->clk_map[IN] = clk_map_imx952;
1348+
asrc_priv->clk_map[OUT] = clk_map_imx952;
13401349
}
13411350

13421351
asrc->channel_avail = 10;
@@ -1575,11 +1584,18 @@ static const struct fsl_asrc_soc_data fsl_asrc_imx8qxp_data = {
15751584
.channel_bits = 4,
15761585
};
15771586

1587+
static const struct fsl_asrc_soc_data fsl_asrc_imx952_data = {
1588+
.use_edma = true,
1589+
.channel_bits = 4,
1590+
.start_before_dma = true,
1591+
};
1592+
15781593
static const struct of_device_id fsl_asrc_ids[] = {
15791594
{ .compatible = "fsl,imx35-asrc", .data = &fsl_asrc_imx35_data },
15801595
{ .compatible = "fsl,imx53-asrc", .data = &fsl_asrc_imx53_data },
15811596
{ .compatible = "fsl,imx8qm-asrc", .data = &fsl_asrc_imx8qm_data },
15821597
{ .compatible = "fsl,imx8qxp-asrc", .data = &fsl_asrc_imx8qxp_data },
1598+
{ .compatible = "fsl,imx952-asrc", .data = &fsl_asrc_imx952_data },
15831599
{}
15841600
};
15851601
MODULE_DEVICE_TABLE(of, fsl_asrc_ids);

sound/soc/fsl/fsl_asrc.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,13 @@ enum asrc_inclk {
326326
INCLK_SAI6_TX_BCLK = 0x22,
327327
INCLK_HDMI_RX_SAI0_RX_BCLK = 0x24,
328328
INCLK_HDMI_TX_SAI0_TX_BCLK = 0x25,
329+
330+
INCLK_SAI2_TX_BCLK = 0x26,
331+
INCLK_SAI3_TX_BCLK = 0x27,
332+
INCLK_SAI4_RX_BCLK = 0x28,
333+
INCLK_SAI4_TX_BCLK = 0x29,
334+
INCLK_SAI5_RX_BCLK = 0x2a,
335+
INCLK_SAI5_TX_BCLK = 0x2b,
329336
};
330337

331338
enum asrc_outclk {
@@ -366,6 +373,13 @@ enum asrc_outclk {
366373
OUTCLK_SAI6_TX_BCLK = 0x22,
367374
OUTCLK_HDMI_RX_SAI0_RX_BCLK = 0x24,
368375
OUTCLK_HDMI_TX_SAI0_TX_BCLK = 0x25,
376+
377+
OUTCLK_SAI2_TX_BCLK = 0x26,
378+
OUTCLK_SAI3_TX_BCLK = 0x27,
379+
OUTCLK_SAI4_RX_BCLK = 0x28,
380+
OUTCLK_SAI4_TX_BCLK = 0x29,
381+
OUTCLK_SAI5_RX_BCLK = 0x2a,
382+
OUTCLK_SAI5_TX_BCLK = 0x2b,
369383
};
370384

371385
#define ASRC_CLK_MAX_NUM 16

0 commit comments

Comments
 (0)