Skip to content

Commit 6e0b401

Browse files
authored
MUA-Witekio: Fixing the fsl SAI kernel module and correcting the DTS (nxp-imx#24)
* Initial sound card integration * Added reserved memory space for Cortex-M4 * Added corrections to SAI clock pads and removed unnecessary IO settings * Override the ALSA slot width. reset it to 32-bit * Fixed wrong bus clock setting * Corrected the clock sync setting of SAI 1,3 so that the RX follows the bit clock of the TX * Reactivated HW Crypto accelerator * Reactivated CAAM * Ethernet reset line deployed * Removed the extra SAI cfg that was enforced in case of missing cfgs, corrected the DTS accordingly
1 parent 53d3fbd commit 6e0b401

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

arch/arm64/boot/dts/freescale/mt-connect.dts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,24 +142,26 @@
142142
pri-dai-link {
143143
link-name = "interproc audio";
144144
format = "i2s";
145+
dai-tdm-slot-num = <8>;
146+
dai-tdm-slot-width = <32>;
145147
fsl,mclk-equal-bclk;
146148
cpu {
147149
sound-dai = <&sai1>;
148-
dai-tdm-slot-width = <32>;
149150
};
150151
};
151152
};
152153

153154
sound_Headphone {
154155
compatible = "fsl,imx-audio-card";
155-
model = "imx-audio-card"; /*Dummy Codec*/
156+
model = "imx-audio-card";
156157
pri-dai-link {
157158
link-name = "Headphone audio";
158159
format = "i2s";
160+
dai-tdm-slot-num = <2>;
161+
dai-tdm-slot-width = <32>;
159162
fsl,mclk-equal-bclk;
160163
cpu {
161164
sound-dai = <&sai3>;
162-
dai-tdm-slot-width = <32>;
163165
};
164166
};
165167
};
@@ -417,6 +419,7 @@
417419
<&dante_osc_sclk>,
418420
<&clk IMX8MM_CLK_DUMMY>, <&clk IMX8MM_CLK_DUMMY>;
419421
clock-names = "bus", "mclk0", "mclk1", "mclk2", "mclk3";
422+
fsl,dataline = <1 0x00 0x01>; /*I2S mode enabled, 0 RX lines, 1 TX lines*/
420423
fsl,txs-rxs;
421424
status = "okay";
422425
};
@@ -428,7 +431,7 @@
428431
<&dante_osc_sclk>,
429432
<&clk IMX8MM_CLK_DUMMY>, <&clk IMX8MM_CLK_DUMMY>;
430433
clock-names = "bus", "mclk0", "mclk1", "mclk2", "mclk3";
431-
fsl,dataline = <1 0x0F 0x0F>; /*I2S mode enabled, 4 TX lines, 4 RX lines*/
434+
fsl,dataline = <1 0x0F 0x0F>; /*I2S mode enabled, 4 RX lines, 4 TX lines*/
432435
fsl,txs-rxs;
433436
status = "okay";
434437
};

sound/soc/fsl/fsl_sai.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,7 @@ static int fsl_sai_hw_params(struct snd_pcm_substream *substream,
550550
slots = sai->slots;
551551
else if (sai->bclk_ratio)
552552
slots = sai->bclk_ratio / slot_width;
553-
553+
554554
pins = DIV_ROUND_UP(channels, slots);
555555

556556
/*
@@ -1266,8 +1266,7 @@ static int fsl_sai_read_dlcfg(struct fsl_sai *sai)
12661266
}
12671267

12681268
num_cfg = elems / 3;
1269-
/* Add one more for default value */
1270-
cfg = devm_kzalloc(&pdev->dev, (num_cfg + 1) * sizeof(*cfg), GFP_KERNEL);
1269+
cfg = devm_kzalloc(&pdev->dev, (num_cfg) * sizeof(*cfg), GFP_KERNEL);
12711270
if (!cfg)
12721271
return -ENOMEM;
12731272

@@ -1283,7 +1282,7 @@ static int fsl_sai_read_dlcfg(struct fsl_sai *sai)
12831282
cfg[0].mask[1] = soc_dl;
12841283
cfg[0].start_off[1] = 0;
12851284
cfg[0].next_off[1] = 0;
1286-
for (i = 1, index = 0; i < num_cfg + 1; i++) {
1285+
for (i = 0, index = 0; i < num_cfg; i++) {
12871286
/*
12881287
* type of dataline
12891288
* 0 means default mode
@@ -1325,7 +1324,7 @@ static int fsl_sai_read_dlcfg(struct fsl_sai *sai)
13251324
}
13261325

13271326
sai->dl_cfg = cfg;
1328-
sai->dl_cfg_cnt = num_cfg + 1;
1327+
sai->dl_cfg_cnt = num_cfg;
13291328
return 0;
13301329
}
13311330

0 commit comments

Comments
 (0)