blob: 72288cc971b25ecb9d8450bb068d64c852986239 [file] [log] [blame]
Padmarao Begari0c4ae802021-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.
Conor Dooley4a182e02022-10-25 08:58:45 +010014 * @parent: a pointer to parent clock.
Heinrich Schuchardt47b4c022022-01-19 18:05:50 +010015 * Return: zero on success, or a negative error code.
Padmarao Begari0c4ae802021-01-15 08:20:38 +053016 */
Conor Dooley4a182e02022-10-25 08:58:45 +010017int mpfs_clk_register_cfgs(void __iomem *base, struct clk *parent);
Padmarao Begari0c4ae802021-01-15 08:20:38 +053018/**
Conor Dooleyd4bbef02022-10-25 08:58:46 +010019 * mpfs_clk_register_msspll() - register the mss pll
20 *
21 * @base: base address of the mpfs system register.
22 * @parent: a pointer to parent clock.
23 * Return: zero on success, or a negative error code.
24 */
25int mpfs_clk_register_msspll(void __iomem *base, struct clk *parent);
26/**
Padmarao Begari0c4ae802021-01-15 08:20:38 +053027 * mpfs_clk_register_periphs() - register peripheral clocks
28 *
29 * @base: base address of the mpfs system register.
Conor Dooley73a1d602022-10-25 08:58:47 +010030 * @dev: udevice representing the clock controller.
Heinrich Schuchardt47b4c022022-01-19 18:05:50 +010031 * Return: zero on success, or a negative error code.
Padmarao Begari0c4ae802021-01-15 08:20:38 +053032 */
Conor Dooley73a1d602022-10-25 08:58:47 +010033int mpfs_clk_register_periphs(void __iomem *base, struct udevice *dev);
Padmarao Begari0c4ae802021-01-15 08:20:38 +053034/**
35 * divider_get_val() - get the clock divider value
36 *
37 * @rate: requested clock rate.
38 * @parent_rate: parent clock rate.
39 * @table: a pointer to clock divider table.
40 * @width: width of the divider bit field.
41 * @flags: common clock framework flags.
Heinrich Schuchardt47b4c022022-01-19 18:05:50 +010042 * Return: divider value on success, or a negative error code.
Padmarao Begari0c4ae802021-01-15 08:20:38 +053043 */
44int divider_get_val(unsigned long rate, unsigned long parent_rate,
45 const struct clk_div_table *table,
46 u8 width, unsigned long flags);
47
48#endif /* __MICROCHIP_MPFS_CLK_H */