From patchwork Wed Apr 24 14:04:32 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Guo X-Patchwork-Id: 2484701 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by patchwork1.kernel.org (Postfix) with ESMTP id BCF533FCA5 for ; Wed, 24 Apr 2013 14:05:29 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UV0Jw-0008Vr-Sz; Wed, 24 Apr 2013 14:05:17 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UV0Jq-0001n6-KK; Wed, 24 Apr 2013 14:05:10 +0000 Received: from va3ehsobe002.messaging.microsoft.com ([216.32.180.12] helo=va3outboundpool.messaging.microsoft.com) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UV0Jf-0001lY-Nv for linux-arm-kernel@lists.infradead.org; Wed, 24 Apr 2013 14:05:00 +0000 Received: from mail55-va3-R.bigfish.com (10.7.14.236) by VA3EHSOBE010.bigfish.com (10.7.40.12) with Microsoft SMTP Server id 14.1.225.23; Wed, 24 Apr 2013 14:04:51 +0000 Received: from mail55-va3 (localhost [127.0.0.1]) by mail55-va3-R.bigfish.com (Postfix) with ESMTP id 2BD852608EB; Wed, 24 Apr 2013 14:04:51 +0000 (UTC) X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPV:NLI; H:mail.freescale.net; RD:none; EFVD:NLI X-SpamScore: 0 X-BigFish: VS0(zzzz1f42h1fc6h1ee6h1de0h1fdah1202h1e76h1d1ah1d2ahzz8275dhz2dh87h2a8h668h839hd24he5bhf0ah1288h12a5h12a9h12bdh12e5h137ah139eh13b6h1441h1504h1537h162dh1631h1758h1898h18e1h1946h19b5h1ad9h1b0ah1151h1155h) X-FB-DOMAIN-IP-MATCH: fail Received: from mail55-va3 (localhost.localdomain [127.0.0.1]) by mail55-va3 (MessageSwitch) id 1366812287223393_26987; Wed, 24 Apr 2013 14:04:47 +0000 (UTC) Received: from VA3EHSMHS015.bigfish.com (unknown [10.7.14.252]) by mail55-va3.bigfish.com (Postfix) with ESMTP id 1EF234E004C; Wed, 24 Apr 2013 14:04:47 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by VA3EHSMHS015.bigfish.com (10.7.99.25) with Microsoft SMTP Server (TLS) id 14.1.225.23; Wed, 24 Apr 2013 14:04:45 +0000 Received: from tx30smr01.am.freescale.net (10.81.153.31) by 039-SN1MMR1-002.039d.mgd.msft.net (10.84.1.15) with Microsoft SMTP Server (TLS) id 14.2.328.11; Wed, 24 Apr 2013 14:04:41 +0000 Received: from S2101-09.ap.freescale.net ([10.192.185.24]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id r3OE4Zrp031638; Wed, 24 Apr 2013 07:04:39 -0700 From: Shawn Guo To: Vinod Koul Subject: [PATCH 1/2] dma: imx: change enum definitions to macros Date: Wed, 24 Apr 2013 22:04:32 +0800 Message-ID: <1366812273-10833-2-git-send-email-shawn.guo@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1366812273-10833-1-git-send-email-shawn.guo@linaro.org> References: <1366812273-10833-1-git-send-email-shawn.guo@linaro.org> MIME-Version: 1.0 X-OriginatorOrg: sigmatel.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130424_100459_880464_FC8DB14D X-CRM114-Status: GOOD ( 12.18 ) X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [216.32.180.12 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Shawn Guo , Arnd Bergmann , kernel@pengutronix.de, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Change enum sdma_peripheral_type and imx_dma_prio to macro definitions for easing the migration to generic DMA device tree bindings later. Signed-off-by: Shawn Guo --- drivers/dma/imx-sdma.c | 4 +-- include/linux/platform_data/dma-imx.h | 56 +++++++++++++++------------------ 2 files changed, 28 insertions(+), 32 deletions(-) diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c index 092867b..e57a0c6 100644 --- a/drivers/dma/imx-sdma.c +++ b/drivers/dma/imx-sdma.c @@ -249,7 +249,7 @@ struct sdma_channel { struct sdma_engine *sdma; unsigned int channel; enum dma_transfer_direction direction; - enum sdma_peripheral_type peripheral_type; + int peripheral_type; unsigned int event_id0; unsigned int event_id1; enum dma_slave_buswidth word_size; @@ -580,7 +580,7 @@ static irqreturn_t sdma_int_handler(int irq, void *dev_id) * sets the pc of SDMA script according to the peripheral type */ static void sdma_get_pc(struct sdma_channel *sdmac, - enum sdma_peripheral_type peripheral_type) + int peripheral_type) { struct sdma_engine *sdma = sdmac->sdma; int per_2_emi = 0, emi_2_per = 0; diff --git a/include/linux/platform_data/dma-imx.h b/include/linux/platform_data/dma-imx.h index f6d30cc..8a8a684 100644 --- a/include/linux/platform_data/dma-imx.h +++ b/include/linux/platform_data/dma-imx.h @@ -16,40 +16,36 @@ /* * This enumerates peripheral types. Used for SDMA. */ -enum sdma_peripheral_type { - IMX_DMATYPE_SSI, /* MCU domain SSI */ - IMX_DMATYPE_SSI_SP, /* Shared SSI */ - IMX_DMATYPE_MMC, /* MMC */ - IMX_DMATYPE_SDHC, /* SDHC */ - IMX_DMATYPE_UART, /* MCU domain UART */ - IMX_DMATYPE_UART_SP, /* Shared UART */ - IMX_DMATYPE_FIRI, /* FIRI */ - IMX_DMATYPE_CSPI, /* MCU domain CSPI */ - IMX_DMATYPE_CSPI_SP, /* Shared CSPI */ - IMX_DMATYPE_SIM, /* SIM */ - IMX_DMATYPE_ATA, /* ATA */ - IMX_DMATYPE_CCM, /* CCM */ - IMX_DMATYPE_EXT, /* External peripheral */ - IMX_DMATYPE_MSHC, /* Memory Stick Host Controller */ - IMX_DMATYPE_MSHC_SP, /* Shared Memory Stick Host Controller */ - IMX_DMATYPE_DSP, /* DSP */ - IMX_DMATYPE_MEMORY, /* Memory */ - IMX_DMATYPE_FIFO_MEMORY,/* FIFO type Memory */ - IMX_DMATYPE_SPDIF, /* SPDIF */ - IMX_DMATYPE_IPU_MEMORY, /* IPU Memory */ - IMX_DMATYPE_ASRC, /* ASRC */ - IMX_DMATYPE_ESAI, /* ESAI */ -}; +#define IMX_DMATYPE_SSI 0 /* MCU domain SSI */ +#define IMX_DMATYPE_SSI_SP 1 /* Shared SSI */ +#define IMX_DMATYPE_MMC 2 /* MMC */ +#define IMX_DMATYPE_SDHC 3 /* SDHC */ +#define IMX_DMATYPE_UART 4 /* MCU domain UART */ +#define IMX_DMATYPE_UART_SP 5 /* Shared UART */ +#define IMX_DMATYPE_FIRI 6 /* FIRI */ +#define IMX_DMATYPE_CSPI 7 /* MCU domain CSPI */ +#define IMX_DMATYPE_CSPI_SP 8 /* Shared CSPI */ +#define IMX_DMATYPE_SIM 9 /* SIM */ +#define IMX_DMATYPE_ATA 10 /* ATA */ +#define IMX_DMATYPE_CCM 11 /* CCM */ +#define IMX_DMATYPE_EXT 12 /* External peripheral */ +#define IMX_DMATYPE_MSHC 13 /* Memory Stick Host Controller */ +#define IMX_DMATYPE_MSHC_SP 14 /* Shared Memory Stick Host Controller */ +#define IMX_DMATYPE_DSP 15 /* DSP */ +#define IMX_DMATYPE_MEMORY 16 /* Memory */ +#define IMX_DMATYPE_FIFO_MEMORY 17 /* FIFO type Memory */ +#define IMX_DMATYPE_SPDIF 18 /* SPDIF */ +#define IMX_DMATYPE_IPU_MEMORY 19 /* IPU Memory */ +#define IMX_DMATYPE_ASRC 20 /* ASRC */ +#define IMX_DMATYPE_ESAI 21 /* ESAI */ -enum imx_dma_prio { - DMA_PRIO_HIGH = 0, - DMA_PRIO_MEDIUM = 1, - DMA_PRIO_LOW = 2 -}; +#define DMA_PRIO_HIGH 0 +#define DMA_PRIO_MEDIUM 1 +#define DMA_PRIO_LOW 2 struct imx_dma_data { int dma_request; /* DMA request line */ - enum sdma_peripheral_type peripheral_type; + int peripheral_type; int priority; };