]>
git.ipfire.org Git - people/ms/u-boot.git/blob - include/clk.h
2 * Copyright (c) 2015 Google, Inc
3 * Written by Simon Glass <sjg@chromium.org>
5 * SPDX-License-Identifier: GPL-2.0+
11 int soc_clk_dump(void);
15 * get_rate() - Get current clock rate
17 * @dev: Device to check (UCLASS_CLK)
18 * @return clock rate in Hz, or -ve error code
20 ulong (*get_rate
)(struct udevice
*dev
);
23 * set_rate() - Set current clock rate
25 * @dev: Device to adjust
26 * @rate: New clock rate in Hz
27 * @return new rate, or -ve error code
29 ulong (*set_rate
)(struct udevice
*dev
, ulong rate
);
32 * clk_set_periph_rate() - Set clock rate for a peripheral
34 * @dev: Device to adjust (UCLASS_CLK)
35 * @rate: New clock rate in Hz
36 * @return new clock rate in Hz, or -ve error code
38 ulong (*get_periph_rate
)(struct udevice
*dev
, int periph
);
41 * clk_set_periph_rate() - Set current clock rate for a peripheral
43 * @dev: Device to update (UCLASS_CLK)
44 * @periph: Peripheral ID to cupdate
45 * @return new clock rate in Hz, or -ve error code
47 ulong (*set_periph_rate
)(struct udevice
*dev
, int periph
, ulong rate
);
50 #define clk_get_ops(dev) ((struct clk_ops *)(dev)->driver->ops)
53 * clk_get_rate() - Get current clock rate
55 * @dev: Device to check (UCLASS_CLK)
56 * @return clock rate in Hz, or -ve error code
58 ulong
clk_get_rate(struct udevice
*dev
);
61 * set_rate() - Set current clock rate
63 * @dev: Device to adjust
64 * @rate: New clock rate in Hz
65 * @return new rate, or -ve error code
67 ulong
clk_set_rate(struct udevice
*dev
, ulong rate
);
70 * clk_get_periph_rate() - Get current clock rate for a peripheral
72 * @dev: Device to check (UCLASS_CLK)
73 * @return clock rate in Hz, -ve error code
75 ulong
clk_get_periph_rate(struct udevice
*dev
, int periph
);
78 * clk_set_periph_rate() - Set current clock rate for a peripheral
80 * @dev: Device to update (UCLASS_CLK)
81 * @periph: Peripheral ID to cupdate
82 * @return new clock rate in Hz, or -ve error code
84 ulong
clk_set_periph_rate(struct udevice
*dev
, int periph
, ulong rate
);