From patchwork Fri Jun 17 08:20:51 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 890632 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 p5H8KieB003104 for ; Fri, 17 Jun 2011 08:20:55 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756886Ab1FQIUz (ORCPT ); Fri, 17 Jun 2011 04:20:55 -0400 Received: from relmlor1.renesas.com ([210.160.252.171]:58916 "EHLO relmlor1.renesas.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755328Ab1FQIUy (ORCPT ); Fri, 17 Jun 2011 04:20:54 -0400 Received: from relmlir3.idc.renesas.com ([10.200.68.153]) by relmlor1.idc.renesas.com ( SJSMS) with ESMTP id <0LMX00HXTDUTR200@relmlor1.idc.renesas.com> for linux-sh@vger.kernel.org; Fri, 17 Jun 2011 17:20:53 +0900 (JST) Received: from relmlac4.idc.renesas.com ([10.200.69.24]) by relmlir3.idc.renesas.com ( SJSMS) with ESMTP id <0LMX007VLDUTRRF0@relmlir3.idc.renesas.com> for linux-sh@vger.kernel.org; Fri, 17 Jun 2011 17:20:53 +0900 (JST) Received: by relmlac4.idc.renesas.com (Postfix, from userid 0) id 8AA6248087; Fri, 17 Jun 2011 17:20:52 +0900 (JST) Received: from relmlac4.idc.renesas.com (localhost [127.0.0.1]) by relmlac4.idc.renesas.com (Postfix) with ESMTP id 9FA9B4807B; Fri, 17 Jun 2011 17:20:52 +0900 (JST) Received: from relmlii2.idc.renesas.com [10.200.68.66] by relmlac4.idc.renesas.com with ESMTP id TAV00597; Fri, 17 Jun 2011 17:20:52 +0900 Date: Fri, 17 Jun 2011 17:20:51 +0900 X-IronPort-AV: E=Sophos; i="4.65,380,1304262000"; d="scan'208"; a="32631334" Received: from unknown (HELO PG10870.renesas.com) ([172.30.8.159]) by relmlii2.idc.renesas.com with ESMTP; Fri, 17 Jun 2011 17:20:51 +0900 Message-id: To: Paul Mundt Cc: Simon , Magnus , Linux-SH , Guennadi , Kuninori Morimoto In-reply-to: References: 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") From: Kuninori Morimoto Subject: [RFC][PATCH 2/6 v3] dmaengine: shdma: add chcr_ie_bit 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 08:20:55 +0000 (UTC) IE bit position on CHCR register is not same in all DMAC. This patch adds new "chcr_ie_bit" to decide it. Signed-off-by: Kuninori Morimoto --- v2 -> v3 - same as v2 but based on v3 1/6 patch drivers/dma/shdma.c | 11 +++++++++-- drivers/dma/shdma.h | 1 + include/linux/sh_dma.h | 1 + 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/dma/shdma.c b/drivers/dma/shdma.c index 40900c1..9412de3 100644 --- a/drivers/dma/shdma.c +++ b/drivers/dma/shdma.c @@ -181,17 +181,19 @@ static void dmae_set_reg(struct sh_dmae_chan *sh_chan, struct sh_dmae_regs *hw) 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); - chcr |= CHCR_DE | CHCR_IE; + chcr |= CHCR_DE | shdev->chcr_ie_bit; chcr_write(sh_chan, chcr & ~CHCR_TE); } static void dmae_halt(struct sh_dmae_chan *sh_chan) { + struct sh_dmae_device *shdev = to_sh_dev(sh_chan); u32 chcr = chcr_read(sh_chan); - chcr &= ~(CHCR_DE | CHCR_TE | CHCR_IE); + chcr &= ~(CHCR_DE | CHCR_TE | shdev->chcr_ie_bit); chcr_write(sh_chan, chcr); } @@ -1157,6 +1159,11 @@ static int __init sh_dmae_probe(struct platform_device *pdev) else shdev->chcr_offset = CHCR; + if (pdata->chcr_ie_bit) + shdev->chcr_ie_bit = pdata->chcr_ie_bit; + else + shdev->chcr_ie_bit = CHCR_IE; + platform_set_drvdata(pdev, shdev); pm_runtime_enable(&pdev->dev); diff --git a/drivers/dma/shdma.h b/drivers/dma/shdma.h index 6f064ca..dc56576 100644 --- a/drivers/dma/shdma.h +++ b/drivers/dma/shdma.h @@ -48,6 +48,7 @@ struct sh_dmae_device { u32 __iomem *chan_reg; u16 __iomem *dmars; unsigned int chcr_offset; + u32 chcr_ie_bit; }; #define to_sh_chan(chan) container_of(chan, struct sh_dmae_chan, common) diff --git a/include/linux/sh_dma.h b/include/linux/sh_dma.h index 41fe4c2..96803aa 100644 --- a/include/linux/sh_dma.h +++ b/include/linux/sh_dma.h @@ -63,6 +63,7 @@ struct sh_dmae_pdata { int ts_shift_num; u16 dmaor_init; unsigned int chcr_offset; + u32 chcr_ie_bit; }; /* DMA register */