xref: /openbmc/u-boot/drivers/clk/at91/clk-master.c (revision e8f80a5a)
1 // SPDX-License-Identifier: GPL-2.0+
2 /*
3  * Copyright (C) 2016 Atmel Corporation
4  *               Wenyou.Yang <wenyou.yang@atmel.com>
5  */
6 
7 #include <common.h>
8 #include <clk-uclass.h>
9 #include <dm.h>
10 
11 DECLARE_GLOBAL_DATA_PTR;
12 
at91_master_clk_get_rate(struct clk * clk)13 static ulong at91_master_clk_get_rate(struct clk *clk)
14 {
15 	return gd->arch.mck_rate_hz;
16 }
17 
18 static struct clk_ops at91_master_clk_ops = {
19 	.get_rate = at91_master_clk_get_rate,
20 };
21 
22 static const struct udevice_id at91_master_clk_match[] = {
23 	{ .compatible = "atmel,at91rm9200-clk-master" },
24 	{ .compatible = "atmel,at91sam9x5-clk-master" },
25 	{}
26 };
27 
28 U_BOOT_DRIVER(at91_master_clk) = {
29 	.name = "at91-master-clk",
30 	.id = UCLASS_CLK,
31 	.of_match = at91_master_clk_match,
32 	.ops = &at91_master_clk_ops,
33 };
34