summaryrefslogtreecommitdiffstats
path: root/include/drivers/clk.h
blob: a18f41ffca632e9b8abc899898fa4f34605e8a55 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/*
 * Copyright (c) 2021, STMicroelectronics - All Rights Reserved
 *
 * SPDX-License-Identifier: BSD-3-Clause
 */

#ifndef CLK_H
#define CLK_H

#include <stdbool.h>

struct clk_ops {
	int (*enable)(unsigned long id);
	void (*disable)(unsigned long id);
	unsigned long (*get_rate)(unsigned long id);
	int (*get_parent)(unsigned long id);
	bool (*is_enabled)(unsigned long id);
};

int clk_enable(unsigned long id);
void clk_disable(unsigned long id);
unsigned long clk_get_rate(unsigned long id);
bool clk_is_enabled(unsigned long id);
int clk_get_parent(unsigned long id);

void clk_register(const struct clk_ops *ops);

#endif /* CLK_H */