All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] spi: Add the use of DMA config operation
@ 2012-02-08  6:52 Kyoungil Kim
  2012-02-08 10:05 ` Sylwester Nawrocki
  0 siblings, 1 reply; 3+ messages in thread
From: Kyoungil Kim @ 2012-02-08  6:52 UTC (permalink / raw)
  To: spi-devel-general, linux-samsung-soc
  Cc: 'Grant Likely', 'Kukjin Kim', 'Kyoungil Kim'

Config operation is separated from request operation in DMA common operation.
Because spi driver can change the DMA config for every message.
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>
---
 drivers/spi/spi-s3c64xx.c |   35 +++++++++++++++++++++--------------
 1 files changed, 21 insertions(+), 14 deletions(-)

diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c
index dcf7e10..f3b7f6a 100644
--- a/drivers/spi/spi-s3c64xx.c
+++ b/drivers/spi/spi-s3c64xx.c
@@ -265,15 +265,27 @@ 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 info;
+	struct samsung_dma_prep info;
+	struct samsung_dma_config config;
 
-	if (dma->direction == DMA_FROM_DEVICE)
+	if (dma->direction == DMA_FROM_DEVICE) {
 		sdd = container_of((void *)dma,
 			struct s3c64xx_spi_driver_data, rx_dma);
-	else
+
+		config.direction = sdd->rx_dma.direction;
+		config.fifo = sdd->sfr_start + S3C64XX_SPI_RX_DATA;
+		config.width = sdd->cur_bpw / 8;
+		sdd->ops->config(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(sdd->tx_dma.ch, &config);
+	}
+
 	info.cap = DMA_SLAVE;
 	info.len = len;
 	info.fp = s3c64xx_spi_dmacb;
@@ -287,20 +299,15 @@ static void prepare_dma(struct s3c64xx_spi_dma_data *dma,
 
 static int acquire_dma(struct s3c64xx_spi_driver_data *sdd)
 {
-	struct samsung_dma_info info;
+	struct samsung_dma_req req;
 
 	sdd->ops = samsung_dma_get_ops();
 
-	info.cap = DMA_SLAVE;
-	info.client = &s3c64xx_spi_dma_client;
-	info.width = sdd->cur_bpw / 8;
-
-	info.direction = sdd->rx_dma.direction;
-	info.fifo = sdd->sfr_start + S3C64XX_SPI_RX_DATA;
-	sdd->rx_dma.ch = sdd->ops->request(sdd->rx_dma.dmach, &info);
-	info.direction =  sdd->tx_dma.direction;
-	info.fifo = sdd->sfr_start + S3C64XX_SPI_TX_DATA;
-	sdd->tx_dma.ch = sdd->ops->request(sdd->tx_dma.dmach, &info);
+	req.cap = DMA_SLAVE;
+	req.client = &s3c64xx_spi_dma_client;
+
+	sdd->rx_dma.ch = sdd->ops->request(sdd->rx_dma.dmach, &req);
+	sdd->tx_dma.ch = sdd->ops->request(sdd->tx_dma.dmach, &req);
 
 	return 1;
 }
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] spi: Add the use of DMA config operation
  2012-02-08  6:52 [PATCH] spi: Add the use of DMA config operation Kyoungil Kim
@ 2012-02-08 10:05 ` Sylwester Nawrocki
  2012-02-08 10:34   ` Kyoungil Kim
  0 siblings, 1 reply; 3+ messages in thread
From: Sylwester Nawrocki @ 2012-02-08 10:05 UTC (permalink / raw)
  To: Kyoungil Kim
  Cc: spi-devel-general, linux-samsung-soc, 'Grant Likely',
	'Kukjin Kim'

Hi,

On 02/08/2012 07:52 AM, Kyoungil Kim wrote:
> Config operation is separated from request operation in DMA common operation.
> Because spi driver can change the DMA config for every message.
> 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>
> ---
>  drivers/spi/spi-s3c64xx.c |   35 +++++++++++++++++++++--------------
>  1 files changed, 21 insertions(+), 14 deletions(-)

I'm getting following compilation errors with this patch:

  CC      drivers/spi/spi-s3c64xx.o
drivers/spi/spi-s3c64xx.c: In function ‘prepare_dma’:
drivers/spi/spi-s3c64xx.c:268: error: storage size of ‘info’ isn’t known
drivers/spi/spi-s3c64xx.c:269: error: storage size of ‘config’ isn’t known
drivers/spi/spi-s3c64xx.c:278: error: ‘struct samsung_dma_ops’ has no member
named ‘config’
drivers/spi/spi-s3c64xx.c:286: error: ‘struct samsung_dma_ops’ has no member
named ‘config’
drivers/spi/spi-s3c64xx.c:269: warning: unused variable ‘config’
drivers/spi/spi-s3c64xx.c:268: warning: unused variable ‘info’
drivers/spi/spi-s3c64xx.c: In function ‘acquire_dma’:
drivers/spi/spi-s3c64xx.c:302: error: storage size of ‘req’ isn’t known
drivers/spi/spi-s3c64xx.c:302: warning: unused variable ‘req’

Which tree has it been created off of ?

It seems there are some patches not yet in mainline that it depends on.


Thanks,
-- 
Sylwester Nawrocki
Samsung Poland R&D Center

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [PATCH] spi: Add the use of DMA config operation
  2012-02-08 10:05 ` Sylwester Nawrocki
