summaryrefslogtreecommitdiffstats
path: root/drivers/spi/spi-sirf.c
Commit message (Collapse)AuthorAgeFilesLines
* spi: sirf: drop redundant sirf,marco-spi compatible stringBarry Song2015-01-061-1/+0
| | | | | | | | | | "sirf,marco-spi" is redundant as all SPI controllers in CSR SiRFSoC are compatible with prima2-spi. at the same time, the whole marco project was dropped and its replacement atlas7 is also compatible with prima2 in SPI. Signed-off-by: Barry Song <Baohua.Song@csr.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* Merge tag 'driver-core-3.19-rc1' of ↵Linus Torvalds2014-12-141-1/+0
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core Pull driver core update from Greg KH: "Here's the set of driver core patches for 3.19-rc1. They are dominated by the removal of the .owner field in platform drivers. They touch a lot of files, but they are "simple" changes, just removing a line in a structure. Other than that, a few minor driver core and debugfs changes. There are some ath9k patches coming in through this tree that have been acked by the wireless maintainers as they relied on the debugfs changes. Everything has been in linux-next for a while" * tag 'driver-core-3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (324 commits) Revert "ath: ath9k: use debugfs_create_devm_seqfile() helper for seq_file entries" fs: debugfs: add forward declaration for struct device type firmware class: Deletion of an unnecessary check before the function call "vunmap" firmware loader: fix hung task warning dump devcoredump: provide a one-way disable function device: Add dev_<level>_once variants ath: ath9k: use debugfs_create_devm_seqfile() helper for seq_file entries ath: use seq_file api for ath9k debugfs files debugfs: add helper function to create device related seq_file drivers/base: cacheinfo: remove noisy error boot message Revert "core: platform: add warning if driver has no owner" drivers: base: support cpu cache information interface to userspace via sysfs drivers: base: add cpu_device_create to support per-cpu devices topology: replace custom attribute macros with standard DEVICE_ATTR* cpumask: factor out show_cpumap into separate helper function driver core: Fix unbalanced device reference in drivers_probe driver core: fix race with userland in device_add() sysfs/kernfs: make read requests on pre-alloc files use the buffer. sysfs/kernfs: allow attributes to request write buffer be pre-allocated. fs: sysfs: return EGBIG on write if offset is larger than file size ...
| * spi: drop owner assignment from platform_driversWolfram Sang2014-10-201-1/+0
| | | | | | | | | | | | | | A platform_driver does not need to set an owner, it will be populated by the driver core. Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
| |
| \
*-. \ Merge remote-tracking branches 'spi/topic/mxs', 'spi/topic/pxa', ↵Mark Brown2014-12-081-3/+9
|\ \ \ | | |/ | |/| | | | 'spi/topic/rockchip', 'spi/topic/samsung' and 'spi/topic/sirf' into spi-next
| | * spi: sirf: reset SPI controller in init stageQipan Li2014-11-211-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | in SPI boot mode, romcode uses SPI controller to fetch data from NOR flash. Here we need to reset the hardware IP to restore its state. Signed-off-by: Qipan Li <Qipan.Li@csr.com> Signed-off-by: Barry Song <Baohua.Song@csr.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| | * spi: sirf: assign spi_master's max_speed_hz memberQipan Li2014-11-181-3/+2
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | if spi device has no frequency, spi core will setup the default frequency to max_speed_hz of spi_master according to int spi_setup(struct spi_device *spi) { ... if (!spi->max_speed_hz) spi->max_speed_hz = spi->master->max_speed_hz; ... } this patch moves CSR SiRFSoC SPI frequency set to follow SPI core behaviour. Signed-off-by: Qipan Li <Qipan.Li@csr.com> Signed-off-by: Barry Song <Baohua.Song@csr.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | spi: sirf: fix word width configurationQipan Li2014-11-181-2/+2
|/ | | | | | | | | | | | | | | | | commit 8c328a262f ("spi: sirf: Avoid duplicate code in various bits_per_word cases") is wrong in setting data width register of fifo is not right, it should use sspi->word_width >> 1 to set related bits. According to hardware spec, the mapping between register value and data width: 0 - byte 1 - WORD 2 - DWORD Fixes: 8c328a262f ("spi: sirf: Avoid duplicate code in various bits_per_word cases") is wrong in setting data width register of Signed-off-by: Qipan Li <Qipan.Li@csr.com> Signed-off-by: Barry Song <Baohua.Song@csr.com> Signed-off-by: Mark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org
*-. Merge remote-tracking branches 'spi/topic/pl022', 'spi/topic/pxa2xx', ↵Mark Brown2014-10-031-65/+44
|\ \ | | | | | | | | | 'spi/topic/rspi', 'spi/topic/sh-msiof' and 'spi/topic/sirf' into spi-next
| | * spi: sirf: cleanup the indentation of marcosQipan Li2014-09-041-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | let "#define" statement keep same indentation. the old code layout is pretty ugly. Signed-off-by: Qipan Li <Qipan.Li@csr.com> Signed-off-by: Barry Song <Baohua.Song@csr.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| | * spi: sirf: fix 'cmd_transfer' function typosQipan Li2014-09-041-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | unify 'cmd_transfer' like 'pio_transfer' and 'dma_transfer' as void function, and also change left_rx_word according to transfer result. Signed-off-by: Qipan Li <Qipan.Li@csr.com> Signed-off-by: Barry Song <Baohua.Song@csr.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| | * spi: sirf: correct spi gpio and hardware chipselect behaviourQipan Li2014-09-041-53/+33
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the old codes check the cs-gpios, if the gpio number is 0 like: <&gpio, 0, 0>, the driver will use the only hardware chipselect. this is wrong because of_spi_register_master() can read property cs-gpios from device node and set the spi master's cs number and gpio cs automatically based on whether the cs-gpios is valid. this patch fixes the beviour of CSR spi driver and move to a core level supported way. Signed-off-by: Qipan Li <Qipan.Li@csr.com> Signed-off-by: Barry Song <Baohua.Song@csr.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | spi: sirf: add fifo reset/start for cmd transferQipan Li2014-09-041-0/+2
| | | | | | | | | | | | | | | | | | for command mode spi transfer, HW spec requires to do fifo reset work to clear FIFO status. Signed-off-by: Qipan Li <Qipan.Li@csr.com> Signed-off-by: Barry Song <Baohua.Song@csr.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | spi: sirf: enable RX_IO_DMA_INT interruptQipan Li2014-09-041-1/+2
|/ | | | | | | | | | | | | | | | in spi interrupt handler, we need check RX_IO_DMA status to ensure rx fifo have received the specify count data. if not set, the while statement in spi isr function will keep loop, at last, make the kernel hang. [The code is actually there in the interrupt handler but apparently it needs the interrupt unmasking so the handler sees the status -- broonie] Signed-off-by: Qipan Li <Qipan.Li@csr.com> Signed-off-by: Barry Song <Baohua.Song@csr.com> Signed-off-by: Mark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org
* spi: sirf: decrease the interrupt count and latency of PIO modeQipan Li2014-05-201-47/+54
| | | | | | | | | | | | | | | | | current PIO tranfer method be described as follows: 1. fill as much as bytes but no more than 256 bytes(fifo size) 2. enable oflow/uflow/txfifo_empty interrupt 3. isr process 3 interrupt signal, do complete works. 4. after isr done, if there are left bytes go into 1 else go into 5 5. transfer end by current PIO transfer method: 1. reduce interrupt counts in spi interrupt line. 2. reduce interrupt latency because no do data fill/fetch in isr. Signed-off-by: Qipan Li <Qipan.Li@csr.com> Signed-off-by: Barry Song <Baohua.Song@csr.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* spi: sirf: refactor spi transfer functionsQipan Li2014-04-151-109/+123
| | | | | | | | | | split sirfsoc_spi_transfer function into 3 sub-functions: spi_sirfsoc_cmd_transfer, spi_sirfsoc_pio_transfer and spi_sirfsoc_dma_transfer. Signed-off-by: Qipan Li <Qipan.Li@csr.com> Signed-off-by: Barry Song <Baohua.Song@csr.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* spi: sirf: fix spi full-duplex DMA transferring issueQipan Li2014-04-141-2/+5
| | | | | | | | | | sometimes t->tx can be equal with t->rx. for example, spidev will make tx and rx point to spidev->buffer at the same time. currently, for this case, we map the buffer BIDIRECTION to fix the cache consistency. Signed-off-by: Qipan Li <Qipan.Li@csr.com> Signed-off-by: Barry Song <Baohua.Song@csr.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* spi: sirf: fix line over 80 characters style issueQipan Li2014-04-141-19/+32
| | | | | | | | | fix a lot of "line over 80 characters" checkpatch issues, on which the users of the driver, key customers care about this very much. Signed-off-by: Qipan Li <Qipan.Li@csr.com> Signed-off-by: Barry Song <Baohua.Song@csr.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* spi: sirf: make GPIO chipselect function work wellQipan Li2014-04-141-1/+10
| | | | | | | | | orignal GPIO chipslect is not standard because it don't take care to the chipselect signal: BITBANG_CS_ACTIVE and BITBANG_CS_INACTIVE. Signed-off-by: Qipan Li <Qipan.Li@csr.com> Signed-off-by: Barry Song <Baohua.Song@csr.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* spi: sirf: set SPI controller in RISC IO chipselect modeQipan Li2014-04-141-0/+5
| | | | | | | | | | | | | SPI bitbang supply "chipselect" interface for change chip-select line , in the SiRFSoC SPI controller, we need to enable "SPI_CS_IO_MODE", otherwise, spi_sirfsoc_chipselect() has no effect. now the driver is working is because SPI controller will control CS automatically without SPI_CS_IO_MODE. this patch makes the CS controller really controlled by software. Signed-off-by: Qipan Li <Qipan.Li@csr.com> Signed-off-by: Barry Song <Baohua.Song@csr.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* spi: sirf: correct TXFIFO empty interrupt status bitQipan Li2014-04-141-2/+2
| | | | | | | | | | | the old code uses wrong marco - SIRFSOC_SPI_FIFO_FULL is not for FIFO interrupt status, it is for FIFO status. here in the ISR, SIRFSOC_SPI_TXFIFO_EMPTY is the right bit for SPI TXFIFO interrupt status. Signed-off-by: Qipan Li <Qipan.Li@csr.com> Signed-off-by: Barry Song <Baohua.Song@csr.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* spi: sirf: Add missing spi_master_{resume,suspend} calls to PM callbacksAxel Lin2014-03-131-1/+6
| | | | | | | | | This is required since commit 2025172e3280 "spi/bitbang: Use core message pump". spi-bitbang now uses core message pump, so it needs to call spi_master_suspend/ spi_master_resume to stop/start the queue while suspend/resume. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* spi: sirf: provide a shortcut for spi command-data modeQipan Li2014-03-031-0/+50
| | | | | | | | | | | | | | | | | there are many SPI clients which use the following protocal: step 1: send command bytes to clients(rx buffer is empty) step 2: send data bytes to clients or receive data bytes from clients. SiRFprimaII provides a shortcut for this kind of SPI transfer. when tx buf is less or equal than 4 bytes and rx buf is null in a transfer, we think it as 'command' data and use hardware command register for the transfer. here we can save some CPU loading than doing both tx and rx for a normal transfer. Signed-off-by: Qipan Li <Qipan.Li@csr.com> Signed-off-by: Barry Song <Baohua.Song@csr.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* spi: sirf: Use SIMPLE_DEV_PM_OPS macroJingoo Han2014-02-271-3/+2
| | | | | | | | Use SIMPLE_DEV_PM_OPS macro in order to make the code simpler. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Acked-by: Barry Song <Baohua.Song@csr.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* spi: sirf: use SET_SYSTEM_SLEEP_PM_OPS to initialize PM entriesQipan Li2014-02-241-6/+3
| | | | | | | | | use SET_SYSTEM_SLEEP_PM_OPS to initialize PM entries, this makes the codes clean and also enable the ability of hibernation support for sirf SPI. Signed-off-by: Qipan Li <Qipan.Li@csr.com> Signed-off-by: Barry Song <Baohua.Song@csr.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* spi: sirf: move to use generic dma dt-bindingBarry Song2014-02-241-24/+2
| | | | | | | | | | | | | sirf-dma driver enabled generic dt binding for dma channels. see here we remove self-defined dma channel prop and move to use generic dma_request_slave_channel. related changes in dts is something like: dmas = <&dmac1 9>, <&dmac1 4>; dma-names = "rx", "tx"; Signed-off-by: Barry Song <Baohua.Song@csr.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* spi: sirf: Avoid duplicate code in various bits_per_word casesAxel Lin2014-02-031-15/+6
| | | | | | | Trivial cleanup to avoid duplicate code in various bits_per_word cases. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* spi: Remove duplicate code to set default bits_per_word settingAxel Lin2014-01-171-7/+0
| | | | | | | | | | | | The implementation in spi_setup() already set spi->bits_per_word = 8 when spi->bits_per_word is 0 before calling spi->master->setup. So we don't need to do it again in setup() callback. Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Marek Vasut <marex@denx.de> Acked-by: Barry Song <Baohua.Song@csr.com> Acked-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Mark Brown <broonie@linaro.org>
* tree-wide: use reinit_completion instead of INIT_COMPLETIONWolfram Sang2013-11-151-2/+2
| | | | | | | | | | | | Use this new function to make code more comprehensible, since we are reinitialzing the completion, not initializing. [akpm@linux-foundation.org: linux-next resyncs] Signed-off-by: Wolfram Sang <wsa@the-dreams.de> Acked-by: Linus Walleij <linus.walleij@linaro.org> (personally at LCE13) Cc: Ingo Molnar <mingo@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* spi: bitbang: Let spi_bitbang_start() take a reference to masterAxel Lin2013-09-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Many drivers that use bitbang library have a leak on probe error paths. This is because once a spi_master_get() call succeeds, we need an additional spi_master_put() call to free the memory. Fix this issue by moving the code taking a reference to master to spi_bitbang_start(), so spi_bitbang_start() will take a reference to master on success. With this change, the caller is responsible for calling spi_bitbang_stop() to decrement the reference and spi_master_put() as counterpart of spi_alloc_master() to prevent a memory leak. So now we have below patten for drivers using bitbang library: probe: spi_alloc_master -> Init reference count to 1 spi_bitbang_start -> Increment reference count remove: spi_bitbang_stop -> Decrement reference count spi_master_put -> Decrement reference count (reference count reaches 0) Fixup all users accordingly. Signed-off-by: Axel Lin <axel.lin@ingics.com> Suggested-by: Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de> Acked-by: Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de> Signed-off-by: Mark Brown <broonie@linaro.org>
* Merge remote-tracking branch 'spi/topic/sirf' into spi-nextMark Brown2013-09-011-46/+181
|\
| * spi/sirf: fix the misunderstanding about len of spi_transferQipan Li2013-08-261-23/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | the unit of len of spi_transfer is in bytes, not in spi words. the old codes misunderstood that and thought the len is the amount of spi words. but it is actually how many bytes existing in the spi buffer. this patch fixes that and also rename left_tx_cnt and left_rx_cnt to left_tx_word and left_rx_word to highlight they are in words. Signed-off-by: Qipan Li <Qipan.Li@csr.com> Signed-off-by: Barry Song <Baohua.Song@csr.com> Signed-off-by: Mark Brown <broonie@linaro.org>
| * spi: sirf: fix error return code in spi_sirfsoc_probe()Wei Yongjun2013-08-231-1/+5
| | | | | | | | | | | | | | | | Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: Mark Brown <broonie@linaro.org>
| * spi/sirf: simplify use of devm_ioremap_resourceJulia Lawall2013-08-141-6/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove unneeded error handling on the result of a call to platform_get_resource when the value is passed to devm_ioremap_resource. Move the call to platform_get_resource adjacent to the call to devm_ioremap_resource to make the connection between them more clear. A simplified version of the semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ expression pdev,res,n,e,e1; expression ret != 0; identifier l; @@ - res = platform_get_resource(pdev, IORESOURCE_MEM, n); ... when != res - if (res == NULL) { ... \(goto l;\|return ret;\) } ... when != res + res = platform_get_resource(pdev, IORESOURCE_MEM, n); e = devm_ioremap_resource(e1, res); // </smpl> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Acked-by: Barry Song <Baohua.Song@csr.com> Signed-off-by: Mark Brown <broonie@linaro.org>
| * spi: sirf: use DMA if both buffer address and length are alignedBarry Song2013-08-061-23/+157
| | | | | | | | | | | | | | | | | | | | | | | | | | | | this patch enables DMA support for SiRFSoC SPI driver, if both buffers and length are aligned with DMA controller's hardware limitation, use generic SiRF generic dmaengine driver. for PIO, SiRF SPI controller actually is using rx to trigger rx, that means if we write any word to tx fifo, we will get a word from rx fifo. for DMA, we use two different channel for tx and rx, and issue them both for every transfer. Signed-off-by: Barry Song <Baohua.Song@csr.com> Signed-off-by: Mark Brown <broonie@linaro.org>
| * spi: sirf: add missed spi mode_bits that SiRFSoC hardware supportsQipan Li2013-07-151-0/+1
| | | | | | | | | | | | | | | | | | Missing this will cause some user cases fail when they want to change spi transfer mode. Signed-off-by: Qipan Li <Qipan.Li@csr.com> Signed-off-by: Barry Song <Baohua.Song@csr.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* | spi: Use dev_get_drvdata at appropriate placesAxel Lin2013-08-291-4/+2
|/ | | | | | | Use dev_get_drvdata() instead of platform_get_drvdata(to_platform_device(dev)). Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* Merge remote-tracking branch 'spi/topic/sirf' into spi-nextMark Brown2013-06-261-41/+14
|\
| * spi: sirf: fix the issue while transferring more than 256 wordsQipan Li2013-05-201-30/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | currently, spi irq handler only does rx processing and fetching data from rx fifo when "FRM_END" irq happens. FRM_END indicates one transfer completes. if rx size is less than 256, it works well. but the problem is that spi rx fifo size is only 256 bytes, then if data size of one frame is more than 256, before FRM_END comes, rx fifo will be filled with RXFIFO_OFLOW overflow interrupt, it will make us lose some data due to fifo overflow. Explicitly we need do fetch work from device rx fifo in irq handler not only in "FRM_END" irq but also in "THD_REACH" irq. THD_REACH means rx fifo has come to its threshold and will come to overflow if we don't take data from it in time. In this patch, we fix this issue. we take data from rx fifo when either FRM_END or RX_THD_REACH irq comes, we put data into tx fifo when either TX_FIFO_EMPTY or TX_THD_REACH irq comes. Signed-off-by: Qipan Li <Qipan.Li@csr.com> Signed-off-by: Zhiwu Song <Zhiwu.Song@csr.com> Signed-off-by: Barry Song <Baohua.Song@csr.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
| * spi/sirf: Let device core handle pinctrlMark Brown2013-05-131-11/+1
| | | | | | | | | | | | | | | | | | Since commit ab78029 (drivers/pinctrl: grab default handles from device core) we can rely on device core for handling pinctrl so remove devm_pinctrl_get_select_default() from the driver. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Barry Song <baohua.song@csr.com>
* | spi: sirf: avoid uninitialized-use warningArnd Bergmann2013-06-031-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 24778be20 "spi: convert drivers to use bits_per_word_mask" removed the "default" statement in the spi_sirfsoc_setup_transfer switch, causing a new warning: drivers/spi/spi-sirf.c: In function 'spi_sirfsoc_setup_transfer': arch/arm/include/asm/io.h:90:2: warning: 'rxfifo_ctrl' may be used uninitialized in this function [-Wmaybe-uninitialized] asm volatile("str %1, %0" ^ drivers/spi/spi-sirf.c:364:19: note: 'rxfifo_ctrl' was declared here u32 txfifo_ctrl, rxfifo_ctrl; ^ The compiler has correctly identified that this case may happen, but since we know that things are horribly broken if bits_per_word is ever something other than the values we tested, calling BUG() is an appropriate action and tells the compiler that execution will not continue afterwards. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Cc: Stephen Warren <swarren@wwwdotorg.org> Cc: Mark Brown <broonie@kernel.org> Signed-off-by: Mark Brown <broonie@linaro.org>
* | spi: convert drivers to use bits_per_word_maskStephen Warren2013-05-291-4/+2
|/ | | | | | | | | | Fill in the recently added spi_master.bits_per_word_mask field in as many drivers as possible. Make related cleanups, such as removing any redundant error-checking, or empty setup callbacks. Signed-off-by: Stephen Warren <swarren@wwwdotorg.org> Acked-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* spi/sirf: fix MODULE_DEVICE_TABLEArnd Bergmann2013-04-231-1/+1
| | | | | | | | | This fixes building the spi-sirf driver as a loadable module, which uses an incorrect MODULE_DEVICE_TABLE, by changing the reference to the correct symbol. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* Merge tag 'driver-core-3.9-rc1' of ↵Linus Torvalds2013-02-211-4/+3
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core Pull driver core patches from Greg Kroah-Hartman: "Here is the big driver core merge for 3.9-rc1 There are two major series here, both of which touch lots of drivers all over the kernel, and will cause you some merge conflicts: - add a new function called devm_ioremap_resource() to properly be able to check return values. - remove CONFIG_EXPERIMENTAL Other than those patches, there's not much here, some minor fixes and updates" Fix up trivial conflicts * tag 'driver-core-3.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (221 commits) base: memory: fix soft/hard_offline_page permissions drivercore: Fix ordering between deferred_probe and exiting initcalls backlight: fix class_find_device() arguments TTY: mark tty_get_device call with the proper const values driver-core: constify data for class_find_device() firmware: Ignore abort check when no user-helper is used firmware: Reduce ifdef CONFIG_FW_LOADER_USER_HELPER firmware: Make user-mode helper optional firmware: Refactoring for splitting user-mode helper code Driver core: treat unregistered bus_types as having no devices watchdog: Convert to devm_ioremap_resource() thermal: Convert to devm_ioremap_resource() spi: Convert to devm_ioremap_resource() power: Convert to devm_ioremap_resource() mtd: Convert to devm_ioremap_resource() mmc: Convert to devm_ioremap_resource() mfd: Convert to devm_ioremap_resource() media: Convert to devm_ioremap_resource() iommu: Convert to devm_ioremap_resource() drm: Convert to devm_ioremap_resource() ...
| * spi: Convert to devm_ioremap_resource()Thierry Reding2013-01-251-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | Convert all uses of devm_request_and_ioremap() to the newly introduced devm_ioremap_resource() which provides more consistent error handling. devm_ioremap_resource() provides its own error messages so all explicit error messages can be removed from the failure code paths. Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de> Cc: Grant Likely <grant.likely@secretlab.ca> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | spi/sirf: add support for new SiRFmarco SMP SoCBarry Song2013-02-051-0/+1
| | | | | | | | | | | | | | | | the driver is also compatible with SiRFmarco except SiRFprimaII, so simply add "sirf,marco-spi" to OF match table. Signed-off-by: Barry Song <Baohua.Song@csr.com> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
* | spi/sirf: use clk_prepare_enable and clk_disable_unprepareBarry Song2013-02-051-3/+3
| | | | | | | | | | | | | | | | Convert clk_enable/clk_disable to clk_prepare_enable/clk_disable_unprepare calls as required by common clock framework. Signed-off-by: Barry Song <Baohua.Song@csr.com> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
* | spi: remove check for bits_per_word on transfer from low level driverLaxman Dewangan2013-02-051-2/+1
|/ | | | | | | | | | | | | | | | | | | The spi core make sure that each transfer structure have the proper setting for bits_per_word before calling low level transfer APIs. Hence it is no more require to check again in low level driver for this field whether this is set correct or not. Removing such code from low level driver. The txx9 change also removes a test for bits_per_word set to 0, and forcing it to 8 in that case. This can also be removed now since spi_setup() ensures spi->bits_per_word is not zero. if (!spi->bits_per_word) spi->bits_per_word = 8; Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
* spi: Remove HOTPLUG section attributesGrant Likely2012-12-071-3/+3
| | | | | | | | | | | | | | CONFIG_HOTPLUG is going away as an option. As result the __dev* markings will be going away. Remove use of __devinit, __devexit_p, __devinitdata, __devinitconst, and __devexit. Bill Pemberton has done most of the legwork on this series. I've used his script to purge the attributes from the drivers/gpio tree. Reported-by: Bill Pemberton <wfp5p@virginia.edu> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
* SPI: PRIMA2: use the newest APIs of PINCTRL to fix compiling errorsBarry Song2012-05-191-12/+8
| | | | | | | | | | | | | | | | Fix the compiling errors: drivers/spi/spi-sirf.c: In function 'spi_sirfsoc_probe': drivers/spi/spi-sirf.c:563: error: implicit declaration of function 'pinmux_get' drivers/spi/spi-sirf.c:563: warning: assignment makes pointer from integer without a cast drivers/spi/spi-sirf.c:568: error: implicit declaration of function 'pinmux_enable' drivers/spi/spi-sirf.c:602: error: implicit declaration of function 'pinmux_disable' drivers/spi/spi-sirf.c:603: error: implicit declaration of function 'pinmux_put' make[3]: *** [drivers/spi/spi-sirf.o] Error 1 Signed-off-by: Barry Song <Baohua.Song@csr.com> Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
* SPI: add CSR SiRFprimaII SPI controller driverZhiwu Song2012-03-091-0/+687
CSR SiRFprimaII has two SPIs (SPI0 and SPI1). Features: * Master and slave modes * 8-/12-/16-/32-bit data unit * 256 bytes receive data FIFO and 256 bytes transmit data FIFO * Multi-unit frame * Configurable SPI_EN (chip select pin) active state * Configurable SPI_CLK polarity * Configurable SPI_CLK phase * Configurable MSB/LSB first Signed-off-by: Zhiwu Song <zhiwu.song@csr.com> Signed-off-by: Barry Song <Baohua.Song@csr.com> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
OpenPOWER on IntegriCloud