1
0
Fork 0
Commit Graph

28 Commits (579b9239c1f38665b21e8d0e6ee83ecc96dbd6bb)

Author SHA1 Message Date
Ioannis Valasakis f5e4e5e7ae staging: greybus: correct SPDX License Identifier
Replace SPDX License Identifier comments with C comments.
Reported by checkpatch.

Signed-off-by: Ioannis Valasakis <code@wizofe.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-09 09:49:02 -08:00
Greg Kroah-Hartman 863dbc52e7 staging: greybus: Remove redundant license text
Now that the SPDX tag is in all greybus files, that identifies the
license in a specific and legally-defined manner.  So the extra GPL text
wording can be removed as it is no longer needed at all.

This is done on a quest to remove the 700+ different ways that files in
the kernel describe the GPL license text.  And there's unneeded stuff
like the address (sometimes incorrect) for the FSF which is never
needed.

No copyright headers or other non-license-description text was removed.

Cc: Vaibhav Hiremath <hvaibhav.linux@gmail.com>
Reviewed-by: Alex Elder <elder@linaro.org>
Acked-by: Vaibhav Agarwal <vaibhav.sr@gmail.com>
Acked-by: David Lin <dtwlin@gmail.com>
Acked-by: Johan Hovold <johan@kernel.org>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Acked-by: Mark Greer <mgreer@animalcreek.com>
Acked-by: Rui Miguel Silva <rmfrfs@gmail.com>
Acked-by: "Bryan O'Donoghue" <pure.logic@nexus-software.ie>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-11 14:46:21 +01:00
Greg Kroah-Hartman eb50fd3a22 staging: greybus: add SPDX identifiers to all greybus driver files
It's good to have SPDX identifiers in all files to make it easier to
audit the kernel tree for correct licenses.

Update the drivers/staging/greybus files files with the correct SPDX
license identifier based on the license text in the file itself.  The
SPDX identifier is a legally binding shorthand, which can be used
instead of the full boiler plate text.

This work is based on a script and data from Thomas Gleixner, Philippe
Ombredanne, and Kate Stewart.

Cc: Vaibhav Hiremath <hvaibhav.linux@gmail.com>
Cc: "Bryan O'Donoghue" <pure.logic@nexus-software.ie>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Kate Stewart <kstewart@linuxfoundation.org>
Cc: Philippe Ombredanne <pombredanne@nexb.com>
Acked-by: Vaibhav Agarwal <vaibhav.sr@gmail.com>
Acked-by: David Lin <dtwlin@gmail.com>
Reviewed-by: Alex Elder <elder@linaro.org>
Acked-by: Johan Hovold <johan@kernel.org>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Acked-by: Mark Greer <mgreer@animalcreek.com>
Acked-by: Rui Miguel Silva <rmfrfs@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-11 14:46:20 +01:00
Greg Kroah-Hartman 948c6227e7 staging: greybus: remove CONFIG_PM_RUNTIME from kernel_ver.h
The last thing remaining in kernel_ver.h was the setting of
CONFIG_PM_RUNTIME, which isn't needed in a in-tree implementation.  So
remove the setting of this value, and the .h file entirely as that was
the last thing left in it.

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-09-19 16:52:07 +02:00
David Lin 61e13db9cc greybus: bundle: add runtime pm support
This patch adds runtime pm support for the bundle core. Unbound bundle
devices are always deactivated. During probe, Runtime PM status is set
to enabled and active and the usage count is incremented. If the driver
supports runtime PM, it should call pm_runtime_put() in its probe
routine and pm_runtime_get_sync() in remove routine as bundle needs to
be resume before it can be deactivated.

Testing Done:
 - Check runtime_status of the bundle driver when bundle goes to suspend

Signed-off-by: David Lin <dtwlin@google.com>
Signed-off-by: Axel Haslam <ahaslam@baylibre.com>
Reviewed-by: Johan Hovold <johan@hovoldconsulting.com>
Signed-off-by: Alex Elder <elder@linaro.org>
2016-07-14 16:53:55 -05:00
Alex Elder 76639ef579 greybus: define BUNDLE_ID_NONE
Define a bundle ID that means "no bundle".  This will be used for
tracing connection events during the portion of a connection's
lifetime when it has no bundle associated with it.  Don't allow
any bundle to be created using that ID.

