blob: b8ad3ea761676195e72cbf93a245ef05082276da [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>
Conor Dooley54713d62024-10-23 11:17:52 +010010#include <regmap.h>
Padmarao Begari0c4ae802021-01-15 08:20:38 +053011/**
12 * mpfs_clk_register_cfgs() - register configuration clocks
13 *
14 * @base: base address of the mpfs system register.
Conor Dooley4a182e02022-10-25 08:58:45 +010015 * @parent: a pointer to parent clock.
Heinrich Schuchardt47b4c022022-01-19 18:05:50 +010016 * Return: zero on success, or a negative error code.
Padmarao Begari0c4ae802021-01-15 08:20:38 +053017 */
Conor Dooley54713d62024-10-23 11:17:52 +010018int mpfs_clk_register_cfgs(struct clk *parent, struct regmap *regmap);
Padmarao Begari0c4ae802021-01-15 08:20:38 +053019/**
Conor Dooleyd4bbef02022-10-25 08:58:46 +010020 * mpfs_clk_register_msspll() - register the mss pll
21 *
22 * @base: base address of the mpfs system register.
23 * @parent: a pointer to parent clock.
24 * Return: zero on success, or a negative error code.
25 */
26int mpfs_clk_register_msspll(void __iomem *base, struct clk *parent);
27/**
Padmarao Begari0c4ae802021-01-15 08:20:38 +053028 * mpfs_clk_register_periphs() - register peripheral clocks
29 *
30 * @base: base address of the mpfs system register.
Conor Dooley73a1d602022-10-25 08:58:47 +010031 * @dev: udevice representing the clock controller.
Heinrich Schuchardt47b4c022022-01-19 18:05:50 +010032 * Return: zero on success, or a negative error code.
Padmarao Begari0c4ae802021-01-15 08:20:38 +053033 */
Conor Dooley54713d62024-10-23 11:17:52 +010034int mpfs_clk_register_periphs(struct udevice *dev, struct regmap *regmap);
Padmarao Begari0c4ae802021-01-15 08:20:38 +053035/**
36 * divider_get_val() - get the clock divider value
37 *
38 * @rate: requested clock rate.
39 * @parent_rate: parent clock rate.
40 * @table: a pointer to clock divider table.
41 * @width: width of the divider bit field.
42 * @flags: common clock framework flags.
Heinrich Schuchardt47b4c022022-01-19 18:05:50 +010043 * Return: divider value on success, or a negative error code.
Padmarao Begari0c4ae802021-01-15 08:20:38 +053044 */
45int divider_get_val(unsigned long rate, unsigned long parent_rate,
46 const struct clk_div_table *table,
47 u8 width, unsigned long flags);
48
49#endif /* __MICROCHIP_MPFS_CLK_H */