1847c6bc8SGabriel Fernandez /* 2847c6bc8SGabriel Fernandez * Copyright (c) 2021, STMicroelectronics - All Rights Reserved 3847c6bc8SGabriel Fernandez * 4847c6bc8SGabriel Fernandez * SPDX-License-Identifier: BSD-3-Clause 5847c6bc8SGabriel Fernandez */ 6847c6bc8SGabriel Fernandez 7847c6bc8SGabriel Fernandez #ifndef CLK_H 8847c6bc8SGabriel Fernandez #define CLK_H 9847c6bc8SGabriel Fernandez 10847c6bc8SGabriel Fernandez #include <stdbool.h> 11847c6bc8SGabriel Fernandez 12847c6bc8SGabriel Fernandez struct clk_ops { 13847c6bc8SGabriel Fernandez int (*enable)(unsigned long id); 14847c6bc8SGabriel Fernandez void (*disable)(unsigned long id); 15847c6bc8SGabriel Fernandez unsigned long (*get_rate)(unsigned long id); 16847c6bc8SGabriel Fernandez int (*get_parent)(unsigned long id); 17*a2c6016fSGhennadi Procopciuc int (*set_parent)(unsigned long id, unsigned long parent_id); 18847c6bc8SGabriel Fernandez bool (*is_enabled)(unsigned long id); 19847c6bc8SGabriel Fernandez }; 20847c6bc8SGabriel Fernandez 21847c6bc8SGabriel Fernandez int clk_enable(unsigned long id); 22847c6bc8SGabriel Fernandez void clk_disable(unsigned long id); 23847c6bc8SGabriel Fernandez unsigned long clk_get_rate(unsigned long id); 24847c6bc8SGabriel Fernandez bool clk_is_enabled(unsigned long id); 25847c6bc8SGabriel Fernandez int clk_get_parent(unsigned long id); 26*a2c6016fSGhennadi Procopciuc int clk_set_parent(unsigned long id, unsigned long parent_id); 27847c6bc8SGabriel Fernandez 28847c6bc8SGabriel Fernandez void clk_register(const struct clk_ops *ops); 29847c6bc8SGabriel Fernandez 30847c6bc8SGabriel Fernandez #endif /* CLK_H */ 31