summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorRuchi Kandoi <kandoiruchi@google.com>2014-10-29 10:43:38 -0700
committerRuchi Kandoi <kandoiruchi@google.com>2014-10-31 10:58:30 -0700
commitd091713884c3e42b83aaa34fbfcc9bf8eed9b73e (patch)
treee7289f2003ce0999e3dbbef39073576e84eb0a49 /include
parent6b82558129eae20fef9ba053c55da3543388dc24 (diff)
downloadhardware_libhardware-d091713884c3e42b83aaa34fbfcc9bf8eed9b73e.zip
hardware_libhardware-d091713884c3e42b83aaa34fbfcc9bf8eed9b73e.tar.gz
hardware_libhardware-d091713884c3e42b83aaa34fbfcc9bf8eed9b73e.tar.bz2
power: Adds setFeature functionality for the power module
Adds the setFeature callback which could be used to enable/disable power as well as performance specific features. POWER_FEATURE_DOUBLE_TAP_WAKE is added which uses the setFeature callback to enable/disable the double-tap feature. Bug: 16875464 Change-Id: I5ed9b5be8fddedf9861eedd962def421d9fac5bf
Diffstat (limited to 'include')
-rw-r--r--include/hardware/power.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/include/hardware/power.h b/include/hardware/power.h
index dc33705..af7799e 100644
--- a/include/hardware/power.h
+++ b/include/hardware/power.h
@@ -27,6 +27,7 @@ __BEGIN_DECLS
#define POWER_MODULE_API_VERSION_0_1 HARDWARE_MODULE_API_VERSION(0, 1)
#define POWER_MODULE_API_VERSION_0_2 HARDWARE_MODULE_API_VERSION(0, 2)
+#define POWER_MODULE_API_VERSION_0_3 HARDWARE_MODULE_API_VERSION(0, 3)
/**
* The id of this module
@@ -48,6 +49,10 @@ typedef enum {
POWER_HINT_LOW_POWER = 0x00000005
} power_hint_t;
+typedef enum {
+ POWER_FEATURE_DOUBLE_TAP_TO_WAKE = 0x00000001
+} feature_t;
+
/**
* Every hardware module must have a data structure named HAL_MODULE_INFO_SYM
* and the fields of this data structure must begin with hw_module_t
@@ -127,6 +132,21 @@ typedef struct power_module {
*/
void (*powerHint)(struct power_module *module, power_hint_t hint,
void *data);
+
+ /*
+ * (*setFeature) is called to turn on or off a particular feature
+ * depending on the state parameter. The possible features are:
+ *
+ * FEATURE_DOUBLE_TAP_TO_WAKE
+ *
+ * Enabling/Disabling this feature will allow/disallow the system
+ * to wake up by tapping the screen twice.
+ *
+ * availability: version 0.3
+ *
+ */
+ void (*setFeature)(struct power_module *module, feature_t feature, int state);
+
} power_module_t;