summaryrefslogtreecommitdiffstats
path: root/drivers/staging/greybus/bundle.h
AgeCommit message (Collapse)AuthorFilesLines
2017-11-11staging: greybus: Remove redundant license textGreg Kroah-Hartman1-2/+0
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-11staging: greybus: add SPDX identifiers to all greybus driver filesGreg Kroah-Hartman1-0/+1
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>
2016-09-19staging: greybus: remove CONFIG_PM_RUNTIME from kernel_ver.hGreg Kroah-Hartman1-1/+1
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-07-14greybus: bundle: add runtime pm supportDavid Lin1-0/+47
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-06-03greybus: define BUNDLE_ID_NONEAlex Elder1-0/+2
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-03-30greybus: interface: clean up device-id handlingJohan Hovold1-2/+0
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-02-11greybus: bundle: remove private data fieldJohan Hovold1-1/+0
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-01-21greybus: core: defer connection creation to driver probeJohan Hovold1-0/+3
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-19greybus: control: add bundle-version operationJohan Hovold1-0/+4
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>
2015-12-08greybus: bundle: separate bundle creation and registrationJohan Hovold1-0/+1
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-08greybus: bundle: kill the bundle lockJohan Hovold1-2/+0
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-08greybus: bundle: kill gb_bundle_bind_protocolsJohan Hovold1-1/+0
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-07greybus: bundle: remove obsolete function prototypeJohan Hovold1-4/+0
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-10-19greybus: bundle.h: add a private field to struct gb_bundleGreg Kroah-Hartman1-0/+1
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-07-01greybus: bundles: remove gb_bundle(s)_init()Viresh Kumar1-2/+0
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-01greybus: interface: device_id belongs to the interfaceViresh Kumar1-3/+2
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-06-12greybus: bundle: fix gb_bundle_destroy()Alex Elder1-1/+1
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-04-17greybus: bundle: add state sysfs fileGreg Kroah-Hartman1-0/+1
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-06greybus: bundle: s/class_type/classViresh Kumar1-2/+2
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-06greybus: driver corresponds to a bundle, not interfaceViresh Kumar1-0/+4
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-06greybus: bundle: Initialize all bundles on link-upViresh Kumar1-1/+2
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-06greybus: bundle: Create bundles using bundle descriptorsViresh Kumar1-1/+3
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-01-02greybus: bundle: create GB_DEVICE_ID_BADGreg Kroah-Hartman1-0/+2
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>
2014-12-23greybus: protocol: split binding of prototcols to connections out of initGreg Kroah-Hartman1-0/+1
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-19greybus: interface: s/gb_interface_block/gb_interface/gGreg Kroah-Hartman1-5/+5
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-13greybus: bundle: s/gb_interface/gb_bundle/gGreg Kroah-Hartman1-14/+13
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-13greybus: bundle: rename interface.[c|h] to bundle.[c|h]Greg Kroah-Hartman1-0/+35
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>