summaryrefslogtreecommitdiff
path: root/drivers/spi
AgeCommit message (Collapse)Author
2014-01-17Merge branches 'topic/sc18is602' and 'topic/rspi' of ↵Mark Brown
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi into spi-bpw
2014-01-16ACPI: fix module autoloading for ACPI enumerated devicesZhang Rui
ACPI enumerated devices has ACPI style _HID and _CID strings, all of these strings can be used for both driver loading and matching. Currently, in Platform, I2C and SPI bus, the ACPI style driver matching is supported by invoking acpi_driver_match_device() in bus .match() callback. But, the module autoloading is still broken. For example, there is any ACPI device with _HID "INTABCD" that is enumerated to platform bus, and we have a driver that can probe it. The driver exports its module_alias as "acpi:INTABCD" use the following code static const struct acpi_device_id xxx_acpi_match[] = { { "INTABCD", 0 }, { } }; MODULE_DEVICE_TABLE(acpi, xxx_acpi_match); But, unfortunately, the device' modalias is shown as "platform:INTABCD:00", please refer to modalias_show() and platform_uevent() in drivers/base/platform.c. This results in that the driver will not be loaded automatically when the device node is created, because their modalias do not match. This also applies to I2C and SPI bus. With this patch, the device' modalias will be shown as "acpi:INTABCD" as well. Signed-off-by: Zhang Rui <rui.zhang@intel.com> Acked-by: Mark Brown <broonie@linaro.org> Acked-by: Wolfram Sang <wsa@the-dreams.de> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-01-16spi/pxa2xx: fix compilation warning when !CONFIG_PM_SLEEPMika Westerberg
CONFIG_PM will be set if either or both CONFIG_PM_SLEEP and CONFIG_PM_RUNTIME is set. Compiling the driver with !CONFIG_PM_SLEEP causes following compilation warning: drivers/spi/spi-pxa2xx.c:1270:12: warning: ‘pxa2xx_spi_suspend’ defined but not used [-Wunused-function] Fix this by using CONFIG_PM_SLEEP instead. Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-01-14spi: clps711x: Add MODULE_ALIAS to support module auto-loadingAxel Lin
Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-01-14spi: rspi: Add missing clk_disable() calls in error and cleanup pathsGeert Uytterhoeven
Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-01-14Merge branch 'topic/rcar' of ↵Mark Brown
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi into spi-rspi
2014-01-14spi: rspi: Spelling s/transmition/transmission/Geert Uytterhoeven
Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-01-13spi: rspi: Add support for specifying CPHA/CPOLGeert Uytterhoeven
Add support for specifying the SPI clock phase and polarity, based on the SDK reference code. Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-01-13spi/pxa2xx: initialize DMA channels to -1 to prevent inadvertent matchMika Westerberg
Commit cddb339badb0 (spi/pxa2xx: convert to dma_request_slave_channel_compat()) converted the driver to use ACPI provided DMA helpers but it forgot to initialize the platform data for the channels to -1. Failing to do so will result inadvertent match in the filter function because 0 is a valid channel number. Prevent this from happening by initializing both platform data channels correctly to -1. Fixes: cddb339badb0 (spi/pxa2xx: convert to dma_request_slave_channel_compat()) Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Mark Brown <broonie@linaro.org> Cc: stable@vger.kernel.org
2014-01-13spi: rspi: Add more QSPI register documentationGeert Uytterhoeven
Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-01-13spi: rspi: Add more RSPI register documentationGeert Uytterhoeven
Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-01-13spi: rspi: Remove dependency on DMAE for SHMOBILEGeert Uytterhoeven
On ARM-based SHMOBILE, the rspi driver builds and works fine without the DMA controller driver, hence relax the dependencies. Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-01-13spi/s3c64xx: Correct indentationGeert Uytterhoeven
Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-01-13spi: sh: Use spi_sh_clear_bit() instead of open-codedAxel Lin
We have a spi_sh_clear_bit() function, there's no reason not to use it. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-01-13spi: bitbang: Grammar s/make to make/to make/Geert Uytterhoeven
Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-01-13spi: sh-hspi: Spelling s/recive/receive/Geert Uytterhoeven
Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-01-13spi: core: Improve tx/rx_nbits check commentsGeert Uytterhoeven
- Rephrase the comments about tx/rx_nbits validity checks, - Remove the stale comment about SPI_3WIRE (the code it refers to was removed in commit 368ca4e0c75612c0a4d6bbcef7efb944604340c2 ("spi: Eliminate 3WIRE spi_transfer check")). Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-01-13spi: ti-qspi: Fixup driver nameAxel Lin
The driver name in current code looks like a compatible string which is not the naming convention for platform drivers. Fix it and also add modalias since this driver can be built as a module. Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Sourav Poddar <sourav.poddar@ti.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-01-13spi: ti-qspi: Simplify qspi_write_msg and qspi_read_msg implementationAxel Lin
Make the unit of wlen to be byte, and simplify the code to avoid duplicate code for different wlen cases. Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Sourav Poddar <sourav.poddar@ti.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-01-13spi: altera: Remove unneeded NULL checking for hw->bitbang.masterAxel Lin
We already has NULL test for master after calling spi_alloc_master(). Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-01-12spi: mpc512x: adjust to OF based clock lookupGerhard Sittig
after device tree based clock lookup became available, the peripheral driver need no longer construct clock names which include the PSC index, remove the "psc%d_mclk" template and unconditionally use 'mclk' acquire and release the 'ipg' clock item for register access as well Cc: Mark Brown <broonie@kernel.org> Cc: linux-spi@vger.kernel.org Signed-off-by: Gerhard Sittig <gsi@denx.de> Acked-by: Mark Brown <broonie@linaro.org> Signed-off-by: Anatolij Gustschin <agust@denx.de>
2014-01-10spi: clps711x: Use devm_gpio_request()Alexander Shiyan
This patch replaces gpio_request() with devm_ API. As a result this simplifies error path and eliminates "remove" function. Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-01-09spi: oc-tiny: Simplify tiny_spi_txrx_bufs implementation when irq is not usedAxel Lin
Currently we have similar code for (txp && rxp), (txp && !rxp), (!rxp & txp), and (!txp && !rxp) cases. This patch refactors the code a bit to avoid duplicate similar code. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-01-09spi: atmel: Refactor spi-atmel to use SPI framework queueWenyou Yang
Replace the deprecated master->transfer with transfer_one_message() and allow the SPI subsystem handle all the queuing of messages. Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com> Tested-by: Richard Genoud <richard.genoud@gmail.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-01-09spi: fsl-dspi: Add missing breaks for switch casesAxel Lin
Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-01-09spi/davinci: Don't select EDMASekhar Nori
There is no need to force selection of TI EDMA DMA engine driver when DaVinci SPI driver is selected. The driver builds just fine even with CONFIG_TI_EDMA disabled. Forcing this selection causes warnings of the sort: warning: (ARCH_KEYSTONE && SPI_DAVINCI) selects TI_EDMA which has unmet direct dependencies (DMADEVICES && (ARCH_DAVINCI || ARCH_OMAP || ARCH_KEYSTONE)) This reverts commit b5f14330590118e6a0659255476c0f24ab681e05. Reported-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Sekhar Nori <nsekhar@ti.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-01-09spi: Check conflicting CS based on spi->chip_select instead of device nameMika Westerberg
Commit e13ac47bec20 (spi: Use stable dev_name for ACPI enumerated SPI slaves) changed the SPI device naming to be based on ACPI device name instead of carrying bus number and chip select for devices enumerated from ACPI namespace. In case of a buggy BIOS that lists multiple SPI devices sharing the same chip select (even though they should use different) the current code fails to detect that and allows the devices to be added to the bus. Fix this by walking through the bus and comparing spi->chip_select instead of device name. This should work regardless what the device name will be in future. Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> Acked-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-01-09spi: core: Use list_first_entry to extract head of queueAxel Lin
For slightly better readability. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-01-08spi: s3c24xx: Remove reference to plat/fiq.hSachin Kamat
fiq.h contains only a function declaration and is not used by anyone else. Move the declaration to the driver header file and remove the unnecessary platform dependency from the driver. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-01-08spi: atmel: add support for changing message transfer speedRichard Genoud
The only speed available was max_speed (the maximum speed declared for a device). This patch adds the support for spi_tranfer->speed_hz parameter. We can now set a different speed for each spi message. Signed-off-by: Richard Genoud <richard.genoud@gmail.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-01-08spi: sh-hspi: Fix modalias for sh-hspiAxel Lin
Make the modalias matches the driver name. Seems the MODULE_ALIAS is copied from drivers/spi/spi-sh-spi.c. So both spi-sh.ko and spi-sh-hspi.ko have the same alias. Fix it. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-01-07spi: dw-pci: remove free for resources allocated with devm_*Wei Yongjun
It's not necessary to free resources allocated with devm_* and free them may lead to double free. Fixes: 04f421e7b0b1 ('spi: dw: use managed resources') Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-01-07spi: ti-qspi: Fix getting correct address for qspiAxel Lin
Now platform_get_drvdata() returns the address of qspi rather than master. Also drop unneeded spi_unregister_master() call in ti_qspi_remove() because we use devm_spi_register_master() in probe. commit cbcabb7a300b "spi/qspi: Fix qspi remove path" assumes platform_get_drvdata() returns address of master. However, commit 160a061301c7 "spi/qspi: set correct platform drvdata in ti_qspi_probe()" pass qspi to platform_set_drvdata(). Signed-off-by: Axel Lin <axel.lin@ingics.com> Reviewed-by: Sourav Poddar <sourav.poddar@ti.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-01-06spidev: fix hang when transfer_one_message failsDaniel Santos
This corrects a problem in spi_pump_messages() that leads to an spi message hanging forever when a call to transfer_one_message() fails. This failure occurs in my MCP2210 driver when the cs_change bit is set on the last transfer in a message, an operation which the hardware does not support. Rationale Since the transfer_one_message() returns an int, we must presume that it may fail. If transfer_one_message() should never fail, it should return void. Thus, calls to transfer_one_message() should properly manage a failure. Fixes: ffbbdd21329f3 (spi: create a message queueing infrastructure) Signed-off-by: Daniel Santos <daniel.santos@pobox.com> Signed-off-by: Mark Brown <broonie@linaro.org> Cc: stable@vger.kernel.org
2014-01-06spi: dw-pci: fix typoBaruch Siach
Commit 04f421e7b0b10 (spi: dw: use managed resources) introduced a typo in struct field reference. Fix it. Fixes build failure: drivers/spi/spi-dw-pci.c: In function 'spi_pci_probe': drivers/spi/spi-dw-pci.c:50:29: error: 'dev' undeclared (first use in this function) dwpci = devm_kzalloc(&pdev-dev, sizeof(struct dw_spi_pci), GFP_KERNEL); ^ Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Baruch Siach <baruch@tkos.co.il> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-01-02Merge remote-tracking branches 'asoc/topic/ad1836', 'asoc/topic/ad193x', ↵Mark Brown
'asoc/topic/adav80x', 'asoc/topic/adsp', 'asoc/topic/ak4641', 'asoc/topic/ak4642', 'asoc/topic/arizona', 'asoc/topic/atmel', 'asoc/topic/au1x', 'asoc/topic/axi', 'asoc/topic/bcm2835', 'asoc/topic/blackfin', 'asoc/topic/cs4271', 'asoc/topic/cs42l52', 'asoc/topic/da7210', 'asoc/topic/davinci', 'asoc/topic/ep93xx', 'asoc/topic/fsl', 'asoc/topic/fsl-mxs', 'asoc/topic/generic', 'asoc/topic/hdmi', 'asoc/topic/jack', 'asoc/topic/jz4740', 'asoc/topic/max98090', 'asoc/topic/mxs', 'asoc/topic/omap', 'asoc/topic/pxa', 'asoc/topic/rcar', 'asoc/topic/s6000', 'asoc/topic/sai', 'asoc/topic/samsung', 'asoc/topic/sgtl5000', 'asoc/topic/spear', 'asoc/topic/ssm2518', 'asoc/topic/ssm2602', 'asoc/topic/tegra', 'asoc/topic/tlv320aic3x', 'asoc/topic/twl6040', 'asoc/topic/txx9', 'asoc/topic/uda1380', 'asoc/topic/width', 'asoc/topic/wm8510', 'asoc/topic/wm8523', 'asoc/topic/wm8580', 'asoc/topic/wm8711', 'asoc/topic/wm8728', 'asoc/topic/wm8731', 'asoc/topic/wm8741', 'asoc/topic/wm8750', 'asoc/topic/wm8753', 'asoc/topic/wm8776', 'asoc/topic/wm8804', 'asoc/topic/wm8900', 'asoc/topic/wm8901', 'asoc/topic/wm8940', 'asoc/topic/wm8962', 'asoc/topic/wm8974', 'asoc/topic/wm8985', 'asoc/topic/wm8988', 'asoc/topic/wm8990', 'asoc/topic/wm8991', 'asoc/topic/wm8994', 'asoc/topic/wm8995', 'asoc/topic/wm9081' and 'asoc/topic/x86' into asoc-next
2014-01-02spi: s3c64xx: Remove duplicate code to clear S3C64XX_SPI_SLAVE_SEL registerAxel Lin
Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-01-02spi: core: Use list_first_entry_or_null() instead of open-codedAxel Lin
Use list_first_entry_or_null() to save a few lines. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-31Merge tag 'v3.13-rc6' into spi-dwMark Brown
To resolve trivial overlaps with fixes. Linux 3.13-rc6
2013-12-31spi/qspi: Fix runtime resume pathSourav Poddar
Due to the following commit commit 160a061301c7adf54c40696e7ceedc73f6b747dd Author: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Date: Mon Nov 11 14:13:41 2013 +0800 spi/qspi: set correct platform drvdata in ti_qspi_probe() The ti_qspi_remove() use the platform drvdata as a type of struct ti_qspi, we should pass correct platform drvdata to platform_set_drvdata() in ti_qspi_probe(). Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: Mark Brown <broonie@linaro.org> platform_set_drvdata was changed in the probe, so we need to correspondingly change deferencing of qspi in runtime resume path. Else, this will lead to a NULL dereference pointer. Based on v3.13-rc3 Signed-off-by: Sourav Poddar <sourav.poddar@ti.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-31spi: dw: fix memory leak on error pathBaruch Siach
Signed-off-by: Baruch Siach <baruch@tkos.co.il> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-31spi: dw-mmio: prepare the clock before enablingBaruch Siach
This is required for common clock support. Signed-off-by: Baruch Siach <baruch@tkos.co.il> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-31spi: dw: use managed resourcesBaruch Siach
Migrate mmio code and core driver to managed resources to reduce boilerplate error handling code. Also, handle clk_enable() failure while at it, and drop unused dw_spi iolen field. Signed-off-by: Baruch Siach <baruch@tkos.co.il> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-30Merge tag 'v3.13-rc6' into spi-rcarMark Brown
To resolve spurious merge conflicts with fixes. Linux 3.13-rc6
2013-12-30spi: dw: drop unused struct dw_spi fieldBaruch Siach
Signed-off-by: Baruch Siach <baruch@tkos.co.il> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-30spi: Eliminate 3WIRE spi_transfer checkTrent Piepho
Checking for SPI_3WIRE isn't needed. spi_setup() already prevents 3WIRE mode from being combined with DUAL or QUAD mode support. So there is no need to differentiate between a single bit device with SPI_3WIRE set and one with without. It doesn't change the allowed bit widths. Signed-off-by: Trent Piepho <tpiepho@gmail.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-24spi: rspi: Use u8 for 8-bit register valuesGeert Uytterhoeven
Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-24spi: rspi: Use DUMMY_DATA macro instead of hardcoded valueGeert Uytterhoeven
Make it more obvious that this value is dummy data. Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-24spi: rspi: Make more pointers constGeert Uytterhoeven
Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-24spi: rspi: Remove castsGeert Uytterhoeven
Remove useless casts, and do not cast away const. Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org> Signed-off-by: Mark Brown <broonie@linaro.org>