mirror of
https://github.com/torvalds/linux.git
synced 2026-06-08 14:42:37 +02:00
soc: rockchip: system_monitor: Add fb notifier
Change-Id: I8c3f2f145bb0c99d5aa8c28422606a6af1a82b09 Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
This commit is contained in:
parent
72b246bef0
commit
267d231cec
|
|
@ -25,7 +25,6 @@
|
|||
#include <linux/devfreq.h>
|
||||
#include <linux/devfreq_cooling.h>
|
||||
#include <linux/devfreq-event.h>
|
||||
#include <linux/fb.h>
|
||||
#include <linux/input.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/irq.h>
|
||||
|
|
@ -1116,7 +1115,6 @@ struct rockchip_dmcfreq {
|
|||
struct dram_timing *timing;
|
||||
struct regulator *vdd_center;
|
||||
struct notifier_block status_nb;
|
||||
struct notifier_block fb_nb;
|
||||
struct list_head video_info_list;
|
||||
struct freq_map_table *vop_bw_tbl;
|
||||
struct work_struct boost_work;
|
||||
|
|
@ -2830,37 +2828,6 @@ static int rockchip_dmcfreq_system_status_notifier(struct notifier_block *nb,
|
|||
return NOTIFY_OK;
|
||||
}
|
||||
|
||||
static int rockchip_dmcfreq_fb_notifier(struct notifier_block *nb,
|
||||
unsigned long action, void *ptr)
|
||||
{
|
||||
struct fb_event *event = ptr;
|
||||
|
||||
switch (action) {
|
||||
case FB_EARLY_EVENT_BLANK:
|
||||
switch (*((int *)event->data)) {
|
||||
case FB_BLANK_UNBLANK:
|
||||
rockchip_clear_system_status(SYS_STATUS_SUSPEND);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case FB_EVENT_BLANK:
|
||||
switch (*((int *)event->data)) {
|
||||
case FB_BLANK_POWERDOWN:
|
||||
rockchip_set_system_status(SYS_STATUS_SUSPEND);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return NOTIFY_OK;
|
||||
}
|
||||
|
||||
static ssize_t rockchip_dmcfreq_status_show(struct device *dev,
|
||||
struct device_attribute *attr,
|
||||
char *buf)
|
||||
|
|
@ -3411,11 +3378,6 @@ static void rockchip_dmcfreq_register_notifier(struct rockchip_dmcfreq *dmcfreq)
|
|||
if (ret)
|
||||
dev_err(dmcfreq->dev, "failed to register system_status nb\n");
|
||||
|
||||
dmcfreq->fb_nb.notifier_call = rockchip_dmcfreq_fb_notifier;
|
||||
ret = fb_register_client(&dmcfreq->fb_nb);
|
||||
if (ret)
|
||||
dev_err(dmcfreq->dev, "failed to register fb nb\n");
|
||||
|
||||
dmc_mdevp.data = dmcfreq->devfreq;
|
||||
dmcfreq->mdev_info = rockchip_system_monitor_register(dmcfreq->dev,
|
||||
&dmc_mdevp);
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
#include <linux/cpu.h>
|
||||
#include <linux/cpufreq.h>
|
||||
#include <linux/device.h>
|
||||
#include <linux/fb.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/mutex.h>
|
||||
#include <linux/notifier.h>
|
||||
|
|
@ -1368,6 +1369,41 @@ static struct notifier_block rockchip_monitor_reboot_nb = {
|
|||
.notifier_call = rockchip_monitor_reboot_notifier,
|
||||
};
|
||||
|
||||
static int rockchip_monitor_fb_notifier(struct notifier_block *nb,
|
||||
unsigned long action, void *ptr)
|
||||
{
|
||||
struct fb_event *event = ptr;
|
||||
|
||||
switch (action) {
|
||||
case FB_EARLY_EVENT_BLANK:
|
||||
switch (*((int *)event->data)) {
|
||||
case FB_BLANK_UNBLANK:
|
||||
rockchip_clear_system_status(SYS_STATUS_SUSPEND);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case FB_EVENT_BLANK:
|
||||
switch (*((int *)event->data)) {
|
||||
case FB_BLANK_POWERDOWN:
|
||||
rockchip_set_system_status(SYS_STATUS_SUSPEND);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return NOTIFY_OK;
|
||||
}
|
||||
|
||||
static struct notifier_block rockchip_monitor_fb_nb = {
|
||||
.notifier_call = rockchip_monitor_fb_notifier,
|
||||
};
|
||||
|
||||
static int rockchip_system_monitor_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct device *dev = &pdev->dev;
|
||||
|
|
@ -1408,6 +1444,9 @@ static int rockchip_system_monitor_probe(struct platform_device *pdev)
|
|||
|
||||
register_reboot_notifier(&rockchip_monitor_reboot_nb);
|
||||
|
||||
if (fb_register_client(&rockchip_monitor_fb_nb))
|
||||
dev_err(dev, "failed to register fb nb\n");
|
||||
|
||||
dev_info(dev, "system monitor probe\n");
|
||||
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user