• Martin Sperl's avatar
    clk: bcm2835: correctly enable fractional clock support · 959ca92a
    Martin Sperl authored
    The current driver calculates the clock divider with
    fractional support enabled.
    
    But it does not enable fractional support in the
    control register itself resulting in an integer only divider,
    but in clk_set_rate responds back the fractionally divided
    clock frequency.
    
    This patch enables fractional support in the control register
    whenever there is a fractional bit set in the requested clock divider.
    
    Mash clock limits are are also handled for the PWM clock
    applying the correct divider limits (2 and max_int) applicable to
    basic fractional divider support (mash order of 1).
    
    It also adds locking to protect the read/modify/write cycle of
    the register modification.
    
    Fixes: 41691b88 ("clk: bcm2835: Add support for programming the
    audio domain clocks")
    Signed-off-by: default avatarMartin Sperl <kernel@martin.sperl.org>
    Signed-off-by: default avatarEric Anholt <eric@anholt.net>
    Reviewed-by: default avatarEric Anholt <eric@anholt.net>
    959ca92a
clk-bcm2835.c 45.3 KB