platform/kernel/linux-starfive.git
10 years agogreybus: greybus.h: add function prototype for add/remove a module
Greg Kroah-Hartman [Mon, 22 Sep 2014 01:17:12 +0000 (18:17 -0700)]
greybus: greybus.h: add function prototype for add/remove a module

10 years agogreybus: svc_msg.h: add data for hotplug message
Greg Kroah-Hartman [Mon, 22 Sep 2014 01:16:41 +0000 (18:16 -0700)]
greybus: svc_msg.h: add data for hotplug message

10 years agogreybus: gbuf: clean up logic of who owns what "part" of the gbuf
Greg Kroah-Hartman [Mon, 22 Sep 2014 00:34:28 +0000 (17:34 -0700)]
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...

10 years agogreybus: gbuf: implement submission logic
Greg Kroah-Hartman [Sat, 20 Sep 2014 02:13:33 +0000 (19:13 -0700)]
greybus: gbuf: implement submission logic

10 years agogreybus: es1: set buffer sizes for messages based on email discussions
Greg Kroah-Hartman [Sat, 20 Sep 2014 01:37:44 +0000 (18:37 -0700)]
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

10 years agogreybus: update GREYBUS_VERSION_[MAJOR|MINOR] to match spec
Matt Porter [Thu, 18 Sep 2014 19:25:43 +0000 (15:25 -0400)]
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>
10 years agogreybus: move versioning from svc message header to handshake function
Matt Porter [Thu, 18 Sep 2014 19:25:42 +0000 (15:25 -0400)]
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>
10 years agogreybus: update svc_msg_header fields and users to match spec
Matt Porter [Thu, 18 Sep 2014 19:25:41 +0000 (15:25 -0400)]
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>
10 years agogreybus: fix hd init sequence of setting up parent and driver pointers properly
Greg Kroah-Hartman [Sun, 14 Sep 2014 19:27:28 +0000 (12:27 -0700)]
greybus: fix hd init sequence of setting up parent and driver pointers properly

10 years agogreybus: add test_sink driver
Greg Kroah-Hartman [Sun, 14 Sep 2014 19:27:19 +0000 (12:27 -0700)]
greybus: add test_sink driver

10 years agogreybus: gbuf: cport in buffer stream logic
Greg Kroah-Hartman [Sun, 14 Sep 2014 18:40:35 +0000 (11:40 -0700)]
greybus: gbuf: cport in buffer stream logic

10 years agogreybus: gbuf recieve path work, not done, dinner time...
Greg Kroah-Hartman [Sun, 14 Sep 2014 01:20:54 +0000 (18:20 -0700)]
greybus: gbuf recieve path work, not done, dinner time...

10 years agogreybus: devices: endpoint description of device
Greg Kroah-Hartman [Sun, 14 Sep 2014 00:31:27 +0000 (17:31 -0700)]
greybus: devices: endpoint description of device

10 years agogreybus: es1: functionally complete
Greg Kroah-Hartman [Sun, 14 Sep 2014 00:28:33 +0000 (17:28 -0700)]
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.

10 years agogreybus: core: verify major/minor number of greybus protocol
Greg Kroah-Hartman [Sun, 14 Sep 2014 00:28:19 +0000 (17:28 -0700)]
greybus: core: verify major/minor number of greybus protocol

10 years agogreybus: uart-gb: let the core dynamically allocate the major number
Greg Kroah-Hartman [Sun, 14 Sep 2014 00:02:47 +0000 (17:02 -0700)]
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.

10 years agogreybus: tty driver fixes to get init working properly
Greg Kroah-Hartman [Sat, 13 Sep 2014 23:15:52 +0000 (16:15 -0700)]
greybus: tty driver fixes to get init working properly

10 years agogreybus: es1 endpoint descriptor: minor fixes to get the config right
Greg Kroah-Hartman [Sat, 13 Sep 2014 23:15:07 +0000 (16:15 -0700)]
greybus: es1 endpoint descriptor: minor fixes to get the config right

10 years agogreybus: Makefile: add 'check' option to run sparse with endian checks enabled
Greg Kroah-Hartman [Sat, 13 Sep 2014 19:39:23 +0000 (12:39 -0700)]
greybus: Makefile: add 'check' option to run sparse with endian checks enabled

10 years agogreybus: ap: cleanup of process ap message loop
Greg Kroah-Hartman [Sat, 13 Sep 2014 19:18:09 +0000 (12:18 -0700)]
greybus: ap: cleanup of process ap message loop

