display: msm: sde: Add display cooling device interface

Add display cooling device interface, which will enable to register a
cooling device and send a blocking notifier call when there is a new
mitigation request.

Change-Id: I59e4a7190f637fba7f63e47ff495242718cc3c9b
Signed-off-by: Ram Chandrasekar <rkumbako@codeaurora.org>
This commit is contained in:
Ram Chandrasekar
2020-04-03 15:58:02 -07:00
committed by Gerrit - the friendly Code Review server
parent 4b24ccb9d8
commit 132fd3941e
3 changed files with 127 additions and 0 deletions

37
msm/msm_cooling_device.h Normal file
View File

@@ -0,0 +1,37 @@
/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Copyright (c) 2020, The Linux Foundation. All rights reserved.
*/
#ifndef __SDE_THERMAL_CORE_H__
#define __SDE_THERMAL_CORE_H__
#include <linux/device.h>
#include <linux/backlight.h>
#include <linux/thermal.h>
#include <linux/notifier.h>
struct sde_cdev {
struct blocking_notifier_head notifier_head;
struct thermal_cooling_device *cdev;
struct backlight_device *bd;
unsigned long thermal_state;
};
#ifdef CONFIG_THERMAL_OF
struct sde_cdev *backlight_cdev_register(struct device *dev,
struct backlight_device *bd,
struct notifier_block *n);
void backlight_cdev_unregister(struct sde_cdev *cdev);
#else
static inline struct sde_cdev *
backlight_cdev_register(struct device *dev,
struct backlight_device *bd, struct notifier_block *n)
{
return NULL;
}
static inline void backlight_cdev_unregister(struct sde_cdev *cdev)
{ }
#endif
#endif