The firmware will do auto power management once we enable the low power
mode. It will put the device into low power mode when no touch detected
after certain interval and it will get back into active mode once it
detects touch events.

Note we can't put the device into deep sleep mode in runtime suspend,
because no scanning of the panel is perfomed and thus no touches can be
detected, so we can't wake up the device runtime.

The low power mode essentially implements the runtime PM functionality
and we don't need to provide runtime PM callbacks for this driver.

Signed-off-by: Hong Liu <[email protected]>
---
 drivers/input/touchscreen/cyttsp_core.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/drivers/input/touchscreen/cyttsp_core.c 
b/drivers/input/touchscreen/cyttsp_core.c
index 680ac88..7979960 100644
--- a/drivers/input/touchscreen/cyttsp_core.c
+++ b/drivers/input/touchscreen/cyttsp_core.c
@@ -1285,6 +1285,12 @@ static int cyttsp_power_on(struct cyttsp *ts)
        if (retval < 0)
                goto bypass;
 
+       /* enable low power mode, let firmware do auto power management */
+       cmd = CY_LOW_POWER_MODE;
+       retval = ttsp_write_block_data(ts, CY_REG_BASE, sizeof(cmd), &cmd);
+       if (retval < 0)
+               goto bypass;
+
        if (ts->platform_data->use_gestures) {
                u8 gesture_setup;
 
@@ -1371,7 +1377,7 @@ int cyttsp_suspend(void *handle)
                ts->suspended = 1;
                if (ts->platform_data->use_sleep &&
                    (ts->platform_data->power_state == CY_ACTIVE_STATE)) {
-                       sleep_mode = CY_DEEP_SLEEP_MODE;
+                       sleep_mode = CY_DEEP_SLEEP_MODE | CY_LOW_POWER_MODE;
                        retval = ttsp_write_block_data(ts, CY_REG_BASE,
                                        sizeof(sleep_mode), &sleep_mode);
                        if (!(retval < 0))
-- 
1.7.2.3

_______________________________________________
MeeGo-kernel mailing list
[email protected]
http://lists.meego.com/listinfo/meego-kernel

Reply via email to