From patchwork Fri Jun 17 03:39:50 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 890212 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 p5H3dqxD029031 for ; Fri, 17 Jun 2011 03:39:53 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756429Ab1FQDjw (ORCPT ); Thu, 16 Jun 2011 23:39:52 -0400 Received: from relmlor3.renesas.com ([210.160.252.173]:48835 "EHLO relmlor3.renesas.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756476Ab1FQDjw (ORCPT ); Thu, 16 Jun 2011 23:39:52 -0400 Received: from relmlir2.idc.renesas.com ([10.200.68.152]) by relmlor3.idc.renesas.com ( SJSMS) with ESMTP id <0LMX0078Y0UFGD10@relmlor3.idc.renesas.com> for linux-sh@vger.kernel.org; Fri, 17 Jun 2011 12:39:51 +0900 (JST) Received: from relmlac4.idc.renesas.com ([10.200.69.24]) by relmlir2.idc.renesas.com ( SJSMS) with ESMTP id <0LMX00JUO0UEQ740@relmlir2.idc.renesas.com> for linux-sh@vger.kernel.org; Fri, 17 Jun 2011 12:39:51 +0900 (JST) Received: by relmlac4.idc.renesas.com (Postfix, from userid 0) id DBFE04807B; Fri, 17 Jun 2011 12:39:50 +0900 (JST) Received: from relmlac4.idc.renesas.com (localhost [127.0.0.1]) by relmlac4.idc.renesas.com (Postfix) with ESMTP id D6B014808A; Fri, 17 Jun 2011 12:39:50 +0900 (JST) Received: from relmlii2.idc.renesas.com [10.200.68.66] by relmlac4.idc.renesas.com with ESMTP id NAB12914; Fri, 17 Jun 2011 12:39:50 +0900 Date: Fri, 17 Jun 2011 12:39:50 +0900 X-IronPort-AV: E=Sophos; i="4.65,379,1304262000"; d="scan'208"; a="32560707" Received: from unknown (HELO PG10870.renesas.com) ([172.30.8.159]) by relmlii2.idc.renesas.com with ESMTP; Fri, 17 Jun 2011 12:39:50 +0900 Message-id: To: Paul Mundt Cc: Magnus , Linux-SH , Guennadi , Kuninori Morimoto In-reply-to: References: From: Kuninori Morimoto Subject: [RFC][PATCH 3/6] dmaengine: shdma: add dmaor_is_32bit 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:39:53 +0000 (UTC) Signed-off-by: Kuninori Morimoto Reviewed-by: Simon Horman --- drivers/dma/shdma.c | 14 ++++++++++++-- include/linux/sh_dma.h | 2 ++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/drivers/dma/shdma.c b/drivers/dma/shdma.c index 9412de3..aa91309 100644 --- a/drivers/dma/shdma.c +++ b/drivers/dma/shdma.c @@ -70,12 +70,22 @@ static u32 sh_dmae_readl(struct sh_dmae_chan *sh_dc, u32 reg) static u16 dmaor_read(struct sh_dmae_device *shdev) { - return __raw_readw(shdev->chan_reg + DMAOR / sizeof(u32)); + u32 __iomem *addr = shdev->chan_reg + DMAOR / sizeof(u32); + + if (shdev->pdata->dmaor_is_32bit) + return (u16)__raw_readl(addr); + else + return __raw_readw(addr); } static void dmaor_write(struct sh_dmae_device *shdev, u16 data) { - __raw_writew(data, shdev->chan_reg + DMAOR / sizeof(u32)); + u32 __iomem *addr = shdev->chan_reg + DMAOR / sizeof(u32); + + if (shdev->pdata->dmaor_is_32bit) + __raw_writel((u32)data, addr); + else + __raw_writew(data, addr); } static void chcr_write(struct sh_dmae_chan *sh_dc, u32 data) diff --git a/include/linux/sh_dma.h b/include/linux/sh_dma.h index dab2ddc..6a98daf 100644 --- a/include/linux/sh_dma.h +++ b/include/linux/sh_dma.h @@ -64,6 +64,8 @@ struct sh_dmae_pdata { u16 dmaor_init; u32 chcr_offset; u32 chcr_ie_bit; + + u32 dmaor_is_32bit:1; }; /* DMA register */