mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-15 23:36:40 +07:00
2066390ad4
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>
44 lines
1.3 KiB
C
44 lines
1.3 KiB
C
/*
|
|
* Copyright 2013 Ideas On Board SPRL
|
|
* Copyright 2013, 2014 Horms Solutions Ltd.
|
|
*
|
|
* Contact: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
|
|
* Contact: Simon Horman <horms@verge.net.au>
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
* (at your option) any later version.
|
|
*/
|
|
|
|
#ifndef __LINUX_CLK_RENESAS_H_
|
|
#define __LINUX_CLK_RENESAS_H_
|
|
|
|
#include <linux/types.h>
|
|
|
|
struct device;
|
|
struct device_node;
|
|
struct generic_pm_domain;
|
|
|
|
void r8a7778_clocks_init(u32 mode);
|
|
void r8a7779_clocks_init(u32 mode);
|
|
void rcar_gen2_clocks_init(u32 mode);
|
|
|
|
void cpg_mstp_add_clk_domain(struct device_node *np);
|
|
#ifdef CONFIG_CLK_RENESAS_CPG_MSTP
|
|
int cpg_mstp_attach_dev(struct generic_pm_domain *unused, struct device *dev);
|
|
void cpg_mstp_detach_dev(struct generic_pm_domain *unused, struct device *dev);
|
|
#else
|
|
#define cpg_mstp_attach_dev NULL
|
|
#define cpg_mstp_detach_dev NULL
|
|
#endif
|
|
|
|
#ifdef CONFIG_CLK_RENESAS_CPG_MSSR
|
|
int cpg_mssr_attach_dev(struct generic_pm_domain *unused, struct device *dev);
|
|
void cpg_mssr_detach_dev(struct generic_pm_domain *unused, struct device *dev);
|
|
#else
|
|
#define cpg_mssr_attach_dev NULL
|
|
#define cpg_mssr_detach_dev NULL
|
|
#endif
|
|
#endif
|