aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/generic/backport-5.15
diff options
context:
space:
mode:
authorÁlvaro Fernández Rojas <noltari@gmail.com>2023-03-22 18:24:28 +0100
committerÁlvaro Fernández Rojas <noltari@gmail.com>2023-03-22 18:31:31 +0100
commita97965b7b11f33ff8ebd49560c4c680e49deed67 (patch)
tree98d1018d304d7d9277b66f2401387f0a9ed8c26b /target/linux/generic/backport-5.15
parentd2fc620d0a5e0287aa8d60fb10f5d5f590f571f2 (diff)
downloadupstream-a97965b7b11f33ff8ebd49560c4c680e49deed67.tar.gz
upstream-a97965b7b11f33ff8ebd49560c4c680e49deed67.tar.bz2
upstream-a97965b7b11f33ff8ebd49560c4c680e49deed67.zip
kernel: add pending patches for bcm63268-timer-clocks
bcm63268-timer-clocks have been sent upstream with a positive review, so let's add them to pending v5.15. Also add devm_clk_hw_register_gate() patch from v5.17 to backports since it's needed for upstream bcm63268-timer-clocks patches. Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Diffstat (limited to 'target/linux/generic/backport-5.15')
-rw-r--r--target/linux/generic/backport-5.15/080-v5.17-clk-gate-Add-devm_clk_hw_register_gate.patch105
1 files changed, 105 insertions, 0 deletions
diff --git a/target/linux/generic/backport-5.15/080-v5.17-clk-gate-Add-devm_clk_hw_register_gate.patch b/target/linux/generic/backport-5.15/080-v5.17-clk-gate-Add-devm_clk_hw_register_gate.patch
new file mode 100644
index 0000000000..51c23b6e34
--- /dev/null
+++ b/target/linux/generic/backport-5.15/080-v5.17-clk-gate-Add-devm_clk_hw_register_gate.patch
@@ -0,0 +1,105 @@
+From 815f0e738a8d5663a02350e2580706829144a722 Mon Sep 17 00:00:00 2001
+From: Horatiu Vultur <horatiu.vultur@microchip.com>
+Date: Wed, 3 Nov 2021 09:50:59 +0100
+Subject: [PATCH] clk: gate: Add devm_clk_hw_register_gate()
+
+Add devm_clk_hw_register_gate() - devres-managed version of
+clk_hw_register_gate()
+
+Suggested-by: Stephen Boyd <sboyd@kernel.org>
+Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
+Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
+Signed-off-by: Nicolas Ferre <nicolas.ferre@microchip.com>
+Link: https://lore.kernel.org/r/20211103085102.1656081-2-horatiu.vultur@microchip.com
+---
+ drivers/clk/clk-gate.c | 35 +++++++++++++++++++++++++++++++++++
+ include/linux/clk-provider.h | 23 +++++++++++++++++++++++
+ 2 files changed, 58 insertions(+)
+
+--- a/drivers/clk/clk-gate.c
++++ b/drivers/clk/clk-gate.c
+@@ -7,6 +7,7 @@
+ */
+
+ #include <linux/clk-provider.h>
++#include <linux/device.h>
+ #include <linux/module.h>
+ #include <linux/slab.h>
+ #include <linux/io.h>
+@@ -222,3 +223,37 @@ void clk_hw_unregister_gate(struct clk_h
+ kfree(gate);
+ }
+ EXPORT_SYMBOL_GPL(clk_hw_unregister_gate);
++
++static void devm_clk_hw_release_gate(struct device *dev, void *res)
++{
++ clk_hw_unregister_gate(*(struct clk_hw **)res);
++}
++
++struct clk_hw *__devm_clk_hw_register_gate(struct device *dev,
++ struct device_node *np, const char *name,
++ const char *parent_name, const struct clk_hw *parent_hw,
++ const struct clk_parent_data *parent_data,
++ unsigned long flags,
++ void __iomem *reg, u8 bit_idx,
++ u8 clk_gate_flags, spinlock_t *lock)
++{
++ struct clk_hw **ptr, *hw;
++
++ ptr = devres_alloc(devm_clk_hw_release_gate, sizeof(*ptr), GFP_KERNEL);
++ if (!ptr)
++ return ERR_PTR(-ENOMEM);
++
++ hw = __clk_hw_register_gate(dev, np, name, parent_name, parent_hw,
++ parent_data, flags, reg, bit_idx,
++ clk_gate_flags, lock);
++
++ if (!IS_ERR(hw)) {
++ *ptr = hw;
++ devres_add(dev, ptr);
++ } else {
++ devres_free(ptr);
++ }
++
++ return hw;
++}
++EXPORT_SYMBOL_GPL(__devm_clk_hw_register_gate);
+--- a/include/linux/clk-provider.h
++++ b/include/linux/clk-provider.h
+@@ -490,6 +490,13 @@ struct clk_hw *__clk_hw_register_gate(st
+ unsigned long flags,
+ void __iomem *reg, u8 bit_idx,
+ u8 clk_gate_flags, spinlock_t *lock);
++struct clk_hw *__devm_clk_hw_register_gate(struct device *dev,
++ struct device_node *np, const char *name,
++ const char *parent_name, const struct clk_hw *parent_hw,
++ const struct clk_parent_data *parent_data,
++ unsigned long flags,
++ void __iomem *reg, u8 bit_idx,
++ u8 clk_gate_flags, spinlock_t *lock);
+ struct clk *clk_register_gate(struct device *dev, const char *name,
+ const char *parent_name, unsigned long flags,
+ void __iomem *reg, u8 bit_idx,
+@@ -544,6 +551,22 @@ struct clk *clk_register_gate(struct dev
+ __clk_hw_register_gate((dev), NULL, (name), NULL, NULL, (parent_data), \
+ (flags), (reg), (bit_idx), \
+ (clk_gate_flags), (lock))
++/**
++ * devm_clk_hw_register_gate - register a gate clock with the clock framework
++ * @dev: device that is registering this clock
++ * @name: name of this clock
++ * @parent_name: name of this clock's parent
++ * @flags: framework-specific flags for this clock
++ * @reg: register address to control gating of this clock
++ * @bit_idx: which bit in the register controls gating of this clock
++ * @clk_gate_flags: gate-specific flags for this clock
++ * @lock: shared register lock for this clock
++ */
++#define devm_clk_hw_register_gate(dev, name, parent_name, flags, reg, bit_idx,\
++ clk_gate_flags, lock) \
++ __devm_clk_hw_register_gate((dev), NULL, (name), (parent_name), NULL, \
++ NULL, (flags), (reg), (bit_idx), \
++ (clk_gate_flags), (lock))
+ void clk_unregister_gate(struct clk *clk);
+ void clk_hw_unregister_gate(struct clk_hw *hw);
+ int clk_gate_is_enabled(struct clk_hw *hw);