Vim2 Ubuntu 22.04 - I2S clocks inversion?

Hi,
I’m tryin’ to enable I2S to work with ES9023 DAC but it turned out that sound is highly distorted with stock kernel 6.0.0 or freshly built 6.1.0.
I have to add that it sounds good with older Ubuntu 18.04 4.9 (so hardware is ok) but I’d like to use the newest one.

After diggin’ in kernel source from Fenix build I’ve found that in linux\include\sound\soc-dai.h there is such define:

#define SND_SOC_DAIFMT_NB_NF||(0 << 8) /* normal bit clock + frame /
#define SND_SOC_DAIFMT_NB_IF||(2 << 8) /
normal BCLK + inv FRM /
#define SND_SOC_DAIFMT_IB_NF||(3 << 8) /
invert BCLK + nor FRM /
#define SND_SOC_DAIFMT_IB_IF||(4 << 8) /
invert BCLK + FRM */

But in which file can I set this parameters?

Thanks.

First time I’ve done it dirty way by modyfin’ sound/soc/meson/aiu-encoder-i2s.c and ES9023 DAC worked properly, so after some investigations of Kernel code and a lot of time I’ve found the property which should be added in dts:

dai-link-1 {
sound-dai = <&aiu AIU_CPU CPU_I2S_ENCODER>;
dai-format = “i2s”;
bitclock-inversion;
mclk-fs = <256>;
codec-0 {
sound-dai = <&aiu AIU_HDMI CTRL_I2S>;
};
};

There’s also posibility to invert LRCK by adding:

frame-inversion;