Signed-off-by: Alex Elder <elder@linaro.org>
Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-06-03 17:03:23 -07:00
Johan Hovold e9f2f688d1 greybus: interface: clean up device-id handling
Clean up the device id-handling and make sure we never allocate invalid
device ids due to a missing upper bound.

Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-03-30 14:23:19 -07:00
Johan Hovold 8d46ec4981 greybus: bundle: remove private data field
Remove the private data field from the bundle structure as it is no
longer needed. Bundle drivers can use the driver data field in the
bundle device.

Update the only current user to use the connection private data until it
has been converted to a bundle driver.

Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-02-11 21:46:03 -08:00
Johan Hovold 98fdf5a037 greybus: core: defer connection creation to driver probe
Defer connection creation to bundle driver probe instead of creating
them when initialising the interface and parsing the manifest.

Store copies of the CPorts descriptors in the bundle for the drivers to
use, and update the legacy driver.

This is needed for drivers that need more control over host-device
resource management, for example, when a protocol needs to use a
dedicated host CPort for traffic offloading (e.g. camera data).

This also avoids allocating host CPorts for bundles that are not bound
to a driver or for remote CPorts that a driver does not need.

Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-01-21 22:45:09 -08:00
Johan Hovold b807aa7aa5 greybus: control: add bundle-version operation
Add bundle-version operation to fetch the version of the bundle class.

Retrieve the bundle version of all bundles when initialising the
interface in case the control-protocol version is greater than 0.1.

Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-01-19 12:17:13 -08:00
Johan Hovold a7e36d0eac greybus: bundle: separate bundle creation and registration
Separate bundle creation and registration.

Note that the bundle connections still needs to be initialised post
registration as protocol drivers create child devices to the bundle.

This will ultimately allow connection structures to be created while
parsing manifests, but the connections to not be enabled until a driver
is bound.

Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-12-08 15:56:38 -05:00
Johan Hovold 1db1b24304 greybus: bundle: kill the bundle lock
Kill the bundle lock, which looked like it protected the interface
bundle lists but really did not as lock-less manipulations were still
made.

No locking for the interface bundle list is in fact needed as bundles
are created along with the interface, and the list is only used to check
for duplicate bundle ids when parsing the manifest and to destroy the
bundles when removing the interface itself.

Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-12-08 15:56:38 -05:00
Johan Hovold 2d54e4db4e greybus: bundle: kill gb_bundle_bind_protocols
Remove gb_bundle_bind_protocols() that was used to iterate over all
registered bundles and bind protocols to them should a protocol become
available post bundle creation.

The protocol abstraction as a generic construct is going away in favour
of class drivers. Connections will be setup when a class driver is
probed, and driver modules can be loaded on-demand by user space based
on uevents and modalias.

Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-12-08 15:31:14 -05:00
Johan Hovold a2cc7404e1 greybus: bundle: remove obsolete function prototype
Remove obsolete function prototype that was left after a recent code
relocation.

Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-12-07 14:34:46 -05:00
Greg Kroah-Hartman 6ea462a4fc greybus: bundle.h: add a private field to struct gb_bundle
The gb_bundle structure needs a private field if we are going to be able
to replace the gb_connection device with this one for all use cases.

Ideally we could use the private pointer within the struct device, but
for now let's just try to mirror how people were using the gb_connection
structure to make the patches simpler, and the logic the same.

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: Alex Elder <elder@linaro.org>
Reviewed-by: Johan Hovold <johan@hovoldconsulting.com>
2015-10-19 12:09:10 -07:00
Viresh Kumar 5677d48b97 greybus: bundles: remove gb_bundle(s)_init()
They aren't used anymore, remove them. This also gets rid of
gb_bundle_connections_init().

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-07-01 16:38:42 -07:00
Viresh Kumar c3add7883c greybus: interface: device_id belongs to the interface
While introducing bundles, the device_id also got moved to the bundle,
whereas it identifies an interface block to the AP.