10 years agogreybus: ap: convert to workqueue from thread
Greg Kroah-Hartman [Sat, 13 Sep 2014 18:35:02 +0000 (11:35 -0700)]
greybus: ap: convert to workqueue from thread

10 years agogreybus: es1: handle cport data in and out
Greg Kroah-Hartman [Sat, 13 Sep 2014 18:09:35 +0000 (11:09 -0700)]
greybus: es1: handle cport data in and out

10 years agogreybus: es1: allocate cport out urbs properly
Greg Kroah-Hartman [Sat, 13 Sep 2014 16:54:35 +0000 (09:54 -0700)]
greybus: es1: allocate cport out urbs properly

10 years agogreybus: es1: add the start of cport urb handling.
Greg Kroah-Hartman [Sat, 13 Sep 2014 04:17:37 +0000 (21:17 -0700)]
greybus: es1: add the start of cport urb handling.

10 years agogreybus: AP: move a bunch of svc message handling logic into ap.c
Greg Kroah-Hartman [Sat, 13 Sep 2014 03:47:11 +0000 (20:47 -0700)]
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.

10 years agogreybus: Merge branch 'master' of github.com:gregkh/greybus
Greg Kroah-Hartman [Thu, 11 Sep 2014 15:22:57 +0000 (08:22 -0700)]
greybus: Merge branch 'master' of github.com:gregkh/greybus

10 years agogreybus: Fix build errors on older kernels.
Greg Kroah-Hartman [Thu, 11 Sep 2014 15:22:06 +0000 (08:22 -0700)]
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.

10 years agogreybus: fix endian issue in sysfs.c
Greg Kroah-Hartman [Thu, 11 Sep 2014 00:12:20 +0000 (17:12 -0700)]
greybus: fix endian issue in sysfs.c

10 years agogreybus: pass appropriate type to create function
Greg Kroah-Hartman [Wed, 10 Sep 2014 00:16:54 +0000 (17:16 -0700)]
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).

10 years agogreybus: fix manifest parsing size bug
Alex Elder [Tue, 9 Sep 2014 18:55:09 +0000 (13:55 -0500)]
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>
10 years agogreybus: validate descriptor sizes
Alex Elder [Tue, 9 Sep 2014 18:55:08 +0000 (13:55 -0500)]
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>
10 years agogreybus: interpret descriptor type properly
Alex Elder [Tue, 9 Sep 2014 18:55:07 +0000 (13:55 -0500)]
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>
10 years agogreybus: call put_device() on error
Alex Elder [Tue, 9 Sep 2014 18:55:06 +0000 (13:55 -0500)]
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>
10 years agogreybus: define struct greybus_manifest
Alex Elder [Tue, 9 Sep 2014 18:55:04 +0000 (13:55 -0500)]
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>
10 years agogreybus: switch to the term "manifest"
Alex Elder [Tue, 9 Sep 2014 18:55:03 +0000 (13:55 -0500)]
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>
10 years agogreybus: es1: forgot to free our urb on disconnect
Greg Kroah-Hartman [Tue, 9 Sep 2014 03:11:18 +0000 (20:11 -0700)]
greybus: es1: forgot to free our urb on disconnect

10 years agogreybus: es1: finialized USB device structure
Greg Kroah-Hartman [Tue, 9 Sep 2014 03:09:08 +0000 (20:09 -0700)]
greybus: es1: finialized USB device structure

Set up device properly and start up the SVC interrupt in endpoint for
processing data

10 years agogreybus: es1_ap_desc.c: updated ES1 USB device descriptor
Greg Kroah-Hartman [Tue, 9 Sep 2014 02:34:30 +0000 (19:34 -0700)]
greybus: es1_ap_desc.c: updated ES1 USB device descriptor

Interrupt IN endpoint added.

10 years agogreybus: minor whitespace cleanups to make checkpatch.pl happy
Greg Kroah-Hartman [Sun, 7 Sep 2014 22:57:07 +0000 (15:57 -0700)]
greybus: minor whitespace cleanups to make checkpatch.pl happy

10 years agogreybus: battery FIXME added
Greg Kroah-Hartman [Sun, 7 Sep 2014 22:54:24 +0000 (15:54 -0700)]
greybus: battery FIXME added

