Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
80ebe8a6
Commit
80ebe8a6
authored
Aug 31, 2014
by
Greg Kroah-Hartman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
greybus: greybus_desc.h created
parent
b9b2a462
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
105 additions
and
7 deletions
+105
-7
drivers/staging/greybus/ap.c
drivers/staging/greybus/ap.c
+1
-1
drivers/staging/greybus/greybus_desc.h
drivers/staging/greybus/greybus_desc.h
+95
-0
drivers/staging/greybus/svc_msg.h
drivers/staging/greybus/svc_msg.h
+9
-6
No files found.
drivers/staging/greybus/ap.c
View file @
80ebe8a6
...
...
@@ -17,9 +17,9 @@
#include <linux/kthread.h>
#include <linux/device.h>
#include "svc_msg.h"
#include "greybus_desc.h"
#include "greybus.h"
struct
ap_msg
{
u8
*
data
;
int
size
;
...
...
drivers/staging/greybus/greybus_desc.h
0 → 100644
View file @
80ebe8a6
/*
* Greybus device descriptor definition
*
* Defined in the "Greybus Application Protocol" document.
* See that document for any details on these values and structures.
*
* Copyright 2014 Google Inc.
*/
#ifndef __GREYBUS_DESC_H
#define __GREYBUS_DESC_H
struct
greybus_decriptor_block_header
{
__le16
size
;
u8
version_major
;
u8
version_minor
;
};
enum
greybus_descriptor_type
{
GREYBUS_TYPE_INVALID
=
0x0000
,
GREYBUS_TYPE_DEVICE_ID
=
0x0001
,
GREYBUS_TYPE_SERIAL_NUMBER
=
0x0002
,
GREYBUS_TYPE_DEVICE_STRING
=
0x0003
,
GREYBUS_TYPE_CPORT
=
0x0004
,
GREYBUS_TYPE_FUNCTION
=
0x0005
,
};
struct
greybus_descriptor_header
{
__le16
size
;
__le16
type
;
/* enum greybus_descriptor_type */
};
struct
greybus_descriptor_deviceid
{
__le16
vendor
;
__le16
product
;
__le16
version
;
u8
vendor_stringid
;
u8
product_stringid
;
};
struct
greybus_descriptor_serial_number
{
__le64
serial_number
;
};
struct
greybus_descriptor_string
{
u8
id
;
__le16
length
;
u8
string
[
0
];
};
struct
greybus_descriptor_cport
{
__le16
number
;
u8
speed
;
// FIXME
u8
reserved
;
};
enum
greybus_function_class
{
GREYBUS_FUNCTION_CONTROL
=
0x00
,
GREYBUS_FUNCTION_USB
=
0x01
,
GREYBUS_FUNCTION_GPIO
=
0x02
,
GREYBUS_FUNCTION_SPI
=
0x03
,
GREYBUS_FUNCTION_UART
=
0x04
,
GREYBUS_FUNCTION_PWM
=
0x05
,
GREYBUS_FUNCTION_I2S
=
0x06
,
GREYBUS_FUNCTION_I2C
=
0x07
,
GREYBUS_FUNCTION_SDIO
=
0x08
,
GREYBUS_FUNCTION_HID
=
0x09
,
GREYBUS_FUNCTION_DISPLAY
=
0x0a
,
GREYBUS_FUNCTION_CAMERA
=
0x0b
,
GREYBUS_FUNCTION_SENSOR
=
0x0c
,
GREYBUS_FUNCTION_VENDOR
=
0xff
,
};
struct
greybus_descriptor_function
{
__le16
number
;
__le16
cport
;
u8
function_class
;
/* enum greybus_function_class */
u8
function_subclass
;
u8
function_protocol
;
u8
reserved
;
};
struct
greybus_msg_descriptor
{
struct
greybus_descriptor_header
header
;
union
{
struct
greybus_descriptor_deviceid
device_id
;
struct
greybus_descriptor_serial_number
serial_number
;
struct
greybus_descriptor_string
string
;
struct
greybus_descriptor_cport
cport
;
struct
greybus_descriptor_function
function
;
};
};
#endif
/* __GREYBUS_DESC_H */
drivers/staging/greybus/svc_msg.h
View file @
80ebe8a6
...
...
@@ -6,6 +6,10 @@
*
* Copyright 2014 Google Inc.
*/
#ifndef __SVC_MSG_H
#define __SVC_MSG_H
enum
svc_function_type
{
SVC_FUNCTION_HANDSHAKE
=
0x00
,
SVC_FUNCTION_UNIPRO_NETWORK_MANAGEMENT
=
0x01
,
...
...
@@ -21,7 +25,7 @@ struct svc_msg_header {
u8
type
;
/* enum svc_function_type */
u8
version_major
;
u8
version_minor
;
u
16
payload_length
;
__le
16
payload_length
;
};
enum
svc_function_handshake_type
{
...
...
@@ -81,7 +85,7 @@ struct svc_function_ddb_get {
struct
svc_function_ddb_response
{
u8
device_id
;
u8
message_id
;
u
16
descriptor_length
;
__le
16
descriptor_length
;
u8
ddb
[
0
];
};
...
...
@@ -107,8 +111,8 @@ enum svc_function_battery_status {
};
struct
svc_function_power_battery_status
{
u
16
charge_full
;
u
16
charge_now
;
__le
16
charge_full
;
__le
16
charge_now
;
u8
status
;
/* enum svc_function_battery_status */
};
...
...
@@ -158,5 +162,4 @@ struct svc_msg {
};
};
#endif
/* __SVC_MSG_H */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment