Commit Graph

75 Commits

Author SHA1 Message Date
8c53e073f7 greybus: AP: move a bunch of svc message handling logic into ap.c
Add a send_svc_msg() callback to the host driver.
hook up ES1 driver to send control USB messages as it's SVC transport.
2014-09-12 20:47:11 -07:00
ccbb51ed42 greybus: Merge branch 'master' of github.com:gregkh/greybus 2014-09-11 08:22:57 -07:00
f91121b48f greybus: Fix build errors on older kernels.
Thanks to Marti for pointing out the code didn't build properly on 3.10.
Added kernel_ver.h to handle any api mis-matches between the code and
older kernel versions.
2014-09-11 08:22:06 -07:00
a6294fe849 greybus: fix endian issue in sysfs.c 2014-09-10 17:12:20 -07:00
3d5453261b greybus: pass appropriate type to create function
Based on a patch from Alex Elder <elder@linaro.org>.

Alex's original description:

Every descriptor in a manifest is interpreted by greybus_new_module().
We call a function to do initialization based on descriptor's type.

Since we know the type of the descriptor at that point, we can pass
to the called function the actual sub-type it needs (i.e., the union
member associated with the type).  This allows those functions to
be slightly simplified, and more focused.

Also change some size variables to have size_t type, and simplify a
few spots further by using sizeof(object) in place of sizeof(type).
2014-09-09 17:16:54 -07:00
e82bef42fd greybus: fix manifest parsing size bug
The type-specific "create" routines that get called while parsing
the descriptor entries in the module manifest assume the size they
are provided is the size of their data portion only--not including
the descriptor header.

Compute this value in greybus_new_module(), and pass it to those
functions rather than the full descriptor size.  Move a few
declarations to the innermost block that uses them.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2014-09-09 15:16:12 -07:00
57fc0a1104 greybus: validate descriptor sizes
When interpreting a manifest descriptor header, don't assume there
is enough space in the buffer to hold a descriptor header.  Also,
verify the remaining buffer is at least as big as the reported
descriptor size.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2014-09-09 15:15:05 -07:00
a22e15a1fc greybus: interpret descriptor type properly
The type field in a manifest descriptor header is in little endian
format.  Make sure we interpret it that way.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2014-09-09 15:09:59 -07:00
a5808add9a greybus: call put_device() on error
As soon as we've called device_initialize() we're required to call
put_device() in order to drop our reference to the device structure.
This was missed in the error path in greybus_new_module().  Fix that.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2014-09-09 15:09:06 -07:00
badad68e3a greybus: define struct greybus_manifest
Define a structure that describes the entire greybus manifest.
Adjust greybus_new_module() to use that, making it explicit that
it's not just a header that's being provided to that function.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2014-09-09 15:07:42 -07:00
05ad189c23 greybus: switch to the term "manifest"
We agreed to rename a few things to improve clarity.  This patch
implements one of those changes.  The blob of data that describes
what's relevant to Greybus within an Ara module will now be called
the "module manifest."  In addition, in the context of Greybus we'll
also be calling what's in an Ara module a "module" or "Greybus module."

