AnsweredAssumed Answered

How to limit the max. gain value in audio driver?

Question asked by Seven Lin on Feb 14, 2019
Latest reply on Feb 19, 2019 by Seven Lin

According to our audio codec(TAS5756) spec, the min. value of digital gain register is -103dB,
different to the next gain value by 0.5dB, and the total gain level is 255.

So we have below setting in our driver:


static const DECLARE_TLV_DB_SCALE(digital_tlv, -10350, 50, 1);

static const struct snd_kcontrol_new tas5756m_controls[] = {

SOC_SINGLE_TLV("Digital Playback Volume",
TAS5756M_DIGITAL_VOLUME_3, 0, 255, 1, digital_tlv),


We can know the max digital value is 24dB (-103dB+0.5dB*254).
If we would like to limit the digital gain volume to be less than -7dB, and we also want to have control volume from 0% to 100%, how could we do it in the audio driver?