summaryrefslogtreecommitdiff
path: root/drivers/staging/greybus/hd.h
diff options
context:
space:
mode:
authorBryan O'Donoghue <bryan.odonoghue@linaro.org>2016-05-15 18:37:48 (GMT)
committerGreg Kroah-Hartman <gregkh@google.com>2016-05-15 18:39:57 (GMT)
commitc8a657ba3f84643d7ef4b13ff6828e141172419a (patch)
tree69a3d30a724149d77ccfef6255e1aeed684a7d22 /drivers/staging/greybus/hd.h
parent7bf7fa12fcb24fccb99d7957e44b8be6e0b82986 (diff)
downloadlinux-c8a657ba3f84643d7ef4b13ff6828e141172419a.tar.xz
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/hd.h')
-rw-r--r--drivers/staging/greybus/hd.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/staging/greybus/hd.h b/drivers/staging/greybus/hd.h
index 80573ae..8510816 100644
--- a/drivers/staging/greybus/hd.h
+++ b/drivers/staging/greybus/hd.h
@@ -30,6 +30,13 @@ struct gb_hd_driver {
bool async);
int (*cport_features_enable)(struct gb_host_device *hd, u16 cport_id);
int (*cport_features_disable)(struct gb_host_device *hd, u16 cport_id);
+ int (*timesync_enable)(struct gb_host_device *hd, u8 count,
+ u64 frame_time, u32 strobe_delay, u32 refclk);
+ int (*timesync_disable)(struct gb_host_device *hd);
+ int (*timesync_authoritative)(struct gb_host_device *hd,
+ u64 *frame_time);
+ int (*timesync_get_last_event)(struct gb_host_device *hd,
+ u64 *frame_time);
};
struct gb_host_device {