]>
git.ipfire.org Git - people/ms/u-boot.git/blob - drivers/clk/clk-uclass.c
2 * Copyright (C) 2015 Google, Inc
3 * Written by Simon Glass <sjg@chromium.org>
5 * SPDX-License-Identifier: GPL-2.0+
15 ulong
clk_get_rate(struct udevice
*dev
)
17 struct clk_ops
*ops
= clk_get_ops(dev
);
22 return ops
->get_rate(dev
);
25 ulong
clk_set_rate(struct udevice
*dev
, ulong rate
)
27 struct clk_ops
*ops
= clk_get_ops(dev
);
32 return ops
->set_rate(dev
, rate
);
35 ulong
clk_get_periph_rate(struct udevice
*dev
, int periph
)
37 struct clk_ops
*ops
= clk_get_ops(dev
);
39 if (!ops
->get_periph_rate
)
42 return ops
->get_periph_rate(dev
, periph
);
45 ulong
clk_set_periph_rate(struct udevice
*dev
, int periph
, ulong rate
)
47 struct clk_ops
*ops
= clk_get_ops(dev
);
49 if (!ops
->set_periph_rate
)
52 return ops
->set_periph_rate(dev
, periph
, rate
);
55 UCLASS_DRIVER(clk
) = {