mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-11 15:11:48 -04:00
sx9325: When system suspend,disable hardware irq scan.
- the current driver only disable system irq, and not disable hardware irq,maybe cause irq imbalances; - update reset method. Change-Id: I14bea213005916ae858f492f6893a08c2d821fd3 Signed-off-by: Wen Xie <xiewen3@motorola.com> Reviewed-on: https://gerrit.mot.com/1233351 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Nan Wu <wunan3@motorola.com> Reviewed-by: Wang Wang <wangwang1@lenovo.com> Submit-Approved: Jira Key
This commit is contained in:
parent
ccbbd6e0d0
commit
ffc0a5711c
1 changed files with 29 additions and 7 deletions
|
|
@ -941,11 +941,19 @@ static void ps_notify_callback_work(struct work_struct *work)
|
|||
input_top = pDevice->pbuttonInformation->input_top;
|
||||
input_bottom = pDevice->pbuttonInformation->input_bottom;
|
||||
|
||||
LOG_INFO("Usb insert,going to force calibrate\n");
|
||||
ret = write_register(this, SX932x_STAT2_REG, 0x0f);
|
||||
if (ret < 0)
|
||||
LOG_ERR(" Usb insert,calibrate cap sensor failed\n");
|
||||
|
||||
mutex_lock(&this->mutex);
|
||||
if (mEnabled) {
|
||||
LOG_INFO("Usb insert,going to force calibrate\n");
|
||||
ret = write_register(this, SX932x_CTRL1_REG, 0x00);
|
||||
if (ret < 0)
|
||||
LOG_ERR(" Usb insert,calibrate cap sensor failed\n");
|
||||
msleep(100);
|
||||
ret = write_register(this, SX932x_CTRL1_REG,
|
||||
this->board->cust_prox_ctrl0);
|
||||
if (ret < 0)
|
||||
LOG_ERR(" Usb insert,enabel cap sensor failed\n");
|
||||
}
|
||||
mutex_unlock(&this->mutex);
|
||||
input_report_abs(input_top, ABS_DISTANCE, 0);
|
||||
input_sync(input_top);
|
||||
input_report_abs(input_bottom, ABS_DISTANCE, 0);
|
||||
|
|
@ -1618,15 +1626,29 @@ static void sx93XX_worker_func(struct work_struct *work)
|
|||
void sx93XX_suspend(psx93XX_t this)
|
||||
{
|
||||
if (this) {
|
||||
LOG_INFO("sx9325 suspend: disable irq!\n");
|
||||
write_register(this, SX932x_CTRL1_REG,
|
||||
this->board->cust_prox_ctrl0&0xdf);
|
||||
if (sx9325_debug_enable)
|
||||
LOG_INFO("sx9325 suspend: disable irq!\n");
|
||||
disable_irq(this->irq);
|
||||
}
|
||||
}
|
||||
void sx93XX_resume(psx93XX_t this)
|
||||
{
|
||||
if (this) {
|
||||
LOG_INFO("sx9325 resume: enable irq!\n");
|
||||
if (sx9325_debug_enable)
|
||||
LOG_INFO("sx9325 resume: enable irq!\n");
|
||||
#ifdef USE_THREADED_IRQ
|
||||
mutex_lock(&this->mutex);
|
||||
/* Just in case need to reset any uncaught interrupts */
|
||||
sx93XX_process_interrupt(this, 0);
|
||||
mutex_unlock(&this->mutex);
|
||||
#else
|
||||
sx93XX_schedule_work(this, 0);
|
||||
#endif
|
||||
enable_irq(this->irq);
|
||||
write_register(this, SX932x_CTRL1_REG,
|
||||
this->board->cust_prox_ctrl0|0x20);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue