Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c6627cc7 authored by casey.song's avatar casey.song Committed by hecaiqiang
Browse files

Add TP point report patch(1/2)

add TP point report patch

Change-Id: I0479db1177f9de78659508cbb940786b64226593
parent 46c30e14
Loading
Loading
Loading
Loading
+7 −0
Original line number Original line Diff line number Diff line
@@ -1475,6 +1475,13 @@ static int sec_mode_switch(void *chip_data, work_mode mode, bool flag)
			}
			}
			break;
			break;


		case MODE_NDX_DETECT:
			ret = sec_ndx_detect(chip_info, flag);
			if (ret < 0) {
				TPD_INFO("%s: ndx switch: %d failed\n", __func__, flag);
			}
			break;

		case MODE_GESTURE_SWITCH:
		case MODE_GESTURE_SWITCH:
			ret = sec_gesture_switch_mode(chip_info, flag);
			ret = sec_gesture_switch_mode(chip_info, flag);
			if (ret < 0) {
			if (ret < 0) {
+1 −1
Original line number Original line Diff line number Diff line
@@ -151,7 +151,7 @@
#define SEC_CMD_GRIPMODE_SWITCH					0xAD	//0 is portrait,1 is landscape
#define SEC_CMD_GRIPMODE_SWITCH					0xAD	//0 is portrait,1 is landscape
#define SEC_CMD_PORTRAIT_CORNER					0xAB
#define SEC_CMD_PORTRAIT_CORNER					0xAB
#define SEC_CMD_LANDSPACE_CORNER				0xAC
#define SEC_CMD_LANDSPACE_CORNER				0xAC

#define SEC_CMD_NDX_DETECT                                      0x9E






+1 −0
Original line number Original line Diff line number Diff line
@@ -441,6 +441,7 @@ struct touchpanel_data {
	bool fingerprint_int_test;							/*fingerprint int pin test*/
	bool fingerprint_int_test;							/*fingerprint int pin test*/
	u8 limit_switch;									/*0 is phone up 1 is crosswise*/
	u8 limit_switch;									/*0 is phone up 1 is crosswise*/
	u8 touchold_event;									/*0 is touchhold down 1 is up*/
	u8 touchold_event;									/*0 is touchhold down 1 is up*/
	u8 ndx_detect;


#if defined(TPD_USE_EINT)
#if defined(TPD_USE_EINT)
    struct hrtimer         timer;                       /*using polling instead of IRQ*/
    struct hrtimer         timer;                       /*using polling instead of IRQ*/
+64 −0
Original line number Original line Diff line number Diff line
@@ -1491,6 +1491,64 @@ static const struct file_operations proc_limit_switch_fops = {
	.owner = THIS_MODULE,
	.owner = THIS_MODULE,
};
};


static ssize_t ndx_write(struct file *file, const char __user *buffer, size_t count, loff_t *ppos)
{
    int value = 0 ;
    char buf[4] = {0};
    struct touchpanel_data *ts = PDE_DATA(file_inode(file));

    if (count > 4) {
        TPD_INFO("%s:count > 4\n",__func__);
        return count;
    }

    if (!ts) {
        TPD_INFO("%s: ts is NULL\n",__func__);
        return count;
    }

    if (copy_from_user(buf, buffer, count)) {
        TPD_INFO("%s: read proc input error.\n", __func__);
        return count;
    }
    sscanf(buf, "%d", &value);
	if (g_tp->ndx_detect == value)
		return count;

	g_tp->ndx_detect = value;
    TPD_DEBUG("%s: ts->ndx_detect = %d\n", __func__, value);
	if (ts->is_suspended == 0) {
		mutex_lock(&ts->mutex);
		ts->ts_ops->mode_switch(ts->chip_data, MODE_NDX_DETECT, g_tp->ndx_detect);
		mutex_unlock(&ts->mutex);
	}
    return count;
}

static ssize_t ndx_read(struct file *file, char __user *user_buf, size_t count, loff_t *ppos)
{
    int ret = 0;
    char page[4] = {0};
    struct touchpanel_data *ts = PDE_DATA(file_inode(file));

    if (!ts) {
        sprintf(page, "%d\n", -1);//no support
    } else {
        sprintf(page, "%d\n", g_tp->ndx_detect);//support
    }
    ret = simple_read_from_buffer(user_buf, count, ppos, page, strlen(page));
    return ret;
}

static const struct file_operations proc_nxd_detect_fops = {
	.write = ndx_write,
	.read  = ndx_read,
	.open  = simple_open,
	.owner = THIS_MODULE,
};



//proc/touchpanel/black_screen_test
//proc/touchpanel/black_screen_test
static ssize_t proc_black_screen_test_read(struct file *file, char __user *user_buf, size_t count, loff_t *ppos)
static ssize_t proc_black_screen_test_read(struct file *file, char __user *user_buf, size_t count, loff_t *ppos)
{
{
@@ -2391,6 +2449,12 @@ static int init_touchpanel_proc(struct touchpanel_data *ts)
		TPD_INFO("%s: Couldn't create proc entry, %d\n", __func__, __LINE__);
		TPD_INFO("%s: Couldn't create proc entry, %d\n", __func__, __LINE__);
	}
	}


	prEntry_tmp = proc_create_data("nxd_detect", 0666, prEntry_tp, &proc_nxd_detect_fops, ts);
	if (prEntry_tmp == NULL) {
		ret = -ENOMEM;
		TPD_INFO("%s: Couldn't create proc entry, %d\n", __func__, __LINE__);
	}

    ts->prEntry_tp = prEntry_tp;
    ts->prEntry_tp = prEntry_tp;


    //create debug_info node
    //create debug_info node