@liam821 After entering sleep mode, the USB power is turned off, causing the USB touch screen to malfunction during sleep mode. To solve this, we can only do a fake sleep mode, not allowing the machine to enter deep sleep mode, only shallow sleep mode.
sleep: do not enter deep sleep
diff --git a/drivers/misc/khadas-mcu.c b/drivers/misc/khadas-mcu.c
index df96ca24e014..03e1b8666367 100644
--- a/drivers/misc/khadas-mcu.c
+++ b/drivers/misc/khadas-mcu.c
@@ -14,6 +14,7 @@
#include <linux/of.h>
#include <linux/of_address.h>
#include <linux/amlogic/pm.h>
+#include <linux/wakelock.h>
/* Device registers */
#define MCU_BOOT_EN_WOL_REG 0x21
@@ -41,6 +42,7 @@
#define MCU_FAN_SPEED_HIGH_V2 0x64
extern int meson_get_temperature(void);
+static struct wake_lock wake_lock_always;
enum mcu_fan_mode {
MCU_FAN_MODE_MANUAL = 0,
@@ -870,7 +872,8 @@ static int mcu_probe(struct i2c_client *client, const struct i2c_device_id *id)
*/
create_mcu_attrs();
-
+ wake_lock_init(&wake_lock_always, WAKE_LOCK_SUSPEND, "wake_lock_always");
+ wake_lock(&wake_lock_always);
//if (is_support_wol()) {
reg[0] = 0x01;
ret = mcu_i2c_write_regs(client, 0x87, reg, 1);
Please refer to the link and add the corresponding IDC file to take a look.