summaryrefslogtreecommitdiff
path: root/drivers/staging/greybus/spilib.c
AgeCommit message (Collapse)Author
2017-11-11staging: greybus: Remove redundant license textGreg Kroah-Hartman
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-Hartman
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-02staging: greybus: spilib: fix use-after-free after deregistrationJohan Hovold
Remove erroneous spi_master_put() after controller deregistration which would access the already freed spi controller. Note that spi_unregister_master() drops our only controller reference. Fixes: ba3e67001b42 ("greybus: SPI: convert to a gpbridge driver") Cc: stable <stable@vger.kernel.org> # 4.9 Signed-off-by: Johan Hovold <johan@kernel.org> Reviewed-by: Rui Miguel Silva <rmfrfs@gmail.com> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-19staging: greybus: spi: remove KERNEL_VERSION checksGreg Kroah-Hartman
No need to support older kernel versions in the Greybus SPI and spilib driver, so remove the checks as needed, we can now rely on all of the correct SPI core apis being present. Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-07-21greybus: spilib: make spilib independent of gbphyViresh Kumar
spilib is used by multiple users currently (spi.c and fw-core.c) but commit aa52b62a0556 broke that hierarchy and introduced gbphy dependent code in spilib. This may have unreliable consequences as we are doing following operation unconditionally now: gbphy_dev = to_gbphy_dev(spi->parent); gbphy_runtime_get_sync(gbphy_dev); which may not go well when the parent is of type &bundle->dev (fw-core.c). This patch introduces spilib_ops and lets the users of the core register them. This shall have no functional change for the spi.c usecase and shall fix the unreliable results for the fw-core.c usecase. Tested by writing to mtd0 dev and verifying (with print messages) that the below routines are getting called for a gpbridge-test module. Fixes: aa52b62a0556 ("spi: Add runtime_pm support") Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-07-14greybus: spi: Add runtime_pm supportAxel Haslam
Add runtime operations to the spi driver so that the module is woken up when an spi transfer is started and put back to sleep when the transfer is done. Testing Done: Let the module enter standby and initiate an spi operation. The operation wakes up the module and succeeds. Signed-off-by: Axel Haslam <ahaslam@baylibre.com> Signed-off-by: David Lin <dtwlin@google.com> Reviewed-by: Rui Miguel Silva <rui.silva@linaro.org> Signed-off-by: Alex Elder <elder@linaro.org>
2016-06-10greybus: Remove extra blank linesViresh Kumar
This patch removes few blank lines across the repository at places where two blank lines were present together or when a blank line is present at the start or end of a routine. Note that this doesn't remove most of them from greybus_protocols.h as they were added on purpose. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-05-16greybus: spi: add inprogress bit to xfer_flagsRui Miguel Silva
When a SPI transfer needs to be split by more than one greybus spi transfer operation, we need to indicate it so the controller can handle the chip select lines correctly. Add a new bit to indicate it, GB_SPI_XFER_INPROGRESS, and create an helper function to calculate when the transfer is done. As we need this information also in other places. Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org> Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-05-16greybus: spi: rename rdwr field to xfer_flagsRui Miguel Silva
As more bits will be added to the field, let's make the field more generic and name it accordingly. So, rename it from rdwr to xfer_flags. Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org> Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-05-14greybus: spi: Separate out spilib from spi bridged PHY bundle driverViresh Kumar
spilib can be used by multiple bridge drivers implementing different bundle classes. Separate out bridged PHY bundle drivers parts. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Rui Miguel Silva <rui.silva@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2016-05-14greybus: spi: Restructure spi.c to share it with other bundle driversViresh Kumar
This patch restructures spi.c as spilib core, so that the same logic can be reused for SPI connections implemented as part of different bundle types. This is required for Firmware Management Bundle. Note that the 'struct gb_protocol' and its callback aren't moved to a separate file in this commit to make its reviews easier. That will be done by a following patch. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Rui Miguel Silva <rui.silva@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>