From 1e8e22b5cb462e9c4da9c988b3355565cdef1d34 Mon Sep 17 00:00:00 2001 From: Johan Hovold Date: Sat, 23 Apr 2016 18:47:28 +0200 Subject: [PATCH] greybus: svc: add stub interface-activate function Add message structures (based on the current spec) for the SVC Interface Activate operation, and a stub function that always return the Greybus interface type. Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman --- drivers/staging/greybus/greybus_protocols.h | 14 ++++++++++++++ drivers/staging/greybus/svc.c | 9 +++++++++ drivers/staging/greybus/svc.h | 1 + 3 files changed, 24 insertions(+) diff --git a/drivers/staging/greybus/greybus_protocols.h b/drivers/staging/greybus/greybus_protocols.h index 82798cf3ea2b..9ef87972903e 100644 --- a/drivers/staging/greybus/greybus_protocols.h +++ b/drivers/staging/greybus/greybus_protocols.h @@ -802,6 +802,7 @@ 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_INTF_ACTIVATE 0x27 /* * SVC version request/response has the same payload as @@ -1008,6 +1009,19 @@ struct gb_svc_pwrmon_intf_sample_get_response { __le32 measurement; } __packed; +struct gb_svc_intf_activate_request { + __u8 intf_id; +} __packed; + +#define GB_SVC_INTF_TYPE_UNKNOWN 0x00 +#define GB_SVC_INTF_TYPE_DUMMY 0x01 +#define GB_SVC_INTF_TYPE_UNIPRO 0x02 +#define GB_SVC_INTF_TYPE_GREYBUS 0x03 + +struct gb_svc_intf_activate_response { + __u8 intf_type; +} __packed; + /* RAW */ /* Version of the Greybus raw protocol we support */ diff --git a/drivers/staging/greybus/svc.c b/drivers/staging/greybus/svc.c index cac9789b8f67..1b370195e4c3 100644 --- a/drivers/staging/greybus/svc.c +++ b/drivers/staging/greybus/svc.c @@ -274,6 +274,15 @@ int gb_svc_intf_unipro_set(struct gb_svc *svc, u8 intf_id, bool enable) return 0; } +int gb_svc_intf_activate(struct gb_svc *svc, u8 intf_id, u8 *intf_type) +{ + /* FIXME: implement */ + + *intf_type = GB_SVC_INTF_TYPE_GREYBUS; + + return 0; +} + int gb_svc_dme_peer_get(struct gb_svc *svc, u8 intf_id, u16 attr, u16 selector, u32 *value) { diff --git a/drivers/staging/greybus/svc.h b/drivers/staging/greybus/svc.h index 055948ce9e2b..546061198cb9 100644 --- a/drivers/staging/greybus/svc.h +++ b/drivers/staging/greybus/svc.h @@ -72,6 +72,7 @@ int gb_svc_intf_eject(struct gb_svc *svc, u8 intf_id); int gb_svc_intf_vsys_set(struct gb_svc *svc, u8 intf_id, bool enable); int gb_svc_intf_refclk_set(struct gb_svc *svc, u8 intf_id, bool enable); int gb_svc_intf_unipro_set(struct gb_svc *svc, u8 intf_id, bool enable); +int gb_svc_intf_activate(struct gb_svc *svc, u8 intf_id, u8 *intf_type); int gb_svc_dme_peer_get(struct gb_svc *svc, u8 intf_id, u16 attr, u16 selector, u32 *value); int gb_svc_dme_peer_set(struct gb_svc *svc, u8 intf_id, u16 attr, u16 selector, -- 2.20.1