Skip to contentSkip to conversation

ASoC: rt721-sdca: Add RT721 SDCA driver

DISCUSSION Colin King (gmail) 1 participant 1 message Oct 8, 2024 Sound

lore
Share & tools
lore
#0 lore raw

Hi Jack,

With respect to the recent commit in linux-next:

commit 86ce355c1f9ab943bbe099ea7d0b8a3af2247f65

Author: Jack Yu <[email protected]>
Date:   Tue Oct 1 09:17:38 2024 +0000

ASoC: rt721-sdca: Add RT721 SDCA driver

I'm flagging up an issue in function rt721_sdca_dmic_set_gain_get there are a bunch of nested if statements as follows:

                if (!adc_vol_flag) /* boost gain */
                        ctl = regvalue / boost_step;
                else { /* ADC gain */
                        if (adc_vol_flag)
                                ctl = p->max - (((vol_max - regvalue) & 
0xffff) / interval_offset);
                        else
                                ctl = p->max - (((0 - regvalue) & 
0xffff) / interval_offset);
                }

The last else statement ctl = p->max - (((0 - regvalue) & 0xffff) / interval_offset) is redundant, since this is the !adc_vol_flag checked for in the first boost gain if clause.

Colin