suspend: not do suspend action under freeze mode [1/1]
authorwenbiao zhang <wenbiao.zhang@amlogic.com>
Wed, 10 Apr 2019 02:15:13 +0000 (10:15 +0800)
committerTao Zeng <tao.zeng@amlogic.com>
Wed, 17 Apr 2019 13:32:14 +0000 (06:32 -0700)
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>
drivers/amlogic/iio/adc/meson_saradc.c
drivers/amlogic/input/keyboard/adc_keypad.c
drivers/amlogic/input/keyboard/gpio_keypad.c
drivers/input/input-polldev.c

index ca764dd..9b4ab35 100644 (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;
index 7182e59..c1ad720 100644 (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) {
index 33abc17..92c50f1 100644 (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),
index 3664f81..3dad3a2 100644 (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)