summaryrefslogtreecommitdiff
path: root/drivers/spi/spi-s3c64xx.c
AgeCommit message (Collapse)AuthorFilesLines
2012-08-27spi/s3c64xx: Drop extra calls to spi_master_get in suspend/remove functionsGuenter Roeck1-4/+4
Suspend and resume functions call spi_master_get() without matching spi_master_put(). The extra references are unnecessary and cause subsequent module unload attempts to fail. Drop the calls. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Acked-by: Kukjin Kim <kgene.kim@samsung.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-08-10spi/s3c64xx: improve error handlingArnd Bergmann1-1/+1
When a device tree definition os an s3c64xx SPI master is missing a "controller-data" subnode, the newly added s3c64xx_get_slave_ctrldata function might use uninitialized memory in place of that node, which was correctly reported by gcc. Without this patch, building s3c6400_defconfig results in: drivers/spi/spi-s3c64xx.c: In function 's3c64xx_get_slave_ctrldata.isra.25': drivers/spi/spi-s3c64xx.c:841:5: warning: 'data_np' may be used uninitialized in this function [-Wuninitialized] Signed-off-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Thomas Abraham <thomas.abraham@linaro.org> Acked-by: Kukjin Kim <kgene.kim@samsung.com> Cc: Jaswinder Singh <jaswinder.singh@linaro.org> Cc: Grant Likely <grant.likely@secretlab.ca>
2012-07-19spi/s3c64xx: Expand S3C64XX_SPI_{DE,}ACT macros at call sitesMark Brown1-8/+4
They have very few users and they're both just doing a single register write so the advantage of having the macro is a bit limited. An inline function might make sense but it's as easy to just do the writes directly. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
2012-07-19spi/s3c64xx: Convert to devm_request_and_ioremap()Mark Brown1-17/+1
Saves some error handling and a small amount of code. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
2012-07-19spi/s3c64xx: Put the /CS GPIO into output modeMark Brown1-1/+2
No call was being made by the GPIO driver to put the GPIO into output mode meaning that the calls to gpio_set_value() which were being done were not valid. A similar issue appears to exist with the DT GPIO requests but as they appear to be being used for pinmux it's less clear to me that we want to configure them. Without this fix Cragganmore systems can't talk to their SPI devices. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
2012-07-19spi/s3c64xx: Fix handling of errors in gpio_request()Mark Brown1-4/+5
When gpio_request() fails the driver logged the failure but while it'd try to print an error code in the non-DT case it didn't pass the error code in so garbage would be logged and in the DT case the error wasn't logged. Further, in the non-DT case the error code was then overwritten with -EBUSY depriving the caller of information and breaking automatic probe deferral pushing back from the GPIO level. Also reformat the non-DT log message so it's not word wrapped and we can grep for it. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
2012-07-13spi: s3c64xx: add device tree supportThomas Abraham1-39/+264
Add support for device based discovery. Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org> Acked-by: Jaswinder Singh <jaswinder.singh@linaro.org> Acked-by: Grant Likely <grant.likely@secretlab.ca> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
2012-07-13spi: s3c64xx: Remove the 'set_level' callback from controller dataThomas Abraham1-5/+26
The set_level callback in the controller data, which is used to configure the slave select line, cannot be supported when migrating the driver to device tree based discovery. Since all the platforms currently use gpio as the slave select line, this callback can be removed from the controller data and replaced with call to gpio_set_value in the driver. Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org> Acked-by: Jaswinder Singh <jaswinder.singh@linaro.org> Acked-by: Grant Likely <grant.likely@secretlab.ca> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
2012-07-13ARM: SAMSUNG: Remove pdev pointer parameter from spi gpio setup functionsThomas Abraham1-3/+2
The platform data pointer that is passed to the spi gpio setup functions is not used. Hence, this parameter is removed from all the spi gpio setup functions. Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org> Acked-by: Jaswinder Singh <jaswinder.singh@linaro.org> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
2012-07-13spi: s3c64xx: move controller information into driver dataThomas Abraham1-27/+123
Platform data is used to specify controller hardware specific information such as the tx/rx fifo level mask and bit offset of rx fifo level. Such information is not suitable to be supplied from device tree. Instead, it can be moved into the driver data and removed from platform data. Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org> Acked-by: Jaswinder Singh <jaswinder.singh@linaro.org> Acked-by: Grant Likely <grant.likely@secretlab.ca> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
2012-07-13spi: s3c64xx: remove unused S3C64XX_SPI_ST_TRLCNTZ macroThomas Abraham1-4/+0
The macro S3C64XX_SPI_ST_TRLCNTZ is not used and hence it is removed. Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org> Acked-by: Jaswinder Singh <jaswinder.singh@linaro.org> Acked-by: Grant Likely <grant.likely@secretlab.ca> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
2012-06-20spi/s3c64xx: Add the use of DMA config operationBoojin Kim1-14/+19
Config operation is separated from request operation in DMA common operation. Because spi driver can change the DMA config for every transfer. So this patch is using the separated DMA config operation. Signed-off-by: Boojin Kim <boojin.kim@samsung.com> Signed-off-by: Kyoungil Kim <ki0351.kim@samsung.com> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
2012-03-15spi: s3c64xx: Fix buildMark Brown1-1/+1
Commit 054ebc (spi: Compatibility with direction which is used in samsung DMA operation) does not build as one hunk adds a brace to the first branch of an if statement without adding at least the correspoding close. Remove the unwanted brace. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2012-03-15spi: s3c64xx: remove unnecessary callback msg->completeKuninori Morimoto1-3/+0
msg->complete will be called in spi_finalize_current_message(). Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Reviewed-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2012-03-10spi: Compatibility with direction which is used in samsung DMA operationKyoungil Kim1-5/+5
I found that there are two kind of direction type. First one is dma_data_direction defined in include/linux/dma-direction.h. It is used for parameter of dma_map/unmap_single in spi-s3c64xx. The other one is dma_transter_direction defined in include/linux/dmaengine.h. It is used for direction of samsung DMA operation (arch/arm/plat-samsung/dma-ops.c). This patch is just some changes to use direction defines which is used in samsung DMA operation. Signed-off-by: Boojin Kim <boojin.kim@samsung.com> Signed-off-by: Kyoungil Kim <ki0351.kim@samsung.com> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2012-03-10spi/s3c64xx: Convert to using core message queueMark Brown1-103/+22
Convert the s3c64xx driver to using the new message queue factored out of the pl022 driver by Linus Walleij, saving us a nice block of code and getting the benefits of improvements implemented in the core. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2012-01-30Merge branch 'spi/s3c64xx' of ↵Grant Likely1-11/+103
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/misc Conflicts: drivers/spi/spi-s3c64xx.c
2012-01-21spi/s3c64xx: Implement runtime PM supportMark Brown1-0/+39
Enable and disable the clocks to the SPI controller using runtime PM. This serves the dual purpose of reducing power consumption a little and letting the core know when the device is idle. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Linus Walleij <linus.walleij@linaro.org> Acked-by: Heiko Stuebner <heiko@sntech.de>
2012-01-21spi/s3c64xx: Convert to dev_pm_opsMark Brown1-9/+10
In preparation for the addition of runtime PM ops. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-21spi/s3c64xx: Log error interruptsMark Brown1-2/+55
Although the hardware supports interrupts we're not currently using them at all since for small transfers the overhead is greater than that for busy waiting and for large transfers we have interrupts from the DMA. This means that if the hardware reports an error (especially one which might not stall transfer) we might miss it. Take a first pass at dealing with such errors by enabling the interrupt if we can and logging the errors if they happen. Ideally we'd report the error via the affected transfer but since we're in master mode it's very difficult to trigger errors at present and this code is much simpler. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Linus Walleij <linus.walleij@linaro.org>
2011-12-23spi/s3c64xx: Use bus clocks created using clkdevPadmavathi Venna1-9/+5
This patch modifies the driver to stop depending on the clock names being passed from platform and switch over to lookup clocks generic names using clkdev Signed-off-by: Padmavathi Venna <padma.v@samsung.com> Acked-by: Grant Likely <grant.likely@secretlab.ca> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
2011-09-14spi/s3c64xx: Merge dma control codeBoojin Kim1-64/+76
This patch modifies to merge the dma control code. Original s3c64xx spi driver has each dma control code for rx and tx channel. This patch merges these dma control codes into one. With this patch, a dma setup function and callback function handle for both rx and tx channel. Signed-off-by: Boojin Kim <boojin.kim@samsung.com> Acked-by: Linus Walleij <linus.walleij@linaro.org> Acked-by: Vinod Koul <vinod.koul@intel.com> Cc: Grant Likely <grant.likely@secretlab.ca> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2011-09-14spi/s3c64xx: Add support DMA engine APIBoojin Kim1-72/+69
This patch adds to support DMA generic API to transfer raw SPI data. Basiclly the spi driver uses DMA generic API if architecture supports it. Otherwise, uses Samsung specific S3C-PL330 APIs. Signed-off-by: Boojin Kim <boojin.kim@samsung.com> Acked-by: Linus Walleij <linus.walleij@linaro.org> Acked-by: Vinod Koul <vinod.koul@intel.com> Acked-by: Grant Likely <grant.likely@secretlab.ca> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2011-07-23Merge branch 'spi/next' of git://git.secretlab.ca/git/linux-2.6Linus Torvalds1-0/+1245
* 'spi/next' of git://git.secretlab.ca/git/linux-2.6: (34 commits) spi/imx: add device tree probe support spi/imx: copy gpio number passed by platform data into driver private data spi/imx: use soc name in spi device type naming scheme spi/imx: merge type SPI_IMX_VER_0_7 into SPI_IMX_VER_0_4 spi/imx: do not use spi_imx2_3 to name SPI_IMX_VER_2_3 function and macro spi/imx: use mx21 to name SPI_IMX_VER_0_0 function and macro spi/imx: do not make copy of spi_imx_devtype_data spi/dw: Add spi number into spi irq desc spi/tegra: Use engineering names in DT compatible property spi/fsl_spi: fix CPM spi driver mach-s3c2410: remove unused spi-gpio.h file spi: remove obsolete spi-s3c24xx-gpio driver mach-gta2: remove unused spi-gpio.h include mach-qt2410: convert to spi_gpio mach-jive: convert to spi_gpio spi/pxa2xx: Remove unavailable ssp_type from documentation spi/bfin_spi: uninline fat queue funcs spi/bfin_spi: constify pin array spi/bfin_spi: use structs for accessing hardware regs spi/topcliff-pch: Support new device ML7223 IOH ... Fix up trivial conflict in arch/arm/mach-ep93xx/Makefile
2011-06-06spi: reorganize driversGrant Likely1-0/+1247
Sort the SPI makefile and enforce the naming convention spi_*.c for spi drivers. This change also rolls the contents of atmel_spi.h into the .c file since there is only one user of that particular include file. v2: - Use 'spi-' prefix instead of 'spi_' to match what seems to be be the predominant pattern for subsystem prefixes. - Clean up filenames in Kconfig and header comment blocks Signed-off-by: Grant Likely <grant.likely@secretlab.ca> Acked-by: Wolfram Sang <w.sang@pengutronix.de> Acked-by: Linus Walleij <linus.walleij@linaro.org>