]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
clk: thead: th1520-ap: Add macro to define multiplexers with flags
authorYao Zi <ziyao@disroot.org>
Thu, 20 Nov 2025 13:14:14 +0000 (13:14 +0000)
committerDrew Fustini <fustini@kernel.org>
Thu, 18 Dec 2025 19:15:43 +0000 (11:15 -0800)
The new macro, TH_CCU_MUX_FLAGS, extends TH_CCU_MUX macro by adding two
parameters to specify clock flags and multiplexer flags.

Reviewed-by: Drew Fustini <fustini@kernel.org>
Signed-off-by: Yao Zi <ziyao@disroot.org>
Signed-off-by: Drew Fustini <fustini@kernel.org>
drivers/clk/thead/clk-th1520-ap.c

index bf8e80c39a9ed21e526f5fc48234538e473d4bbf..79f001a047b2c86c9259a463bb26885eb5dcb755 100644 (file)
@@ -101,17 +101,22 @@ struct ccu_pll {
                .flags  = _flags,                                       \
        }
 
-#define TH_CCU_MUX(_name, _parents, _shift, _width)                    \
+#define TH_CCU_MUX_FLAGS(_name, _parents, _shift, _width, _flags,      \
+                        _mux_flags)                                    \
        {                                                               \
                .mask           = GENMASK(_width - 1, 0),               \
                .shift          = _shift,                               \
+               .flags          = _mux_flags,                           \
                .hw.init        = CLK_HW_INIT_PARENTS_DATA(             \
                                        _name,                          \
                                        _parents,                       \
                                        &clk_mux_ops,                   \
-                                       0),                             \
+                                       _flags),                        \
        }
 
+#define TH_CCU_MUX(_name, _parents, _shift, _width)                    \
+       TH_CCU_MUX_FLAGS(_name, _parents, _shift, _width, 0, 0)
+
 #define CCU_GATE(_clkid, _struct, _name, _parent, _reg, _bit, _flags)  \
        struct ccu_gate _struct = {                                     \
                .clkid  = _clkid,                                       \