blob: 442562a5e7bfbf42bdbb53bfbf96cd8afe1414cf [file] [log] [blame]
Padmarao Begari2f27c922021-01-15 08:20:38 +05301/* SPDX-License-Identifier: GPL-2.0+ */
2/*
3 * Copyright (C) 2020 Microchip Technology Inc.
4 * Padmarao Begari <padmarao.begari@microchip.com>
5 */
6#ifndef __MICROCHIP_MPFS_CLK_H
7#define __MICROCHIP_MPFS_CLK_H
8
9#include <linux/clk-provider.h>
10/**
11 * mpfs_clk_register_cfgs() - register configuration clocks
12 *
13 * @base: base address of the mpfs system register.
14 * @clk_rate: the mpfs pll clock rate.
15 * @parent_name: a pointer to parent clock name.
Heinrich Schuchardt185f8122022-01-19 18:05:50 +010016 * Return: zero on success, or a negative error code.
Padmarao Begari2f27c922021-01-15 08:20:38 +053017 */
18int mpfs_clk_register_cfgs(void __iomem *base, u32 clk_rate,
19 const char *parent_name);
20/**
21 * mpfs_clk_register_periphs() - register peripheral clocks
22 *
23 * @base: base address of the mpfs system register.
24 * @clk_rate: the mpfs pll clock rate.
25 * @parent_name: a pointer to parent clock name.
Heinrich Schuchardt185f8122022-01-19 18:05:50 +010026 * Return: zero on success, or a negative error code.
Padmarao Begari2f27c922021-01-15 08:20:38 +053027 */
28int mpfs_clk_register_periphs(void __iomem *base, u32 clk_rate,
29 const char *parent_name);
30/**
31 * divider_get_val() - get the clock divider value
32 *
33 * @rate: requested clock rate.
34 * @parent_rate: parent clock rate.
35 * @table: a pointer to clock divider table.
36 * @width: width of the divider bit field.
37 * @flags: common clock framework flags.
Heinrich Schuchardt185f8122022-01-19 18:05:50 +010038 * Return: divider value on success, or a negative error code.
Padmarao Begari2f27c922021-01-15 08:20:38 +053039 */
40int divider_get_val(unsigned long rate, unsigned long parent_rate,
41 const struct clk_div_table *table,
42 u8 width, unsigned long flags);
43
44#endif /* __MICROCHIP_MPFS_CLK_H */