.. include:: /keyword.rst === I2S === This document provides a guide for configuring the Audio I2S interfaces on the |G520-G720-EVK|. .. contents:: Sections :local: :depth: 2 Overview ======== |G520-G720-EVK| exposes four I2S interfaces, supporting master/slave clock configurations and multiple data formats suitable for interfacing with various external codecs, DSPs, or Bluetooth modules. I2S Interfaces ============== The table below details the I2S interface mapping to the AFE route diagram and Backend DAI names: .. table:: I2S Interface Mapping +----------------+----------------------------+--------------------+-------------------+ | Interface Name | Block on AFE Route Diagram | Front End DAI Name | Back End DAI Name | +================+============================+====================+===================+ | I2SOUT0 | eTDM out0 | DL1 | I2SOUT0_BE | +----------------+----------------------------+--------------------+-------------------+ | I2SOUT1 | eTDM out1 | DL3 | I2SOUT1_BE | +----------------+----------------------------+--------------------+-------------------+ | I2SIN0 | eTDM in0 | UL1 | I2SIN0_BE | +----------------+----------------------------+--------------------+-------------------+ | I2SIN1 | eTDM in1 | UL3 | I2SIN1_BE | +----------------+----------------------------+--------------------+-------------------+ .. figure:: /_asset/sw_yocto_porting-guide_audio_g720-i2s-interface.svg :width: 100% :align: center |G520-G720-EVK| I2S Interfaces Device Tree Configuration ========================= The I2S configuration is primarily handled within the **Sound Card** node in the Device Tree Source (DTS). Specifically, settings are applied within the ``dai-link`` subnodes under the ``&sound`` node. Properties Used --------------- To configure the I2S parameters, modify the specific ``dai-link`` node corresponding to the target I2S interface (Back End DAI). - mediatek,clk-provider Defines the clock master/slave relationship between the SoC and the Codec. .. table:: Clock Provider Configuration +--------------------------+------------------------------+---------------------------+ | Value | Clock Provider (Master) | G520/G720 Role | +==========================+==============================+===========================+ | ``cpu`` | G520/G720 SoC | **Master** (default) | +--------------------------+------------------------------+---------------------------+ | ``codec`` | External Codec | **Slave** | +--------------------------+------------------------------+---------------------------+ Usage: .. code-block:: dts mediatek,clk-provider = "codec"; - dai-format Specifies the audio data protocol format. .. table:: Supported DAI Formats +----------------+-----------------------+ | Value | Description | +================+=======================+ | ``i2s`` | Standard I2S format | +----------------+-----------------------+ | ``left_j`` | Left Justified | +----------------+-----------------------+ | ``right_j`` | Right Justified | +----------------+-----------------------+ | ``dsp_a`` | DSP Mode A (PCM A) | +----------------+-----------------------+ | ``dsp_b`` | DSP Mode B (PCM B) | +----------------+-----------------------+ Usage: .. code-block:: dts dai-format = "dsp_a"; Configuration Example --------------------- The following example demonstrates how to configure **I2SIN1** as a **Slave** device using the **Left Justified** format. DTS Snippet ~~~~~~~~~~~ .. code-block:: dts &sound { /* ... other sound card properties ... */ /* Backend DAI Link for I2SIN1 */ dai-link-3 { link-name = "I2SIN1_BE"; mediatek,clk-provider = "codec"; dai-format = "left_j"; }; }; .. note:: - Ensure that the ``link-name`` matches the backend definitions expected by the ASoC machine driver for the G720 platform. - The numbering of ``dai-link-X`` may differ depending on the specific implementation. Please adjust according to your DTS configuration. Limitations =========== Conflict between I2SOUT0 and eDP -------------------------------- **I2SOUT0** and **eDP** are mutually exclusive due to the hardware resource conflict on **GPIO108**, **GPIO109**, and **GPIO110**. Although these pins are assigned to I2SOUT0 by default, enabling eDP takes precedence. Consequently, the system will automatically disable I2SOUT0 when eDP is active. Conflict between I2SIN0 and IT6625 ---------------------------------- **I2SIN0** and **IT6625** cannot be used simultaneously as they share the same pin **GPIO103**. This pin is required by I2SIN0 for the MCLK signal and by IT6625 for interrupt. By default, the system enables I2SIN0. However, enabling IT6625 will override this setting and automatically disable I2SIN0 to accommodate the interrupt requirement.