summaryrefslogtreecommitdiffstats
path: root/include/spi
Commit message (Collapse)AuthorAgeFilesLines
* spi: Extend the core to ease integration of SPI memory controllersSteffen Trumtrar2019-05-081-0/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sync with Linux v5.1-rc1. This is the barebox adoption of the commit commit c36ff266dc82f4ae797a6f3513c6ffa344f7f1c7 Author: Boris Brezillon <boris.brezillon@bootlin.com> Date: Thu Apr 26 18:18:14 2018 +0200 spi: Extend the core to ease integration of SPI memory controllers Some controllers are exposing high-level interfaces to access various kind of SPI memories. Unfortunately they do not fit in the current spi_controller model and usually have drivers placed in drivers/mtd/spi-nor which are only supporting SPI NORs and not SPI memories in general. This is an attempt at defining a SPI memory interface which works for all kinds of SPI memories (NORs, NANDs, SRAMs). Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com> Reviewed-by: Frieder Schrempf <frieder.schrempf@exceet.de> Tested-by: Frieder Schrempf <frieder.schrempf@exceet.de> Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* spi: Import more spi mode defines from LinuxSteffen Trumtrar2019-05-081-0/+10
| | | | | | | | | Sync with Linux v5.1-rc1. Define more spi mode flags. Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* spi: Generalize SPI "master" to "controller"Steffen Trumtrar2019-05-081-12/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sync with Linux v5.1-rc1. This is the barebox adoption of the commit commit 8caab75fd2c2a92667cbb1cd315720bede3feaa9 Author: Geert Uytterhoeven <geert+renesas@glider.be> Date: Tue Jun 13 13:23:52 2017 +0200 spi: Generalize SPI "master" to "controller" Now struct spi_master is used for both SPI master and slave controllers, it makes sense to rename it to struct spi_controller, and replace "master" by "controller" where appropriate. For now this conversion is done for SPI core infrastructure only. Wrappers are provided for backwards compatibility, until all SPI drivers have been converted. Noteworthy details: - SPI_MASTER_GPIO_SS is retained, as it only makes sense for SPI master controllers, - spi_busnum_to_master() is retained, as it looks up masters only, - A new field spi_device.controller is added, but spi_device.master is retained for compatibility (both are always initialized by spi_alloc_device()), - spi_flash_read() is used by SPI masters only. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM i.MX31: add SPI supportAlexander Kurz2016-08-031-0/+7
| | | | | | | | | | | | | | | | | The i.MX31 SPI interface was refered by freescale as spi_ver_0_4 in one of their older vendor extended linux releases. spi_ver_0_4 differs only in minor aspects to spi_ver_0_7 (i.MX35) which is already supported by barebox. Regarding barebox, the differences boil down to the location and length of the CHIP SELECT and BIT COUNT/BURST LENGTH elements of CONREG. The spi_ver_0_4 variant is limited to single word bursts with a maximum of 32 bits_per_word. Add support for the i.MX31 SPI interface to the barebox spi_ver_0_7 implementation. Signed-off-by: Alexander Kurz <akurz@blala.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* spi: i.MX: optimize transfers for ECSPI v2.3Sascha Hauer2015-11-301-1/+2
| | | | | | | | | | | | | | Instead of writing one word to the txfifo and then wait until one is received in the rxfifo we can write while the txfifos are not full and read as long the rxfifos contain data. This makes transfers for the m25p80 driver around 7 times faster here. Unlike the last version this time we only optimize the common case with 8 bits per word and SPI_LSB_FIRST cleared. The other cases would require more bit shuffling of the data. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Revert "spi: i.MX: optimize transfers for ECSPI v2.3"Sascha Hauer2015-10-051-2/+1
| | | | | | | This does not work on the Efika MX Smartbook which uses SPI to connect the MC13892. Needs some rework. This reverts commit 746a5530bee37c8d2ffc75609447641b3f3cb55b.
* spi: i.MX: optimize transfers for ECSPI v2.3Sascha Hauer2015-08-311-1/+2
| | | | | | | | | | Instead of writing one word to the txfifo and then wait until one is received in the rxfifo we can write until the txfifos are not full and read as long the rxfifos contain data. This makes transfers for the m25p80 driver around 7 times faster here. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* spi: i.MX: use start mode control bitSascha Hauer2015-08-311-0/+1
| | | | | | | | The i.MX SPI controller in version 2.3 can immediately start a transfer when the txfifo is written to. In this mode we no longer have to trigger the transfer with the xch bit which makes the code a bit simpler. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* spi: i.MX: move register defines to include/Sascha Hauer2015-07-161-0/+83
| | | | | | | The register defines will be used by the SPI xload code, so move them to a place where the xload code can include them. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* spi: Add SPI GPIO bitbang driverSebastian Hesselbarth2015-04-271-0/+36
| | | | | | | This adds a driver for SPI master by GPIO pins. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Documentation: remove doxygen documentationSascha Hauer2014-06-261-4/+0
| | | | | | | The doxygen documentation is long outdated. Remove it. It will be replaced with sphinx based documentation later. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* spi: Call spi_of_register_slaves from coreSascha Hauer2013-10-311-2/+0
| | | | | | Makes individual handling of OF spi slaves unnecessary in the bus drivers. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* treewide include/: Add missing includesSascha Hauer2013-05-311-0/+1
| | | | | | | This adds several missing includes to files under include/ which we relied on being included implicitly. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Introduce device_spi_driver() macro and use it for SPI driversAlexander Shiyan2013-03-141-0/+3
| | | | | Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* SPI: Rename spi_register_driver() for using with register_driver_macro()Alexander Shiyan2013-03-141-1/+1
| | | | | Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* spi: fix compiler warningAntony Pavlov2013-01-261-0/+2
| | | | | | | | Fixes: drivers/spi/spi.c:59: warning: no previous prototype for 'spi_new_device' Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/spi'Sascha Hauer2012-11-161-0/+2
|\
| * spi: introduce spi_get_masterJean-Christophe PLAGNIOL-VILLARD2012-11-121-0/+2
| | | | | | | | | | | | | | so we can request a master usefull for the spi command Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | mtd: add dataflash supportJean-Christophe PLAGNIOL-VILLARD2012-10-151-1/+1
|/ | | | | | from linux 3.6 Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* spi: add oftree supportSascha Hauer2012-09-141-0/+6
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* SPI: Put SPI devices on their own busSascha Hauer2012-09-141-0/+7
| | | | | | | | | This patch adds a SPI bus on which the SPI devices and drivers register. This makes it cleaner as SPI devices won't accidently end up probed by a platform_device driver. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* spi: indicate in the docs that per-transfer bpw setting is not supportedPaul Fertser2011-09-291-1/+2
| | | | | | | | Currently it's not implemented by any driver so add a note to the documentation. Signed-off-by: Paul Fertser <fercerpav@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* nor: Add SPI flash driverFranck Jullien2011-08-241-0/+30
| | | | | | | | | This patch adds the m25p80 driver. It has been ported from Linux. MTD code has been removed. It has been tested with a m25p40 chip and the Altera SPI master driver. Signed-off-by: Franck Jullien <franck.jullien@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* spi: add bits_per_word to proxy structureFranck Jullien2011-07-061-0/+1
| | | | | | | | | | | | | During the creation of a new spi device, we need to have the possiblility to give the bits_per_word value to master->setup. As a matter of fact, spi master could check the spi device bits_per_word and compare this value against its capabilities. Signed-off-by: Franck Jullien <franck.jullien@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* eeprom: add at25 eeprom driverHubert Feurstein2011-06-211-0/+22
| | | | | | | | This commit adds support for most spi eeproms, such as the Atmel at25 models. Signed-off-by: Hubert Feurstein <h.feurstein@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* spi: add more spi transfer functionsHubert Feurstein2011-06-211-0/+74
| | | | | | | | | | | | | This commit adds the following spi transfer functions: - spi_write - spi_read - spi_write_then_read - spi_w8r8 The code has been ported from the linux kernel. Signed-off-by: Hubert Feurstein <h.feurstein@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* spi: add platform_data pointer to spi_board_infoHubert Feurstein2011-06-211-2/+2
| | | | | | | | | In the spi layer this pointer will be assigned to the platform_data pointer of the new spi device, thus it can be accessed in the drivers 'probe' handler. Signed-off-by: Hubert Feurstein <h.feurstein@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* documentation updatesJuergen Beisert2009-12-151-0/+4
| | | | | Signed-off-by: Juergen Beisert <jbe@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* SPI: Add empty spi_register_board_info function when SPI is disabledSascha Hauer2008-08-131-1/+10
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* first (partly) running spi supportSascha Hauer2008-03-141-1/+307
|
* beginning of SPI supportSascha Hauer2008-03-111-0/+35