touch: Touch_offload using debugfs

Added show support for touch offload sysfs attribue

Change-Id: I5a6a91cfd9df9af35ebd09055204f2d7714cc5dd
Signed-off-by: Saikiran Muppidi <quic_saikmupp@quicinc.com>
This commit is contained in:
Saikiran MUppidi
2024-03-14 12:10:54 +05:30
committed by Saikiran Muppidi
parent 1d69ded5ed
commit c886491e50
4 changed files with 38 additions and 2 deletions

View File

@@ -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),

View File

@@ -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 */

View File

@@ -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;
};

View File

@@ -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)