summaryrefslogtreecommitdiffstats
path: root/drivers/spi (follow)
Commit message (Collapse)AuthorAgeFilesLines
*---. Merge remote-tracking branches 'spi/fix/dt', 'spi/fix/fsl-dspi' and ↵Mark Brown2016-10-293-2/+12
|\ \ \ | | | | | | | | | | | | 'spi/fix/fsl-espi' into spi-linus
| | | * spi: fsl-espi: avoid processing uninitalized data on errorArnd Bergmann2016-10-261-1/+1
| |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When we get a spurious interrupt in fsl_espi_irq, we end up processing four uninitalized bytes of data, as shown in this warning message: drivers/spi/spi-fsl-espi.c: In function 'fsl_espi_irq': drivers/spi/spi-fsl-espi.c:462:4: warning: 'rx_data' may be used uninitialized in this function [-Wmaybe-uninitialized] This adds another check so we skip the data in this case. Fixes: 6319a68011b8 ("spi/fsl-espi: avoid infinite loops on fsl_espi_cpu_irq()") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Mark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org
| | * spi: dspi: clear SPI_SR before enable interruptYuan Yao2016-10-291-0/+7
| |/ |/| | | | | | | | | | | | | | | Once dspi is used in uboot, the SPI_SR have been set by some value. At this time, if kernel enable the interrupt before clear the status flag, that will trigger the wrong interrupt. Signed-off-by: Yuan Yao <yao.yuan@nxp.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| * spi: mark device nodes only in case of successful instantiationRalf Ramsauer2016-10-241-1/+4
|/ | | | | | | | | | | | | | | | | | | | | | Instantiated SPI device nodes are marked with OF_POPULATE. This was introduced in bd6c164. On unloading, loaded device nodes will of course be unmarked. The problem are nodes that fail during initialisation: If a node fails, it won't be unloaded and hence not be unmarked. If a SPI driver module is unloaded and reloaded, it will skip nodes that failed before. Skip device nodes that are already populated and mark them only in case of success. Note that the same issue exists for I2C. Fixes: bd6c164 ("spi: Mark instantiated device nodes with OF_POPULATE") Signed-off-by: Ralf Ramsauer <ralf@ramses-pyramidenbau.de> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Acked-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com> Signed-off-by: Mark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org
* kthread: kthread worker API cleanupPetr Mladek2016-10-121-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A good practice is to prefix the names of functions by the name of the subsystem. The kthread worker API is a mix of classic kthreads and workqueues. Each worker has a dedicated kthread. It runs a generic function that process queued works. It is implemented as part of the kthread subsystem. This patch renames the existing kthread worker API to use the corresponding name from the workqueues API prefixed by kthread_: __init_kthread_worker() -> __kthread_init_worker() init_kthread_worker() -> kthread_init_worker() init_kthread_work() -> kthread_init_work() insert_kthread_work() -> kthread_insert_work() queue_kthread_work() -> kthread_queue_work() flush_kthread_work() -> kthread_flush_work() flush_kthread_worker() -> kthread_flush_worker() Note that the names of DEFINE_KTHREAD_WORK*() macros stay as they are. It is common that the "DEFINE_" prefix has precedence over the subsystem names. Note that INIT() macros and init() functions use different naming scheme. There is no good solution. There are several reasons for this solution: + "init" in the function names stands for the verb "initialize" aka "initialize worker". While "INIT" in the macro names stands for the noun "INITIALIZER" aka "worker initializer". + INIT() macros are used only in DEFINE() macros + init() functions are used close to the other kthread() functions. It looks much better if all the functions use the same scheme. + There will be also kthread_destroy_worker() that will be used close to kthread_cancel_work(). It is related to the init() function. Again it looks better if all functions use the same naming scheme. + there are several precedents for such init() function names, e.g. amd_iommu_init_device(), free_area_init_node(), jump_label_init_type(), regmap_init_mmio_clk(), + It is not an argument but it was inconsistent even before. [arnd@arndb.de: fix linux-next merge conflict] Link: http://lkml.kernel.org/r/20160908135724.1311726-1-arnd@arndb.de Link: http://lkml.kernel.org/r/1470754545-17632-3-git-send-email-pmladek@suse.com Suggested-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Petr Mladek <pmladek@suse.com> Cc: Oleg Nesterov <oleg@redhat.com> Cc: Tejun Heo <tj@kernel.org> Cc: Ingo Molnar <mingo@redhat.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> Cc: Josh Triplett <josh@joshtriplett.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Jiri Kosina <jkosina@suse.cz> Cc: Borislav Petkov <bp@suse.de> Cc: Michal Hocko <mhocko@suse.cz> Cc: Vlastimil Babka <vbabka@suse.cz> Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
*-----. Merge remote-tracking branches 'spi/topic/ti-qspi', 'spi/topic/tools', ↵Mark Brown2016-09-303-21/+137
|\ \ \ \ | | | | | | | | | | | | | | | 'spi/topic/txx9' and 'spi/topic/xlp' into spi-next
| | | | * spi: xlp: Add ACPI support for Vulcan SPI controllerKamlakant Patel2016-08-091-1/+12
| | | |/ | | |/| | | | | | | | | | | | | | | | | | | | | Add ACPI support for SPI controller on Broadcom Vulcan ARM64. Signed-off-by: Kamlakant Patel <kamlakant.patel@broadcom.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| | | * spi: spi-txx9: Add missing clock (un)prepare calls for CCFGeert Uytterhoeven2016-08-181-3/+3
| | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While the custom minimal TXx9 clock implementation doesn't need or use clock (un)prepare calls (they are dummies if !CONFIG_HAVE_CLK_PREPARE), they are mandatory when using the Common Clock Framework. Hence add them, to prepare for the advent of CCF. Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Mark Brown <broonie@kernel.org>
| * / spi: spi-ti-qspi: Add DMA support for QSPI mmap readVignesh R2016-08-171-17/+122
| |/ | | | | | | | | | | | | | | | | | | | | Use mem-to-mem DMA to read from flash when reading in mmap mode. This gives improved read performance and reduces CPU load. With this patch the raw-read throughput is ~16MB/s on DRA74 EVM. And CPU load is <20%. UBIFS read throughput ~13 MB/s. Signed-off-by: Vignesh R <vigneshr@ti.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| |
| \
| \
| \
| \
| \
| \
| \
*-------. \ Merge remote-tracking branches 'spi/topic/rspi', 'spi/topic/sc18is602', ↵Mark Brown2016-09-304-11/+33
|\ \ \ \ \ \ | | | | | |/ | | | | |/| | | | | | | 'spi/topic/sh-msiof', 'spi/topic/spidev-test' and 'spi/topic/st-ssc4' into spi-next
| | | | | * spi: st-ssc4: Fix misuse of devm_gpio_request/devm_gpio_free APIsAxel Lin2016-09-141-8/+11
| | | | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | devm_* API is supposed to be used only in probe function call. The resource is allocated at 'probe' and free automatically at 'remove'. Usage of devm_* functions outside probe sometimes leads to resource leak. Thus avoid using devm_* APIs in .setup/.cleanup callbacks. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| | | * / spi: sh-msiof: Use ARCH_SHMOBILE instead of SUPERHGeert Uytterhoeven2016-09-011-1/+1
| | | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "spi_sh_msiof" is used on sh7723 and sh7724 only. As all of the above select ARCH_SHMOBILE, restrict its driver dependencies from SUPERH to ARCH_SHMOBILE. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Simon Horman <horms+renesas@verge.net.au> Signed-off-by: Mark Brown <broonie@kernel.org>
| | * | spi: sc18is602: Change gpiod_set_value to gpiod_set_value_cansleepPhil Reid2016-09-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To avoid warning when using i2c gpio expander change call to the cansleep variant. There should be no issue with sleeping in the drivers probe function. Signed-off-by: Phil Reid <preid@electromag.com.au> Signed-off-by: Mark Brown <broonie@kernel.org>
| | * | spi: sc18is602: Add reset control via gpio pin.Phil Reid2016-09-011-0/+9
| | |/ | | | | | | | | | | | | | | | | | | | | | | | | This sc18is602 has a reset pin that may need to be deasserted. Add optional binding to specifiy the reset pin via a gpio and deassert during probe. Signed-off-by: Phil Reid <preid@electromag.com.au> Signed-off-by: Mark Brown <broonie@kernel.org>
| * / spi: rspi: Increase accuracy of bit rate for RZChris Brandt2016-08-081-2/+12
| |/ | | | | | | | | | | | | | | | | | | When you leave the clock divider at 0, 130kHz is the lowest you can go. Also, by adjusting the clock divider you can get more accurate resolutions for clock speeds lower than 16MHz. This patch uses the clock divider as part of the bit rate setup. Signed-off-by: Chris Brandt <chris.brandt@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| |
| \
| \
| \
| \
| \
*-----. \ Merge remote-tracking branches 'spi/topic/octeon', 'spi/topic/pic32-sqi', ↵Mark Brown2016-09-309-55/+273
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | 'spi/topic/pxa2xx' and 'spi/topic/qup' into spi-next
| | | | * | spi: qup: skip clk_disable_unprepare if the device is already runtime suspendedSudeep Holla2016-09-011-2/+4
| | | | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the spi device is already runtime suspended, if spi_qup_suspend is executed during suspend-to-idle or suspend-to-ram it will result in the a splat from unpreparing a non-prepared clock. This patch fixes the issue by executing clk_disable_unprepare conditionally in spi_qup_suspend. [Reworded commit message to remove irrelevant backtrace -- broonie] Signed-off-by: Sudeep Holla <sudeep.holla@arm.com> Tested-by: Andy Gross <andy.gross@linaro.org> Signed-off-by: Mark Brown <broonie@kernel.org>
| | | * | spi: pxa2xx: Fix build error because of missing headerMika Westerberg2016-09-291-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Kbuild test robot reports: drivers/spi/spi-pxa2xx.c: In function ‘setup_cs’: drivers/spi/spi-pxa2xx.c:1190:20: error: implicit declaration of function ‘desc_to_gpio’ ... Reason for this is the fact that those functions are declared in linux/gpio/consumer.h which is not included in the driver. Fix this by including it. Reported-by: kbuild test robot <fengguang.wu@intel.com> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| | | * | spi: pxa2xx: Add support for GPIO descriptor chip selectsMika Westerberg2016-09-262-3/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The driver uses custom chip_info coming from platform data for chip selects implemented as GPIOs. If the system lacks board files setting up the platform data, it is not possible to use GPIOs as chip selects. This adds support for GPIO descriptors so that regardless of the underlying firmware interface (DT, ACPI or platform data) the driver can request GPIOs used as chip selects and configure them accordingly. The custom chip_info GPIO support is still left there to make sure the existing systems keep working as expected. Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| | | * | spi: pxa2xx: Default thresholds to PXA configurationAndy Shevchenko2016-09-121-5/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Most of the devices in the supported list have PXA configuration of FIFO. In particularly Intel Medfield and Merrifield have bigger FIFO, than it's defined for CE4100. Split CE4100 in the similar way how it was done for Intel Quark, i.e. prefix definitions by CE4100 and append necessary pieces of code to switch case conditions. We are on safe side since those bits are ignored on all LPSS IPs. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| | | * | spi: pxa2xx: Remove pointer to chip data from driver dataJarkko Nikula2016-09-123-17/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Transfer state machine in this driver does not need to set/unset pointer to chip data between queueing and finalizing message as it is not actually used as a state info itself but just pointer passing. Since this per SPI device specific chip data is already carried in ctldata use that and remove pointer to chip data from driver data. While at it, group initialized variables before uninitialized variables in pump_transfers(). Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| | | * | spi: pxa2xx: Remove pointer to current SPI message from driver dataJarkko Nikula2016-09-123-16/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is no need to carry pointer to current SPI message in driver data because cur_msg in struct spi_master holds it already when driver is using the message queueing infrastructure from the SPI core. Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| | | * | spi: pxa2xx: Do not needlessly initialize stack variablesJarkko Nikula2016-09-122-11/+11
| | | |/ | | | | | | | | | | | | | | | | | | | | | | | | All of these variables are unconditionally set before their use. Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| | * / spi: pic32-sqi: use list_move_tail and list_moveWei Yongjun2016-08-081-4/+2
| | |/ | | | | | | | | | | | | | | | | | | Using list_move_tail() and list_move() to simplify the code. Signed-off-by: Wei Yongjun <weiyj.lk@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| * | spi: spi-cavium-thunderx: Add missing clk_disable_unprepare()Wei Yongjun2016-08-241-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | Add the missing clk_disable_unprepare() before return in the probe error handling case and remove. Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| * | spi: octeon: Add ThunderX driverJan Glauber2016-08-194-0/+130
| |/ | | | | | | | | | | | | | | | | | | Add ThunderX SPI driver using the shared part from the Octeon driver. The main difference of the ThunderX driver is that it is a PCI device so probing is different. The system clock settings can be specified in device tree. Signed-off-by: Jan Glauber <jglauber@cavium.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| |
| \
| \
| \
| \
| \
| \
| \
*-------. \ Merge remote-tracking branches 'spi/topic/fsl-espi', 'spi/topic/imx', ↵Mark Brown2016-09-308-382/+505
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | 'spi/topic/jcore', 'spi/topic/loopback' and 'spi/topic/meson' into spi-next
| | | | | * | spi: meson: Add GXBB compatibleNeil Armstrong2016-09-121-0/+1
| | | | | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Neil Armstrong <narmstrong@baylibre.com> Acked-by: Kevin Hilman <khilman@baylibre.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| | | | * / spi: loopback-test: mark rx_ranges_cmp() staticBaoyou Xie2016-09-011-1/+1
| | | | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We get 1 warning when building kernel with W=1: drivers/spi/spi-loopback-test.c:408:5: warning: no previous prototype for 'rx_ranges_cmp' [-Wmissing-prototypes] In fact, this function is only used in the file in which it is declared and don't need a declaration, but can be made static. So this patch marks it 'static'. Signed-off-by: Baoyou Xie <baoyou.xie@linaro.org> Acked-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Mark Brown <broonie@kernel.org>
| | | * | spi: jcore: remove unnecessary platform_set_drvdata()Wei Yongjun2016-08-091-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL. Signed-off-by: Wei Yongjun <weiyj.lk@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| | | * | spi: add driver for J-Core SPI controllerRich Felker2016-08-083-0/+240
| | | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The J-Core "spi2" device is a PIO-based SPI master controller. It differs from "bitbang" devices in that that it's clocked in hardware rather than via soft clock modulation over gpio, and performs byte-at-a-time transfers between the cpu and SPI controller. This driver will be extended to support future versions of the J-Core SPI controller with DMA transfers when they become available. Signed-off-by: Rich Felker <dalias@libc.org> Signed-off-by: Mark Brown <broonie@kernel.org>
| | * | spi: imx: fix error return code in spi_imx_probe()Wei Yongjun2016-09-281-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix to return error code -EINVAL if no CS GPIOs available instead of 0, as done elsewhere in this function. Fixes: f13d4e189d20 ("spi: imx: Gracefully handle NULL master->cs_gpios") Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Acked-by: Marek Vasut <marex@denx.de> Signed-off-by: Mark Brown <broonie@kernel.org>
| | * | spi: imx: Gracefully handle NULL master->cs_gpiosMarek Vasut2016-09-261-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is possible that master->cs_gpios is NULL after spi_bitbang_start(), this happens if the master has no CS GPIOs specified in DT. Check for this case after spi_bitbang_start() to prevent NULL pointer dereference in the subsequent for loop, which accesses the master->cs_gpios field. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Martin Kaiser <martin@kaiser.cx> Cc: Mark Brown <broonie@kernel.org> Signed-off-by: Mark Brown <broonie@kernel.org>
| | * | spi: imx: support loopback mode on imx35Martin Kaiser2016-09-141-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | imx35 and compatible chipsets support loopback mode by setting a loopback control bit in the test register. Make this setting available for data transfers, similar to what we do for imx51. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Signed-off-by: Mark Brown <broonie@kernel.org>
| | * | spi: imx: set spi_bus_clk for mx1, mx31 and mx35Martin Kaiser2016-09-141-5/+12
| | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Modify spi_imx_clkdiv_2() to return the resulting bus clock frequency when the selected clock divider is applied. Set spi_imx->spi_bus_clk to this frequency. If spi_bus_clk is unset, spi_imx_calculate_timeout() causes a division by 0. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Signed-off-by: Mark Brown <broonie@kernel.org>
| * | spi: fsl-espi: improve return value handling in fsl_espi_probeHeiner Kallweit2016-09-241-16/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | The return value of fsl_espi_probe (currently struct spi_master *) is just used for checking whether an error occurred. Change the return value type to int and simplify the code. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| * | spi: fsl-espi: simplify of_fsl_espi_probeHeiner Kallweit2016-09-241-14/+7
| | | | | | | | | | | | | | | | | | | | | Simplify of_fsl_espi_probe. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| * | spi: fsl-espi: remove unused variable in fsl_espi_setupHeiner Kallweit2016-09-241-2/+0
| | | | | | | | | | | | | | | | | | | | | Remove an unused variable. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| * | spi: fsl-espi: improve and extend register bit definitionsHeiner Kallweit2016-09-141-19/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add definition of further register bits for use in upcoming driver extensions and improve current bit definitions: - use BIT macro - use bit names as in the chip spec Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| * | spi: fsl-espi: align register access with other driversHeiner Kallweit2016-09-142-64/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change register access to the method used in other drivers too. - use register names as in the chip spec for constants - avoid hard to read statements like __be32 __iomem *espi_mode = &reg_base->mode - get rid of old powerpc-specific functions like in_8 In addition annotate reg_base in struct mpc8xxx_spi as __iomem. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| * | spi: fsl-espi: improve and simplify interrupt handlerHeiner Kallweit2016-09-141-10/+6
| | | | | | | | | | | | | | | | | | | | | | | | Simplify the interrupt handler a little. In addition don't call fsl_espi_cpu_irq() if no event bit is set. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| * | spi: fsl-espi: simplify fsl_espi_setup_transferHeiner Kallweit2016-09-141-14/+2
| | | | | | | | | | | | | | | | | | | | | | | | If t is not null then the SPI core takes care that bits_per_word and speed_hz are populated. This allows to simplify fsl_espi_setup_transfer. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| * | spi: fsl-espi: merge fsl_espi_trans and fsl_espi_do_transHeiner Kallweit2016-09-121-14/+4
| | | | | | | | | | | | | | | | | | | | | | | | Merge both functions to reduce source code size and improve readability. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| * | spi: fsl-espi: improve message length handlingHeiner Kallweit2016-09-121-7/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | Move checking for a zero-length message up in the call chain and use m->frame_length instead of re-calculating the overall length of all transfers in the message. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| * | spi: fsl-espi: factor out handling of read dataHeiner Kallweit2016-09-121-20/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | Factor out copying read data to the read buffers in the original message to a new function fsl_espi_copy_from_buf. This also allows to simplify fsl_espi_copy_to_buf. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| * | spi: fsl-espi: centralize populating struct spi_transferHeiner Kallweit2016-09-121-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | Better structure the code by population all elements of struct spi_transfer in one place. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| * | spi: fsl-espi: factor out initial message checkingHeiner Kallweit2016-09-121-14/+29
| | | | | | | | | | | | | | | | | | | | | | | | Checking the message is currently done at diffrent places in the driver. Factor it out to fsl_espi_check_message. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| * | spi: fsl-espi: merge fsl_espi_bufs and fsl_espi_cpu_bufsHeiner Kallweit2016-09-121-19/+8
| | | | | | | | | | | | | | | | | | | | | fsl_espi_bufs and fsl_espi_cpu_bufs are very small that we can merge them. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| * | spi: fsl-espi: improve return value handling in fsl_espi_bufsHeiner Kallweit2016-09-121-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | Return a proper status code from fsl_espi_bufs instead of returning the number of remaining words and let the caller evaluate it. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| * | spi: fsl-espi: merge fsl_espi_cmd_trans and fsl_espi_rw_transHeiner Kallweit2016-09-121-27/+6
| | | | | | | | | | | | | | | | | | | | | | | | fsl_espi_cmd_trans and fsl_espi_rw_trans share most of the code so we can merge them. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>