Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Wenyou Yang | 8c772bd | 2016-07-20 17:55:12 +0800 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (C) 2016 Atmel Corporation |
| 4 | * Wenyou.Yang <wenyou.yang@atmel.com> |
Wenyou Yang | 8c772bd | 2016-07-20 17:55:12 +0800 | [diff] [blame] | 5 | */ |
| 6 | |
| 7 | #include <common.h> |
| 8 | #include <clk-uclass.h> |
Simon Glass | 11c89f3 | 2017-05-17 17:18:03 -0600 | [diff] [blame] | 9 | #include <dm.h> |
Wenyou Yang | 8c772bd | 2016-07-20 17:55:12 +0800 | [diff] [blame] | 10 | |
| 11 | static int at91_slow_clk_enable(struct clk *clk) |
| 12 | { |
| 13 | return 0; |
| 14 | } |
| 15 | |
| 16 | static ulong at91_slow_clk_get_rate(struct clk *clk) |
| 17 | { |
| 18 | return CONFIG_SYS_AT91_SLOW_CLOCK; |
| 19 | } |
| 20 | |
| 21 | static struct clk_ops at91_slow_clk_ops = { |
| 22 | .enable = at91_slow_clk_enable, |
| 23 | .get_rate = at91_slow_clk_get_rate, |
| 24 | }; |
| 25 | |
| 26 | static const struct udevice_id at91_slow_clk_match[] = { |
| 27 | { .compatible = "atmel,at91sam9x5-clk-slow" }, |
| 28 | {} |
| 29 | }; |
| 30 | |
| 31 | U_BOOT_DRIVER(at91_slow_clk) = { |
| 32 | .name = "at91-slow-clk", |
| 33 | .id = UCLASS_CLK, |
| 34 | .of_match = at91_slow_clk_match, |
| 35 | .ops = &at91_slow_clk_ops, |
| 36 | }; |