summaryrefslogtreecommitdiff
path: root/patches.tizen/0717-spi-spi-s3c64xx-Remove-unused-code.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches.tizen/0717-spi-spi-s3c64xx-Remove-unused-code.patch')
-rw-r--r--patches.tizen/0717-spi-spi-s3c64xx-Remove-unused-code.patch115
1 files changed, 115 insertions, 0 deletions
diff --git a/patches.tizen/0717-spi-spi-s3c64xx-Remove-unused-code.patch b/patches.tizen/0717-spi-spi-s3c64xx-Remove-unused-code.patch
new file mode 100644
index 00000000000..ed4f885b0f7
--- /dev/null
+++ b/patches.tizen/0717-spi-spi-s3c64xx-Remove-unused-code.patch
@@ -0,0 +1,115 @@
+From 30ebc1122adb1d4f25ab262e05dd7a76fb100271 Mon Sep 17 00:00:00 2001
+From: Lukasz Czerwinski <l.czerwinski@samsung.com>
+Date: Fri, 30 Aug 2013 13:50:30 +0200
+Subject: [PATCH 0717/1302] spi: spi-s3c64xx: Remove unused code
+
+So far physical address (used to set dma transfer) was obtained
+from mapping virtual address of the client buffer address passed
+in SPI message. Deprecated code uses dma_map_single() and
+dma_unmap_single().
+
+Now mapping of virtual address has been replaced by data
+transfer from client buffer to contiguous regions allocated by
+dma_alloc_coherent(). Physical address of dma buffers is used
+to set dma transfer.
+
+This makes functions: s3c64xx_spi_map_mssg(), s3c64xx_spi_unmap()
+redundant hence they are removed.
+
+Signed-off-by: Lukasz Czerwinski <l.czerwinski@samsung.com>
+Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
+---
+ drivers/spi/spi-s3c64xx.c | 77 -----------------------------------------------
+ 1 file changed, 77 deletions(-)
+
+diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c
+index 5eacae5..4a01dda 100644
+--- a/drivers/spi/spi-s3c64xx.c
++++ b/drivers/spi/spi-s3c64xx.c
+@@ -698,83 +698,6 @@ static void s3c64xx_spi_config(struct s3c64xx_spi_driver_data *sdd)
+ }
+ }
+
+-#define XFER_DMAADDR_INVALID DMA_BIT_MASK(32)
+-
+-static int s3c64xx_spi_map_mssg(struct s3c64xx_spi_driver_data *sdd,
+- struct spi_message *msg)
+-{
+- struct device *dev = &sdd->pdev->dev;
+- struct spi_transfer *xfer;
+-
+- if (msg->is_dma_mapped)
+- return 0;
+-
+- /* First mark all xfer unmapped */
+- list_for_each_entry(xfer, &msg->transfers, transfer_list) {
+- xfer->rx_dma = XFER_DMAADDR_INVALID;
+- xfer->tx_dma = XFER_DMAADDR_INVALID;
+- }
+-
+- /* Map until end or first fail */
+- list_for_each_entry(xfer, &msg->transfers, transfer_list) {
+-
+- if (xfer->len <= ((FIFO_LVL_MASK(sdd) >> 1) + 1))
+- continue;
+-
+- if (xfer->tx_buf != NULL) {
+- xfer->tx_dma = dma_map_single(dev,
+- (void *)xfer->tx_buf, xfer->len,
+- DMA_TO_DEVICE);
+- if (dma_mapping_error(dev, xfer->tx_dma)) {
+- dev_err(dev, "dma_map_single Tx failed\n");
+- xfer->tx_dma = XFER_DMAADDR_INVALID;
+- return -ENOMEM;
+- }
+- }
+-
+- if (xfer->rx_buf != NULL) {
+- xfer->rx_dma = dma_map_single(dev, xfer->rx_buf,
+- xfer->len, DMA_FROM_DEVICE);
+- if (dma_mapping_error(dev, xfer->rx_dma)) {
+- dev_err(dev, "dma_map_single Rx failed\n");
+- dma_unmap_single(dev, xfer->tx_dma,
+- xfer->len, DMA_TO_DEVICE);
+- xfer->tx_dma = XFER_DMAADDR_INVALID;
+- xfer->rx_dma = XFER_DMAADDR_INVALID;
+- return -ENOMEM;
+- }
+- }
+- }
+-
+- return 0;
+-}
+-
+-static void s3c64xx_spi_unmap_mssg(struct s3c64xx_spi_driver_data *sdd,
+- struct spi_message *msg)
+-{
+- struct device *dev = &sdd->pdev->dev;
+- struct spi_transfer *xfer;
+-
+- if (msg->is_dma_mapped)
+- return;
+-
+- list_for_each_entry(xfer, &msg->transfers, transfer_list) {
+-
+- if (xfer->len <= ((FIFO_LVL_MASK(sdd) >> 1) + 1))
+- continue;
+-
+- if (xfer->rx_buf != NULL
+- && xfer->rx_dma != XFER_DMAADDR_INVALID)
+- dma_unmap_single(dev, xfer->rx_dma,
+- xfer->len, DMA_FROM_DEVICE);
+-
+- if (xfer->tx_buf != NULL
+- && xfer->tx_dma != XFER_DMAADDR_INVALID)
+- dma_unmap_single(dev, xfer->tx_dma,
+- xfer->len, DMA_TO_DEVICE);
+- }
+-}
+-
+ static int s3c64xx_spi_transfer_one_message(struct spi_master *master,
+ struct spi_message *msg)
+ {
+--
+1.8.3.2
+