移动设备的休眠唤醒功能,为了省电而生,当然,你也可以在休眠的时候做一些差异化的功能。下面就介绍如何在高通平台中根据显示屏的状态,修改设备的工作状态。本文内容参考自sm6350, kernel 4.19
1:设备的dtsi属性设置示例:
xxx-qrd.dtst
&qupv3_se8_i2c {
#address-cells = <1>;
#size-cells = <0>;
status = "ok";
qcom,i2c-touch-active = "focaltech,fts";
focaltech@38 {
compatible = "focaltech,fts";
...
panel = <&dsi_rm692d7_visionox_amoled_cmd>;
};
};
2:内核公共数据结构
notifier.h
typedef int (*notifier_fn_t)(struct notifier_block *nb,
unsigned long action, void *data);
struct notifier_block {
notifier_fn_t notifier_call;
struct notifier_block __rcu *next;
int priority;
};
struct blocking_notifier_head {
struct rw_semaphore rwsem;
struct notifier_block __rcu *head;
};
3:高通私有数据结构和函数,及相关显示驱动
drm_panel.h
/**
-
struct drm_panel - DRM panel object
-
@drm: DRM device owning the panel
-
@connector: DRM connector that the panel is attached to
-
@dev: parent device of the panel
-
@funcs: operations that can be performed on the panel
-
@list: panel entry in registry
-
@nh: panel notifie