From 25ad59d3e76c06230686612e423eb370618fe012 Mon Sep 17 00:00:00 2001 From: cuijy1 Date: Fri, 21 May 2021 18:20:45 +0800 Subject: [PATCH] sx937x:change offset val bit mask offset reg use D13~D0 bit change the mask to 0x3fff Change-Id: Ibc5b021d27c2bf52df1b579be8134f38c65c036d Signed-off-by: cuijy1 Reviewed-on: https://gerrit.mot.com/1956900 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Minghui Wei Reviewed-by: Hong Zhang Reviewed-by: Tao Sun Submit-Approved: Jira Key --- drivers/misc/sx937x/sx937x_sar.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/misc/sx937x/sx937x_sar.c b/drivers/misc/sx937x/sx937x_sar.c index 7c812e2cab4f..84a8f1acae41 100644 --- a/drivers/misc/sx937x/sx937x_sar.c +++ b/drivers/misc/sx937x/sx937x_sar.c @@ -301,7 +301,7 @@ static void read_dbg_raw(psx93XX_t this) sx937x_i2c_read_16bit(this, SX937X_DIFF_PH0 + ph*4, &uData); diff = (s32)uData>>10; sx937x_i2c_read_16bit(this, SX937X_OFFSET_PH0 + ph*4*3, &uData); - off = (u16)(uData & 0x7FFF); + off = (u16)(uData & 0x3FFF); state = psmtcButtons[ph].state; dev_info(this->pdev, @@ -364,7 +364,7 @@ static void read_rawData(psx93XX_t this) sx937x_i2c_read_16bit(this, SX937X_DIFF_PH0 + index, &uData); diff = (s32)uData>>10; sx937x_i2c_read_16bit(this, SX937X_OFFSET_PH0 + index*3, &uData); - offset = (u16)(uData & 0x7FFF); + offset = (u16)(uData & 0x3FFF); state = psmtcButtons[csx].state; @@ -463,7 +463,7 @@ static ssize_t capsense_raw_data_show(struct class *class, sx937x_i2c_read_16bit(this, SX937X_DIFF_PH0 + csx*4, &uData); diff = (s32)uData>>10; sx937x_i2c_read_16bit(this, SX937X_OFFSET_PH0 + csx*12, &uData); - offset = (u16)(uData & 0x7FFF); + offset = (u16)(uData & 0x3FFF); p += snprintf(p, PAGE_SIZE, "PH= %d Useful = %d Average = %d DIFF = %d Offset = %d \n", csx,useful,average,diff,offset); }