clk: renesas: cpg-mssr: Export cpg_mssr_{at,de}tach_dev()
authorGeert Uytterhoeven <geert+renesas@glider.be>
Fri, 4 Mar 2016 16:03:46 +0000 (17:03 +0100)
committerGeert Uytterhoeven <geert+renesas@glider.be>
Wed, 20 Apr 2016 07:17:07 +0000 (09:17 +0200)
commit2066390ad47b374f3d35075a32325b47d15bf735
tree83ae9d2bbda1d30485e2ffe852914fca58115fc6
parent12524e348bcb2189a8cf43829e90256f7e7d4f3d
clk: renesas: cpg-mssr: Export cpg_mssr_{at,de}tach_dev()

The R-Car SYSC PM Domain driver has to power manage devices in power
areas using clocks. To reuse code and to share knowledge of clocks
suitable for power management, this is ideally done through the existing
cpg_mssr_attach_dev() and cpg_mssr_detach_dev() callbacks.

Hence these callbacks can no longer rely on their "domain" parameter
pointing to the CPG/MSSR Clock Domain. To handle this, keep a pointer to
the clock domain in a static variable. cpg_mssr_attach_dev() has to
support probe deferral, as the R-Car SYSC PM Domain may be initialized,
and devices may be added to it, before the CPG/MSSR Clock Domain is
initialized.

Dummy callbacks are provided for the case where CPG/MSTP support is not
included, so the rcar-sysc driver won't have to care about this.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
drivers/clk/renesas/renesas-cpg-mssr.c
include/linux/clk/renesas.h