On Friday, 4 December 2026 11:55:27 CET Benjamin Koerner wrote: > +static u16 mt7996_spectrum_gain_db(u8 gain) > +{ > + const u16 gain_db[] = { 1, 55, 47, 39 }; > + > + if (gain < ARRAY_SIZE(gain_db)) > + return gain_db[gain]; > + > + return 1; > +} This hardware supports more gains. We already discussed that we might to add them too. But here a specific idea from Simon: The gains are most likely hardware specific. And it is a little bit awkward to remember which name belongs to which gain. It might therefore be a good idea to have a read-only file "gains_available" (like the scaling governor) which shows which gains can be selected. And then the user can then write these values to gain file. Either the actual dB value from this list or the alias. But the aliases high/medium/low can of course also be dropped when this would not be appropriate. If it is not one from the list then the write will be rejected with an -EINVAL. And maybe we disallow "auto" because then the samples are returned with a random gain (which we don't know and don't get reported). The list could then for example look like this: 55 (high) 47 (medium) 39 (low) 31 23 15 5 Regards, Sven