Move it back to interface instead of bundle.

Calls to gb_bundle(s)_init() are dropped as connections will be
initialized while they are created now, as device_id will be valid.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-07-01 16:38:42 -07:00
Alex Elder fe53b45ca8 greybus: bundle: fix gb_bundle_destroy()
Currently gb_bundle_destroy() takes an interface as an argument,
and really doesn't do what a function by that name should do.

What it now does is delete all bundles associated with a given
interface.  What it should do is destroy a single bundle.

Move the looping logic out of gb_bundle_destroy() and into its
caller, gb_interface_destroy().  Pass each bundle in an interface to
gb_bundle_destroy(), which will do what's required to destroy a
single bundle (including removing it from its interface's bundle
list under protection of the lock).

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-06-12 12:14:24 -07:00
Greg Kroah-Hartman 75052a5504 greybus: bundle: add state sysfs file
A bundle has a state file, that is managed by the endo userspace
process.  This file can be written to and any process that is polling on
the file will be woken up and can read the new value.  It's a "cheap"
IPC for programs that are not allowed to do anything other than
read/write to kernel sysfs files.

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-04-17 16:12:49 +02:00
Viresh Kumar 88e6d37c44 greybus: bundle: s/class_type/class
Alex suggested to name it class instead of class type.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-04-06 12:47:06 +02:00
Viresh Kumar 9f5f30e712 greybus: driver corresponds to a bundle, not interface
A Greybus driver will bind to a bundle, not an interface. Lets follow
this rule in code.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-04-06 12:07:30 +02:00
Viresh Kumar bb97ea813b greybus: bundle: Initialize all bundles on link-up
An interface can have 1 or more bundles. On link-up event, we must initialize
all the bundles associated with the interface.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-04-06 11:34:39 +02:00
Viresh Kumar 7c183f70ed greybus: bundle: Create bundles using bundle descriptors
Currently we are creating bundles based on interface descriptors. An interface
can have one or more bundles associated with it and so a bundle must be created
based on a bundle descriptor.

Also get class_type from bundle descriptor.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-04-06 11:34:39 +02:00
Greg Kroah-Hartman 1b6ea0db01 greybus: bundle: create GB_DEVICE_ID_BAD
Use a "name" for when we don't have a valid device id yet, instead of a
magic value of 0xff.

Reported-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
Reviewed-by: Alex Elder <elder@linaro.org>
2015-01-02 13:05:42 -08:00
Greg Kroah-Hartman fb69cb506c greybus: protocol: split binding of prototcols to connections out of init
When adding a new protocol to the system, walk all bundles and try to
hook up any connections that do not have a protocol already.  This sets
the stage to allow for protocols to be loaded at any time, not just
before the device is seen in the system.

Reviewed-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2014-12-23 21:04:02 -08:00
Greg Kroah-Hartman 4ab9b3c24b greybus: interface: s/gb_interface_block/gb_interface/g
Rename struct gb_interface_block to struct gb_interface

Lots of renaming, and variable renames as well (gb_ib->intf), but all
should be sane with regards to the new naming scheme we are using.

Reviewed-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2014-12-19 15:35:44 -08:00
Greg Kroah-Hartman 1db0a5ff3a greybus: bundle: s/gb_interface/gb_bundle/g
Rename struct gb_interface to struct gb_bundle

It's a lot of renaming, some structures got renamed and also some
fields, but the goal was to rename things to make sense with the new
naming of how the system is put together in the 'driver model' view.

Reviewed-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2014-12-13 13:37:49 -05:00
Greg Kroah-Hartman 3bdec69931 greybus: bundle: rename interface.[c|h] to bundle.[c|h]
We are renameing the "interface" term to "bundle" so rename the files
before we start changing structure names to make it easier for people to
see what really is happening in the changes.

Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
Reviewed-by: Alex Elder <elder@linaro.org>
2014-12-13 13:35:33 -05:00