Commit Graph

2321 Commits

Author SHA1 Message Date
Alex Elder 1dd7f58f8e greybus: fix the guard in "greybus_manifest.h"
The tag in the #ifndef guard surrounding the content of
"greybus_manifest.h" needs to be updated to reflect the
actual name of the file.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2014-09-29 18:06:27 -07:00
Alex Elder cb705e0dd0 greybus: fix document version number
Two spots use the old "0.draft" version number for the Greybus
protocol specification.  We've updated that to be 0.1.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2014-09-29 18:01:40 -07:00
Alex Elder 908a85d7dd greybus: update a few header file comments
Add a GPLv2 tag and reword some comments at the top of "greybus_desc.h"
and "svc_msg.h".

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2014-09-29 18:01:40 -07:00
Alex Elder 0db32a6d5e greybus: some more renames
This patch renames of symbols, for better clarity and consistency.

    cport -> cport_id (when it represents a cport *number*)
    send_svc_msg -> submit_svc (like submit_gbuf)
    greybus_cport_in_data -> greybus_cport_in
    gb_new_ap_msg -> greybus_svc_in (like greybus_cport_in)
    cport->number -> cport->id (like cport_id)

Making the svc and cport message stuff more similar is done with an
eye toward having SVC messages and messages exchanged with other
modules use some more common communication mechanisms.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2014-09-29 18:00:55 -07:00
Alex Elder 877b1ee82e greybus: encapsulate URB status checking
Define a new common function check_urb_status() that looks at the
status in a completed URB (containing incoming data) and issues
warnings in a consistent way.  It returns -EAGAIN to signal an
unrecognized status was seen, so the caller can ignore it and
re-post the URB to receive the next incoming data.  This
consolidates three blocks of code into one.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2014-09-29 18:00:10 -07:00
Matt Porter c41a366773 greybus: update descriptor type enums to match renumbering in spec
Greybus spec updated the descriptor type values and added an
additional class descriptor type. Change the enum accordingly.

Signed-off-by: Matt Porter <mporter@linaro.org>
Reviewed-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2014-09-29 17:58:08 -07:00
Matt Porter cbd0fd7b9b greybus: update string descriptor length field to __u8 type to match spec
Greybus spec was updated to make the length field a single byte. Update
the type and remove endian handling of that field in the core.

Signed-off-by: Matt Porter <mporter@linaro.org>
Reviewed-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2014-09-29 17:57:33 -07:00
Matt Porter 097724c2fb greybus: remove unused function descriptor fields and change class->function_type
Greybus spec was updated to remove a number of unused function descriptor
fields. In addition, the class field was change to function_type to avoid
confusion with the concept of high-level class drivers.

Signed-off-by: Matt Porter <mporter@linaro.org>
Reviewed-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2014-09-29 17:57:33 -07:00
Matt Porter 4fc645494f greybus: remove serial number descriptor to match spec
Greybus spec was updated to remove the serial number descriptor and
move the serial number field to the, now mandatory, module descriptor.
Change everything accordingly.

Signed-off-by: Matt Porter <mporter@linaro.org>
Reviewed-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2014-09-29 17:57:06 -07:00
Matt Porter 6d63ff7a2d greybus: update descriptor module_id->module to match spec
Greybus spec was updated to change the name of the Module ID descriptor
to simply Module descriptor. Change everything accordingly.

Signed-off-by: Matt Porter <mporter@linaro.org>
Reviewed-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2014-09-29 17:54:08 -07:00
Greg Kroah-Hartman dce745af21 greybus: fix up coding style issue I caused with the last patch... 2014-09-23 20:58:58 -07:00
Alex Elder 2e353685bf greybus: embed workqueue structure in struct gbuf
A Greybus buffer containing outbound data is submitted to to the
underlying driver to be sent over a CPort.  Sending that data could
be deferred, so the submit operation completes asynchronously.  When
the send is done, a callback occurs, and the buffer is "completed",
and the buffer's completion routine is called.  The buffer is then
freed.

