summaryrefslogtreecommitdiffstats
path: root/drivers/staging/greybus/greybus_protocols.h
diff options
context:
space:
mode:
authorBryan O'Donoghue <bryan.odonoghue@linaro.org>2016-05-15 19:37:48 +0100
committerGreg Kroah-Hartman <gregkh@google.com>2016-05-15 11:39:57 -0700
commitc8a657ba3f84643d7ef4b13ff6828e141172419a (patch)
tree69a3d30a724149d77ccfef6255e1aeed684a7d22 /drivers/staging/greybus/greybus_protocols.h
parent7bf7fa12fcb24fccb99d7957e44b8be6e0b82986 (diff)
downloadop-kernel-dev-c8a657ba3f84643d7ef4b13ff6828e141172419a.zip
op-kernel-dev-c8a657ba3f84643d7ef4b13ff6828e141172419a.tar.gz
greybus: hd: Add TimeSync APBridge commands
This patch adds a number of USB Vendor commands to es2.c to enable TimeSync in the bridge. Adds: - es2.c::timesync_enable(u8 count, u64 frame_time, u32 strobe_delay, u32 refclk); Commands APBx to enable timers and clocks to track a pulse-train of incoming TIME_SYNC strobes with strobe_delay microseconds between each. Provides the reference clock the AP is using to track FrameTime. It is the responsibility of APBx to adequately track the FrameTime based on the indicated AP refclk. Once this command has succeeded APBx may not transition to a low-power state were FrameTime counters stop. This function is initiated from the timesync worker thread logic when re-synchronizing frame-time throughout the system. TimeSync is at this time enabled for all APBx active in the system i.e. currently APB2 will not receive TimeSync commands until it becomes a registered host-device in Greybus. - es2.c::timesync_disable(void) Commands APBx to discontinue tracking of FrameTime. After this operation completes APBx may transition to a low-power state where timer-clocks stop operating. - es2.c::timesync_authoritative(u64 *frame_time) Provides an authoritative time for each TIME_SYNC strobe to APBx. APBx must align its local FrameTime to the authoritative clock. - es2.c::timesync_get_last_event(u64 *frame_time) Returns the FrameTime at the last SVC_TIMESYNC_PING to the AP Module. Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@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.h26
1 files changed, 16 insertions, 10 deletions
diff --git a/drivers/staging/greybus/greybus_protocols.h b/drivers/staging/greybus/greybus_protocols.h
index e3ad5d7..d379fe3 100644
--- a/drivers/staging/greybus/greybus_protocols.h
+++ b/drivers/staging/greybus/greybus_protocols.h
@@ -188,30 +188,36 @@ struct gb_control_timesync_get_last_event_response {
/* APBridge protocol */
/* request APB1 log */
-#define GB_APB_REQUEST_LOG 0x02
+#define GB_APB_REQUEST_LOG 0x02
/* request to map a cport to bulk in and bulk out endpoints */
-#define GB_APB_REQUEST_EP_MAPPING 0x03
+#define GB_APB_REQUEST_EP_MAPPING 0x03
/* request to get the number of cports available */
-#define GB_APB_REQUEST_CPORT_COUNT 0x04
+#define GB_APB_REQUEST_CPORT_COUNT 0x04
/* request to reset a cport state */
-#define GB_APB_REQUEST_RESET_CPORT 0x05
+#define GB_APB_REQUEST_RESET_CPORT 0x05
/* request to time the latency of messages on a given cport */
-#define GB_APB_REQUEST_LATENCY_TAG_EN 0x06
-#define GB_APB_REQUEST_LATENCY_TAG_DIS 0x07
+#define GB_APB_REQUEST_LATENCY_TAG_EN 0x06
+#define GB_APB_REQUEST_LATENCY_TAG_DIS 0x07
/* request to control the CSI transmitter */
-#define GB_APB_REQUEST_CSI_TX_CONTROL 0x08
+#define GB_APB_REQUEST_CSI_TX_CONTROL 0x08
/* request to control the CSI transmitter */
-#define GB_APB_REQUEST_AUDIO_CONTROL 0x09
+#define GB_APB_REQUEST_AUDIO_CONTROL 0x09
/* vendor requests to enable/disable CPort features */
-#define GB_APB_REQUEST_CPORT_FEAT_EN 0x0b
-#define GB_APB_REQUEST_CPORT_FEAT_DIS 0x0c
+#define GB_APB_REQUEST_CPORT_FEAT_EN 0x0b
+#define GB_APB_REQUEST_CPORT_FEAT_DIS 0x0c
+
+/* TimeSync commands */
+#define REQUEST_TIMESYNC_ENABLE 0x0d
+#define REQUEST_TIMESYNC_DISABLE 0x0e
+#define REQUEST_TIMESYNC_AUTHORITATIVE 0x0f
+#define REQUEST_TIMESYNC_GET_LAST_EVENT 0x10
/* Firmware Download Protocol */
OpenPOWER on IntegriCloud