Padmarao Begari | 0c4ae80 | 2021-01-15 08:20:38 +0530 | [diff] [blame] | 1 | /* 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 Schuchardt | 47b4c02 | 2022-01-19 18:05:50 +0100 | [diff] [blame] | 16 | * Return: zero on success, or a negative error code. |
Padmarao Begari | 0c4ae80 | 2021-01-15 08:20:38 +0530 | [diff] [blame] | 17 | */ |
| 18 | int 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 Schuchardt | 47b4c02 | 2022-01-19 18:05:50 +0100 | [diff] [blame] | 26 | * Return: zero on success, or a negative error code. |
Padmarao Begari | 0c4ae80 | 2021-01-15 08:20:38 +0530 | [diff] [blame] | 27 | */ |
| 28 | int 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 Schuchardt | 47b4c02 | 2022-01-19 18:05:50 +0100 | [diff] [blame] | 38 | * Return: divider value on success, or a negative error code. |
Padmarao Begari | 0c4ae80 | 2021-01-15 08:20:38 +0530 | [diff] [blame] | 39 | */ |
| 40 | int 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 */ |