public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dmaengine: rcar-dmac: clear pertinence number of channels
@ 2016-03-03  6:04 Kuninori Morimoto
  2016-03-03  8:22 ` Geert Uytterhoeven
  0 siblings, 1 reply; 5+ messages in thread
From: Kuninori Morimoto @ 2016-03-03  6:04 UTC (permalink / raw)
  To: linux-renesas-soc, linux-kernel, dmaengine
  Cc: robin.murphy, vinod.koul, laurent.pinchart, geert+renesas,
	linus.walleij, dan.j.williams, arnd


From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

DMACHCLR clears each channels, but its channel number is based on
its SoC or IP. Current driver is using fixed 0x7fff (= for 14ch),
it is not good match for Gen3 or Gen2 Audio DMAC. This patch fixes it

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/dma/sh/rcar-dmac.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/dma/sh/rcar-dmac.c b/drivers/dma/sh/rcar-dmac.c
index 57a6dfc9..02b86c6 100644
--- a/drivers/dma/sh/rcar-dmac.c
+++ b/drivers/dma/sh/rcar-dmac.c
@@ -422,7 +422,7 @@ static int rcar_dmac_init(struct rcar_dmac *dmac)
 	u16 dmaor;
 
 	/* Clear all channels and enable the DMAC globally. */
-	rcar_dmac_write(dmac, RCAR_DMACHCLR, 0x7fff);
+	rcar_dmac_write(dmac, RCAR_DMACHCLR, GENMASK(dmac->n_channels - 1, 0));
 	rcar_dmac_write(dmac, RCAR_DMAOR,
 			RCAR_DMAOR_PRI_FIXED | RCAR_DMAOR_DME);
 
-- 
1.9.1

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

* Re: [PATCH] dmaengine: rcar-dmac: clear pertinence number of channels
  2016-03-03  6:04 [PATCH] dmaengine: rcar-dmac: clear pertinence number of channels Kuninori Morimoto
@ 2016-03-03  8:22 ` Geert Uytterhoeven
  2016-03-03  8:25   ` [PATCH v2] dma: " Kuninori Morimoto
  0 siblings, 1 reply; 5+ messages in thread
From: Geert Uytterhoeven @ 2016-03-03  8:22 UTC (permalink / raw)
  To: Kuninori Morimoto
  Cc: linux-renesas-soc, linux-kernel@vger.kernel.org, dmaengine,
	Robin Murphy, Vinod Koul, Laurent Pinchart, Geert Uytterhoeven,
	Linus Walleij, Dan Williams, Arnd Bergmann

On Thu, Mar 3, 2016 at 7:04 AM, Kuninori Morimoto
<kuninori.morimoto.gx@renesas.com> wrote:
> From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
>
> DMACHCLR clears each channels, but its channel number is based on
> its SoC or IP. Current driver is using fixed 0x7fff (= for 14ch),

15ch.

> it is not good match for Gen3 or Gen2 Audio DMAC. This patch fixes it
>
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* [PATCH v2] dma: rcar-dmac: clear pertinence number of channels
  2016-03-03  8:22 ` Geert Uytterhoeven
@ 2016-03-03  8:25   ` Kuninori Morimoto
  2016-03-03 10:52     ` Laurent Pinchart
  2016-03-03 17:24     ` Vinod Koul
  0 siblings, 2 replies; 5+ messages in thread
From: Kuninori Morimoto @ 2016-03-03  8:25 UTC (permalink / raw)
  To: Geert Uytterhoeven, Robin Murphy, Vinod Koul, Laurent Pinchart,
	Linus Walleij, Dan Williams, Arnd Bergmann
  Cc: linux-renesas-soc, linux-kernel@vger.kernel.org, dmaengine

From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

DMACHCLR clears each channels, but its channel number is based on
its SoC or IP. Current driver is using fixed 0x7fff (= for 15ch),
it is not good match for Gen3 or Gen2 Audio DMAC. This patch fixes it

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
v1 -> v2

 - 14ch -> 15ch

 drivers/dma/sh/rcar-dmac.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/dma/sh/rcar-dmac.c b/drivers/dma/sh/rcar-dmac.c
index 57a6dfc9..02b86c6 100644
--- a/drivers/dma/sh/rcar-dmac.c
+++ b/drivers/dma/sh/rcar-dmac.c
@@ -422,7 +422,7 @@ static int rcar_dmac_init(struct rcar_dmac *dmac)
 	u16 dmaor;
 
 	/* Clear all channels and enable the DMAC globally. */
-	rcar_dmac_write(dmac, RCAR_DMACHCLR, 0x7fff);
+	rcar_dmac_write(dmac, RCAR_DMACHCLR, GENMASK(dmac->n_channels - 1, 0));
 	rcar_dmac_write(dmac, RCAR_DMAOR,
 			RCAR_DMAOR_PRI_FIXED | RCAR_DMAOR_DME);
 
-- 
1.9.1

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

* Re: [PATCH v2] dma: rcar-dmac: clear pertinence number of channels
  2016-03-03  8:25   ` [PATCH v2] dma: " Kuninori Morimoto
