summaryrefslogtreecommitdiffstats
path: root/drivers/staging/greybus/greybus_protocols.h
diff options
context:
space:
mode:
authorDavid Lin <dtwlin@google.com>2016-04-20 16:55:08 -0700
committerGreg Kroah-Hartman <gregkh@google.com>2016-04-21 10:50:56 +0900
commit9504677c9a9ef4123e4bc9fb8f6903b92453ea6f (patch)
treea2d69392373817433895285b75a24c308e655d41 /drivers/staging/greybus/greybus_protocols.h
parent05a849191f964cf684777fed9ac471d59f2f18ef (diff)
downloadop-kernel-dev-9504677c9a9ef4123e4bc9fb8f6903b92453ea6f.zip
op-kernel-dev-9504677c9a9ef4123e4bc9fb8f6903b92453ea6f.tar.gz
greybus: svc: add AP power measurements debugfs support
This change adds the AP Power Monitor functions to read out all the rails power information monitored by the SVC. Testing Done: - $ cat /d/greybus/1-svc/pwrmon/*/* and validate the output with the svc stub power monitor functions - $ tree /d/greybus/1-svc/pwrmon | | | |---pwrmon | | | | |---DUMMY_RAIL_1 | | | | | |---current_now | | | | | |---power_now | | | | | |---voltage_now | | | | |---DUMMY_RAIL_2 | | | | | |---current_now | | | | | |---power_now | | | | | |---voltage_now | | | | |---DUMMY_RAIL_3 | | | | | |---current_now | | | | | |---power_now | | | | | |---voltage_now | | | | |---DUMMY_RAIL_4 | | | | | |---current_now | | | | | |---power_now | | | | | |---voltage_now Signed-off-by: David Lin <dtwlin@google.com> Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Diffstat (limited to 'drivers/staging/greybus/greybus_protocols.h')
-rw-r--r--drivers/staging/greybus/greybus_protocols.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/drivers/staging/greybus/greybus_protocols.h b/drivers/staging/greybus/greybus_protocols.h
index e0c0493..82798cf 100644
--- a/drivers/staging/greybus/greybus_protocols.h
+++ b/drivers/staging/greybus/greybus_protocols.h
@@ -967,6 +967,18 @@ struct gb_svc_key_event_request {
#define GB_SVC_KEY_PRESSED 0x01
} __packed;
+#define GB_SVC_PWRMON_MAX_RAIL_COUNT 254
+
+struct gb_svc_pwrmon_rail_count_get_response {
+ __u8 rail_count;
+} __packed;
+
+#define GB_SVC_PWRMON_RAIL_NAME_BUFSIZE 32
+
+struct gb_svc_pwrmon_rail_names_get_response {
+ __u8 name[0][GB_SVC_PWRMON_RAIL_NAME_BUFSIZE];
+} __packed;
+
#define GB_SVC_PWRMON_TYPE_CURR 0x01
#define GB_SVC_PWRMON_TYPE_VOL 0x02
#define GB_SVC_PWRMON_TYPE_PWR 0x03
@@ -976,6 +988,16 @@ struct gb_svc_key_event_request {
#define GB_SVC_PWRMON_GET_SAMPLE_NOSUPP 0x02
#define GB_SVC_PWRMON_GET_SAMPLE_HWERR 0x03
+struct gb_svc_pwrmon_sample_get_request {
+ __u8 rail_id;
+ __u8 measurement_type;
+} __packed;
+
+struct gb_svc_pwrmon_sample_get_response {
+ __u8 result;
+ __le32 measurement;
+} __packed;
+
struct gb_svc_pwrmon_intf_sample_get_request {
__u8 intf_id;
__u8 measurement_type;
OpenPOWER on IntegriCloud