summaryrefslogtreecommitdiffstats
path: root/drivers/staging/greybus/control.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>
2017-01-07staging: greybus: remove timesync protocol supportGreg Kroah-Hartman1-7/+0
While the timesync protocol was a great idea, it never ended up getting implemented by any known hardware devices. It's also a bit "interesting" in how it ties into the platform controller. So, just remove it for now. It's not needed, no one uses it, and it's a stumbling block in getting the greybus core code merged out of the staging tree. If anyone wants it in the future, reverting this patch is a great place to start from. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Reviewed-by: Johan Hovold <johan@kernel.org> Reviewed-by: Alex Elder <elder@kernel.org> Acked-by: Bryan O'Donoghue <pure.logic@nexus-software.ie> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-07-21greybus: control: suppress bundle_activate() for bootromJohan Hovold1-0/+1
We always knew backward compatibility with the ES3 bootrom, which was finalised about a year ago, would be a pain. Here we go again. The bootrom does not support control requests added after it was burnt into ROM for obvious reasons. This means that we need to suppress sending the new bundle_activate() operation to any interface executing the legacy bootrom. Do so by adding a new NO_PM interface quirk (we can use the control-protocol version for this later once we bump it). Note that the interface-disable path (e.g. for power down) is already handled by the FORCED_DISABLE quirk, and that the suspend/resume paths are currently avoided by making sure that the bootrom bundle never suspends. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Acked-by: Bartosz Golaszewski <bgolaszewski@baylibre.com> Tested-by: Bartosz Golaszewski <bgolaszewski@baylibre.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-07-08greybus: control: add connection suspend and resume callsDavid Lin1-0/+2
Adds function calls for handling control connection suspend and resume, for now all they do is disable and enable control connection. Signed-off-by: David Lin <dtwlin@google.com> Reviewed-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Alex Elder <elder@linaro.org>
2016-07-08greybus: control: add interface hibernate abort operationDavid Lin1-0/+1
Add the AP implementation for the Greybus Control Hibernate Abort Operation. AP may use this Operation to abort a previous Control Interface Suspend or Control Interface Deactivate Prepare Operation. Signed-off-by: David Lin <dtwlin@google.com> Reviewed-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Alex Elder <elder@linaro.org>
2016-07-08greybus: control: add interface deactivate prepare operationDavid Lin1-0/+1
Add the AP implementation for the Greybus Control Interface Deactivate Prepare Operation. AP uses this Operation during the Power Down transition to request the bridge to power down after it detects a subsequent UniPro link hibernation. Signed-off-by: David Lin <dtwlin@google.com> Reviewed-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Alex Elder <elder@linaro.org>
2016-07-08greybus: control: add interface suspend prepare operationDavid Lin1-0/+1
Add the AP implementation for the Greybus Control Interface Suspend Prepare Operation. AP uses this Operation during the Suspend transition to request the Interface to enter a low-power mode after it detects a subsequent UniPro link hibernation. Signed-off-by: David Lin <dtwlin@google.com> Reviewed-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Alex Elder <elder@linaro.org>
2016-07-08greybus: control: add bundle deactivate and activate operationDavid Lin1-0/+2
Add the AP implementation for the Greybus Control Bundle Deactivate Operation. This operation requests a Bundle to enter the BUNDLE_OFF state. All Connections associated with the Bundle must be closed prior sending this operation. Add the AP implementation for the Greybus Control Bundle Activate Operation. This operation requests a specific Bundle to transition from the BUNDLE_OFF state to the BUNDLE_ACTIVE state. [elder@linaro.org: fixed a typo pointed out by Johan] Signed-off-by: David Lin <dtwlin@google.com> Reviewed-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Alex Elder <elder@linaro.org>
2016-07-08greybus: control: add bundle suspend and resume preparationsDavid Lin1-1/+2
Add the AP implementation for the Greybus Control Bundle Suspend Operation. This Operation is used to request a Bundle to enter the BUNDLE_SUSPENDED state, all Connections associated with this Bundle must be closed before issuing this operation. Add the AP implementation for the Greybus Control Bundle Resume Operation. This operation request a specific Bundle to transition from the BUNDLE_SUSPENDED state to the BUNDLE_ACTIVE state. Signed-off-by: David Lin <dtwlin@google.com> Reviewed-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Alex Elder <elder@linaro.org>
2016-05-27greybus: interface: implement generic mode-switch functionalityJohan Hovold1-0/+3
Add a generic interface for bundle drivers to use to request that a mode switch is carried out on its behalf. Mode switching involves tearing down all connections to an interface, sending a unidirectional mode-switch request, and waiting for a mailbox event that triggers deferred control connection reset and re-enumeration of the interface. In case of a timeout waiting for the interface mailbox event, or on other errors, the interface is powered off. All of this needs to be done by core from work-queue context in order not to block incoming SVC requests and bundle-device tear down. Care must also be taken to serialise against concurrent module removal events and eject requests. Special handling of legacy mode-switching is also added in order to continue to support the ES3 bootrom. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-05-27greybus: control: implement disconnecting operationJohan Hovold1-0/+2
Implement the new disconnecting control operation needed for proper connection tear down. 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-05-14greybus: control: Drop unused parameter from timesync_authoritativeBryan O'Donoghue1-1/+1
The count field is redundant and unused. Drop it from the control timesync_authoritative command. Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-05-14greybus: control: Add TimeSync get-last-event logicBryan O'Donoghue1-0/+2
gb_control_timesync_get_last_event() sends a request asking for the FrameTime at the last SVC strobe event. The responding entity returns the FrameTime in the response phase of the request. Performing this operation to an Interface after previously: 1. Synchronizing time using timesync-enable/timesync-authoritative 2. Sending an SVC_TIMESYNC_PING will return the FrameTime of the responding entity at the SVC-ping. If this command is sent before synchronization has been initiated or successfully completed the responding entity should return an error code. - control.c::gb_control_timesync_get_last_event(u64 *frame_time) Returns the FrameTime at the last SVC_TIMESYNC_PING to the AP Module. Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> Reviewed-by: Vaibhav Hiremath <vaibhav.hiremath@linaro.org> Reviewed-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-05-05greybus: Revert "interface: Fetch and expose version of interface's firmware"Viresh Kumar1-1/+0
This reverts commit b957ade7b3e4ab8c149c53346dbf02e977b7f3a7. The interface version is now managed as part of the firmware-management protocol. This operation is already removed from the greybus specifications. Drop interface version support from greybus. Tested with gbsim (sysfs file not available after this patch). Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Johan Hovold <johan@hovoldconsulting.com> Acked-by: Sandeep Patil <sspatil@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-04-29greybus: control: implement mode-switch operationJohan Hovold1-0/+1
Implement the unidirectional mode-switch operation. This operation will be used in the implementation of the new generic mode-switch functionality. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-04-21greybus: interface: move vendor and product strings to control deviceJohan Hovold1-0/+3
The control device is an abstraction of the control connection over which a greybus manifest is retrieved. As interfaces switch modes (e.g. after boot-over-unipro) they expose new manifests, which can contain different vendor and product strings. Eventually control devices will be deregistered and recreated after an interface mode switch, while the interface itself remains registered. Note that only interfaces of type greybus will have control devices. Specifically, dummy interfaces will not. 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>
2016-04-21greybus: interface: register control device at hotplugJohan Hovold1-0/+2
Make sure to register also the control device along with any bundles when registering an interface. Note that we currently ignore failures to register the control device just as we do for bundle devices. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-04-21greybus: core: make the control object be a deviceJohan Hovold1-2/+6
Make the control object be a greybus device. The control device will be used to expose attributes specific to greybus-type interfaces. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-03-03greybus: control: Add TimeSync control commandsBryan O'Donoghue1-0/+5
Simple addition of the TimeSync commands defined in the specification. Note for the case of timesync_authoritative we're passing the request structure directly so as not to have to pass eight parameters into the function. Adds: - control.c::timesync_enable(u8 count, u64 frame_time, u32 strobe_delay, u32 refclk) Informs an Interface to expect count TimeSync strobe pulses with strobe_delay milliseconds delay between each strobe. Once enabled an Interface may not enter a low-power mode which will result in the reference timer used to track time switching off. - control.c::timesync_disable(void) Commands an Interface to immediately halt TimeSync logic. This will allow an Interface to transition into low-power modes where the reference time being used for TimeSync may switch off. - control.c::timesync_authoritative(u64 *frame_time, u8 count) Used by the AP Module to inform an Interface of the authoritative TimeSync clock-master time at each strobe pulse. Down-stream clock slaves shall adjust their local frame-time appropriately based on the diseminated authoritative frame-time. Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-01-19greybus: control: add bundle-version operationJohan Hovold1-0/+3
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-19greybus: control: drop legacy-protocol dependencyJohan Hovold1-2/+3
Drop dependency on the legacy protocol abstraction. Instead implement the protocol-specific version request directly, and use the new interface for managing the control connection. Note that the version request is being removed from most protocols, but we need to keep the current request for the control protocol as-is indefinitely to maintain backwards compatibility (e.g. with the ES2/ES3 bootrom). 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-30greybus: interface: Fetch and expose version of interface's firmwareViresh Kumar1-0/+1
The version of the currently running firmware on the module is useful for userspace as it can be used to find if an update is available or not. This patch fetches interface's version with a new control operation and exposes the same in userspace. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-12-15greybus: interface: clean up control-connection handlingJohan Hovold1-0/+5
Clean up control-connection handling by managing it through the control structure and a higher-level control interface. Also make both the control structure and connection lifetimes coincide with that of the interface. The control connection is now only enabled and disabled when the interface is initialised and removed. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-08-11greybus: control: Drop get_version supportViresh Kumar1-2/+0
This is done from a common place now, no need to replicate it. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-06-23greybus: Add control protocol supportViresh Kumar1-0/+27
Add control protocol driver that is responsible for handling operations on control CPort. The AP also needs to support incoming requests on its control port. Features not implemented yet are marked as TODO for now. NOTE: This also fixes cport-bundle-id to 0 and cport-id to 2 for control protocol. Reviewed-by: Alex Elder <elder@linaro.org> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>