Introduktion: I having a HDMI PHY SII9022A. I want to enable audio on that PHY.
Requriments:
I need to create a proper device tree for the SII9022A.
https://www.kernel.org/doc/Documentation/devicetree/bindings/display/bridge/sil%2Csii9022.yaml
According to this file, I need to activate audio-graph-card bindings and of course i2s.
I have created my device tree. Notice that I have not using MCLK (Master Clock) because PLL can be used instead of MCLK.
My linux kernel configuration looks like this.
My device tree looks like this:
hdmi-transmitter@39{ compatible = "sil,sii9022"; reg = <0x39>; iovcc-supply = <&v3v3_hdmi>; cvcc12-supply = <&v1v2_hdmi>; reset-gpios = <&gpioe 8 GPIO_ACTIVE_LOW>; interrupts = <1 IRQ_TYPE_EDGE_FALLING>; interrupt-parent = <&gpiog>; #sound-dai-cells = <0>; sil,i2s-data-lanes = <0>; /*clocks = <&mclk>; clock-names = "mclk";*/ status = "okay"; ports{ #address-cells = <1>; #size-cells = <0>; port@0{ reg = <0>; sii9022_in:endpoint{ remote-endpoint = <<dc_ep0_out>; }; }; port@1{ reg = <1>; sii9022_out:endpoint{ remote-endpoint = <&hdmi_connector_in>; }; }; port@3{ reg = <3>; sii9022_tx_endpoint:endpoint{ remote-endpoint = <&i2s2_endpoint>; }; }; }; }; &i2s2{ pinctrl-names = "default", "sleep"; pinctrl-0 = <&i2s2_pins_mx>; pinctrl-1 = <&i2s2_sleep_pins_mx>; status = "okay"; /* USER CODE BEGIN i2s2 */ clocks = <&rcc SPI2>, <&rcc SPI2_K>, <&rcc PLL3_Q>, <&rcc PLL3_R>; clock-names = "pclk", "i2sclk", "x8k", "x11k"; i2s2_port:port{ i2s2_endpoint:endpoint{ remote-endpoint = <&sii9022_tx_endpoint>; dai-format = "i2s"; mclk-fs = <256>; }; }; /* USER CODE END i2s2 */ }; Question:
As you can see, I'm using the dai-format = "i2s", but still, I'm getting this debug messages.
drivers/gpu/drm/bridge/sii902x.c:577 [sii902x]sii902x_audio_hw_params =p "%s: Unsupported i2s format %u\n" drivers/gpu/drm/bridge/sii902x.c:560 [sii902x]sii902x_audio_hw_params =p "%s: I2S clock provider mode not supported\n" From this .c code: https://github.com/torvalds/linux/blob/master/drivers/gpu/drm/bridge/sii902x.c
static int sii902x_audio_hw_params(struct device *dev, void *data, struct hdmi_codec_daifmt *daifmt, struct hdmi_codec_params *params) { struct sii902x *sii902x = dev_get_drvdata(dev); u8 i2s_config_reg = SII902X_TPI_I2S_SD_DIRECTION_MSB_FIRST; u8 config_byte2_reg = (SII902X_TPI_AUDIO_INTERFACE_I2S | SII902X_TPI_AUDIO_MUTE_ENABLE | SII902X_TPI_AUDIO_CODING_PCM); u8 config_byte3_reg = 0; u8 infoframe_buf[HDMI_INFOFRAME_SIZE(AUDIO)]; unsigned long mclk_rate; int i, ret; if (daifmt->bit_clk_provider || daifmt->frame_clk_provider) { dev_dbg(dev, "%s: I2S clock provider mode not supported\n", __func__); <-------------------------- return -EINVAL; } switch (daifmt->fmt) { case HDMI_I2S: i2s_config_reg |= SII902X_TPI_I2S_FIRST_BIT_SHIFT_YES | SII902X_TPI_I2S_SD_JUSTIFY_LEFT; break; case HDMI_RIGHT_J: i2s_config_reg |= SII902X_TPI_I2S_SD_JUSTIFY_RIGHT; break; case HDMI_LEFT_J: i2s_config_reg |= SII902X_TPI_I2S_SD_JUSTIFY_LEFT; break; default: dev_dbg(dev, "%s: Unsupported i2s format %u\n", __func__, daifmt->fmt); <-------------------------------- return -EINVAL; } So how can I get the I2S clock prover mode a proper setup?


