regmap: mmio: Add function to attach a clock
authorMaxime Ripard <maxime.ripard@free-electrons.com>
Wed, 21 Feb 2018 09:20:25 +0000 (10:20 +0100)
committerMark Brown <broonie@kernel.org>
Mon, 26 Feb 2018 11:05:44 +0000 (11:05 +0000)
commit31895662f9ba81e8ea9ef05abf8edcb29d4b9c18
tree977da55be387cc63f74a29393193261cb082780c
parent7928b2cbe55b2a410a0f5c1f154610059c57b1b2
regmap: mmio: Add function to attach a clock

regmap_init_mmio_clk allows to specify a clock that needs to be enabled
while accessing the registers.

However, that clock is retrieved through its clock ID, which means it will
lookup that clock based on the current device that registers the regmap,
and, in the DT case, will only look in that device OF node.

This might be problematic if the clock to enable is stored in another node.
Let's add a function that allows to attach a clock that has already been
retrieved to a regmap in order to fix this.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/base/regmap/regmap-mmio.c
include/linux/regmap.h