瀏覽代碼

Merge "touch: Touch_offload using debugfs"

qctecmdr 11 月之前
父節點
當前提交
e8f2113533
共有 4 個文件被更改,包括 38 次插入2 次删除
  1. 24 1
      pt/pt_core.c
  2. 1 0
      raydium/raydium_driver.c
  3. 1 0
      raydium/raydium_driver.h
  4. 12 1
      raydium/raydium_sysfs.c

+ 24 - 1
pt/pt_core.c

@@ -15180,6 +15180,29 @@ exit:
 	return size;
 }
 
+/*******************************************************************************
+ * FUNCTION: pt_touch_offload_show
+ *
+ * SUMMARY: The show method for the touch_offload sysfs node that allows the TTDL
+ * 			 to verify touch offload enable or disabled.
+ *
+ * RETURN: size of data written to sysfs node
+ *
+ * PARAMETERS:
+ * 			*dev  - pointer to device structure
+ *			*attr - pointer to device attributes
+ *			*buf  - pointer to print output buffer
+ ******************************************************************************/
+static ssize_t pt_touch_offload_show(struct device *dev,
+			struct device_attribute *attr, char *buf)
+{
+	struct pt_core_data *cd = dev_get_drvdata(dev);
+
+	return scnprintf(buf, PT_MAX_PRBUF_SIZE,
+			"Touch offload   : %s\n",
+			(cd->touch_offload)? "Enabled" : "Disabled");
+}
+
 /*******************************************************************************
  * FUNCTION: pt_pip2_version_show
  *
@@ -17573,7 +17596,7 @@ static struct device_attribute attributes[] = {
 	__ATTR(get_param, 0644,
 		pt_get_param_show, pt_get_param_store),
 	__ATTR(pt_touch_offload, 0644,
-		NULL, pt_touch_offload_store),
+		pt_touch_offload_show, pt_touch_offload_store),
 #ifdef EASYWAKE_TSG6
 	__ATTR(easy_wakeup_gesture, 0644, pt_easy_wakeup_gesture_show,
 		pt_easy_wakeup_gesture_store),

+ 1 - 0
raydium/raydium_driver.c

@@ -2477,6 +2477,7 @@ static int raydium_ts_probe(struct i2c_client *client,
 
 	g_raydium_ts->irq_desc = irq_to_desc(g_raydium_ts->irq);
 	g_raydium_ts->irq_enabled = true;
+	g_raydium_ts->touch_offload = false;
 
 	/*disable_irq then enable_irq for avoid Unbalanced enable for IRQ */
 

+ 1 - 0
raydium/raydium_driver.h

@@ -333,6 +333,7 @@ struct raydium_ts_data {
 	struct pinctrl_state *pinctrl_state_suspend;
 	struct pinctrl_state *pinctrl_state_release;
 #endif /*end of MSM_NEW_VER*/
+	bool touch_offload;
 
 
 };

+ 12 - 1
raydium/raydium_sysfs.c

@@ -409,18 +409,29 @@ static ssize_t raydium_touch_offload_store(struct device *dev,
 
 		LOGD(LOG_INFO, "[touch]RAD %s disable touch offload!!\n", __func__);
 		raydium_ts_touch_entry();
+		g_raydium_ts->touch_offload = true;
 		break;
 
 	case 1: /* Enable Touch offload */
 
 		LOGD(LOG_INFO, "[touch]RAD %s enable touch offload!!\n", __func__);
 		raydium_ts_touch_exit();
+		g_raydium_ts->touch_offload = false;
 		break;
 	}
 
 	return count;
 }
 
+static ssize_t raydium_touch_offload_show(struct device *dev,
+					struct device_attribute *attr,
+					char *p_i8_buf)
+{
+	return snprintf(p_i8_buf, PAGE_SIZE,
+			"Touch offload   : %s\n",
+			(g_raydium_ts->touch_offload)? "Enabled" : "Disabled");
+
+}
 static ssize_t raydium_touch_lock_store(struct device *dev,
 					struct device_attribute *attr,
 					const char *p_i8_buf, size_t count)
@@ -1568,7 +1579,7 @@ static DEVICE_ATTR(raydium_i2c_touch_lock, 0644,
  *            echo 0 > raydium_touch_offload ==> disable touch offload
  */
 static DEVICE_ATTR(raydium_touch_offload, 0644,
-		   NULL,
+		   raydium_touch_offload_show,
 		   raydium_touch_offload_store);
 
 /* Log level (W)