Tom Rini | dec7ea0 | 2024-05-20 13:35:03 -0600 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 2 | /* |
| 3 | * (C) Copyright 2022 - Analog Devices, Inc. |
| 4 | * |
| 5 | * Written and/or maintained by Timesys Corporation |
| 6 | * |
| 7 | * Author: Greg Malysa <greg.malysa@timesys.com> |
| 8 | */ |
| 9 | |
| 10 | #include "clk.h" |
| 11 | |
| 12 | static ulong adi_get_rate(struct clk *clk) |
| 13 | { |
| 14 | struct clk *c; |
| 15 | int ret; |
| 16 | |
| 17 | ret = clk_get_by_id(clk->id, &c); |
| 18 | if (ret) |
| 19 | return ret; |
| 20 | |
| 21 | return clk_get_rate(c); |
| 22 | } |
| 23 | |
| 24 | static ulong adi_set_rate(struct clk *clk, ulong rate) |
| 25 | { |
| 26 | //Not yet implemented |
| 27 | return 0; |
| 28 | } |
| 29 | |
| 30 | static int adi_enable(struct clk *clk) |
| 31 | { |
| 32 | //Not yet implemented |
| 33 | return 0; |
| 34 | } |
| 35 | |
| 36 | static int adi_disable(struct clk *clk) |
| 37 | { |
| 38 | //Not yet implemented |
| 39 | return 0; |
| 40 | } |
| 41 | |
| 42 | const struct clk_ops adi_clk_ops = { |
| 43 | .set_rate = adi_set_rate, |
| 44 | .get_rate = adi_get_rate, |
| 45 | .enable = adi_enable, |
| 46 | .disable = adi_disable, |
| 47 | }; |
| 48 | |