• Vladimir Zapolskiy's avatar
    spi: sh-msiof: Simplify calculation of divisors for transfer rate · 51093cba
    Vladimir Zapolskiy authored
    The change updates sh_msiof_spi_set_clk_regs() function by iterating
    over BRDV power values. Note that the change is a functional one, namely
    prescaler output x 1/1 set in BRDV bit field (0b111) for MSO division
    rate set to 2 is substituted by BRDV = 0b000 and BRPS = 0b0, in terms
    of written values to TSCR setting of 0x0107 is substituted by 0x0000,
    and for all input parameter cases this is the only functional change,
    which touches the controller.
    
    As a result of the rework the function is supposed to be slightly more
    efficient and more readable and maintainable in case of any further
    extensions.
    Signed-off-by: default avatarVladimir Zapolskiy <vladimir_zapolskiy@mentor.com>
    Signed-off-by: default avatarMark Brown <broonie@kernel.org>
    51093cba
spi-sh-msiof.c 38.1 KB