Skip to content

Commit 01d5bea

Browse files
abelvesaShawn Guo
authored andcommitted
clk: imx: Add helpers for passing the device as argument
All the imx clocks that need to be registered by the audiomix need to pass on the device so that the runtime PM support could work properly. Signed-off-by: Abel Vesa <[email protected]> Reviewed-by: Stephen Boyd <[email protected]> Reviewed-by: Peng Fan <[email protected]> Signed-off-by: Shawn Guo <[email protected]>
1 parent 55a8b3c commit 01d5bea

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

drivers/clk/imx/clk.h

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,13 @@ static inline struct clk_hw *imx_clk_hw_gate(const char *name, const char *paren
319319
shift, 0, &imx_ccm_lock);
320320
}
321321

322+
static inline struct clk_hw *imx_dev_clk_hw_gate(struct device *dev, const char *name,
323+
const char *parent, void __iomem *reg, u8 shift)
324+
{
325+
return clk_hw_register_gate(dev, name, parent, CLK_SET_RATE_PARENT, reg,
326+
shift, 0, &imx_ccm_lock);
327+
}
328+
322329
static inline struct clk_hw *imx_clk_hw_gate_dis(const char *name, const char *parent,
323330
void __iomem *reg, u8 shift)
324331
{
@@ -431,6 +438,15 @@ static inline struct clk_hw *imx_clk_hw_mux(const char *name, void __iomem *reg,
431438
width, 0, &imx_ccm_lock);
432439
}
433440

441+
static inline struct clk_hw *imx_dev_clk_hw_mux(struct device *dev,
442+
const char *name, void __iomem *reg, u8 shift,
443+
u8 width, const char * const *parents, int num_parents)
444+
{
445+
return clk_hw_register_mux(dev, name, parents, num_parents,
446+
CLK_SET_RATE_NO_REPARENT | CLK_SET_PARENT_GATE,
447+
reg, shift, width, 0, &imx_ccm_lock);
448+
}
449+
434450
static inline struct clk *imx_clk_mux2(const char *name, void __iomem *reg,
435451
u8 shift, u8 width, const char * const *parents,
436452
int num_parents)
@@ -493,6 +509,19 @@ static inline struct clk_hw *imx_clk_hw_mux_flags(const char *name,
493509
reg, shift, width, 0, &imx_ccm_lock);
494510
}
495511

512+
static inline struct clk_hw *imx_dev_clk_hw_mux_flags(struct device *dev,
513+
const char *name,
514+
void __iomem *reg, u8 shift,
515+
u8 width,
516+
const char * const *parents,
517+
int num_parents,
518+
unsigned long flags)
519+
{
520+
return clk_hw_register_mux(dev, name, parents, num_parents,
521+
flags | CLK_SET_RATE_NO_REPARENT,
522+
reg, shift, width, 0, &imx_ccm_lock);
523+
}
524+
496525
struct clk_hw *imx_clk_hw_cpu(const char *name, const char *parent_name,
497526
struct clk *div, struct clk *mux, struct clk *pll,
498527
struct clk *step);

0 commit comments

Comments
 (0)