From patchwork Fri Jun 17 08:20:56 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 890642 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 p5H8KieC003104 for ; Fri, 17 Jun 2011 08:20:59 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757397Ab1FQIU7 (ORCPT ); Fri, 17 Jun 2011 04:20:59 -0400 Received: from relmlor2.renesas.com ([210.160.252.172]:58930 "EHLO relmlor2.renesas.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755328Ab1FQIU6 (ORCPT ); Fri, 17 Jun 2011 04:20:58 -0400 Received: from relmlir4.idc.renesas.com ([10.200.68.154]) by relmlor2.idc.renesas.com ( SJSMS) with ESMTP id <0LMX00HV1DUXTL00@relmlor2.idc.renesas.com> for linux-sh@vger.kernel.org; Fri, 17 Jun 2011 17:20:57 +0900 (JST) Received: from relmlac2.idc.renesas.com ([10.200.69.22]) by relmlir4.idc.renesas.com ( SJSMS) with ESMTP id <0LMX007TXDUXUOE0@relmlir4.idc.renesas.com> for linux-sh@vger.kernel.org; Fri, 17 Jun 2011 17:20:57 +0900 (JST) Received: by relmlac2.idc.renesas.com (Postfix, from userid 0) id 3587D70002; Fri, 17 Jun 2011 17:20:57 +0900 (JST) Received: from relmlac2.idc.renesas.com (localhost [127.0.0.1]) by relmlac2.idc.renesas.com (Postfix) with ESMTP id 0E74E78002; Fri, 17 Jun 2011 17:20:57 +0900 (JST) Received: from relmlii2.idc.renesas.com [10.200.68.66] by relmlac2.idc.renesas.com with ESMTP id TAH11312; Fri, 17 Jun 2011 17:20:57 +0900 Date: Fri, 17 Jun 2011 17:20:56 +0900 X-IronPort-AV: E=Sophos; i="4.65,380,1304262000"; d="scan'208"; a="32631362" Received: from unknown (HELO PG10870.renesas.com) ([172.30.8.159]) by relmlii2.idc.renesas.com with ESMTP; Fri, 17 Jun 2011 17:20:56 +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 3/6 v3] dmaengine: shdma: add dmaor_is_32bit flag 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:59 +0000 (UTC) Signed-off-by: Kuninori Morimoto --- v2 -> v3 - u32 -> unsigned int for dmaor_is_32bit:1 - remove type-cast 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..6a21cd8 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 __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(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 96803aa..f25afc6 100644 --- a/include/linux/sh_dma.h +++ b/include/linux/sh_dma.h @@ -64,6 +64,8 @@ struct sh_dmae_pdata { u16 dmaor_init; unsigned int chcr_offset; u32 chcr_ie_bit; + + unsigned int dmaor_is_32bit:1; }; /* DMA register */