• Cezary Rojewski's avatar
    ASoC: Intel: Skylake: Make MCPS and CPS params obsolete · 84b71067
    Cezary Rojewski authored
    As per FW Interface Modules Configuration, init instance IPC request
    requires base initial module configuration. This configuration structure
    is made of:
    - cpc (chunks per cycle)
    - ibs (input buffer size)
    - obs (output buffer size)
    - is_pages (memory pages required)
    - audio_fmt (self explanatory)
    
    Skylake topology accepts following tokens: MCPS, CPS and CPC. All of
    these are directly connected. Moreover, assigning one of these allows
    to calculate the remaining two. In simplest scenario and assuming 1ms
    scheduling, following is true:
    
    CPS = CPC times 1000
    MCPS = CPS times 1000 000
    Note: these calculations vary depending on scenario and scheduling
    requirements.
    
    Given the current implementation, userspace is allowed to provide
    different values for all three causing informational chaos. On top of
    that, struct skl_base_cfg which represents base module configuration,
    incorrectly takes CPS param instead of CPC.
    
    This ambiguity may lead to user unintentionally providing improper
    values to DSP firmware and thus impacting module scheduling in
    unexpected fashion. Fix by making MCPS and CPS topology params obsolete
    and relying solely on CPC value.
    Signed-off-by: default avatarCezary Rojewski <cezary.rojewski@intel.com>
    Link: https://lore.kernel.org/r/20190723145854.8527-7-cezary.rojewski@intel.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
    84b71067
skl-topology.h 10.7 KB