greybus: hid: Move request/response structure/definitions to greybus_protocols.h
authorViresh Kumar <viresh.kumar@linaro.org>
Wed, 12 Aug 2015 06:21:11 +0000 (11:51 +0530)
committerGreg Kroah-Hartman <gregkh@google.com>
Thu, 13 Aug 2015 03:57:56 +0000 (20:57 -0700)
These must be exposed to external modules, like gbsim. Move them to
greybus_protocols.h file.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/greybus_protocols.h
drivers/staging/greybus/hid.c

index e0aed3be21d08ff9049b34b21e360d597d4fb1f1..0ba11f8629d6736583053653de2b210ba7a06932 100644 (file)
@@ -258,6 +258,58 @@ struct gb_battery_voltage_response {
 };
 
 
+/* HID */
+
+/* Version of the Greybus hid protocol we support */
+#define GB_HID_VERSION_MAJOR           0x00
+#define GB_HID_VERSION_MINOR           0x01
+
+/* Greybus HID operation types */
+#define GB_HID_TYPE_INVALID            0x00
+#define GB_HID_TYPE_PROTOCOL_VERSION   0x01
+#define GB_HID_TYPE_GET_DESC           0x02
+#define GB_HID_TYPE_GET_REPORT_DESC    0x03
+#define GB_HID_TYPE_PWR_ON             0x04
+#define GB_HID_TYPE_PWR_OFF            0x05
+#define GB_HID_TYPE_GET_REPORT         0x06
+#define GB_HID_TYPE_SET_REPORT         0x07
+#define GB_HID_TYPE_IRQ_EVENT          0x08
+
+/* Report type */
+#define GB_HID_INPUT_REPORT            0
+#define GB_HID_OUTPUT_REPORT           1
+#define GB_HID_FEATURE_REPORT          2
+
+/* Different request/response structures */
+/* HID get descriptor response */
+struct gb_hid_desc_response {
+       __u8                            bLength;
+       __le16                          wReportDescLength;
+       __le16                          bcdHID;
+       __le16                          wProductID;
+       __le16                          wVendorID;
+       __u8                            bCountryCode;
+} __packed;
+
+/* HID get report request/response */
+struct gb_hid_get_report_request {
+       __u8                            report_type;
+       __u8                            report_id;
+};
+
+/* HID set report request */
+struct gb_hid_set_report_request {
+       __u8                            report_type;
+       __u8                            report_id;
+       __u8                            report[0];
+};
+
+/* HID input report request, via interrupt pipe */
+struct gb_hid_input_report_request {
+       __u8                            report[0];
+};
+
+
 /* I2C */
 
 /* Version of the Greybus i2c protocol we support */
index 887dbac8c117bd8323273abe175ab47b4e7dc561..0044b844c3e9578f177385d04b73806ec6c1869c 100644 (file)
 
 #include "greybus.h"
 
-/* Version of the Greybus hid protocol we support */
-#define GB_HID_VERSION_MAJOR           0x00
-#define GB_HID_VERSION_MINOR           0x01
-
-/* Greybus HID operation types */
-#define GB_HID_TYPE_INVALID            0x00
-#define GB_HID_TYPE_PROTOCOL_VERSION   0x01
-#define GB_HID_TYPE_GET_DESC           0x02
-#define GB_HID_TYPE_GET_REPORT_DESC    0x03
-#define GB_HID_TYPE_PWR_ON             0x04
-#define GB_HID_TYPE_PWR_OFF            0x05
-#define GB_HID_TYPE_GET_REPORT         0x06
-#define GB_HID_TYPE_SET_REPORT         0x07
-#define GB_HID_TYPE_IRQ_EVENT          0x08
-
-/* Report type */
-#define GB_HID_INPUT_REPORT            0
-#define GB_HID_OUTPUT_REPORT           1
-#define GB_HID_FEATURE_REPORT          2
-
-/* Different request/response structures */
-/* HID get descriptor response */
-struct gb_hid_desc_response {
-       __u8                            bLength;
-       __le16                          wReportDescLength;
-       __le16                          bcdHID;
-       __le16                          wProductID;
-       __le16                          wVendorID;
-       __u8                            bCountryCode;
-} __packed;
-
-/* HID get report request/response */
-struct gb_hid_get_report_request {
-       __u8                            report_type;
-       __u8                            report_id;
-};
-
-/* HID set report request */
-struct gb_hid_set_report_request {
-       __u8                            report_type;
-       __u8                            report_id;
-       __u8                            report[0];
-};
-
-/* HID input report request, via interrupt pipe */
-struct gb_hid_input_report_request {
-       __u8                            report[0];
-};
-
 /* Greybus HID device's structure */
 struct gb_hid {
        struct gb_connection            *connection;