summaryrefslogtreecommitdiff
path: root/drivers/spi/omap3_spi.c
AgeCommit message (Collapse)Author
2017-06-01dm: Rename dev_addr..() functionsSimon Glass
These support the flat device tree. We want to use the dev_read_..() prefix for functions that support both flat tree and live tree. So rename the existing functions to avoid confusion. In the end we will have: 1. dev_read_addr...() - works on devices, supports flat/live tree 2. devfdt_get_addr...() - current functions, flat tree only 3. of_get_address() etc. - new functions, live tree only All drivers will be written to use 1. That function will in turn call either 2 or 3 depending on whether the flat or live tree is in use. Note this involves changing some dead code - the imx_lpi2c.c file. Signed-off-by: Simon Glass <sjg@chromium.org>
2017-05-15omap: spi: Drop CONFIG_OMAP3_SPI_D0_D1_SWAPPED supportTom Rini
This particular quirk is not enabled in any config files today. It does however exist and is handled correctly in device trees and via CONFIG_DM_SPI. So we drop the symbol now and add a comment to indicate that any (new) boards that require this quirk need to enable DM_SPI instead. Signed-off-by: Tom Rini <trini@konsulko.com>
2017-05-03drivers: spi: Remove duplicate .probe methodSuniel Mahesh
.probe method has been assigned twice when declaring a driver with U_BOOT_DRIVER(). Removed one of them. Here is the last commit which had the duplicate entry: "spi: omap3: Convert to driver model" (sha1: 77b8d04854f486741471ad02b93b473b5b3d72f8) Signed-off-by: Suniel Mahesh <suniel.spartan@gmail.com> Reviewed-by: Jagan Teki <jagan@openedev.com>
2017-02-08dm: core: Replace of_offset with accessorSimon Glass
At present devices use a simple integer offset to record the device tree node associated with the device. In preparation for supporting a live device tree, which uses a node pointer instead, refactor existing code to access this field through an inline function. Signed-off-by: Simon Glass <sjg@chromium.org>
2016-05-23omap3: Fix SPI registers on am33xx and am43xxMartin Hejnfelt
When the base registers are read from device tree the base is not 0x48030100 as the driver expects, but 0x48030000, resulting in non functioning SPI. To deal with this, use same idea as how this is done in the linux kernel (drivers/spi/spi-omap2-mcspi.c) and add a structure with a field that is used to shift the registers on these systems. v2: Fixed commit subject line to correct cpu Signed-off-by: Martin Hejnfelt <mh@newtec.dk>
2016-03-15spi: omap3: Fix multiple definition of 'priv'Jagan Teki
Global definition of priv seems no-sense to use it for non-dm case and pass the pointer to functions which are common to both dm and non-dm. So, fix this by removing omap3_spi_slave from non-dm and make visible to omap3_spi_priv for both dm and non-dm. Cc: Christophe Ricard <christophe-h.ricard@st.com> Reported-by: Tom Rini <trini@konsulko.com> Signed-off-by: Jagan Teki <jteki@openedev.com>
2016-03-14spi: omap3: Convert to driver modelJagan Teki
After this conversion the driver will able to support both dm and non-dm and code is more extensible like we can remove the non-dm part simply without touching anycode if all the boards which are using this driver become dm driven. Cc: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org> Acked-by: Christophe Ricard <christophe-h.ricard@st.com> Tested-by: Christophe Ricard <christophe-h.ricard@st.com> Signed-off-by: Jagan Teki <jteki@openedev.com> [Set priv->wordlen, Add Kconfig entry and file credit for dm conversion] Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com>
2016-03-14spi: omap3: Make local functions as staticJagan Teki
Attach static on local defined functions. Cc: Tom Rini <trini@konsulko.com> Cc: Simon Glass <sjg@chromium.org> Signed-off-by: Jagan Teki <jteki@openedev.com> Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com>
2016-03-14spi: omap3: Move headers code inside the driverJagan Teki
Header file have macro's and register definition and some unneeded function proto types which becomes tunned further in future patches and entire driver code resides in one file for more readability. Cc: Tom Rini <trini@konsulko.com> Cc: Simon Glass <sjg@chromium.org> Signed-off-by: Jagan Teki <jteki@openedev.com> [Fixes on code styles, Remove omap3_spi_txrx|write|read in header] Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com>
2016-02-23spi: omap3: Remove unused variable irqstatus in omap3_spi_txrxChristophe Ricard
Remove unused variable irqstatus in omap3_spi_txrx Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Jagan Teki <jteki@openedev.com>
2015-04-27spi: omap3: Fix timeout handlingDavid Dueck
The timeout value is never reset during the transfer. This means that when transferring more data we eventually trigger the timeout. This was reported on the mailing list: "Spansion SPI flash read timeout with AM335x" Signed-off-by: David Dueck <davidcdueck@googlemail.com> CC: Tom Rini <trini@konsulko.com> CC: Stefan Roese <sr@denx.de> CC: Andy Pont <andy.pont@sdcsystems.com> Tested-by: David Dueck <davidcdueck@googlemail.com> Reviewed-by: Jagannadha Sutradharudu Teki <jagannadh.teki@gmail.com>
2014-03-12drivers/spi/omap3: Bug fix of premature write transfer completionVasili Galka
The logic determining SPI "write" transfer completion was faulty. At certain conditions (e.g. slow SPI clock freq) the transfers were interrupted before completion. Both EOT and TXS flags of channel status registeer shall be checked to ensure that all data was transferred. Tested on AM3359 chip. Signed-off-by: Vasili Galka <vasili@visionmap.com>
2013-11-12spi: omap3: add support for more word lengthsNikita Kiryanov
Current implementation only supports 8 bit word lengths, even though omap3 can handle anything between 4 and 32. Update the spi interface to support changing the SPI word length, and implement it in omap3_spi driver to support the full range of possible word lengths. This implementation is backwards compatible by defaulting to the old behavior of 8 bit word lengths. Also, it required a change to the omap3_spi non static I/O functions, but since they are not used anywhere else, no collateral changes are required. Cc: Tom Rini <trini@ti.com> Cc: Jagannadha Sutradharudu Teki <jagannadh.teki@gmail.com> Cc: Igor Grinberg <grinberg@compulab.co.il> Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>
2013-11-12spi: omap3: remove semicolon from #defineNikita Kiryanov
Remove unnecessary semicolon from #define SPI_WAIT_TIMEOUT Cc: Tom Rini <trini@ti.com> Cc: Jagannadha Sutradharudu Teki <jagannadh.teki@gmail.com> Cc: Igor Grinberg <grinberg@compulab.co.il> Cc: Gerhard Sittig <gsi@denx.de> Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>
2013-10-14Coding Style cleanup: replace leading SPACEs by TABsWolfgang Denk
Signed-off-by: Wolfgang Denk <wd@denx.de> [trini: Drop changes for PEP 4 following python tools] Signed-off-by: Tom Rini <trini@ti.com>
2013-10-14Coding Style cleanup: remove trailing white spaceWolfgang Denk
Signed-off-by: Wolfgang Denk <wd@denx.de>
2013-07-24Add GPL-2.0+ SPDX-License-Identifier to source filesWolfgang Denk
Signed-off-by: Wolfgang Denk <wd@denx.de> [trini: Fixup common/cmd_io.c] Signed-off-by: Tom Rini <trini@ti.com>
2013-03-19spi: Use spi_alloc_slave() in each SPI driverSimon Glass
Rather than each driver having its own way to allocate a SPI slave, use the new allocation function everywhere. This will make it easier to extend the interface without breaking drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
2012-12-10OMAP3 SPI : Fixed bugs related to SPI transferajoy
Added posted writes (read after writes) to effect the change immediately for channel confiuration and channel enable register Disable the channel to purge receieve data in TX_ONLY mode transfer otherwise rx data will get affected by the next immediate RX_ONLY mode transfer Wait for the EOT bit to be set after last byte has been loaded to TX shift register in the the TX_ONLY mode.This ensures TX data has been completely shifted out Disable the channel in RX_ONLY mode before reading the last data from RXX register to prevent the SPI slave to transmit next word Signed-off-by: Ajoy Kumar Das <akdas75@yahoo.in> Cc: Tom Rini <trini@ti.com> Cc: jacopo mondi <j.mondi@voltaelectronics.com>
2012-10-25omap3_spi: introduce CONFIG_OMAP3_SPI_D0_D1_SWAPPEDPeter Korsgaard
D0/D1 Swapped or not is a board property, not anything specific to the am33xx SoC, so add a custom define for it. At the same time correct the bit handling for the swapped mode (DPE0 should be cleared and SI/DPE1 set). Signed-off-by: Peter Korsgaard <peter.korsgaard@barco.com>
2012-09-01am335x evm: Enable support for spi0Tom Rini
Signed-off-by: Tom Rini <trini@ti.com>
2012-09-01am33xx: Add support, update omap3 McSPI driverTom Rini
Signed-off-by: Tom Rini <trini@ti.com>
2012-03-27omap3_spi: receive transmit modejacopo mondi
Implementation of receive-transmit mode for omap3 MCSPI. Introduces full duplex communication, needed by some spi devices (such as enc28j60). Signed-off-by: jacopo mondi <mondi@cs.unibo.it> <j.mondi@voltaelectronics.com>
2010-12-11OMAP3: SPI driverDirk Behme
CC: Ruslan N. Araslanov <byaaka@yandex.ru> Signed-off-by: Ruslan Araslanov <ruslan.araslanov@vitecmm.com> Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>