[Feature][ZXW-235][DTR]DTR changed to waiting queue add explanatory note
Only Configure :No
Affected branch: master
Affected module: autosuspend
Is it affected on both ZXIC and MTK:only ZXIC
Self-test: Yes
Doc Update: No
Change-Id: I1660eef3012d532c2d9b4c927e63b49f37340b7f
diff --git a/cap/zx297520v3/zxic_code/zxic_source/linux-5.10/drivers/soc/sc/power_4line/hal_xp2xp.c b/cap/zx297520v3/zxic_code/zxic_source/linux-5.10/drivers/soc/sc/power_4line/hal_xp2xp.c
index b9044fa..7d19f5c 100755
--- a/cap/zx297520v3/zxic_code/zxic_source/linux-5.10/drivers/soc/sc/power_4line/hal_xp2xp.c
+++ b/cap/zx297520v3/zxic_code/zxic_source/linux-5.10/drivers/soc/sc/power_4line/hal_xp2xp.c
@@ -141,8 +141,8 @@
/****************************************************************************
* Global Variables
****************************************************************************/
-static wait_queue_head_t wakeup_dtr_wqhead;
-static int wakeup_irq_occurs = 0;
+static wait_queue_head_t wakeup_dtr_wqhead;//jb.qi add for dtr on 20240202
+static int wakeup_irq_occurs = 0;//jb.qi add for dtr on 20240202
struct wakeup_source *xp2xp_wake_lock;
static int xp2xp_init_flag = 0;
static int irq_num = 0;
@@ -176,13 +176,14 @@
ssize_t xp2xp_obj_show(struct kobject *kobject,struct attribute *attr,char *buf)
{
+ /*jb.qi add for dtr on 20240202 start*/
wakeup_irq_occurs = 0;
wait_event_interruptible(wakeup_dtr_wqhead,wakeup_irq_occurs);
if(!strcmp(attr->name, XP2XP_STATE))
{
sprintf(buf, "%s\n",(g_xp2xp.wake_state == 1 ? "work" : "sleep"));
}
-
+ /*jb.qi add for dtr on 20240202 end*/
return strlen(buf);
}
@@ -402,7 +403,7 @@
unsigned int irq_type;
struct hal_xp2xp_dev *xp2xp_dev = (struct hal_xp2xp_dev *)priv;
- disable_irq_nosync(irq);
+ disable_irq_nosync(irq);/*jb.qi add for dtr on 20240202*/
gpio_value = 0 ;
if(xp2xp_dev->xp2xp_ws){
@@ -434,9 +435,11 @@
printk( "setting card detect irq failed\n");
}
irq_set_irq_type(irq,irq_type);
+ /*jb.qi add for dtr on 20240202 start*/
wakeup_irq_occurs = 1;
wake_up_interruptible(&wakeup_dtr_wqhead);
enable_irq(xp2xp_dev->eint_irq);
+ /*jb.qi add for dtr on 20240202 end*/
return IRQ_HANDLED;
}
/*jb.qi add for dtr uevent on 20231218 end*/
@@ -717,7 +720,7 @@
spin_lock_init(&g_xp2xp.wk_lock);
device_init_wakeup(&pdev->dev, true);//jb.q add for dtr on 20231204
- init_waitqueue_head(&wakeup_dtr_wqhead);
+ init_waitqueue_head(&wakeup_dtr_wqhead);/*jb.qi add for dtr on 20240202*/
g_xp2xp.xp2xp_ws = wakeup_source_register(NULL, "xp2xp");
if(g_xp2xp.xp2xp_ws == NULL){
printk("adb_setup wakeup_source_create fail\n");
@@ -795,7 +798,7 @@
panic("hal_xp2xp_probe request_irq fail, %d", ret);
}
- /*
+ /*jb.qi add for dtr on 20240202 start
g_xp2xp.wake_int_thread = kthread_run(xp2xp_wkcp_thread, (void *)&g_xp2xp, "xp2xp_wake_thread");
if (IS_ERR(g_xp2xp.wake_int_thread)) {