mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-22 23:02:27 +07:00
fcaf20360a
Based on 1 normalized pattern(s): the code contained herein is licensed under the gnu general public license you may obtain a copy of the gnu general public license version 2 or later at the following locations http www opensource org licenses gpl license html http www gnu org copyleft gpl html extracted by the scancode license scanner the SPDX license identifier GPL-2.0-or-later has been chosen to replace the boilerplate/reference in 161 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Richard Fontana <rfontana@redhat.com> Reviewed-by: Allison Randal <allison@lohutok.net> Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190527070033.383790741@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
62 lines
1.7 KiB
C
62 lines
1.7 KiB
C
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
/*
|
|
* Copyright 2012 Freescale Semiconductor, Inc.
|
|
*/
|
|
|
|
#ifndef __MXS_CLK_H
|
|
#define __MXS_CLK_H
|
|
|
|
struct clk;
|
|
|
|
#include <linux/clk-provider.h>
|
|
#include <linux/spinlock.h>
|
|
|
|
#define SET 0x4
|
|
#define CLR 0x8
|
|
|
|
extern spinlock_t mxs_lock;
|
|
|
|
int mxs_clk_wait(void __iomem *reg, u8 shift);
|
|
|
|
struct clk *mxs_clk_pll(const char *name, const char *parent_name,
|
|
void __iomem *base, u8 power, unsigned long rate);
|
|
|
|
struct clk *mxs_clk_ref(const char *name, const char *parent_name,
|
|
void __iomem *reg, u8 idx);
|
|
|
|
struct clk *mxs_clk_div(const char *name, const char *parent_name,
|
|
void __iomem *reg, u8 shift, u8 width, u8 busy);
|
|
|
|
struct clk *mxs_clk_frac(const char *name, const char *parent_name,
|
|
void __iomem *reg, u8 shift, u8 width, u8 busy);
|
|
|
|
static inline struct clk *mxs_clk_fixed(const char *name, int rate)
|
|
{
|
|
return clk_register_fixed_rate(NULL, name, NULL, 0, rate);
|
|
}
|
|
|
|
static inline struct clk *mxs_clk_gate(const char *name,
|
|
const char *parent_name, void __iomem *reg, u8 shift)
|
|
{
|
|
return clk_register_gate(NULL, name, parent_name, CLK_SET_RATE_PARENT,
|
|
reg, shift, CLK_GATE_SET_TO_DISABLE,
|
|
&mxs_lock);
|
|
}
|
|
|
|
static inline struct clk *mxs_clk_mux(const char *name, void __iomem *reg,
|
|
u8 shift, u8 width, const char *const *parent_names, int num_parents)
|
|
{
|
|
return clk_register_mux(NULL, name, parent_names, num_parents,
|
|
CLK_SET_RATE_PARENT | CLK_SET_RATE_NO_REPARENT,
|
|
reg, shift, width, 0, &mxs_lock);
|
|
}
|
|
|
|
static inline struct clk *mxs_clk_fixed_factor(const char *name,
|
|
const char *parent_name, unsigned int mult, unsigned int div)
|
|
{
|
|
return clk_register_fixed_factor(NULL, name, parent_name,
|
|
CLK_SET_RATE_PARENT, mult, div);
|
|
}
|
|
|
|
#endif /* __MXS_CLK_H */
|