@ 2012-02-08 10:34   ` Kyoungil Kim
  0 siblings, 0 replies; 3+ messages in thread
From: Kyoungil Kim @ 2012-02-08 10:34 UTC (permalink / raw)
  To: spi-devel-general, linux-samsung-soc; +Cc: 'Sylwester Nawrocki'

Hi,

Sylwester Nawrocki wrote:
> Hi,
> 
> On 02/08/2012 07:52 AM, Kyoungil Kim wrote:
> > Config operation is separated from request operation in DMA common operation.
> > Because spi driver can change the DMA config for every message.
> > 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>
> > ---
> >  drivers/spi/spi-s3c64xx.c |   35 +++++++++++++++++++++--------------
> >  1 files changed, 21 insertions(+), 14 deletions(-)
> 
> I'm getting following compilation errors with this patch:
> 
>   CC      drivers/spi/spi-s3c64xx.o
> drivers/spi/spi-s3c64xx.c: In function 'prepare_dma':
> drivers/spi/spi-s3c64xx.c:268: error: storage size of 'info' isn't known
> drivers/spi/spi-s3c64xx.c:269: error: storage size of 'config' isn't known
> drivers/spi/spi-s3c64xx.c:278: error: 'struct samsung_dma_ops' has no member
> named 'config'
> drivers/spi/spi-s3c64xx.c:286: error: 'struct samsung_dma_ops' has no member
> named 'config'
> drivers/spi/spi-s3c64xx.c:269: warning: unused variable 'config'
> drivers/spi/spi-s3c64xx.c:268: warning: unused variable 'info'
> drivers/spi/spi-s3c64xx.c: In function 'acquire_dma':
> drivers/spi/spi-s3c64xx.c:302: error: storage size of 'req' isn't known
> drivers/spi/spi-s3c64xx.c:302: warning: unused variable 'req'
> 
> Which tree has it been created off of ?
> 
> It seems there are some patches not yet in mainline that it depends on.

I'm sorry, I thought that the dependant patch was already in mainline.
I'll re-send it with dependant patch.

Thank you.
Best Regards.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-02-08 10:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-08  6:52 [PATCH] spi: Add the use of DMA config operation Kyoungil Kim
2012-02-08 10:05 ` Sylwester Nawrocki
2012-02-08 10:34   ` Kyoungil Kim

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.