mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-14 08:36:12 -04:00
capsensor sx9331: add suspend irq shielding
Change-Id: I24f762b45b5b792c659b167fd311e957258a8a03 Signed-off-by: liugy11 <liugy11@lenovo.com> Reviewed-on: https://gerrit.mot.com/1237354 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Jiyue Cui <cuijy2@lenovo.com> Reviewed-by: Ryan Lattrel <ryanl@motorola.com> Reviewed-by: Tao Sun <suntao2@motorola.com> Submit-Approved: Jira Key
This commit is contained in:
parent
8c77f5b3ff
commit
3c0d28d4cf
1 changed files with 6 additions and 2 deletions
|
|
@ -76,6 +76,7 @@ typedef struct sx933x
|
|||
static int irq_gpio_num;
|
||||
static psx93XX_t global_sx933x;
|
||||
|
||||
static void sx93XX_schedule_work(psx93XX_t this, unsigned long delay);
|
||||
static int sx933x_get_nirq_state(void)
|
||||
{
|
||||
return !gpio_get_value(irq_gpio_num);
|
||||
|
|
@ -1116,8 +1117,9 @@ static int sx933x_suspend(struct device *dev)
|
|||
{
|
||||
psx93XX_t this = dev_get_drvdata(dev);
|
||||
if (this) {
|
||||
sx933x_i2c_write_16bit(this,SX933X_CMD_REG,0xD);//make sx933x in Sleep mode
|
||||
LOG_DBG(LOG_TAG "sx933x suspend:disable irq!\n");
|
||||
disable_irq(this->irq);
|
||||
//sx933x_i2c_write_16bit(this,SX933X_CPS_CTRL0_REG,0x20);//make sx933x in Sleep mode
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -1126,8 +1128,10 @@ static int sx933x_resume(struct device *dev)
|
|||
{
|
||||
psx93XX_t this = dev_get_drvdata(dev);
|
||||
if (this) {
|
||||
LOG_DBG(LOG_TAG "sx933x resume:enable irq!\n");
|
||||
sx93XX_schedule_work(this,0);
|
||||
enable_irq(this->irq);
|
||||
//sx933x_i2c_write_16bit(this,SX933X_CPS_CTRL0_REG,0x27);//Exit from Sleep mode
|
||||
sx933x_i2c_write_16bit(this,SX933X_CMD_REG,0xC);//Exit from Sleep mode
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue