2 * Copyright (C) 2015 Thomas Chou <thomas@wytron.com.tw>
4 * SPDX-License-Identifier: GPL-2.0+
11 * timer_conv_64 - convert 32-bit counter value to 64-bit
13 * @count: 32-bit counter value
14 * @return: 64-bit counter value
16 u64 timer_conv_64(u32 count);
19 * Get the current timer count
21 * @dev: The timer device
22 * @count: pointer that returns the current timer count
23 * @return: 0 if OK, -ve on error
25 int timer_get_count(struct udevice *dev, u64 *count);
28 * Get the timer input clock frequency
30 * @dev: The timer device
31 * @return: the timer input clock frequency
33 unsigned long timer_get_rate(struct udevice *dev);
36 * struct timer_ops - Driver model timer operations
38 * The uclass interface is implemented by all timer devices which use
43 * Get the current timer count
45 * @dev: The timer device
46 * @count: pointer that returns the current 64-bit timer count
47 * @return: 0 if OK, -ve on error
49 int (*get_count)(struct udevice *dev, u64 *count);
53 * struct timer_dev_priv - information about a device used by the uclass
55 * @clock_rate: the timer input clock frequency
57 struct timer_dev_priv {
58 unsigned long clock_rate;
61 #endif /* _TIMER_H_ */