RE: [PATCH v4 1/2] ASoC: codecs: add support for ES8389

set_tdm_slot()
We will register multiple codecs inside a single dai_link and differentiate these codecs by of_node. And the adc_slot and the dac_slot may be different, they can be decided by the user.If we use set_tdm_slot,the adc_slot and the dac_slot will be same.
No, the machine driver should be configuring different TDM slots for each device - that's the whole point of the API.
We are using multiple codecs as a single device.So we can't use set_tdm_slot to configure different slots for multiple codecs under one device.
ret = clk_prepare_enable(es8389->mclk);
if (ret) {
dev_err(codec->dev, "%s, unable to enable mclk\n", __func__);
return ret;
}
- }
Making the use of a MCLK depend on the configuration of a TDM slot for the ADC seems *very* unusual, what's going on there?
Because we are associating multiple codecs under a single dai_link, we will be executing probe and init many times during initialization.But MCLK only needs to be used once.So we decided making the use of a MCLK depend on the configuration of a TDM slot for the ADC
No, each device should just get and enable the MCLK itself - the clock API does reference counting so there's no problem with this, it's normal for a clok to have multiple consumers.
ok,I'll fix it

On Thu, Mar 06, 2025 at 03:23:54PM +0800, Zhang Yi wrote:
No, the machine driver should be configuring different TDM slots for each device - that's the whole point of the API.
We are using multiple codecs as a single device.So we can't use set_tdm_slot to configure different slots for multiple codecs under one device.
What do you mean by using it "as a single device"? Multiple CODECs on the same link is the main use case for set_tdm_slot().
participants (1)
-
Mark Brown
-
Zhang Yi