So this patch renames some structures and updates some comments.  It
also renames "greybus_desc.h" to be "greybus_manifest.h", and renames
greybus_new_device() to be greybus_new_module().

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2014-09-09 15:05:25 -07:00
d9d077fdbc greybus: es1: forgot to free our urb on disconnect 2014-09-08 20:11:18 -07:00
47f6ef12fe greybus: es1: finialized USB device structure
Set up device properly and start up the SVC interrupt in endpoint for
processing data
2014-09-08 20:09:08 -07:00
8b9951480b greybus: es1_ap_desc.c: updated ES1 USB device descriptor
Interrupt IN endpoint added.
2014-09-08 19:34:30 -07:00
fe3270425f greybus: minor whitespace cleanups to make checkpatch.pl happy 2014-09-07 15:57:07 -07:00
d47aa76161 greybus: battery FIXME added 2014-09-07 15:54:24 -07:00
33ea3a3f56 greybus: add battery module 2014-09-07 15:39:34 -07:00
43cc32a2ab greybus: first cut at parsing svc messages sent to the AP 2014-09-07 13:51:12 -07:00
68f1fc4d2c greybus: more hd work 2014-09-07 13:12:11 -07:00
a39879fc08 greybus: host controller additions
Also some gbuf functions starting to get fleshed out.
2014-09-06 16:57:36 -07:00
d6e0e1c552 greybus: add es1_ap_desc.c to describe the ES1 USB device descriptors 2014-09-06 13:13:13 -07:00
f0e49eb059 greybus: uart-gb: remove unneeded THIS_MODULE setting 2014-09-06 11:42:25 -07:00
7fabc884f9 greybus: uart-gb.c: dynamically allocate device numbers 2014-09-06 11:42:07 -07:00
f8089c0c6e greybus: uart-gb.c: replace alloc_tty_driver with tty_alloc_driver
alloc_tty_driver() is deprecated.

Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2014-09-06 11:41:23 -07:00
48123e0e1e greybus: add proper packing to all greybus message types 2014-09-02 10:51:56 -07:00
3be03d42cd greybus: minor checkpatch cleanups 2014-09-01 19:10:06 -07:00
06340efb7c greybus: split sysfs functions out to separate file. 2014-09-01 19:05:54 -07:00
e24e7257b1 greybus: greybus_string() 2014-09-01 19:01:14 -07:00
21ee4116fd greybus: module id attributes 2014-09-01 18:57:42 -07:00
291f3b9e61 greybus: serial number attribute added 2014-09-01 18:41:39 -07:00
b94295e050 greybus: sysfs attributes for functions and more driver core integration. 2014-09-01 18:34:28 -07:00
526c5c8d23 greybus: start parsing descriptor fields 2014-09-01 16:03:31 -07:00
a239f67c5d greybus: start parsing descriptor structures 2014-09-01 14:39:49 -07:00
d94a44a54e greybus: export gb_new_ap_msg so that the es1 module can use it 2014-09-01 14:39:34 -07:00
ec909874c7 greybus: turn off warnings for es1-ap-usb.c to make it easier to build for now... 2014-09-01 14:39:14 -07:00
6dca7b97c7 greybus: get field names right for descriptors 2014-09-01 13:42:43 -07:00
6584c8af70 greybus: s/greybus_device_id/greybus_module_id/g 2014-09-01 13:31:31 -07:00
d58778002b greybus: more changes due to name changes in the greybus document 2014-09-01 10:59:08 -07:00
712d65915a greybus: greybus.h: tiny movement around 2014-09-01 09:51:51 -07:00
3772f1610f greybus: header file s/u8/__u8/g 2014-09-01 09:51:33 -07:00
80ebe8a631 greybus: greybus_desc.h created 2014-08-31 18:08:52 -07:00
b9b2a46265 greybus: split svc msg out into separate header file 2014-08-31 17:43:38 -07:00
2ecd536de7 greybus: more structure definitions added 2014-08-31 17:25:22 -07:00
be1e2e9cd1 greybus: structures added 2014-08-31 16:21:33 -07:00
de536e3094 greybus: ap message loop added. 2014-08-31 16:17:04 -07:00
27fb83109a greybus: register the bus with the driver core and add framework for debugfs files. 2014-08-31 13:54:59 -07:00
6f83ab76b8 greybus: es1-ap-usb: more init framework added. 2014-08-30 17:30:04 -07:00
f1eec30ac8 greybus: first framework for the es1 ap controller 2014-08-30 17:18:14 -07:00
8bf23e84d7 greybus: actually get the devm() change to build... 2014-08-30 17:18:04 -07:00
e5f167f1df greybus: can't use devm anymore, we aren't tieing into the driver model lifecycle :( 2014-08-30 17:11:41 -07:00