10 years agogreybus: add battery module
Greg Kroah-Hartman [Sun, 7 Sep 2014 22:39:34 +0000 (15:39 -0700)]
greybus: add battery module

10 years agogreybus: first cut at parsing svc messages sent to the AP
Greg Kroah-Hartman [Sun, 7 Sep 2014 20:51:12 +0000 (13:51 -0700)]
greybus: first cut at parsing svc messages sent to the AP

10 years agogreybus: more hd work
Greg Kroah-Hartman [Sun, 7 Sep 2014 20:12:11 +0000 (13:12 -0700)]
greybus: more hd work

10 years agogreybus: host controller additions
Greg Kroah-Hartman [Sat, 6 Sep 2014 23:57:36 +0000 (16:57 -0700)]
greybus: host controller additions

Also some gbuf functions starting to get fleshed out.

10 years agogreybus: add es1_ap_desc.c to describe the ES1 USB device descriptors
Greg Kroah-Hartman [Sat, 6 Sep 2014 20:13:13 +0000 (13:13 -0700)]
greybus: add es1_ap_desc.c to describe the ES1 USB device descriptors

10 years agogreybus: uart-gb: remove unneeded THIS_MODULE setting
Greg Kroah-Hartman [Sat, 6 Sep 2014 18:42:25 +0000 (11:42 -0700)]
greybus: uart-gb: remove unneeded THIS_MODULE setting

10 years agogreybus: uart-gb.c: dynamically allocate device numbers
Marti Bolivar [Sat, 6 Sep 2014 03:56:10 +0000 (23:56 -0400)]
greybus: uart-gb.c: dynamically allocate device numbers

10 years agogreybus: uart-gb.c: replace alloc_tty_driver with tty_alloc_driver
Marti Bolivar [Sat, 6 Sep 2014 03:56:09 +0000 (23:56 -0400)]
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>
10 years agogreybus: add proper packing to all greybus message types
Greg Kroah-Hartman [Tue, 2 Sep 2014 17:51:56 +0000 (10:51 -0700)]
greybus: add proper packing to all greybus message types

10 years agogreybus: minor checkpatch cleanups
Greg Kroah-Hartman [Tue, 2 Sep 2014 02:10:06 +0000 (19:10 -0700)]
greybus: minor checkpatch cleanups

10 years agogreybus: split sysfs functions out to separate file.
Greg Kroah-Hartman [Tue, 2 Sep 2014 02:05:54 +0000 (19:05 -0700)]
greybus: split sysfs functions out to separate file.

10 years agogreybus: greybus_string()
Greg Kroah-Hartman [Tue, 2 Sep 2014 02:01:14 +0000 (19:01 -0700)]
greybus: greybus_string()

10 years agogreybus: module id attributes
Greg Kroah-Hartman [Tue, 2 Sep 2014 01:57:42 +0000 (18:57 -0700)]
greybus: module id attributes

10 years agogreybus: serial number attribute added
Greg Kroah-Hartman [Tue, 2 Sep 2014 01:41:39 +0000 (18:41 -0700)]
greybus: serial number attribute added

10 years agogreybus: sysfs attributes for functions and more driver core integration.
Greg Kroah-Hartman [Tue, 2 Sep 2014 01:34:28 +0000 (18:34 -0700)]
greybus: sysfs attributes for functions and more driver core integration.

10 years agogreybus: start parsing descriptor fields
Greg Kroah-Hartman [Mon, 1 Sep 2014 23:03:31 +0000 (16:03 -0700)]
greybus: start parsing descriptor fields

10 years agogreybus: start parsing descriptor structures
Greg Kroah-Hartman [Mon, 1 Sep 2014 21:39:49 +0000 (14:39 -0700)]
greybus: start parsing descriptor structures

10 years agogreybus: export gb_new_ap_msg so that the es1 module can use it
Greg Kroah-Hartman [Mon, 1 Sep 2014 21:39:34 +0000 (14:39 -0700)]
greybus: export gb_new_ap_msg so that the es1 module can use it

10 years agogreybus: turn off warnings for es1-ap-usb.c to make it easier to build for now...
Greg Kroah-Hartman [Mon, 1 Sep 2014 21:39:14 +0000 (14:39 -0700)]
greybus: turn off warnings for es1-ap-usb.c to make it easier to build for now...

10 years agogreybus: get field names right for descriptors
Greg Kroah-Hartman [Mon, 1 Sep 2014 20:42:43 +0000 (13:42 -0700)]
greybus: get field names right for descriptors

