blob: d4cc90da004a2597952f7dfeadf3f6c149ded9da [file] [log] [blame]
Gabriel Fernandez8aac3072020-10-13 09:36:25 +02001/*
2 * Copyright (c) 2021, STMicroelectronics - All Rights Reserved
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#ifndef CLK_H
8#define CLK_H
9
10#include <stdbool.h>
11
12struct clk_ops {
13 int (*enable)(unsigned long id);
14 void (*disable)(unsigned long id);
15 unsigned long (*get_rate)(unsigned long id);
16 int (*get_parent)(unsigned long id);
Ghennadi Procopciuc52f8b012024-06-03 09:16:41 +030017 int (*set_parent)(unsigned long id, unsigned long parent_id);
Gabriel Fernandez8aac3072020-10-13 09:36:25 +020018 bool (*is_enabled)(unsigned long id);
19};
20
21int clk_enable(unsigned long id);
22void clk_disable(unsigned long id);
23unsigned long clk_get_rate(unsigned long id);
24bool clk_is_enabled(unsigned long id);
25int clk_get_parent(unsigned long id);
Ghennadi Procopciuc52f8b012024-06-03 09:16:41 +030026int clk_set_parent(unsigned long id, unsigned long parent_id);
Gabriel Fernandez8aac3072020-10-13 09:36:25 +020027
28void clk_register(const struct clk_ops *ops);
29
30#endif /* CLK_H */