summaryrefslogtreecommitdiffstats
path: root/drivers/spi
Commit message (Collapse)AuthorAgeFilesLines
...
| * of: use 'const void *' for struct of_device_id.dataAntony Pavlov2015-04-303-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since 2011 barebox' of_device_id struct uses unsigned long type for data field: struct of_device_id { char *compatible; unsigned long data; }; Almost always struct of_device_id.data field are used as pointer and need 'unsigned long' casting. E.g. see 'git grep -A 4 of_device_id drivers/' output: drivers/ata/sata-imx.c:static __maybe_unused struct of_device_id imx_sata_dt_ids[] = { drivers/ata/sata-imx.c- { drivers/ata/sata-imx.c- .compatible = "fsl,imx6q-ahci", drivers/ata/sata-imx.c- .data = (unsigned long)&data_imx6, drivers/ata/sata-imx.c- }, { Here is of_device_id struct in linux kernel v4.0: struct of_device_id { char name[32]; char type[32]; char compatible[128]; const void *data; }; Changing of_device_id.data type to 'const void *data' will increase barebox' linux kernel compatibility and decrease number of 'unsigned long' casts. Part of the patch was done using the 'coccinelle' tool with the following semantic patch: @rule1@ identifier dev; identifier type; identifier func; @@ func(...) { <... - dev_get_drvdata(dev, (unsigned long *)&type) + dev_get_drvdata(dev, (const void **)&type) ...> } @rule2@ identifier dev; identifier type; identifier func; identifier data; @@ func(...) { <... - dev_get_drvdata(dev, (unsigned long *)&type->data) + dev_get_drvdata(dev, (const void **)&type->data) ...> } Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/mvebu'Sascha Hauer2015-05-065-2/+247
|\ \
| * | spi: Add SPI GPIO bitbang driverSebastian Hesselbarth2015-04-273-0/+245
| | | | | | | | | | | | | | | | | | | | | 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>
| * | spi: ath79: move spidelay from spi-bitbang-txrxSebastian Hesselbarth2015-04-272-2/+2
| |/ | | | | | | | | | | | | | | | | Bitbang helpers for SPI require spidelay. This should be set by the user and not the helper itself. Move it to ath79_spi instead. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / spi: i.MX: Respect the value of 'cs_change'Andrey Smirnov2015-04-141-1/+19
|/ | | | | | | | Add the code to correctly handle 'cs_change' field in 'struct spi_transfer'(base on the similar code from altera_spi.c) Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* driver: Call remove function only when availableSascha Hauer2015-03-171-1/+2
| | | | | | | | The bus implementations currently call the drivers remove hook unconditionally, but this hook is seldomly populated. Only call it when it's actually populated. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: move DMA alloc functions to dma.hLucas Stach2015-03-061-1/+0
| | | | | | | | | | This better separates the DMA from the MMU functionality. Also move all drivers that only depends on asm/mmu.h for the alloc functions over to the common header. Signed-off-by: Lucas Stach <dev@lynxeye.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* i.MX: SPI: Respect SPI_LSB_FIRST flag in mode settingsAndrey Smirnov2015-01-161-4/+37
| | | | | | | | | | Add code to support SPI transfers that have data shifted out least significant bit first. This is useful in many cases, but specifically it is needed for drivers/firmware/altera_serial.c to work on i.MX platform. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* drivers: remove unnecessary mach/imx-regs.h includeSascha Hauer2015-01-051-1/+0
| | | | | | And replace the ones needed with the SoC specific header. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* spi: mxs-spi: Allow compilation on i.MX28 onlySascha Hauer2014-11-281-1/+1
| | | | | | | The driver does not compile on i.MX23, so remove the i.MX23 from the dependency list. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* resource: Let dev_request_mem_region return an error pointerSascha Hauer2014-09-163-2/+8
| | | | | | For all users fix or add the error check. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* treewide: remove address of the Free Software FoundationAntony Pavlov2014-06-112-9/+0
| | | | | | | | | | | | | | | | | | The FSF address has changed; The FSF site says that address is Free Software Foundation 51 Franklin Street, Fifth Floor Boston, MA 02110-1301 USA (see http://www.fsf.org/about/contact/) Instead of updating it each time the address changes, just drop it completely treewide. Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/omap'Sascha Hauer2014-06-042-2/+23
|\ | | | | | | | | | | Conflicts: arch/arm/configs/am335x_beaglebone_defconfig arch/arm/configs/am335x_defconfig
| * spi: omap: support swapping D0/D1Jan Luebbe2014-05-152-2/+23
| | | | | | | | | | | | | | The OMAP SPI core allows swapping MISO/MOSI and some boards are wired up that way, so add a property to swap the lines. Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
* | spi: i.MX: Move to coredevice_initcallSascha Hauer2014-05-191-1/+1
|/ | | | | | | SPI is often used by other devices, so make sure it's initialized early. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2014-05-052-4/+4
|\
| * SPI: i.MX: Remove redundant assignmentAlexander Shiyan2014-04-291-1/+1
| | | | | | | | | | Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * spi: altera_spi: fix altera_spi_setup() return error codesAntony Pavlov2014-04-231-3/+3
| | | | | | | | | | | | Reported-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/mips'Sascha Hauer2014-05-054-0/+399
|\ \ | | | | | | | | | | | | Conflicts: arch/mips/boards/loongson-ls1b/serial.c
| * | spi: add controller driver for Atheros AR7XXX/AR9XXX SoCsAntony Pavlov2014-04-073-0/+304
| | | | | | | | | | | | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | spi: import bitbang txrx utility functions from linuxAntony Pavlov2014-04-071-0/+95
| | | | | | | | | | | | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/imx'Sascha Hauer2014-05-052-16/+8
|\ \ \ | |_|/ |/| |
| * | spi: i.MX: Optimise driver private structureAlexander Shiyan2014-04-231-8/+2
| | | | | | | | | | | | | | | | | | | | | | | | No need to store init() function in the driver private structure since it called only once during startup. Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | spi: i.MX: Simplify cspi_0_0_init()Alexander Shiyan2014-04-231-7/+5
| | | | | | | | | | | | | | | | | | | | | Use SPI module software reset to simplify cspi_0_0_init(). Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | imx-spi: enable v0.7 spi driver for imx53-cspiWjatscheslaw Stoljarski2014-04-051-1/+1
| |/ | | | | | | | | Signed-off-by: Wjatscheslaw Stoljarski <wjatscheslaw.stoljarski@kiwigrid.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / spi: i.MX: Fix direction for CS GPIOsAlexander Shiyan2014-04-081-2/+2
|/ | | | | | | | Direction for CS GPIOs (for some targets) is undefined. This patch fixes this issue. Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/spi'Sascha Hauer2014-03-071-68/+64
|\
| * spi: imx: Use device idsSascha Hauer2014-02-101-18/+48
| | | | | | | | | | | | To let the driver work on all SoCs without the use of cpu_is_*() Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * spi: imx: Use IS_ENABLED to drop ifdefsSascha Hauer2014-02-091-21/+8
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * spi: imx: drop use of enumSascha Hauer2014-02-091-45/+24
| | | | | | | | | | | | | | | | | | enum imx_spi_devtype is used as index into an array of controller types. This makes the controller type handling unnecessarily complicated. Just drop the enum and instead of an array use different statically initialized structs and referene them by name. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/modalias'Sascha Hauer2014-03-071-1/+1
|\ \
| * | i2c/spi: match of_modaliasesSascha Hauer2014-02-071-1/+1
| |/ | | | | | | | | | | | | | | i2c/spi devices in the devicetree often come with a "vendor,device" comaptible string. These do not match in barebox, so add a device_match_of_modalias function which does exactly that. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / spi: altera_spi: Remove redundant assignmentAlexander Shiyan2014-02-171-1/+1
|/ | | | | Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/omap-drivers'Sascha Hauer2013-12-062-3/+54
|\
| * spi: omap: Add devicetree probe supportSascha Hauer2013-11-221-0/+13
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * spi: omap: encode register offset into device_idSascha Hauer2013-11-222-3/+41
| | | | | | | | | | | | | | | | | | | | The omap3 and omap4/am33xx spi cores differ in the offset of the registers in the address space. Instead of encoding this into the resources use the platform_device_id mechanism. This is done in preparation for devicetree probe support where the address space is in the devicetree and can't be adjusted. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | treewide: Add missing includesSascha Hauer2013-11-081-0/+1
|/ | | | | | | | A lot of files rely on include/driver.h including include/of.h (and this including include/errno.h. include the files explicitly so we can eventually get rid of including of.h from driver.h Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* spi: Get bus_num from devicetreeSascha Hauer2013-10-311-0/+3
| | | | | | Get the bus_num from devicetree if a "spi" alias exists. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* spi: support dynamic bus idsSascha Hauer2013-10-311-0/+5
| | | | | | | | | When probing spi bus masters from devicetree they got a bus_num of -1. This works with a single bus master only since all bus masters had the same bus_num. Detect this and dynamically assign a valid bus_num. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* spi: Call spi_of_register_slaves from coreSascha Hauer2013-10-313-8/+10
| | | | | | Makes individual handling of OF spi slaves unnecessary in the bus drivers. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mxs_spi: unbreak driverEric Bénard2013-09-101-0/+1
| | | | | | | | | | | | since the switch to common clock, SPI driver reports : MXS: Timeout resetting block via register 0x80014000 mxs_spi mxs_spi2: MXS SPI: Timeout waiting for start The reason is that the clock is not enabled anywhere in the driver. Signed-off-by: Eric Bénard <eric@eukrea.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mxs_spi: fix compile errorEric Bénard2013-09-101-2/+1
| | | | | | | | | | | | | | this fix : drivers/spi/mxs_spi.c:29:22: fatal error: mach/mxs.h: No such file or directory and drivers/spi/mxs_spi.c: In function 'mxs_spi_setup': drivers/spi/mxs_spi.c:102:2: error: too few arguments to function 'stmp_reset_block' include/stmp-device.h:21:12: note: declared here only compile tested ATM Signed-off-by: Eric Bénard <eric@eukrea.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: AT91: move iomux definitions to iomux.hSascha Hauer2013-08-161-0/+1
| | | | | | | mach/gpio.h is for the gpio API, so move unrelated stuff away. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/mtd'Sascha Hauer2013-08-051-13/+14
|\
| * ARM: MXS: introduce stmp device supportSascha Hauer2013-07-231-13/+14
| | | | | | | | | | | | | | | | | | | | | | | | MXS specific devices have some common infrastructure in the kernel known as STMP devices. We have the same in barebox, but with a mxs_ prefix instead of a stmp_ prefix. As some STMP devices are also found on i.MX6 move the common infrastructure out of MXS specific files and use the stmp_ prefix. This is done in preparation for i.MX6 NAND support. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/marvell'Sascha Hauer2013-08-054-0/+388
|\ \ | | | | | | | | | | | | | | | Conflicts: arch/arm/boards/Makefile arch/arm/dts/Makefile
| * | spi: add Marvell MVEBU SoC SPI driverSebastian Hesselbarth2013-07-083-0/+387
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds support for the SPI controller found on Marvell MVEBU SoCs (Dove, Kirkwood, Discovery Innovation, and Armada 370/XP). Current driver is DT only. Compatible strings are provided for Orion (common denominator), Armada 370/XP and Dove SoCs. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | OF: gpio: convert DT based gpio handling to new OF APISebastian Hesselbarth2013-07-051-0/+1
| |/ | | | | | | | | | | | | | | | | | | | | This creates a Linux OF API compatible counterpart of of_get_named_gpio_flags. Existing of_get_named_gpio is converted to a static inline function, which is in the corresponding of_gpio.h include. While at it, drivers/of/gpio.c is also renamed to drivers/of/of_gpio.c to follow the of_ prefix naming scheme. The new include is also added to existing users of of_get_named_gpio. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / spi: Reuse "driver_match" for SPI busAlexander Shiyan2013-07-151-10/+1
|/ | | | | | | This will allow to use device_ids and make code a bit smaller. Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next-manual/oftree-linux-sync'Sascha Hauer2013-07-021-6/+6
|\