From 596e4a1933e4f6f2b19d5c05884d35cb91e3cf58 Mon Sep 17 00:00:00 2001 From: Bryan O'Donoghue Date: Thu, 5 May 2016 15:34:55 +0100 Subject: [PATCH] greybus: greybus_protocols.h Add SVC_TIMESYNC_WAKE_PINS_ACQUIRE/RELEASE Its necessary to establish an initial state on the wake-detect lines before enabling timesync on APB/GPB in order to ensure all GPIO edge-transitions are correctly interpreted by the receiving processor. This patch adds the operations defined in the Greybus specification to greybus_protocols.h, this involves adding the SVC_TIMESYNC_WAKE_PINS_ACQUIRE and SVC_TIMESYNC_WAKE_PINS_RELEASE commands and moving the 'strobe_mask' parameter from 'struct gb_svc_timesync_enable_request' to 'struct gb_svc_timesync_wd_pins_acquire_request' since the communication of the strobe_mask will be communicated before preparing any of the bridges to receive the TimeSync pulses. A separate patch to the greybus specification describes the transition between the wake sub-state and the timesync sub-state. Signed-off-by: Bryan O'Donoghue Reviewed-by: Vaibhav Hiremath Reviewed-by: Alex Elder Signed-off-by: Greg Kroah-Hartman --- drivers/staging/greybus/greybus_protocols.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/staging/greybus/greybus_protocols.h b/drivers/staging/greybus/greybus_protocols.h index 5f5b92864ac2..d5a63d38a28a 100644 --- a/drivers/staging/greybus/greybus_protocols.h +++ b/drivers/staging/greybus/greybus_protocols.h @@ -835,6 +835,8 @@ struct gb_spi_transfer_response { #define GB_SVC_TYPE_PWRMON_RAIL_NAMES_GET 0x15 #define GB_SVC_TYPE_PWRMON_SAMPLE_GET 0x16 #define GB_SVC_TYPE_PWRMON_INTF_SAMPLE_GET 0x17 +#define GB_SVC_TYPE_TIMESYNC_WAKE_PINS_ACQUIRE 0x18 +#define GB_SVC_TYPE_TIMESYNC_WAKE_PINS_RELEASE 0x19 #define GB_SVC_TYPE_MODULE_INSERTED 0x1f #define GB_SVC_TYPE_MODULE_REMOVED 0x20 #define GB_SVC_TYPE_INTF_ACTIVATE 0x27 @@ -955,7 +957,6 @@ struct gb_svc_timesync_enable_request { __u8 count; __le64 frame_time; __le32 strobe_delay; - __le32 strobe_mask; __le32 refclk; } __packed; /* timesync enable response has no payload */ @@ -965,6 +966,15 @@ struct gb_svc_timesync_authoritative_response { __le64 frame_time[GB_TIMESYNC_MAX_STROBES]; }; +struct gb_svc_timesync_wake_pins_acquire_request { + __le32 strobe_mask; +}; + +/* timesync wake pins acquire response has no payload */ + +/* timesync wake pins release request has no payload */ +/* timesync wake pins release response has no payload */ + #define GB_SVC_UNIPRO_FAST_MODE 0x01 #define GB_SVC_UNIPRO_SLOW_MODE 0x02 #define GB_SVC_UNIPRO_FAST_AUTO_MODE 0x04 -- 2.39.2