• Adam Thomson's avatar
    ASoC: da7219: Use clk_round_rate to handle enabled bclk/wclk case · 1cd472d2
    Adam Thomson authored
    For some platforms where DA7219 is the DAI clock master, BCLK/WCLK
    will be set and enabled prior to the codec's hw_params() function
    being called. It is possible the platform requires a different
    BCLK configuration than would be chosen by hw_params(), for
    example S16_LE format needed with a 64-bit frame to satisfy certain
    devices using the clocks.
    
    To handle those kinds of scenarios, the use of clk_round_rate() is
    now employed as part of hw_params(). If BCLK is already enabled
    then this function will just return the currently set rate, if it
    is valid for the desired frame size, so the subsequent call to
    clk_set_rate() will succeed and nothing changes with regards to
    clocking. In addition the specific BCLK & WCLK recalc_rate()
    implementations needed updating to always give back a real value,
    as those functions are called as part of the clk init code and a
    real value is needed for the clk_round_rate() call to work as
    expected.
    Signed-off-by: default avatarAdam Thomson <Adam.Thomson.Opensource@diasemi.com>
    Signed-off-by: default avatarMark Brown <broonie@kernel.org>
    1cd472d2
da7219.c 75.8 KB