mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-09 21:59:12 -04:00
sar sensor remove calibration when display off
Change-Id: Ic70e126848b59ae86d864b226aaf7b4a377f1306 WHY:Not need to calibration when display off HOW:Remove it. Signed-off-by: wunan3 <wunan3@lenovo.com> Reviewed-on: https://gerrit.mot.com/1268929 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Wen Xie <xiewen3@motorola.com> Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com> Submit-Approved: Jira Key
This commit is contained in:
parent
d4e70c0c3a
commit
8eec4e9c18
2 changed files with 1 additions and 119 deletions
|
|
@ -31,10 +31,6 @@
|
|||
#include <linux/usb.h>
|
||||
#include <linux/power_supply.h>
|
||||
|
||||
#if defined(CONFIG_FB)
|
||||
#include <linux/fb.h>
|
||||
#endif
|
||||
|
||||
/* main struct, interrupt,init,pointers */
|
||||
#include <linux/input/sx9310_triple.h>
|
||||
|
||||
|
|
@ -1101,49 +1097,6 @@ static int ps_notify_callback(struct notifier_block *self,
|
|||
return 0;
|
||||
}
|
||||
|
||||
#if defined(CONFIG_FB)
|
||||
static void fb_notify_resume_work(struct work_struct *work)
|
||||
{
|
||||
psx93XX_t this = container_of(work, sx93XX_t, fb_notify_work);
|
||||
psx9310_t pDevice = NULL;
|
||||
struct input_dev *input_top = NULL;
|
||||
struct input_dev *input_bottom = NULL;
|
||||
int ret = 0;
|
||||
|
||||
pDevice = this->pDevice;
|
||||
input_top = pDevice->pbuttonInformation->input_top;
|
||||
input_bottom = pDevice->pbuttonInformation->input_bottom;
|
||||
|
||||
if (sx9310_debug_enable)
|
||||
LOG_INFO("Lcd suspend/resume event,going to force reset\n");
|
||||
ret = write_register(this, SX9310_IRQSTAT_REG, 0xff);
|
||||
if (ret < 0)
|
||||
LOG_ERR(" Lcd suspend/resume,reset cap sensor failed\n");
|
||||
}
|
||||
|
||||
static int fb_notifier_callback(struct notifier_block *self,
|
||||
unsigned long event, void *data)
|
||||
{
|
||||
struct fb_event *evdata = data;
|
||||
int *blank;
|
||||
psx93XX_t this = container_of(self, sx93XX_t, fb_notif);
|
||||
|
||||
if ((event == FB_EVENT_BLANK) &&
|
||||
evdata && evdata->data) {
|
||||
blank = evdata->data;
|
||||
if ((*blank == FB_BLANK_POWERDOWN)
|
||||
|| (*blank == FB_BLANK_UNBLANK)) {
|
||||
if (sx9310_debug_enable)
|
||||
LOG_INFO("fb event = %lu blank = %d\n",
|
||||
event, *blank);
|
||||
schedule_work(&this->fb_notify_work);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
static struct class capsense_class = {
|
||||
.name = "capsense",
|
||||
.owner = THIS_MODULE,
|
||||
|
|
@ -1388,15 +1341,6 @@ static int sx9310_probe(struct i2c_client *client,
|
|||
}
|
||||
}
|
||||
|
||||
#if defined(CONFIG_FB)
|
||||
INIT_WORK(&this->fb_notify_work, fb_notify_resume_work);
|
||||
this->fb_notif.notifier_call = fb_notifier_callback;
|
||||
ret = fb_register_client(&this->fb_notif);
|
||||
if (ret) {
|
||||
LOG_ERR("Unable to register fb_notifier: %d\n", ret);
|
||||
goto free_ps_notifier;
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
return -ENOMEM;
|
||||
|
|
@ -1441,9 +1385,6 @@ static int sx9310_remove(struct i2c_client *client)
|
|||
pDevice = this->pDevice;
|
||||
pplatData = client->dev.platform_data;
|
||||
if (this && pDevice) {
|
||||
#if defined(CONFIG_FB)
|
||||
fb_unregister_client(&this->fb_notif);
|
||||
#endif
|
||||
power_supply_unreg_notifier(&this->ps_notif);
|
||||
cancel_work_sync(&this->ps_notify_work);
|
||||
|
||||
|
|
|
|||
|
|
@ -31,10 +31,6 @@
|
|||
#include <linux/usb.h>
|
||||
#include <linux/power_supply.h>
|
||||
|
||||
#if defined(CONFIG_FB)
|
||||
#include <linux/fb.h>
|
||||
#endif
|
||||
|
||||
/* main struct, interrupt,init,pointers */
|
||||
#include <linux/input/sx9325_sar.h>
|
||||
|
||||
|
|
@ -1019,49 +1015,6 @@ static int ps_notify_callback(struct notifier_block *self,
|
|||
return 0;
|
||||
}
|
||||
|
||||
#if defined(CONFIG_FB)
|
||||
static void fb_notify_resume_work(struct work_struct *work)
|
||||
{
|
||||
psx93XX_t this = container_of(work, sx93XX_t, fb_notify_work);
|
||||
psx9325_t pDevice = NULL;
|
||||
struct input_dev *input_top = NULL;
|
||||
struct input_dev *input_bottom = NULL;
|
||||
int ret = 0;
|
||||
|
||||
pDevice = this->pDevice;
|
||||
input_top = pDevice->pbuttonInformation->input_top;
|
||||
input_bottom = pDevice->pbuttonInformation->input_bottom;
|
||||
|
||||
if (sx9325_debug_enable)
|
||||
LOG_INFO("Lcd suspend/resume event,going to force reset\n");
|
||||
ret = write_register(this, SX932x_STAT2_REG, 0x0f);
|
||||
if (ret < 0)
|
||||
LOG_ERR(" Lcd suspend/resume,reset cap sensor failed\n");
|
||||
}
|
||||
|
||||
static int fb_notifier_callback(struct notifier_block *self,
|
||||
unsigned long event, void *data)
|
||||
{
|
||||
struct fb_event *evdata = data;
|
||||
int *blank;
|
||||
psx93XX_t this = container_of(self, sx93XX_t, fb_notif);
|
||||
|
||||
if ((event == FB_EVENT_BLANK) &&
|
||||
evdata && evdata->data) {
|
||||
blank = evdata->data;
|
||||
if ((*blank == FB_BLANK_POWERDOWN)
|
||||
|| (*blank == FB_BLANK_UNBLANK)) {
|
||||
if (sx9325_debug_enable)
|
||||
LOG_INFO("fb event = %lu blank = %d\n",
|
||||
event, *blank);
|
||||
schedule_work(&this->fb_notify_work);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
static struct class capsense_class = {
|
||||
.name = "capsense",
|
||||
.owner = THIS_MODULE,
|
||||
|
|
@ -1307,19 +1260,10 @@ static int sx9325_probe(struct i2c_client *client,
|
|||
LOG_ERR(
|
||||
"psy get property failed rc=%d\n",
|
||||
ret);
|
||||
goto free_ps_notifier;
|
||||
goto free_fb_notifier;
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(CONFIG_FB)
|
||||
INIT_WORK(&this->fb_notify_work, fb_notify_resume_work);
|
||||
this->fb_notif.notifier_call = fb_notifier_callback;
|
||||
ret = fb_register_client(&this->fb_notif);
|
||||
if (ret) {
|
||||
LOG_ERR("Unable to register fb_notifier: %d\n", ret);
|
||||
goto free_fb_notifier;
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
return -ENOMEM;
|
||||
|
|
@ -1362,9 +1306,6 @@ static int sx9325_remove(struct i2c_client *client)
|
|||
pDevice = this->pDevice;
|
||||
pplatData = client->dev.platform_data;
|
||||
if (this && pDevice) {
|
||||
#if defined(CONFIG_FB)
|
||||
fb_unregister_client(&this->fb_notif);
|
||||
#endif
|
||||
power_supply_unreg_notifier(&this->ps_notif);
|
||||
cancel_work_sync(&this->ps_notify_work);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue