From patchwork Fri Jun 17 03:39:59 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 890222 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p5H3dqxE029031 for ; Fri, 17 Jun 2011 03:40:01 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756487Ab1FQDkB (ORCPT ); Thu, 16 Jun 2011 23:40:01 -0400 Received: from relmlor3.renesas.com ([210.160.252.173]:48842 "EHLO relmlor3.renesas.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756492Ab1FQDkA (ORCPT ); Thu, 16 Jun 2011 23:40:00 -0400 Received: from relmlir1.idc.renesas.com ([10.200.68.151]) by relmlor3.idc.renesas.com ( SJSMS) with ESMTP id <0LMX007940UNGD10@relmlor3.idc.renesas.com> for linux-sh@vger.kernel.org; Fri, 17 Jun 2011 12:39:59 +0900 (JST) Received: from relmlac1.idc.renesas.com ([10.200.69.21]) by relmlir1.idc.renesas.com (SJSMS) with ESMTP id <0LMX00JYN0UNNH50@relmlir1.idc.renesas.com> for linux-sh@vger.kernel.org; Fri, 17 Jun 2011 12:39:59 +0900 (JST) Received: by relmlac1.idc.renesas.com (Postfix, from userid 0) id 69D0580086; Fri, 17 Jun 2011 12:39:59 +0900 (JST) Received: from relmlac1.idc.renesas.com (localhost [127.0.0.1]) by relmlac1.idc.renesas.com (Postfix) with ESMTP id 6016B800A2; Fri, 17 Jun 2011 12:39:59 +0900 (JST) Received: from relmlii1.idc.renesas.com [10.200.68.65] by relmlac1.idc.renesas.com with ESMTP id NAC09963; Fri, 17 Jun 2011 12:39:59 +0900 Date: Fri, 17 Jun 2011 12:39:59 +0900 X-IronPort-AV: E=Sophos; i="4.65,379,1304262000"; d="scan'208"; a="32462817" Received: from unknown (HELO PG10870.renesas.com) ([172.30.8.159]) by relmlii1.idc.renesas.com with ESMTP; Fri, 17 Jun 2011 12:39:59 +0900 Message-id: To: Paul Mundt Cc: Magnus , Linux-SH , Guennadi , Kuninori Morimoto In-reply-to: References: From: Kuninori Morimoto Subject: [RFC][PATCH 4/6] dmaengine: shdma: add is_usbdmac flag User-Agent: SEMI/1.14.6 (Maruoka) FLIM/1.14.7 (=?ISO-2022-JP-2?B?U2Fuag==?= =?ISO-2022-JP-2?B?GyQoRCtXGyhC?=) APEL/10.6 Emacs/23.2 (i386-mingw-nt5.1.2600) MULE/6.0 (HANACHIRUSATO) MIME-version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-type: text/plain; charset=US-ASCII Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Fri, 17 Jun 2011 03:40:01 +0000 (UTC) Signed-off-by: Kuninori Morimoto --- drivers/dma/shdma.c | 8 ++++++++ include/linux/sh_dma.h | 3 +++ 2 files changed, 11 insertions(+), 0 deletions(-) diff --git a/drivers/dma/shdma.c b/drivers/dma/shdma.c index aa91309..3de661e 100644 --- a/drivers/dma/shdma.c +++ b/drivers/dma/shdma.c @@ -194,6 +194,10 @@ static void dmae_start(struct sh_dmae_chan *sh_chan) struct sh_dmae_device *shdev = to_sh_dev(sh_chan); u32 chcr = chcr_read(sh_chan); + /* USB-DMAC needs TEND settings */ + if (shdev->pdata->is_usbdmac) + sh_dmae_writel(sh_chan, 0xFFFFFFFF, TEND); + chcr |= CHCR_DE | shdev->chcr_ie_bit; chcr_write(sh_chan, chcr & ~CHCR_TE); } @@ -242,6 +246,10 @@ static int dmae_set_dmars(struct sh_dmae_chan *sh_chan, u16 val) if (dmae_is_busy(sh_chan)) return -EBUSY; + /* USB-DMAC doesn't need DMARS settings */ + if (pdata->is_usbdmac) + return 0; + /* in the case of a missing DMARS resource use first memory window */ if (!addr) addr = (u16 __iomem *)shdev->chan_reg; diff --git a/include/linux/sh_dma.h b/include/linux/sh_dma.h index 6a98daf..8a5bffd 100644 --- a/include/linux/sh_dma.h +++ b/include/linux/sh_dma.h @@ -66,6 +66,7 @@ struct sh_dmae_pdata { u32 chcr_ie_bit; u32 dmaor_is_32bit:1; + u32 is_usbdmac:1; }; /* DMA register */ @@ -75,6 +76,8 @@ struct sh_dmae_pdata { #define CHCR 0x0C #define DMAOR 0x40 +#define TEND 0x18 /* USB-DMAC */ + /* DMAOR definitions */ #define DMAOR_AE 0x00000004 #define DMAOR_NMIF 0x00000002