If data arrives on the CPort, greybus_cport_in_data() is called
to allocate a Greybus buffer and copy the received data into it.
Once that's done the buffer is completed, again allowing the
buffer's completion routine to finish any final tasks before
freeing the buffer.

We use a workqueue to schedule calling the buffer's completion
function.  This patch does two things related to the work queue:
    - Renames the work queue "gbuf_workqueue" so its name more
      directly describes its purpose
    - Moves the work_struct needed for scheduling completions
      into the struct greybuf.  Previously a separate type
      was used, and dynamically allocated *at interrupt time*
      to hold this work_struct.  We can now do away with that.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2014-09-23 20:58:00 -07:00
Alex Elder 217b870e99 greybus: get rid of a weird idiom
It strikes me as strange to add one to a value while checking to see
if it exceeds a maximum.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2014-09-23 20:40:29 -07:00
Alex Elder 380f6bddc9 greybus: quick fix for sysfs serial number
Let the serial number attribute have its own is_visible function.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2014-09-23 20:40:29 -07:00
Alex Elder 778c69c9e2 greybus: rename struct greybus_device
The greybus_device structure represents an Ara phone module.
It does *not* (necessarily) represent a UniPro device, nor any
device (like an i2c adapter) that might reside on an Ara module.

As such, rename struct greybus_device to be struct greybus_module.
Rename all symbols having that type to be "gmod" rather than "gdev".

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2014-09-22 17:33:07 -07:00
Alex Elder 69f93abf11 greybus: simple fixes
A few silly little fixes.
    - Clear out some unnecessary #includes in "debugfs.c"
    - Drop some unneeded parentheses in hd_to_es1()
    - Use &hd->hd_priv in hd_to_es1() to emphasize we are working
      with an embedded array, not a pointer
    - Fix a comment in the header for ap_probe()
    - Drop a duplicate #include in "gpio-gb.c"
    - Fix a use-before-set problem in set_serial_info()

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2014-09-22 17:32:08 -07:00
Matt Porter be5064c75b greybus: initialize all fields in an SVC handshake message
Currently only the handshake_type is being initialized when
responding to an SVC handshake request. Update this to
explicitly set all header/payload fields appropriately.

Signed-off-by: Matt Porter <mporter@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2014-09-22 13:23:05 -07:00
Matt Porter 648cb6cb75 greybus: es1-ap-usb: fix svc control pipe flags
The control message flags currently indicate USB_DIR_IN, which
doesn't allow the data phase carrying the SVC message to be
send to the device. Change this to USB_DIR_OUT so our SVC
message buffer reaches the device.

Also, the recipient is USB_RECIP_OTHER but almost all real devices
that handle vendor setup requests seem to set this as
USB_RECIP_INTERFACE. As a result, functionfs-based gadgets don't handle
vendor setup requests with a recipient of OTHER. Change this to
USB_RECIP_INTERFACE to work with the functionfs-based emulator and
this should be no issue for the firmware to implement to match.

Signed-off-by: Matt Porter <mporter@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2014-09-22 13:23:05 -07:00
Greg Kroah-Hartman 4a833fdb7f greybus: core: hook up the hotplug message
We should now try to parse the manifest and create a device based on the
manifest.  Not hooked up to the driver core yet, so removing it isn't
going to do anything except cause problems...
2014-09-21 19:17:55 -07:00
Greg Kroah-Hartman d0cfd109c7 greybus: ap: validate the rest of the svc message buffer sizes 2014-09-21 19:10:39 -07:00
Greg Kroah-Hartman 00c52e4d3e greybus: ap: start validating the message better
We check the type of the message now.

Start to check the size of the payload to match the size of the message
type.  Still more work to do needed here.

