The iSST driver makes Intel PCH as I2S Master and output TDM audio data (48KHz, 2 lanes, 24bit sampling) as default. I want to change it to I2S Slave and output standard I2S (non-TDM) data(48KHz, 2 lanes, 24bit sampling).Now I found in PC’s BIOS code the I2S configuration array which specifies the I2S format as follows:
// I2S/SSP Configuration BLOBs
// Audio Format and Configuration details
//
// Frequency: 48kHz, PCM resolution: 24 bits
// TDM slots: 4
// Codec: Realtek ALC274, mode: slave
CONST UINT32 I2sRtk274Render4ch48kHz24bitFormatConfig =
{0x0,//gtw_attr
0xffffff10, 0xffffff32, 0xffff3210,0xffff3210,//tdm_ts_group
0xffff3210, 0xffff3210, 0xffff3210,0xffff3210,//tdm_ts_group
0x83d00737, 0xc0700000, 0x0, // ssc0, ssc1, sscto
0x02010004, 0xf, 0xf, 0x4002, // sspsp, sstsa, ssrsa, ssc2
0x4, 0x7070f00, 0x20, // sspsp2, ssc3, ssioc
0x00020001, //mdivctrl
0x00000002}; // mdivr
This above array’s structure is defined as :
// struct skl_i2s_config_blob_legacy - Structure defines I2S Gateway configuration legacy blob
// @gtw_attr: Gateway attribute for the I2S Gateway
// @tdm_ts_group: TDM slot mapping against channels in the Gateway.
// @i2s_cfg: I2S HW registers
// @mclk: MCLK clock source and divider values
struct skl_i2s_config_blob_legacy {
u32 gtw_attr;
u32 tdm_ts_group[SKL_I2S_MAX_TIME_SLOTS];
struct skl_i2s_config i2s_cfg;
struct skl_i2s_config_mclk mclk;
};
The skl_i2s_config i2s_cfg and skl_i2s_config_mclk is defined as:
struct skl_i2s_config {
u32 ssc0;
u32 ssc1;
u32 sscto;
u32 sspsp;
u32 sstsa;
u32 ssrsa;
u32 ssc2;
u32 sspsp2;
u32 ssc3;
u32 ssioc;
} __packed;
struct skl_i2s_config_mclk {
u32 mdivctrl;
u32 mdivr;
};
As far as I know, the ssc0, ssc1 ssioc are intel PCH’s HW registers congiguration value. I dont know how to configure those registers to acheive certain I2S output format, Can anyone help me? Thank you very much.