summaryrefslogtreecommitdiffstats
path: root/drivers/staging/greybus/sdio.c
Commit message (Collapse)AuthorAgeFilesLines
* staging: greybus: Remove redundant license textGreg Kroah-Hartman2017-11-111-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>
* staging: greybus: add SPDX identifiers to all greybus driver filesGreg Kroah-Hartman2017-11-111-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>
* staging: greybus: sdio: Prefer u32 over uint32_tFranck Demathieu2017-01-271-1/+1
| | | | | | | | | | It fixes the following issue reported by checkpatch.pl: Prefer kernel type 'u32' over 'uint32_t' Signed-off-by: Franck Demathieu <fdemathieu@gmail.com> Acked-by: Rui Miguel Silva <rmfrfs@gmail.com> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: Greybus: Remove unnecessary braces for single statement blockRahul Krishnan2016-11-191-2/+1
| | | | | | | | | This patch fixes the following checkpath.pl warning WARNING: braces {} are not necessary for single statement blocks Signed-off-by: Rahul Krishnan <mrahul.krishnan@gmail.com> Reviewed-by: Rui Miguel Silva <rmfrfs@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: greybus: sdio: fix cmd_flags check for none responseRui Miguel Silva2016-10-021-1/+1
| | | | | | | | | | | | | When checking for command flags field if response is not available we really need to compare it with the right define and not bitwise AND it. smatch warn: drivers/staging/greybus/sdio.c:481 gb_sdio_command() warn: bitwise AND condition is false here Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Rui Miguel Silva <rmfrfs@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: greybus: sdio: remove KERNEL_VERSION checksRui Miguel Silva2016-09-191-8/+4
| | | | | | | | | No need to support older kernel versions in the Greybus SDIO driver, so remove the checks as needed, we can now rely on all of the correct SDIO core apis being present. Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* staging: greybus: sdio: fix min() type checkGreg Kroah-Hartman2016-09-191-1/+1
| | | | | | | | The 0-day bot pointed out a type difference in one min() call, so fix it up by being explicit about the type being compared. Reported-by: kbuild test robot <fengguang.wu@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: sdio: increase maximum segment sizeRui Miguel Silva2016-08-101-2/+2
| | | | | | | | | | | | | Adjust maximum segment size of the sg list to meet the maximum request size, this will allow to have less segments which increase the performance of data movement during transfer operations. Test Done: using mmc_test with best-case read/write performance and see that only one segment is used and that the results are better (288KiB vs 300KiB in read operation). Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: SDIO: Add runtime pm supportJackson Chang2016-08-051-4/+27
| | | | | | | | | | | | | | | | Modify SDIO greybus driver to support runtime PM framework. To enable SDIO runtime PM, it needs to remove MMC_CAP_NEEDS_POLL and add MMC_CAP2_CORE_RUNTIME_PM in set_host_caps(). The suspend function and resume function have been tested with micron-sdio image by sysfs. SDIO functions work well on suspend/resume. Testing Done: Compiled and verified on EVT2.0 + Micron ARA SD module with USB connector Signed-off-by: Jackson Chang <chang_jackson@projectara.com> Reviewed-by: Rui Miguel Silva <rui.silva@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: sdio: add switch voltage operationRui Miguel Silva2016-07-191-0/+6
| | | | | | | | | | Core sd/mmc needs the start_signal_voltage_switch operation to be defined to issue a voltage switch command. So, we define it here even though we do not need to take in action on it, since all voltage control is done in the Module. Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: sdio: convert vdd kernel values to greybusRui Miguel Silva2016-07-191-1/+8
| | | | | | | | We need to convert vdd kernel values to greybus ones. And we get this by shifting the kernel values by 8. Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: sdio: avoid extra memory operation at data transferRui Miguel Silva2016-06-211-35/+45
| | | | | | | | | | | | | | Right now greybus sdio uses the greybus operation_sync to transfer data, this will imply an extra memcpy at greybus core that we can avoid. Also with this change we remove the need for an extra buffer to store intermediate copy. So, let us create the operation and do the memory operations in the sdio driver. Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: gbphy: Remove protocol specific version handlingViresh Kumar2016-05-311-4/+0
| | | | | | | | | | | | | | | | | We should be using the generic version handling at bundle level, instead of at protocol level for bridged PHY devices as well. The bundle version handling is already in place, though it is *not* used today as we haven't bumped the version of control protocol yet. Remove protocol specific handling for bridged PHY devices. Tested on EVT 1.5 with gpbridge-test module. No nuttx changes are required with this. 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>
* greybus: fix unbalanced mutexAlex Elder2016-05-271-2/+8
| | | | | | | | | | Running "make coccicheck" on the Greybus code reports that gb_mmc_get_ro() and gb_mmc_get_cd() can return without releasing the mutex it acquired if there's an error. Fix this. 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>
* greybus: gpbridge: rename 'gpbridge' to 'gbphy' everywhereSandeep Patil2016-05-191-18/+18
| | | | | | | | | | | | | | The 'gpbridge' name didn't relaly reflect what the bus is; which is a bus for bridged-phy devices. So, rename all instances of 'gpbridge' to more appropriate 'gbphy' Testing Done: Build and boot tested. 'lsgb' will stop displaying 'GPBridge' devices until I change the library to reflect this change. Signed-off-by: Sandeep Patil <patil_sandeep@projectara.com> Suggested-by: Greg Kroah-Hartman <gregkh@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: sdio: Create separate moduleViresh Kumar2016-05-141-1/+4
| | | | | | | | | | Create separate module for sdio gpbridge driver. Tested on EVT 1.5 by inserting GP test module, all the devices were enumerated correctly. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: SDIO: convert to a gpbridge driverGreg Kroah-Hartman2016-05-051-26/+57
| | | | | | | | | | | | | | | This converts the SDIO driver to be a gpbridge driver, moving it away from the "legacy" interface. Testing Done: Tested on gbsim. Signed-off-by: Greg Kroah-Hartman <gregkh@google.com> Signed-off-by: Vaibhav Hiremath <vaibhav.hiremath@linaro.org> [vaibhav.hiremath@linaro.org: 1.Changed code to retain init/exit fns of drivers. 2.Exit path fix. 3. Fixed review comments] Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Tested-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: convert drivers to use connection->private set/getGreg Kroah-Hartman2016-03-221-7/+6
| | | | | | | | | | This converts all drivers to use the gb_connection_get_data() and gb_connection_set_data() functions to make it a bit more explicit as to what is going on. Signed-off-by: Greg Kroah-Hartman <gregkh@google.com> Reviewed-by: Alex Elder <elder@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: gpbridge.h: move protocol init/exit prototypesGreg Kroah-Hartman2016-03-031-0/+1
| | | | | | | | | Create gpbridge.h for the gpbridge-specific function prototypes, the rest of the greybus drivers don't care about them. Signed-off-by: Greg Kroah-Hartman <gregkh@google.com> Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Johan Hovold <johan@hovoldconsulting.com>
* greybus: Prefix hexadecimal values with 0x while printing themViresh Kumar2015-12-041-2/+2
| | | | | | | | | | To clearly specify the base for printed values, prefix hexadecimal values with 0x. Suggested-by: Johan Hovold <johan@hovoldconsulting.com> 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>
* greybus: sdio: some cleanups in command functionRui Miguel Silva2015-10-191-2/+2
| | | | | | | | | Some cleanups in gb_sdio_command function, ret does not need to be initialize and mrq is already pointing to request, no need to get it from host. Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: sdio: send data block details at command requestRui Miguel Silva2015-10-191-1/+7
| | | | | | | | | If SDIO request include data to be transfer send details (data blocks and block size) in command request, as it seems some controllers need this info prior to set the registers correctly. Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: sdio: use the bundle struct device instead of the connectorGreg Kroah-Hartman2015-10-151-3/+3
| | | | | | | | | | | | We are removing struct device from the gb_connection structure in the near future. The gb_bundle structure's struct device should be used as a replacement. This patch moves the sdio driver to use the bundle pointer instead of the connection pointer. Signed-off-by: Greg Kroah-Hartman <gregkh@google.com> Reviewed-by: Alex Elder <elder@linaro.org>
* greybus: sdio: clarify operator precedenceRui Miguel Silva2015-10-091-22/+22
| | | | | | | | | | | When translating capabilities from greybus to mmc values add some parentheses to clarify operation precedence and avoid static analyses warnings. [sdio.c:81]: (style) Clarify calculation precedence for '&' and '?' Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: sdio: convert greybus ocr values to mmc onesRui Miguel Silva2015-10-091-1/+25
| | | | | | | | | | It was missing the translation between the ocr vdd values of greybus to mmc_core values. This would make the detection of range voltage fail. mmc: host doesn't support card's voltages Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: sdio: fix card removable detectionRui Miguel Silva2015-10-091-2/+2
| | | | | | | | | | | | | In kernel versions bellow 3.15, the mmc_card_is_removable helper function has an extra check used for a suspend/resume hack. This made the gd_sdio_process_event to behave badly handling the module card insert event in that versions. So, just test bit the flag that we need, instead of using the helper function. This way will work in all kernel versions. Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: sdio: add field to get_caps responseRui Miguel Silva2015-10-091-0/+4
| | | | | | | | Frequency maximum and minimum are needed to complete the configuration of the controller. Add them to get_caps response operation. Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: sdio: fix work-queue leak and use-after-freeJohan Hovold2015-09-141-7/+12
| | | | | | | | | | | A single global work-queue pointer was used for the per-connection workqueue, something which would lead to memory leaks and all sorts of bad things if there are ever more than one SDIO connection in a system. Also add the missing error handling when allocating the queue. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: sdio: fix tear-down use-after-freeJohan Hovold2015-09-141-1/+1
| | | | | | | | | The mmc-driver private data must not be accessed after mmc_free_host() has released it. 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>
* greybus: sdio: Drop get_version supportViresh Kumar2015-08-111-9/+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>
* greybus: sdio: error out only for smaller payloads receivedViresh Kumar2015-08-101-2/+3
| | | | | | | | | | | | | | != was used in place of <, while comparing expected and actual payload size. The module may be running a higher version of the protocol and might have some extra fields (towards the end) in the structure, and the AP needs to ignore them. This also updates the print (expected-payload-size < actual-payload-size), when the size doesn't match for requests received by the module. This gives more details required for debugging. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: sdio: fix transfer buffer handling and blocks countingRui Miguel Silva2015-07-061-9/+16
| | | | | | | | | Fix copy to/from scatterlist destination buffer offset, fix calculation of blocks to be transfer and make a more verbose out of error when the blocks receive/send do not match. Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: sdio: add need poll to host capsRui Miguel Silva2015-07-061-1/+1
| | | | | | | | | As we do not have, yet, a event callback to notify core about changes we add the MMC_CAP_NEEDS_POLL capability to the rest of the caps received from the module. Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: sdio: check number of blocks in transferRui Miguel Silva2015-07-061-0/+14
| | | | | | | | | | Before initiating a transfers, check if the command (for single block) match the number of blocks in the request. While at it, fix also a missing break. Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: sdio: pass only data pointer to tranfer funtionRui Miguel Silva2015-07-061-3/+2
| | | | | | | No need to pass the all request to the transfer related funtctions. Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: sdio: fix call to stop command if no data existRui Miguel Silva2015-07-061-2/+2
| | | | | | | | If data is not available the stop command could dereference NULL. Fetch the stop command directly from the request instead. Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: sdio: fix return of get_cd and get_roRui Miguel Silva2015-07-061-2/+2
| | | | | | | | Functions were returning the wrong flag for the expected value. Swap them. Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: sdio: rework of event handlerRui Miguel Silva2015-07-061-31/+55
| | | | | | | | | | Between the time connection with module is up and the host is added, we can receive events (card inserted/removed, write protection switch), so until the setup is complete we queue the events received and handle them after. Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: sdio: split cmd_flags to there meaningRui Miguel Silva2015-07-061-0/+8
| | | | | | | | Instead of using values in the command cmd_flags field use the real flags in a bit mask. Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: Rename gb_gpbridge_protocol_driver() as gb_builtin_protocol_driver()Viresh Kumar2015-07-011-1/+1
| | | | | | | | | | | This macro is also required by core protocols like control and svc, and hence the 'gpbridge' name doesn't fit anymore. Lets call this macro gb_builtin_protocol_driver(). 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>
* greybus: sdio: correct the usage of mmc request in work queues handlerPhong Tran2015-06-291-3/+8
| | | | | | | | | | The mmc request should assigned before use. Then It should avoid freeing before using in mmc_request_done(). Signed-off-by: Phong Tran <tranmanphong@gmail.com> Reviewed-by: Rui Miguel Silva <rui.silva@linaro.org> Reviewed-by: Mark Greer <mgreer@animalcreek.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: sdio: change the order of remove and free mmc hostPhong Tran2015-06-291-1/+1
| | | | | | | | | | The mmc host should be removed frist. Then it will be freed. Signed-off-by: Phong Tran <tranmanphong@gmail.com> Reviewed-by: Rui Miguel Silva <rui.silva@linaro.org> Reviewed-by: Mark Greer <mgreer@animalcreek.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: sdio: fix defines for older kernelsRui Miguel Silva2015-06-241-3/+11
| | | | | | | | | | | | Some of the options for mmc host, are not defined in older kernels. MMC_CAP2_HS400_1_2V, MMC_CAP2_HS400_1_8V, MMC_TIMING_MMC_DDR52 and MMC_TIMING_MMC_HS400. To not use them for older versions. Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org> Tested-by: Mark Greer <mgreer@animalcreek.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: sdio: extend sdio implementationRui Miguel Silva2015-06-231-29/+648
| | | | | | | | | | | | Extend sdio implementation, as it for now it was basically stubs. This implementation is compile tested only since there is no fw or simulation support yet. Next step is to add sdio support to gbsim and test it with success using the mmc_test facility. Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: Use gb_gpbridge_protocol_init()Viresh Kumar2015-05-201-9/+1
| | | | | | | | Start using gb_gpbridge_protocol_init() in gpbridge drivers. 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>
* greybus: Remove "-gb" suffix from .c filesViresh Kumar2015-01-221-0/+99
Some files are prefixed with "gb-" and some are suffixed with "-gb". The rationale behind the first one is that the modules would be named so, i.e. gb-*.ko. But there is no reason to keep the "-gb" suffix in the second case. Remove the unnecessary suffix. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Alex Elder <elder@linaro.org> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
OpenPOWER on IntegriCloud