suspend: not do suspend action under freeze mode [1/1]

PD#TV-4213

Problem:
can't wake up by gpio/adc key when suspend into freeze mode

Solution:
not suspend gpio/adc when freeze

Verify:
X301

Change-Id: I32ff27aafebe35d8deb6e9b4d3daee686bbf90bc
Signed-off-by: wenbiao zhang <wenbiao.zhang@amlogic.com>
This commit is contained in:
wenbiao zhang
2019-04-10 10:15:13 +08:00
committed by Tao Zeng
parent 1b72d60edd
commit e04e7b051d
4 changed files with 19 additions and 1 deletions

View File

@@ -38,6 +38,7 @@
#include <linux/iio/buffer.h>
#include <linux/iio/kfifo_buf.h>
#include <linux/slab.h>
#include <linux/amlogic/pm.h>
#define MESON_SAR_ADC_REG0 0x00
#define MESON_SAR_ADC_REG0_PANEL_DETECT BIT(31)
@@ -1702,6 +1703,9 @@ static int __maybe_unused meson_sar_adc_suspend(struct device *dev)
struct iio_dev *indio_dev = dev_get_drvdata(dev);
int ret;
if (is_pm_freeze_mode())
return 0;
if (iio_buffer_enabled(indio_dev)) {
ret = meson_sar_adc_buffer_predisable(indio_dev);
if (ret)
@@ -1720,6 +1724,9 @@ static int __maybe_unused meson_sar_adc_resume(struct device *dev)
struct iio_dev *indio_dev = dev_get_drvdata(dev);
int ret;
if (is_pm_freeze_mode())
return 0;
ret = meson_sar_adc_hw_enable(indio_dev);
if (ret)
return ret;

View File

@@ -576,6 +576,8 @@ static int meson_adc_kp_remove(struct platform_device *pdev)
static int meson_adc_kp_suspend(struct platform_device *pdev,
pm_message_t state)
{
if (is_pm_freeze_mode())
return 0;
return 0;
}
@@ -584,6 +586,9 @@ static int meson_adc_kp_resume(struct platform_device *pdev)
struct adc_key *key;
struct meson_adc_kp *kp = platform_get_drvdata(pdev);
if (is_pm_freeze_mode())
return 0;
if (get_resume_method() == POWER_KEY_WAKEUP) {
list_for_each_entry(key, &kp->adckey_head, list) {
if (key->code == KEY_POWER) {

View File

@@ -280,6 +280,9 @@ static int meson_gpio_kp_suspend(struct platform_device *dev,
{
struct gpio_keypad *pdata;
if (is_pm_freeze_mode())
return 0;
pdata = (struct gpio_keypad *)platform_get_drvdata(dev);
if (!pdata->use_irq)
del_timer(&(pdata->polling_timer));
@@ -291,6 +294,9 @@ static int meson_gpio_kp_resume(struct platform_device *dev)
int i;
struct gpio_keypad *pdata;
if (is_pm_freeze_mode())
return 0;
pdata = (struct gpio_keypad *)platform_get_drvdata(dev);
if (!pdata->use_irq)
mod_timer(&(pdata->polling_timer),

View File

@@ -30,7 +30,7 @@ static void input_polldev_queue_work(struct input_polled_dev *dev)
if (delay >= HZ)
delay = round_jiffies_relative(delay);
queue_delayed_work(system_freezable_wq, &dev->work, delay);
queue_delayed_work(system_wq, &dev->work, delay);
}
static void input_polled_device_work(struct work_struct *work)