1 /* SPDX-License-Identifier: GPL-2.0+ */ 2 /* 3 * (C) Copyright 2018 Rockchip Electronics Co., Ltd 4 */ 5 6 #ifndef _DVFS_H_ 7 #define _DVFS_H_ 8 9 #include <dm.h> 10 11 /** 12 * dvfs_init() - init first dvfs driver 13 * 14 * @apply: do dvfs policy apply if true, otherwise just init. 15 * @return 0 if OK, 1 on error 16 */ 17 int dvfs_init(bool apply); 18 19 /** 20 * dvfs_apply() - do dvfs policy apply 21 * 22 * @dev: dvfs device 23 * @return 0 if OK, otherwise on error 24 */ 25 int dvfs_apply(struct udevice *dev); 26 27 /** 28 * dvfs_repeat_apply() - do dvfs policy repeat apply 29 * 30 * @dev: dvfs device 31 * @return 0 if OK, otherwise on error 32 */ 33 int dvfs_repeat_apply(struct udevice *dev); 34 35 /** 36 * struct dm_dvfs_ops - Driver model Thermal operations 37 * 38 * The uclass interface is implemented by all Thermal devices which use 39 * driver model. 40 */ 41 42 struct dm_dvfs_ops { 43 int (*apply)(struct udevice *dev); 44 int (*repeat_apply)(struct udevice *dev); 45 }; 46 47 #endif /* _DVFS_H_ */ 48