10 years agogreybus: s/greybus_device_id/greybus_module_id/g
Greg Kroah-Hartman [Mon, 1 Sep 2014 20:31:31 +0000 (13:31 -0700)]
greybus: s/greybus_device_id/greybus_module_id/g

10 years agogreybus: more changes due to name changes in the greybus document
Greg Kroah-Hartman [Mon, 1 Sep 2014 17:59:08 +0000 (10:59 -0700)]
greybus: more changes due to name changes in the greybus document

10 years agogreybus: greybus.h: tiny movement around
Greg Kroah-Hartman [Mon, 1 Sep 2014 16:51:51 +0000 (09:51 -0700)]
greybus: greybus.h: tiny movement around

10 years agogreybus: header file s/u8/__u8/g
Greg Kroah-Hartman [Mon, 1 Sep 2014 16:51:33 +0000 (09:51 -0700)]
greybus: header file s/u8/__u8/g

10 years agogreybus: greybus_desc.h created
Greg Kroah-Hartman [Mon, 1 Sep 2014 01:08:52 +0000 (18:08 -0700)]
greybus: greybus_desc.h created

10 years agogreybus: split svc msg out into separate header file
Greg Kroah-Hartman [Mon, 1 Sep 2014 00:43:38 +0000 (17:43 -0700)]
greybus: split svc msg out into separate header file

10 years agogreybus: more structure definitions added
Greg Kroah-Hartman [Mon, 1 Sep 2014 00:25:22 +0000 (17:25 -0700)]
greybus: more structure definitions added

10 years agogreybus: structures added
Greg Kroah-Hartman [Sun, 31 Aug 2014 23:21:33 +0000 (16:21 -0700)]
greybus: structures added

10 years agogreybus: ap message loop added.
Greg Kroah-Hartman [Sun, 31 Aug 2014 23:17:04 +0000 (16:17 -0700)]
greybus: ap message loop added.

10 years agogreybus: register the bus with the driver core and add framework for debugfs files.
Greg Kroah-Hartman [Sun, 31 Aug 2014 20:54:59 +0000 (13:54 -0700)]
greybus: register the bus with the driver core and add framework for debugfs files.

10 years agogreybus: es1-ap-usb: more init framework added.
Greg Kroah-Hartman [Sun, 31 Aug 2014 00:30:04 +0000 (17:30 -0700)]
greybus: es1-ap-usb: more init framework added.

10 years agogreybus: first framework for the es1 ap controller
Greg Kroah-Hartman [Sun, 31 Aug 2014 00:18:14 +0000 (17:18 -0700)]
greybus: first framework for the es1 ap controller

10 years agogreybus: actually get the devm() change to build...
Greg Kroah-Hartman [Sun, 31 Aug 2014 00:18:04 +0000 (17:18 -0700)]
greybus: actually get the devm() change to build...

