• Richard Fitzgerald's avatar
    ASoC: cs42l42: Add warnings about DETECT_MODE and PLL_START · 71a6254c
    Richard Fitzgerald authored
    DETECT_MODE and PLL_START must be zero while HP_PDN and ADC_PDN are
    both 1. If this condition is broken it can discharge FILT+ and it
    can then take up to 1 second for FILT+ to recharge.
    
    There is no workaround required for this, simply avoiding settings
    and sequences that would break the requirement. The driver already
    meets the requirement.
    
    But it is not obvious from reading the code that this requirement
    exists, or what is ensuring it is met. So it would not currently be
    obvious to someone changing the code that there is certain special
    behaviour that must be maintained.
    
    To avoid accidental breakage in the future:
    
    - Add comments into the register definitions to warn about this so
      that anyone changing the code around DETECT_MODE and PLL_START is
      aware of this requirement.
    
    - Add a comment where PLL_START is written to 1 to highlight the
      requirement and why it is satisfied.
    
    - Add a comment in cs42l42_setup_hs_type_detect() when DETECT_MODE is
      initialized.
    Signed-off-by: default avatarRichard Fitzgerald <rf@opensource.cirrus.com>
    Link: https://lore.kernel.org/r/20220304144015.398656-1-rf@opensource.cirrus.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
    71a6254c
cs42l42.h 35.2 KB