Also "hooked up" the hotplug message, but doesn't call anything as the
core doesn't implement that yet...
2014-09-21 18:19:54 -07:00
Greg Kroah-Hartman 6779997d78 greybus: core.c: create empty functions to keep linking working for hotplug/remove 2014-09-21 18:17:36 -07:00
Greg Kroah-Hartman 85e0066c59 greybus: greybus.h: add function prototype for add/remove a module 2014-09-21 18:17:12 -07:00
Greg Kroah-Hartman 798ea88abe greybus: svc_msg.h: add data for hotplug message 2014-09-21 18:16:41 -07:00
Greg Kroah-Hartman 3e7736e5c1 greybus: gbuf: clean up logic of who owns what "part" of the gbuf
Started documenting the gbuf and how a greybus driver and a host
controller driver needs to interact with it, and the rest of the greybus
system.  It's crude documentation, but better than nothing for now...
2014-09-21 17:34:28 -07:00
Greg Kroah-Hartman f036e05600 greybus: gbuf: implement submission logic 2014-09-19 19:13:33 -07:00
Greg Kroah-Hartman 29f000f434 greybus: es1: set buffer sizes for messages based on email discussions
The gbuf sizes are 4k (i.e. PAGE_SIZE) and svc interrupt urb is 2k
2014-09-19 18:37:44 -07:00
Matt Porter 52adb56340 greybus: update GREYBUS_VERSION_[MAJOR|MINOR] to match spec
The Greybus spec was updated to have major=0 and minor=1 so update
this in the code.

Signed-off-by: Matt Porter <mporter@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2014-09-18 20:06:08 -07:00
Matt Porter e94e17143e greybus: move versioning from svc message header to handshake function
The Greybus spec has been updated to improve the efficiency of the
version major/minor information that had been previously carried in
every SVC message header. The version major/minor is now provided
as part of the handshake function.

Update the SVC msg header and handshake function payload definitions
and move the version major/minor validation into the SVC handshake
handling routine.

Signed-off-by: Matt Porter <mporter@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2014-09-18 20:06:08 -07:00
Matt Porter 710ecb0605 greybus: update svc_msg_header fields and users to match spec
The Greybus spec has been updated to clarify some of the original
intent of the SVC message definition. The svc_msg_header was:

struct svc_msg_header {
	__u8 function;
	__u8 message_type;
...
}

and is now

struct svc_msg_header {
	__u8 function_id;
	__u8 message_type;
...
}

to match the spec. The function_id carries enum svc_function_id values
and message_type is now clarified to be a session layer level field
that is simply "data" or "error".

Change all references of function type to function id. For now, don't
parse the message_type field but add the two allowable svc_msg_type enums.

Signed-off-by: Matt Porter <mporter@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2014-09-18 20:06:08 -07:00
Greg Kroah-Hartman 772149b6df greybus: fix hd init sequence of setting up parent and driver pointers properly 2014-09-14 12:27:28 -07:00
Greg Kroah-Hartman 13c8d9cd8a greybus: add test_sink driver 2014-09-14 12:27:19 -07:00
Greg Kroah-Hartman 45f3678bcf greybus: gbuf: cport in buffer stream logic 2014-09-14 11:40:35 -07:00
Greg Kroah-Hartman 80e04f0994 greybus: gbuf recieve path work, not done, dinner time... 2014-09-13 18:20:54 -07:00
Greg Kroah-Hartman ee6fb79902 greybus: devices: endpoint description of device 2014-09-13 17:31:27 -07:00
Greg Kroah-Hartman 7f9e05e15b greybus: es1: functionally complete
Have only tested USB device add/remove, the urbs seem to all be queued
up, no data has been tested to flow through yet.

