mirror of
https://github.com/rd-stuffs/msm-4.14.git
synced 2025-02-20 11:45:48 +08:00
thermal: core: Use qcom drm notifier
Change-Id: Ib184c28c0441847399df567466a04b48b9b68c46 Signed-off-by: azrim <mirzaspc@gmail.com>
This commit is contained in:
parent
9e53ddbe20
commit
df79851c17
@ -28,7 +28,7 @@
|
||||
#include <linux/cpu_cooling.h>
|
||||
|
||||
#ifdef CONFIG_DRM
|
||||
#include <drm/drm_notifier.h>
|
||||
#include <linux/msm_drm_notify.h>
|
||||
#endif
|
||||
|
||||
#define CREATE_TRACE_POINTS
|
||||
@ -1840,25 +1840,21 @@ static void destroy_thermal_message_node(void)
|
||||
#ifdef CONFIG_DRM
|
||||
static int screen_state_for_thermal_callback(struct notifier_block *nb, unsigned long val, void *data)
|
||||
{
|
||||
struct drm_notify_data *evdata = data;
|
||||
struct msm_drm_notifier *evdata = data;
|
||||
unsigned int blank;
|
||||
|
||||
if (val != DRM_EVENT_BLANK || !evdata || !evdata->data)
|
||||
if (val != MSM_DRM_EVENT_BLANK || !evdata || !evdata->data)
|
||||
return 0;
|
||||
|
||||
blank = *(int *)(evdata->data);
|
||||
switch (blank) {
|
||||
case DRM_BLANK_LP1:
|
||||
pr_warn("%s: DRM_BLANK_LP1\n", __func__);
|
||||
case DRM_BLANK_LP2:
|
||||
pr_warn("%s: DRM_BLANK_LP2\n", __func__);
|
||||
case DRM_BLANK_POWERDOWN:
|
||||
case MSM_DRM_BLANK_POWERDOWN:
|
||||
sm.screen_state = 0;
|
||||
pr_warn("%s: DRM_BLANK_POWERDOWN\n", __func__);
|
||||
pr_warn("%s: MSM_DRM_BLANK_POWERDOWN\n", __func__);
|
||||
break;
|
||||
case DRM_BLANK_UNBLANK:
|
||||
case MSM_DRM_BLANK_UNBLANK:
|
||||
sm.screen_state = 1;
|
||||
pr_warn("%s: DRM_BLANK_UNBLANK\n", __func__);
|
||||
pr_warn("%s: MSM_DRM_BLANK_UNBLANK\n", __func__);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@ -1929,7 +1925,7 @@ static int __init thermal_init(void)
|
||||
|
||||
#ifdef CONFIG_DRM
|
||||
sm.thermal_notifier.notifier_call = screen_state_for_thermal_callback;
|
||||
if (drm_register_client(&sm.thermal_notifier) < 0) {
|
||||
if (msm_drm_register_client(&sm.thermal_notifier) < 0) {
|
||||
pr_warn("Thermal: register screen state callback failed\n");
|
||||
}
|
||||
#endif
|
||||
@ -1954,7 +1950,7 @@ error:
|
||||
static void thermal_exit(void)
|
||||
{
|
||||
#ifdef CONFIG_DRM
|
||||
drm_unregister_client(&sm.thermal_notifier);
|
||||
msm_drm_unregister_client(&sm.thermal_notifier);
|
||||
#endif
|
||||
unregister_pm_notifier(&thermal_pm_nb);
|
||||
of_thermal_destroy_zones();
|
||||
|
Loading…
x
Reference in New Issue
Block a user