From 55ec09e898adb43cf69ebd8839e3d5656a0e7345 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 19 Jan 2016 23:30:42 -0800 Subject: [PATCH] greybus: svc: add ping command This implements the SVC "ping" command. It's tiny and simple, but we need something like this in order for us to "know" if all is working well. Signed-off-by: Greg Kroah-Hartman Reviewed-by: Viresh Kumar Signed-off-by: Greg Kroah-Hartman --- drivers/staging/greybus/greybus_protocols.h | 1 + drivers/staging/greybus/svc.c | 7 +++++++ drivers/staging/greybus/svc.h | 1 + 3 files changed, 9 insertions(+) diff --git a/drivers/staging/greybus/greybus_protocols.h b/drivers/staging/greybus/greybus_protocols.h index 2a48d95..3f51fb5 100644 --- a/drivers/staging/greybus/greybus_protocols.h +++ b/drivers/staging/greybus/greybus_protocols.h @@ -782,6 +782,7 @@ struct gb_spi_transfer_response { #define GB_SVC_TYPE_INTF_SET_PWRM 0x10 #define GB_SVC_TYPE_INTF_EJECT 0x11 #define GB_SVC_TYPE_KEY_EVENT 0x12 +#define GB_SVC_TYPE_PING 0x13 /* * SVC version request/response has the same payload as diff --git a/drivers/staging/greybus/svc.c b/drivers/staging/greybus/svc.c index ad04a95..8c675d3 100644 --- a/drivers/staging/greybus/svc.c +++ b/drivers/staging/greybus/svc.c @@ -363,6 +363,13 @@ int gb_svc_intf_set_power_mode(struct gb_svc *svc, u8 intf_id, u8 hs_series, } EXPORT_SYMBOL_GPL(gb_svc_intf_set_power_mode); +int gb_svc_ping(struct gb_svc *svc) +{ + return gb_operation_sync(svc->connection, GB_SVC_TYPE_PING, + NULL, 0, NULL, 0); +} +EXPORT_SYMBOL_GPL(gb_svc_ping); + static int gb_svc_version_request(struct gb_operation *op) { struct gb_connection *connection = op->connection; diff --git a/drivers/staging/greybus/svc.h b/drivers/staging/greybus/svc.h index f079b4d..f3e8479 100644 --- a/drivers/staging/greybus/svc.h +++ b/drivers/staging/greybus/svc.h @@ -55,6 +55,7 @@ int gb_svc_intf_set_power_mode(struct gb_svc *svc, u8 intf_id, u8 hs_series, u8 tx_mode, u8 tx_gear, u8 tx_nlanes, u8 rx_mode, u8 rx_gear, u8 rx_nlanes, u8 flags, u32 quirks); +int gb_svc_ping(struct gb_svc *svc); int gb_svc_protocol_init(void); void gb_svc_protocol_exit(void); -- 2.7.4