]> git.baikalelectronics.ru Git - kernel.git/commit
clk: add clk accuracy retrieval support
authorBoris BREZILLON <b.brezillon@overkiz.com>
Sat, 21 Dec 2013 09:34:47 +0000 (10:34 +0100)
committerMike Turquette <mturquette@linaro.org>
Mon, 23 Dec 2013 07:14:27 +0000 (23:14 -0800)
commitf883ad57ed108403e8fb1b5a88e6c8abdcb4c415
tree0d6ab9695d994cedc85c32b08f6e8d211acf4207
parent6f8e1eebc1701ab89f5d6d955fbc56e58f3f0737
clk: add clk accuracy retrieval support

The clock accuracy is expressed in ppb (parts per billion) and represents
the possible clock drift.
Say you have a clock (e.g. an oscillator) which provides a fixed clock of
20MHz with an accuracy of +- 20Hz. This accuracy expressed in ppb is
20Hz/20MHz = 1000 ppb (or 1 ppm).

Clock users may need the clock accuracy information in order to choose
the best clock (the one with the best accuracy) across several available
clocks.

This patch adds clk accuracy retrieval support for common clk framework by
means of a new function called clk_get_accuracy.
This function returns the given clock accuracy expressed in ppb.

In order to get the clock accuracy, this implementation adds one callback
called recalc_accuracy to the clk_ops structure.
This callback is given the parent clock accuracy (if the clock is not a
root clock) and should recalculate the given clock accuracy.

This callback is optional and may be implemented if the clock is not
a perfect clock (accuracy != 0 ppb).

Signed-off-by: Boris BREZILLON <b.brezillon@overkiz.com>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
Documentation/clk.txt
drivers/clk/clk.c
include/linux/clk-private.h
include/linux/clk-provider.h
include/linux/clk.h