aboutsummaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorAbel Vesa <[email protected]>2022-12-27 22:45:27 +0200
committerBjorn Andersson <[email protected]>2023-01-10 11:04:50 -0600
commit26b36df7516692292312063ca6fd19e73c06d4e7 (patch)
treed98d4a2d946ff5d7bc95e5eec70ac7742592696d /include/linux
parentce273e690d84b63ba73db2b63badeba4e74f3980 (diff)
clk: Add generic sync_state callback for disabling unused clocks
There are unused clocks that need to remain untouched by clk_disable_unused, and most likely could be disabled later on sync_state. So provide a generic sync_state callback for the clock providers that register such clocks. Then, use the same mechanism as clk_disable_unused from that generic callback, but pass the device to make sure only the clocks belonging to the current clock provider get disabled, if unused. Also, during the default clk_disable_unused, if the driver that registered the clock has the generic clk_sync_state_disable_unused callback set for sync_state, skip disabling its clocks. Signed-off-by: Abel Vesa <[email protected]> Reviewed-by: Bjorn Andersson <[email protected]> Reviewed-by: Dmitry Baryshkov <[email protected]> Signed-off-by: Bjorn Andersson <[email protected]> Link: https://lore.kernel.org/r/[email protected]
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/clk-provider.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h
index 842e72a5348f..cf1adfeaf257 100644
--- a/include/linux/clk-provider.h
+++ b/include/linux/clk-provider.h
@@ -720,6 +720,7 @@ struct clk *clk_register_divider_table(struct device *dev, const char *name,
void __iomem *reg, u8 shift, u8 width,
u8 clk_divider_flags, const struct clk_div_table *table,
spinlock_t *lock);
+void clk_sync_state_disable_unused(struct device *dev);
/**
* clk_register_divider - register a divider clock with the clock framework
* @dev: device registering this clock