10 years agogreybus: can't use devm anymore, we aren't tieing into the driver model lifecycle :(
Greg Kroah-Hartman [Sun, 31 Aug 2014 00:11:41 +0000 (17:11 -0700)]
greybus: can't use devm anymore, we aren't tieing into the driver model lifecycle :(

10 years agogreybus: initial framework for ES1 usb AP driver
Greg Kroah-Hartman [Sun, 31 Aug 2014 00:06:54 +0000 (17:06 -0700)]
greybus: initial framework for ES1 usb AP driver

10 years agogreybus: uart: tie into gb core properly
Greg Kroah-Hartman [Sat, 30 Aug 2014 23:54:05 +0000 (16:54 -0700)]
greybus: uart: tie into gb core properly

10 years agogreybus: sdio: tie into gb core properly
Greg Kroah-Hartman [Sat, 30 Aug 2014 23:52:18 +0000 (16:52 -0700)]
greybus: sdio: tie into gb core properly

10 years agogreybus: gpio: tie into gb core properly
Greg Kroah-Hartman [Sat, 30 Aug 2014 23:51:21 +0000 (16:51 -0700)]
greybus: gpio: tie into gb core properly

10 years agogreybus: i2c: use same naming convention everywhere
Greg Kroah-Hartman [Sat, 30 Aug 2014 23:49:59 +0000 (16:49 -0700)]
greybus: i2c: use same naming convention everywhere

10 years agogreybus: i2c: tie to the proper place on the greybus_device
Greg Kroah-Hartman [Sat, 30 Aug 2014 23:49:05 +0000 (16:49 -0700)]
greybus: i2c: tie to the proper place on the greybus_device

10 years agogreybus: hook up sdio, gpio, and tty into the greybus core.
Greg Kroah-Hartman [Sat, 30 Aug 2014 23:47:26 +0000 (16:47 -0700)]
greybus: hook up sdio, gpio, and tty into the greybus core.

10 years agogreybus: static module_init/exit functions
Greg Kroah-Hartman [Sat, 30 Aug 2014 23:21:03 +0000 (16:21 -0700)]
greybus: static module_init/exit functions

10 years agogreybus: start moving the function types into the greybus core
Greg Kroah-Hartman [Sat, 30 Aug 2014 23:20:22 +0000 (16:20 -0700)]
greybus: start moving the function types into the greybus core

10 years agogreybus: uart-gb: a few minor bug fixes
Alex Elder [Mon, 18 Aug 2014 23:25:12 +0000 (18:25 -0500)]
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>
10 years agogreybus: uart-gb: improve minor device number error checking
Alex Elder [Mon, 18 Aug 2014 23:25:11 +0000 (18:25 -0500)]
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>
10 years agogreybus: uart-gb: now builds, more framework added
Greg Kroah-Hartman [Fri, 15 Aug 2014 11:44:32 +0000 (19:44 +0800)]
greybus: uart-gb: now builds, more framework added

10 years agogreybus: more uart work
Greg Kroah-Hartman [Fri, 15 Aug 2014 10:54:11 +0000 (18:54 +0800)]
greybus: more uart work

10 years agogreybus: uart-gb: more work on tty functions
Greg Kroah-Hartman [Fri, 15 Aug 2014 10:33:33 +0000 (18:33 +0800)]
greybus: uart-gb: more work on tty functions

10 years agogreybus: uart framework added, doesn't build
Greg Kroah-Hartman [Fri, 15 Aug 2014 08:01:23 +0000 (16:01 +0800)]
greybus: uart framework added, doesn't build

10 years agogreybus: gpio-gb.c: it now builds properly
Greg Kroah-Hartman [Tue, 12 Aug 2014 06:41:49 +0000 (14:41 +0800)]
greybus: gpio-gb.c: it now builds properly

10 years agogreybus: gpio driver
Greg Kroah-Hartman [Tue, 12 Aug 2014 04:00:16 +0000 (12:00 +0800)]
greybus: gpio driver

10 years agogreybus: add framework for 'struct gbuf'
Greg Kroah-Hartman [Mon, 11 Aug 2014 11:03:20 +0000 (19:03 +0800)]
greybus: add framework for 'struct gbuf'

This is the equlivant of sk_buf or urbs for Greybus.

10 years agogreybus: Greybus SD/MMC host driver
Greg Kroah-Hartman [Mon, 11 Aug 2014 09:27:22 +0000 (17:27 +0800)]
greybus: Greybus SD/MMC host driver

Need to add specifics, but this should be enough to hook up to the mmc
framework.

10 years agogreybus: greybus.h: tiny coding style cleanups
Greg Kroah-Hartman [Mon, 11 Aug 2014 09:27:07 +0000 (17:27 +0800)]
greybus: greybus.h: tiny coding style cleanups

10 years agogreybus: i2c-gb: actually add the i2c adapter properly...
Greg Kroah-Hartman [Mon, 11 Aug 2014 09:01:15 +0000 (17:01 +0800)]
greybus: i2c-gb: actually add the i2c adapter properly...

10 years agogreybus: update README with info on how to build and contact me.
Greg Kroah-Hartman [Mon, 11 Aug 2014 07:44:51 +0000 (15:44 +0800)]
greybus: update README with info on how to build and contact me.

10 years agogreybus: README and .gitignore updates
Greg Kroah-Hartman [Mon, 11 Aug 2014 07:32:12 +0000 (15:32 +0800)]
greybus: README and .gitignore updates

10 years agogreybus: Import most recent greybus code to new repo.
Greg Kroah-Hartman [Mon, 11 Aug 2014 07:30:45 +0000 (15:30 +0800)]
greybus: Import most recent greybus code to new repo.

10 years agogreybus: Initial commit
Greg Kroah-Hartman [Mon, 11 Aug 2014 07:29:23 +0000 (15:29 +0800)]
greybus: Initial commit