Re: [PATCH v2 2/4] ASoC: es8316: Enable support for MCLK div by 2
From: Marian Postevca
Date: Mon Aug 28 2023 - 16:25:10 EST
Mark Brown <broonie@xxxxxxxxxx> writes:
>
> In general a MCLK that allows you to configure the dividers in the CODEC
> appropriately for use. So long as it works your change looks fine I
> think modulo.
Sorry, maybe this question is dumb, but I am not familiar with this
expression. What do you mean by "your change looks fine I think modulo"?
>> + do {
>> + /* Validate supported sample rates that are autodetected from MCLK */
>> + for (i = 0; i < NR_SUPPORTED_MCLK_LRCK_RATIOS; i++) {
>> + const unsigned int ratio = supported_mclk_lrck_ratios[i];
>> +
>> + if (clk % ratio != 0)
>> + continue;
>> + if (clk / ratio == params_rate(params))
>> + break;
>> + }
>
> Use ARRAY_SIZE()
>
Do you mean instead of all instances of NR_SUPPORTED_MCLK_LRCK_RATIOS?
If so, it's already defined as:
#define NR_SUPPORTED_MCLK_LRCK_RATIOS ARRAY_SIZE(supported_mclk_lrck_ratios)
If not, then I don't see where else I could use it.