clk: add clk_rate_exclusive api
authorJerome Brunet <jbrunet@baylibre.com>
Fri, 1 Dec 2017 21:51:59 +0000 (22:51 +0100)
committerMichael Turquette <mturquette@baylibre.com>
Wed, 20 Dec 2017 00:35:34 +0000 (16:35 -0800)
commit55e9b8b7b806ec3f9a8817e13596682a5981c19c
tree9739ff95800ee2449e34a920ab174a0644edd189
parentc5ce26edb4fec178232b9cb37f334ec574931514
clk: add clk_rate_exclusive api

Using clock rate protection, we can now provide a way for clock consumer
to claim exclusive control over the rate of a producer

So far, rate change operations have been a "last write wins" affair. This
changes allows drivers to explicitly protect against this behavior, if
required.

Of course, if exclusivity over a producer is claimed more than once, the
rate is effectively locked as exclusivity cannot be preempted

Tested-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Acked-by: Michael Turquette <mturquette@baylibre.com>
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Signed-off-by: Michael Turquette <mturquette@baylibre.com>
Link: lkml.kernel.org/r/20171201215200.23523-10-jbrunet@baylibre.com
drivers/clk/clk.c
include/linux/clk.h