drm/panel: panel-simple: add panel notifier for tp resume/suspend

The tp of some screens has strict timing requirements (especially the
display and tp are integrated on a screen IC), while kernel-6.1 does
not have fb function. The notifier is added to correlate the sleep and
wake-up timing of display and tp. For screens with low requirements
for tp and display timing, you can choose whether to use it to notify
on wake-up and sleep.

Type: Function
Redmine ID: #474634 #468692
Associated modifications: N/A
Test: N/A

Signed-off-by: Zhibin Huang <zhibin.huang@rock-chips.com>
Change-Id: I11cb63564fce97b6ca6b02cf12bc19db5d82124b
This commit is contained in:
Zhibin Huang
2024-04-16 20:33:13 +08:00
parent d74b36463b
commit cda0fc9ebc

View File

@@ -31,6 +31,7 @@
#include <linux/platform_device.h>
#include <linux/regulator/consumer.h>
#include <linux/spi/spi.h>
#include <linux/rockchip-panel-notifier.h>
#include <video/display_timing.h>
#include <video/mipi_display.h>
@@ -217,6 +218,8 @@ struct panel_simple {
struct drm_dsc_picture_parameter_set *pps;
enum drm_panel_orientation orientation;
struct rockchip_panel_notifier panel_notifier;
};
static inline void panel_simple_msleep(unsigned int msecs)
@@ -530,6 +533,9 @@ int panel_simple_loader_protect(struct drm_panel *panel)
p->prepared = true;
p->enabled = true;
rockchip_panel_notifier_call_chain(&p->panel_notifier,
PANEL_ENABLED, NULL);
return 0;
}
EXPORT_SYMBOL(panel_simple_loader_protect);
@@ -538,6 +544,13 @@ static int panel_simple_disable(struct drm_panel *panel)
{
struct panel_simple *p = to_panel_simple(panel);
/*
* notify other devices (such as TP) to perform the action before the
* panel is disabled.
*/
rockchip_panel_notifier_call_chain(&p->panel_notifier,
PANEL_PRE_DISABLE, NULL);
if (!p->enabled)
return 0;
@@ -641,6 +654,13 @@ static int panel_simple_enable(struct drm_panel *panel)
p->enabled = true;
/*
* notify other devices (such as TP) to perform the action after the
* panel is enabled.
*/
rockchip_panel_notifier_call_chain(&p->panel_notifier,
PANEL_ENABLED, NULL);
return 0;
}
@@ -973,6 +993,9 @@ static int panel_simple_probe(struct device *dev, const struct panel_desc *desc)
dev_set_drvdata(dev, panel);
devm_rockchip_panel_notifier_register(dev, &panel->base,
&panel->panel_notifier);
drm_panel_init(&panel->base, dev, &panel_simple_funcs, connector_type);
err = drm_panel_of_backlight(&panel->base);