clk: bcm2835: Minimise clock jitter for PCM clock
authorPhil Elwell <phil@raspberrypi.org>
Mon, 22 May 2017 12:56:41 +0000 (13:56 +0100)
committerRaspbian kernel package updater <root@raspbian.org>
Sat, 31 Mar 2018 14:54:16 +0000 (15:54 +0100)
commitd4260f9fddd68a897b11ff439010b86ea7a0d0b7
treeed1269654ea7cb2553af9b4760ef30694b79f6a5
parentdee53187804c0ac7463ee19d9bc08494de2cd904
clk: bcm2835: Minimise clock jitter for PCM clock

Fractional clock dividers generate accurate average frequencies but
with jitter, particularly when the integer divisor is small.

Introduce a new metric of clock accuracy to penalise clocks with a good
average but worse jitter compared to clocks with an average which is no
better but with lower jitter. The metric is the ideal rate minus the
worse deviation from that ideal using the nearest integer divisors.

Use this metric for parent selection for clocks requiring low jitter
(currently just PCM).

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
drivers/clk/bcm/clk-bcm2835.c