* [PATCH] spi: Compatibility with direction which is used in samsung DMA operation
@ 2012-03-10 0:48 Kyoungil Kim
2012-03-10 4:10 ` Grant Likely
0 siblings, 1 reply; 4+ messages in thread
From: Kyoungil Kim @ 2012-03-10 0:48 UTC (permalink / raw)
To: spi-devel-general, linux-samsung-soc
Cc: 'Grant Likely', 'Kukjin Kim',
'Kyoungil Kim'
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>
---
drivers/spi/spi-s3c64xx.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c
index dcf7e10..003a1bf 100644
--- a/drivers/spi/spi-s3c64xx.c
+++ b/drivers/spi/spi-s3c64xx.c
@@ -239,7 +239,7 @@ static void s3c64xx_spi_dmacb(void *data)
struct s3c64xx_spi_dma_data *dma = data;
unsigned long flags;
- if (dma->direction == DMA_FROM_DEVICE)
+ if (dma->direction == DMA_DEV_TO_MEM)
sdd = container_of(data,
struct s3c64xx_spi_driver_data, rx_dma);
else
@@ -248,7 +248,7 @@ static void s3c64xx_spi_dmacb(void *data)
spin_lock_irqsave(&sdd->lock, flags);
- if (dma->direction == DMA_FROM_DEVICE) {
+ if (dma->direction == DMA_DEV_TO_MEM) {
sdd->state &= ~RXBUSY;
if (!(sdd->state & TXBUSY))
complete(&sdd->xfer_completion);
@@ -267,7 +267,7 @@ static void prepare_dma(struct s3c64xx_spi_dma_data *dma,
struct s3c64xx_spi_driver_data *sdd;
struct samsung_dma_prep_info info;
- if (dma->direction == DMA_FROM_DEVICE)
+ if (dma->direction == DMA_DEV_TO_MEM) {
sdd = container_of((void *)dma,
struct s3c64xx_spi_driver_data, rx_dma);
else
@@ -1021,9 +1021,9 @@ static int __init s3c64xx_spi_probe(struct platform_device *pdev)
sdd->pdev = pdev;
sdd->sfr_start = mem_res->start;
sdd->tx_dma.dmach = dmatx_res->start;
- sdd->tx_dma.direction = DMA_TO_DEVICE;
+ sdd->tx_dma.direction = DMA_MEM_TO_DEV;
sdd->rx_dma.dmach = dmarx_res->start;
- sdd->rx_dma.direction = DMA_FROM_DEVICE;
+ sdd->rx_dma.direction = DMA_DEV_TO_MEM;
sdd->cur_bpw = 8;
--
1.7.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] spi: Compatibility with direction which is used in samsung DMA operation
2012-03-10 0:48 [PATCH] spi: Compatibility with direction which is used in samsung DMA operation Kyoungil Kim
@ 2012-03-10 4:10 ` Grant Likely
0 siblings, 0 replies; 4+ messages in thread
From: Grant Likely @ 2012-03-10 4:10 UTC (permalink / raw)
To: Kyoungil Kim, spi-devel-general, linux-samsung-soc
Cc: 'Kukjin Kim', 'Kyoungil Kim'
On Sat, 10 Mar 2012 09:48:46 +0900, Kyoungil Kim <ki0351.kim@samsung.com> wrote:
> 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>
Applied, thanks.
g.
> ---
> drivers/spi/spi-s3c64xx.c | 10 +++++-----
> 1 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c
> index dcf7e10..003a1bf 100644
> --- a/drivers/spi/spi-s3c64xx.c
> +++ b/drivers/spi/spi-s3c64xx.c
> @@ -239,7 +239,7 @@ static void s3c64xx_spi_dmacb(void *data)
> struct s3c64xx_spi_dma_data *dma = data;
> unsigned long flags;
>
> - if (dma->direction == DMA_FROM_DEVICE)
> + if (dma->direction == DMA_DEV_TO_MEM)
> sdd = container_of(data,
> struct s3c64xx_spi_driver_data, rx_dma);
> else
> @@ -248,7 +248,7 @@ static void s3c64xx_spi_dmacb(void *data)
>
> spin_lock_irqsave(&sdd->lock, flags);
>
> - if (dma->direction == DMA_FROM_DEVICE) {
> + if (dma->direction == DMA_DEV_TO_MEM) {
> sdd->state &= ~RXBUSY;
> if (!(sdd->state & TXBUSY))
> complete(&sdd->xfer_completion);
> @@ -267,7 +267,7 @@ static void prepare_dma(struct s3c64xx_spi_dma_data *dma,
> struct s3c64xx_spi_driver_data *sdd;
> struct samsung_dma_prep_info info;
>
> - if (dma->direction == DMA_FROM_DEVICE)
> + if (dma->direction == DMA_DEV_TO_MEM) {
> sdd = container_of((void *)dma,
> struct s3c64xx_spi_driver_data, rx_dma);
> else
> @@ -1021,9 +1021,9 @@ static int __init s3c64xx_spi_probe(struct platform_device *pdev)
> sdd->pdev = pdev;
> sdd->sfr_start = mem_res->start;
> sdd->tx_dma.dmach = dmatx_res->start;
> - sdd->tx_dma.direction = DMA_TO_DEVICE;
> + sdd->tx_dma.direction = DMA_MEM_TO_DEV;
> sdd->rx_dma.dmach = dmarx_res->start;
> - sdd->rx_dma.direction = DMA_FROM_DEVICE;
> + sdd->rx_dma.direction = DMA_DEV_TO_MEM;
>
> sdd->cur_bpw = 8;
>
> --
> 1.7.1
>
--
Grant Likely, B.Sc, P.Eng.
Secret Lab Technologies,Ltd.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] spi: Compatibility with direction which is used in samsung DMA operation
@ 2012-02-08 6:54 Kyoungil Kim
2012-03-09 21:58 ` Grant Likely
0 siblings, 1 reply; 4+ messages in thread
From: Kyoungil Kim @ 2012-02-08 6:54 UTC (permalink / raw)
To: spi-devel-general, linux-samsung-soc
Cc: 'Grant Likely', 'Kukjin Kim',
'Kyoungil Kim'
Signed-off-by: Boojin Kim <boojin.kim@samsung.com>
Signed-off-by: Kyoungil Kim <ki0351.kim@samsung.com>
---
drivers/spi/spi-s3c64xx.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c
index f3b7f6a..1972377 100644
--- a/drivers/spi/spi-s3c64xx.c
+++ b/drivers/spi/spi-s3c64xx.c
@@ -239,7 +239,7 @@ static void s3c64xx_spi_dmacb(void *data)
struct s3c64xx_spi_dma_data *dma = data;
unsigned long flags;
- if (dma->direction == DMA_FROM_DEVICE)
+ if (dma->direction == DMA_DEV_TO_MEM)
sdd = container_of(data,
struct s3c64xx_spi_driver_data, rx_dma);
else
@@ -248,7 +248,7 @@ static void s3c64xx_spi_dmacb(void *data)
spin_lock_irqsave(&sdd->lock, flags);
- if (dma->direction == DMA_FROM_DEVICE) {
+ if (dma->direction == DMA_DEV_TO_MEM) {
sdd->state &= ~RXBUSY;
if (!(sdd->state & TXBUSY))
complete(&sdd->xfer_completion);
@@ -268,7 +268,7 @@ static void prepare_dma(struct s3c64xx_spi_dma_data *dma,
struct samsung_dma_prep info;
struct samsung_dma_config config;
- if (dma->direction == DMA_FROM_DEVICE) {
+ if (dma->direction == DMA_DEV_TO_MEM) {
sdd = container_of((void *)dma,
struct s3c64xx_spi_driver_data, rx_dma);
@@ -1028,9 +1028,9 @@ static int __init s3c64xx_spi_probe(struct platform_device *pdev)
sdd->pdev = pdev;
sdd->sfr_start = mem_res->start;
sdd->tx_dma.dmach = dmatx_res->start;
- sdd->tx_dma.direction = DMA_TO_DEVICE;
+ sdd->tx_dma.direction = DMA_MEM_TO_DEV;
sdd->rx_dma.dmach = dmarx_res->start;
- sdd->rx_dma.direction = DMA_FROM_DEVICE;
+ sdd->rx_dma.direction = DMA_DEV_TO_MEM;
sdd->cur_bpw = 8;
--
1.7.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] spi: Compatibility with direction which is used in samsung DMA operation
2012-02-08 6:54 Kyoungil Kim
@ 2012-03-09 21:58 ` Grant Likely
0 siblings, 0 replies; 4+ messages in thread
From: Grant Likely @ 2012-03-09 21:58 UTC (permalink / raw)
To: Kyoungil Kim, spi-devel-general, linux-samsung-soc
Cc: 'Kukjin Kim', 'Kyoungil Kim'
On Wed, 08 Feb 2012 15:54:40 +0900, Kyoungil Kim <ki0351.kim@samsung.com> wrote:
> Signed-off-by: Boojin Kim <boojin.kim@samsung.com>
> Signed-off-by: Kyoungil Kim <ki0351.kim@samsung.com>
I'm sorry, I don't understand the reason for the patch. Please help a poor
maintainer out and include the reason *why* the patch is needed in the
commit text.
(repost with a proper commit log message).
g.
> ---
> drivers/spi/spi-s3c64xx.c | 10 +++++-----
> 1 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c
> index f3b7f6a..1972377 100644
> --- a/drivers/spi/spi-s3c64xx.c
> +++ b/drivers/spi/spi-s3c64xx.c
> @@ -239,7 +239,7 @@ static void s3c64xx_spi_dmacb(void *data)
> struct s3c64xx_spi_dma_data *dma = data;
> unsigned long flags;
>
> - if (dma->direction == DMA_FROM_DEVICE)
> + if (dma->direction == DMA_DEV_TO_MEM)
> sdd = container_of(data,
> struct s3c64xx_spi_driver_data, rx_dma);
> else
> @@ -248,7 +248,7 @@ static void s3c64xx_spi_dmacb(void *data)
>
> spin_lock_irqsave(&sdd->lock, flags);
>
> - if (dma->direction == DMA_FROM_DEVICE) {
> + if (dma->direction == DMA_DEV_TO_MEM) {
> sdd->state &= ~RXBUSY;
> if (!(sdd->state & TXBUSY))
> complete(&sdd->xfer_completion);
> @@ -268,7 +268,7 @@ static void prepare_dma(struct s3c64xx_spi_dma_data *dma,
> struct samsung_dma_prep info;
> struct samsung_dma_config config;
>
> - if (dma->direction == DMA_FROM_DEVICE) {
> + if (dma->direction == DMA_DEV_TO_MEM) {
> sdd = container_of((void *)dma,
> struct s3c64xx_spi_driver_data, rx_dma);
>
> @@ -1028,9 +1028,9 @@ static int __init s3c64xx_spi_probe(struct platform_device *pdev)
> sdd->pdev = pdev;
> sdd->sfr_start = mem_res->start;
> sdd->tx_dma.dmach = dmatx_res->start;
> - sdd->tx_dma.direction = DMA_TO_DEVICE;
> + sdd->tx_dma.direction = DMA_MEM_TO_DEV;
> sdd->rx_dma.dmach = dmarx_res->start;
> - sdd->rx_dma.direction = DMA_FROM_DEVICE;
> + sdd->rx_dma.direction = DMA_DEV_TO_MEM;
>
> sdd->cur_bpw = 8;
>
> --
> 1.7.1
>
>
--
Grant Likely, B.Sc, P.Eng.
Secret Lab Technologies,Ltd.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-03-10 4:10 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-10 0:48 [PATCH] spi: Compatibility with direction which is used in samsung DMA operation Kyoungil Kim
2012-03-10 4:10 ` Grant Likely
-- strict thread matches above, loose matches on Subject: below --
2012-02-08 6:54 Kyoungil Kim
2012-03-09 21:58 ` Grant Likely
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).