enum isp_cooling_property {
GET_LEVEL,
- GET_FREQ,
+ GET_FPS,
GET_MAXL,
};
}
i = 0;
+ level = (int)input;
isp_fps_for_each_valid_entry(pos, table) {
/* ignore duplicate entry */
if (fps == pos->fps)
*output = descend ? i : (max_level - i);
return 0;
}
- if (property == GET_FREQ && level == i) {
+ if (property == GET_FPS && level == i) {
/* get fps by level */
*output = fps;
return 0;
}
EXPORT_SYMBOL_GPL(isp_cooling_get_level);
+/**
+ * isp_cooling_get_fps - for a give isp, return the fps value corresponding to cooling level.
+ * @isp: isp for which the level is required
+ * @level: the cooling level
+ *
+ * This function will match the fps value corresponding to the
+ * requested @level and return it.
+ *
+ * Return: The matched fps value on success or ISP_FPS_INVALID otherwise.
+ */
+unsigned long isp_cooling_get_fps(unsigned int isp, unsigned long level)
+{
+ unsigned int val;
+
+ if (get_property(isp, level, &val, GET_FPS))
+ return ISP_FPS_INVALID;
+
+ return (unsigned long)val;
+}
+
/**
* isp_apply_cooling - function to apply fps clipping.
* @isp_device: isp_cooling_device pointer containing fps
#include <linux/thermal.h>
#include <linux/cpumask.h>
+#define ISP_FPS_INVALID ~1
+
#ifdef CONFIG_ISP_THERMAL
#define ISP_FPS_ENTRY_INVALID ~0
void isp_cooling_unregister(struct thermal_cooling_device *cdev);
unsigned long isp_cooling_get_level(unsigned int isp, unsigned int fps);
+unsigned long isp_cooling_get_fps(unsigned int isp, unsigned long level);
#else /* !CONFIG_GPU_THERMAL */
static inline struct thermal_cooling_device *
isp_cooling_register(const struct cpumask *clip_gpus)
{
return THERMAL_CSTATE_INVALID;
}
+static inline
+unsigned long isp_cooling_get_fps(unsigned int isp, unsigned long level)
+{
+ return ISP_FPS_INVALID;
+}
#endif /* CONFIG_ISP_THERMAL */
#endif /* __ISP_COOLING_H__ */