@ 2016-03-03 10:52     ` Laurent Pinchart
  2016-03-03 17:24     ` Vinod Koul
  1 sibling, 0 replies; 5+ messages in thread
From: Laurent Pinchart @ 2016-03-03 10:52 UTC (permalink / raw)
  To: Kuninori Morimoto
  Cc: Geert Uytterhoeven, Robin Murphy, Vinod Koul, Linus Walleij,
	Dan Williams, Arnd Bergmann, linux-renesas-soc,
	linux-kernel@vger.kernel.org, dmaengine

Hi Morimoto-san,

Thank you for the patch.

On Thursday 03 March 2016 17:25:53 Kuninori Morimoto wrote:
> From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> 
> DMACHCLR clears each channels, but its channel number is based on
> its SoC or IP. Current driver is using fixed 0x7fff (= for 15ch),
> it is not good match for Gen3 or Gen2 Audio DMAC. This patch fixes it
> 
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>

Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
> v1 -> v2
> 
>  - 14ch -> 15ch
> 
>  drivers/dma/sh/rcar-dmac.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/dma/sh/rcar-dmac.c b/drivers/dma/sh/rcar-dmac.c
> index 57a6dfc9..02b86c6 100644
> --- a/drivers/dma/sh/rcar-dmac.c
> +++ b/drivers/dma/sh/rcar-dmac.c
> @@ -422,7 +422,7 @@ static int rcar_dmac_init(struct rcar_dmac *dmac)
>  	u16 dmaor;
> 
>  	/* Clear all channels and enable the DMAC globally. */
> -	rcar_dmac_write(dmac, RCAR_DMACHCLR, 0x7fff);
> +	rcar_dmac_write(dmac, RCAR_DMACHCLR, GENMASK(dmac->n_channels - 1, 0));
>  	rcar_dmac_write(dmac, RCAR_DMAOR,
>  			RCAR_DMAOR_PRI_FIXED | RCAR_DMAOR_DME);

-- 
Regards,

Laurent Pinchart

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

* Re: [PATCH v2] dma: rcar-dmac: clear pertinence number of channels
  2016-03-03  8:25   ` [PATCH v2] dma: " Kuninori Morimoto
  2016-03-03 10:52     ` Laurent Pinchart
@ 2016-03-03 17:24     ` Vinod Koul
  1 sibling, 0 replies; 5+ messages in thread
From: Vinod Koul @ 2016-03-03 17:24 UTC (permalink / raw)
  To: Kuninori Morimoto
  Cc: Geert Uytterhoeven, Robin Murphy, Laurent Pinchart, Linus Walleij,
	Dan Williams, Arnd Bergmann, linux-renesas-soc,
	linux-kernel@vger.kernel.org, dmaengine

On Thu, Mar 03, 2016 at 05:25:53PM +0900, Kuninori Morimoto wrote:
> From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> 
> DMACHCLR clears each channels, but its channel number is based on
> its SoC or IP. Current driver is using fixed 0x7fff (= for 15ch),
> it is not good match for Gen3 or Gen2 Audio DMAC. This patch fixes it

Applied, thanks

-- 
~Vinod

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

end of thread, other threads:[~2016-03-03 17:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-03  6:04 [PATCH] dmaengine: rcar-dmac: clear pertinence number of channels Kuninori Morimoto
2016-03-03  8:22 ` Geert Uytterhoeven
2016-03-03  8:25   ` [PATCH v2] dma: " Kuninori Morimoto
2016-03-03 10:52     ` Laurent Pinchart
2016-03-03 17:24     ` Vinod Koul

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox