aboutsummaryrefslogtreecommitdiff
path: root/drivers/clk/intel/clk_intel.c
blob: 46ccbb1d834d28458bfd37cab709ed240bb24635 (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
29
30
31
32
33
34
35
36
37
// SPDX-License-Identifier: GPL-2.0+
/*
 * Copyright 2019 Google LLC
 * Written by Simon Glass <sjg@chromium.org>
 */

#include <common.h>
#include <dm.h>
#include <clk-uclass.h>
#include <dt-bindings/clock/intel-clock.h>

static ulong intel_clk_get_rate(struct clk *clk)
{
	switch (clk->id) {
	case CLK_I2C:
		/* Hard-coded to 133MHz on current platforms */
		return 133333333;
	default:
		return -ENODEV;
	}
}

static struct clk_ops intel_clk_ops = {
	.get_rate	= intel_clk_get_rate,
};

static const struct udevice_id intel_clk_ids[] = {
	{ .compatible = "intel,apl-clk" },
	{ }
};

U_BOOT_DRIVER(intel_apl_clk) = {
	.name		= "intel_apl_clk",
	.id		= UCLASS_CLK,
	.of_match	= intel_clk_ids,
	.ops		= &intel_clk_ops,
};