diff options
Diffstat (limited to 'patches.tizen/0712-spi-spi-s3c64xx-Remove-platform-dependent-code.patch')
-rw-r--r-- | patches.tizen/0712-spi-spi-s3c64xx-Remove-platform-dependent-code.patch | 147 |
1 files changed, 147 insertions, 0 deletions
diff --git a/patches.tizen/0712-spi-spi-s3c64xx-Remove-platform-dependent-code.patch b/patches.tizen/0712-spi-spi-s3c64xx-Remove-platform-dependent-code.patch new file mode 100644 index 00000000000..f06536f76f9 --- /dev/null +++ b/patches.tizen/0712-spi-spi-s3c64xx-Remove-platform-dependent-code.patch @@ -0,0 +1,147 @@ +From 8c6427b0165710cb8edcc33e48a116b3b8710175 Mon Sep 17 00:00:00 2001 +From: Lukasz Czerwinski <l.czerwinski@samsung.com> +Date: Wed, 21 Aug 2013 13:13:00 +0200 +Subject: [PATCH 0712/1302] spi: spi-s3c64xx: Remove platform dependent code + +This patch removes platform dependent code from the spi-s3c64xx driver. + +Signed-off-by: Lukasz Czerwinski <l.czerwinski@samsung.com> +Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com> +--- + drivers/spi/spi-s3c64xx.c | 99 +---------------------------------------------- + 1 file changed, 1 insertion(+), 98 deletions(-) + +diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c +index 71cc3e6..c1cf40d 100644 +--- a/drivers/spi/spi-s3c64xx.c ++++ b/drivers/spi/spi-s3c64xx.c +@@ -34,10 +34,6 @@ + + #include <linux/platform_data/spi-s3c64xx.h> + +-#ifdef CONFIG_S3C_DMA +-#include <mach/dma.h> +-#endif +- + #define MAX_SPI_PORTS 3 + + /* Registers and bit-fields */ +@@ -199,9 +195,7 @@ struct s3c64xx_spi_driver_data { + unsigned cur_speed; + struct s3c64xx_spi_dma_data rx_dma; + struct s3c64xx_spi_dma_data tx_dma; +-#ifdef CONFIG_S3C_DMA +- struct samsung_dma_ops *ops; +-#endif ++ + struct s3c64xx_spi_port_config *port_conf; + unsigned int port_id; + unsigned long gpios[4]; +@@ -283,96 +277,6 @@ static void s3c64xx_spi_dmacb(void *data) + spin_unlock_irqrestore(&sdd->lock, flags); + } + +-#ifdef CONFIG_S3C_DMA +-/* FIXME: remove this section once arch/arm/mach-s3c64xx uses dmaengine */ +- +-static struct s3c2410_dma_client s3c64xx_spi_dma_client = { +- .name = "samsung-spi-dma", +-}; +- +-static void prepare_dma(struct s3c64xx_spi_dma_data *dma, +- unsigned len, dma_addr_t buf) +-{ +- struct s3c64xx_spi_driver_data *sdd; +- struct samsung_dma_prep info; +- struct samsung_dma_config config; +- +- if (dma->direction == DMA_DEV_TO_MEM) { +- sdd = container_of((void *)dma, +- struct s3c64xx_spi_driver_data, rx_dma); +- config.direction = sdd->rx_dma.direction; +- config.fifo = sdd->sfr_start + S3C64XX_SPI_RX_DATA; +- config.width = sdd->cur_bpw / 8; +- sdd->ops->config((enum dma_ch)sdd->rx_dma.ch, &config); +- } else { +- sdd = container_of((void *)dma, +- struct s3c64xx_spi_driver_data, tx_dma); +- config.direction = sdd->tx_dma.direction; +- config.fifo = sdd->sfr_start + S3C64XX_SPI_TX_DATA; +- config.width = sdd->cur_bpw / 8; +- sdd->ops->config((enum dma_ch)sdd->tx_dma.ch, &config); +- } +- +- info.cap = DMA_SLAVE; +- info.len = len; +- info.fp = s3c64xx_spi_dmacb; +- info.fp_param = dma; +- info.direction = dma->direction; +- info.buf = buf; +- +- sdd->ops->prepare((enum dma_ch)dma->ch, &info); +- sdd->ops->trigger((enum dma_ch)dma->ch); +-} +- +-static int acquire_dma(struct s3c64xx_spi_driver_data *sdd) +-{ +- struct samsung_dma_req req; +- struct device *dev = &sdd->pdev->dev; +- +- sdd->ops = samsung_dma_get_ops(); +- +- req.cap = DMA_SLAVE; +- req.client = &s3c64xx_spi_dma_client; +- +- sdd->rx_dma.ch = (void *)sdd->ops->request(sdd->rx_dma.dmach, &req, dev, "rx"); +- sdd->tx_dma.ch = (void *)sdd->ops->request(sdd->tx_dma.dmach, &req, dev, "tx"); +- +- return 1; +-} +- +-static int s3c64xx_spi_prepare_transfer(struct spi_master *spi) +-{ +- struct s3c64xx_spi_driver_data *sdd = spi_master_get_devdata(spi); +- +- /* Acquire DMA channels */ +- while (!acquire_dma(sdd)) +- usleep_range(10000, 11000); +- +- pm_runtime_get_sync(&sdd->pdev->dev); +- +- return 0; +-} +- +-static int s3c64xx_spi_unprepare_transfer(struct spi_master *spi) +-{ +- struct s3c64xx_spi_driver_data *sdd = spi_master_get_devdata(spi); +- +- /* Free DMA channels */ +- sdd->ops->release((enum dma_ch)sdd->rx_dma.ch, &s3c64xx_spi_dma_client); +- sdd->ops->release((enum dma_ch)sdd->tx_dma.ch, &s3c64xx_spi_dma_client); +- +- pm_runtime_put(&sdd->pdev->dev); +- +- return 0; +-} +- +-static void s3c64xx_spi_dma_stop(struct s3c64xx_spi_driver_data *sdd, +- struct s3c64xx_spi_dma_data *dma) +-{ +- sdd->ops->stop((enum dma_ch)dma->ch); +-} +-#else +- + static void prepare_dma(struct s3c64xx_spi_dma_data *dma, + unsigned len, dma_addr_t buf) + { +@@ -476,7 +380,6 @@ static void s3c64xx_spi_dma_stop(struct s3c64xx_spi_driver_data *sdd, + { + dmaengine_terminate_all(dma->ch); + } +-#endif + + static void enable_datapath(struct s3c64xx_spi_driver_data *sdd, + struct spi_device *spi, +-- +1.8.3.2 + |