Odds are the hc interface will have to change, but this is a good first
start to build on.
2014-09-13 17:28:33 -07:00
Greg Kroah-Hartman a1dc62b0c8 greybus: core: verify major/minor number of greybus protocol 2014-09-13 17:28:19 -07:00
Greg Kroah-Hartman 543b8ed2fe greybus: uart-gb: let the core dynamically allocate the major number
Don't register the tty_gb_driver, the gb core is not ready for the for
ES1 devices.
2014-09-13 17:02:47 -07:00
Greg Kroah-Hartman 168db1cd29 greybus: tty driver fixes to get init working properly 2014-09-13 16:15:52 -07:00
Greg Kroah-Hartman 082570b0ee greybus: es1 endpoint descriptor: minor fixes to get the config right 2014-09-13 16:15:07 -07:00
Greg Kroah-Hartman ac7171ea26 greybus: Makefile: add 'check' option to run sparse with endian checks enabled 2014-09-13 12:39:23 -07:00
Greg Kroah-Hartman b57b06241b greybus: ap: cleanup of process ap message loop 2014-09-13 12:18:09 -07:00
Greg Kroah-Hartman 88929c593d greybus: ap: convert to workqueue from thread 2014-09-13 11:35:02 -07:00
Greg Kroah-Hartman 9c8d3afdb5 greybus: es1: handle cport data in and out 2014-09-13 11:09:35 -07:00
Greg Kroah-Hartman 0dad95dc37 greybus: es1: allocate cport out urbs properly 2014-09-13 09:54:35 -07:00
Greg Kroah-Hartman 112997324d greybus: es1: add the start of cport urb handling. 2014-09-12 21:17:37 -07:00
Greg Kroah-Hartman 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
Greg Kroah-Hartman ccbb51ed42 greybus: Merge branch 'master' of github.com:gregkh/greybus 2014-09-11 08:22:57 -07:00
Greg Kroah-Hartman 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
Greg Kroah-Hartman a6294fe849 greybus: fix endian issue in sysfs.c 2014-09-10 17:12:20 -07:00
Greg Kroah-Hartman 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
Alex Elder 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
Alex Elder 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
Alex Elder 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
Alex Elder 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
Alex Elder 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
Alex Elder 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
Greg Kroah-Hartman d9d077fdbc greybus: es1: forgot to free our urb on disconnect 2014-09-08 20:11:18 -07:00
Greg Kroah-Hartman 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
Greg Kroah-Hartman 8b9951480b greybus: es1_ap_desc.c: updated ES1 USB device descriptor
Interrupt IN endpoint added.
2014-09-08 19:34:30 -07:00
Greg Kroah-Hartman fe3270425f greybus: minor whitespace cleanups to make checkpatch.pl happy 2014-09-07 15:57:07 -07:00
Greg Kroah-Hartman d47aa76161 greybus: battery FIXME added 2014-09-07 15:54:24 -07:00
Greg Kroah-Hartman 33ea3a3f56 greybus: add battery module 2014-09-07 15:39:34 -07:00
Greg Kroah-Hartman 43cc32a2ab greybus: first cut at parsing svc messages sent to the AP 2014-09-07 13:51:12 -07:00
Greg Kroah-Hartman 68f1fc4d2c greybus: more hd work 2014-09-07 13:12:11 -07:00
Greg Kroah-Hartman a39879fc08 greybus: host controller additions
Also some gbuf functions starting to get fleshed out.
2014-09-06 16:57:36 -07:00
Greg Kroah-Hartman d6e0e1c552 greybus: add es1_ap_desc.c to describe the ES1 USB device descriptors 2014-09-06 13:13:13 -07:00
Greg Kroah-Hartman f0e49eb059 greybus: uart-gb: remove unneeded THIS_MODULE setting 2014-09-06 11:42:25 -07:00
Marti Bolivar 7fabc884f9 greybus: uart-gb.c: dynamically allocate device numbers 2014-09-06 11:42:07 -07:00
Marti Bolivar 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
Greg Kroah-Hartman 48123e0e1e greybus: add proper packing to all greybus message types 2014-09-02 10:51:56 -07:00
Greg Kroah-Hartman 3be03d42cd greybus: minor checkpatch cleanups 2014-09-01 19:10:06 -07:00
Greg Kroah-Hartman 06340efb7c greybus: split sysfs functions out to separate file. 2014-09-01 19:05:54 -07:00
Greg Kroah-Hartman e24e7257b1 greybus: greybus_string() 2014-09-01 19:01:14 -07:00
Greg Kroah-Hartman 21ee4116fd greybus: module id attributes 2014-09-01 18:57:42 -07:00
Greg Kroah-Hartman 291f3b9e61 greybus: serial number attribute added 2014-09-01 18:41:39 -07:00
Greg Kroah-Hartman b94295e050 greybus: sysfs attributes for functions and more driver core integration. 2014-09-01 18:34:28 -07:00
Greg Kroah-Hartman 526c5c8d23 greybus: start parsing descriptor fields 2014-09-01 16:03:31 -07:00
Greg Kroah-Hartman a239f67c5d greybus: start parsing descriptor structures 2014-09-01 14:39:49 -07:00
Greg Kroah-Hartman d94a44a54e greybus: export gb_new_ap_msg so that the es1 module can use it 2014-09-01 14:39:34 -07:00
Greg Kroah-Hartman 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
Greg Kroah-Hartman 6dca7b97c7 greybus: get field names right for descriptors 2014-09-01 13:42:43 -07:00
Greg Kroah-Hartman 6584c8af70 greybus: s/greybus_device_id/greybus_module_id/g 2014-09-01 13:31:31 -07:00
Greg Kroah-Hartman d58778002b greybus: more changes due to name changes in the greybus document 2014-09-01 10:59:08 -07:00
Greg Kroah-Hartman 712d65915a greybus: greybus.h: tiny movement around 2014-09-01 09:51:51 -07:00
Greg Kroah-Hartman 3772f1610f greybus: header file s/u8/__u8/g 2014-09-01 09:51:33 -07:00
Greg Kroah-Hartman 80ebe8a631 greybus: greybus_desc.h created 2014-08-31 18:08:52 -07:00
Greg Kroah-Hartman b9b2a46265 greybus: split svc msg out into separate header file 2014-08-31 17:43:38 -07:00
Greg Kroah-Hartman 2ecd536de7 greybus: more structure definitions added 2014-08-31 17:25:22 -07:00
Greg Kroah-Hartman be1e2e9cd1 greybus: structures added 2014-08-31 16:21:33 -07:00
Greg Kroah-Hartman de536e3094 greybus: ap message loop added. 2014-08-31 16:17:04 -07:00
Greg Kroah-Hartman 27fb83109a greybus: register the bus with the driver core and add framework for debugfs files. 2014-08-31 13:54:59 -07:00
Greg Kroah-Hartman 6f83ab76b8 greybus: es1-ap-usb: more init framework added. 2014-08-30 17:30:04 -07:00
Greg Kroah-Hartman f1eec30ac8 greybus: first framework for the es1 ap controller 2014-08-30 17:18:14 -07:00
Greg Kroah-Hartman 8bf23e84d7 greybus: actually get the devm() change to build... 2014-08-30 17:18:04 -07:00
Greg Kroah-Hartman e5f167f1df greybus: can't use devm anymore, we aren't tieing into the driver model lifecycle :( 2014-08-30 17:11:41 -07:00
Greg Kroah-Hartman ba4468d464 greybus: initial framework for ES1 usb AP driver 2014-08-30 17:06:54 -07:00
Greg Kroah-Hartman eca17c5203 greybus: uart: tie into gb core properly 2014-08-30 16:54:05 -07:00
Greg Kroah-Hartman 56f10573be greybus: sdio: tie into gb core properly 2014-08-30 16:52:18 -07:00
Greg Kroah-Hartman 426f29d6be greybus: gpio: tie into gb core properly 2014-08-30 16:51:21 -07:00
Greg Kroah-Hartman 3d9efaaea3 greybus: i2c: use same naming convention everywhere 2014-08-30 16:49:59 -07:00
Greg Kroah-Hartman e7e0782c41 greybus: i2c: tie to the proper place on the greybus_device 2014-08-30 16:49:05 -07:00
Greg Kroah-Hartman db6e1fd264 greybus: hook up sdio, gpio, and tty into the greybus core. 2014-08-30 16:47:26 -07:00
Greg Kroah-Hartman 503c1cdbfb greybus: static module_init/exit functions 2014-08-30 16:21:03 -07:00
Greg Kroah-Hartman 199d68d4a8 greybus: start moving the function types into the greybus core 2014-08-30 16:20:22 -07:00
Alex Elder caaa8a838d greybus: uart-gb: a few minor bug fixes
Here are a few small bug fixes in uart-gb.c:
    - In wait_serial_change():
        - Return -EINVAL if *none* of the relevant flags are set in
          the "arg" parameter.
        - Balance the spin_lock_irq() with an unlock call (not
          another lock).
        - Rearrange a nested if structure (not a bug fix).
    - In tty_gb_probe():
        - Reset the greybus_device driver data in case of error.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-19 05:10:43 -05:00
Alex Elder ff5f0b3822 greybus: uart-gb: improve minor device number error checking
When alloc_minor() finds an available minor device number it
does not constrain the highest number desired.  Instead, it
relies on its caller, tty_gb_probe() to see if the returned
number indicates all minor numbers have been exhausted.

There are a couple problems with this--or rather with this
code.

First, if an allocation is attempted *after* GB_NUM_MINORS
is returned, a new number greater than (but not equal to)
GB_NUM_MINORS will be allocated, and that won't produce
any error condition.

Second, alloc_minor() can return an error code (like -ENOMEM).  And
its caller is only checking for GB_NUM_MINORS.  If an error code
is returned, tty_gb_probe() simply uses it.

Change alloc_minor() so it requests minor device numbers in the
range 0..(GB_NUM_MINORS-1), and use an error return to detect
when the minor device numbers have been exhausted.

If alloc_minor() returns -ENOSPC (from idr_alloc()), translate that
to -ENODEV.  The only other error we might see is -ENOMEM, and if
we get that, return it.

Finally, zero gb_tty->minor when it's released.  (If this is
actually important a reserved value like GB_NUM_MINORS should
be used instead to signify a gb_tty with no minor assigned.)

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-19 05:10:42 -05:00
Greg Kroah-Hartman e68453ed28 greybus: uart-gb: now builds, more framework added 2014-08-15 19:44:32 +08:00
Greg Kroah-Hartman a18e151757 greybus: more uart work 2014-08-15 18:54:11 +08:00
Greg Kroah-Hartman ff45c265f8 greybus: uart-gb: more work on tty functions 2014-08-15 18:33:33 +08:00
Greg Kroah-Hartman 79c822be7b greybus: uart framework added, doesn't build 2014-08-15 16:01:23 +08:00
Greg Kroah-Hartman e9023d227a greybus: gpio-gb.c: it now builds properly 2014-08-12 14:41:49 +08:00
Greg Kroah-Hartman c16854c3bf greybus: gpio driver 2014-08-12 12:00:16 +08:00
Greg Kroah-Hartman d5d1903dcd greybus: add framework for 'struct gbuf'
This is the equlivant of sk_buf or urbs for Greybus.
2014-08-11 19:03:20 +08:00
Greg Kroah-Hartman 83ddaaab01 greybus: Greybus SD/MMC host driver
Need to add specifics, but this should be enough to hook up to the mmc
framework.
2014-08-11 17:27:22 +08:00
Greg Kroah-Hartman 776f136c75 greybus: greybus.h: tiny coding style cleanups 2014-08-11 17:27:07 +08:00
Greg Kroah-Hartman 53419e07cc greybus: i2c-gb: actually add the i2c adapter properly... 2014-08-11 17:01:15 +08:00
Greg Kroah-Hartman 4c009fada1 greybus: update README with info on how to build and contact me. 2014-08-11 15:44:51 +08:00
Greg Kroah-Hartman 06823c3eb9 greybus: README and .gitignore updates 2014-08-11 15:32:12 +08:00
Greg Kroah-Hartman c8a797a98c greybus: Import most recent greybus code to new repo. 2014-08-11 15:30:45 +08:00
Greg Kroah-Hartman cd26f1bd6b greybus: Initial commit 2014-08-11 15:29:23 +08:00