From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752677AbcHIIWt (ORCPT ); Tue, 9 Aug 2016 04:22:49 -0400 Received: from mail-pf0-f195.google.com ([209.85.192.195]:36595 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752641AbcHIIWp (ORCPT ); Tue, 9 Aug 2016 04:22:45 -0400 From: Keguang Zhang To: linux-mips@linux-mips.org, linux-kernel@vger.kernel.org Cc: Ralf Baechle , Kelvin Cheung Subject: [PATCH V1] MIPS: Loongson1B: Provide DMA filter callbacks via platform data Date: Tue, 9 Aug 2016 16:22:25 +0800 Message-Id: <1470730945-24456-1-git-send-email-keguang.zhang@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Kelvin Cheung This patch provides DMA filter callbacks via platform data to make NAND driver independent of single DMA engine driver. Signed-off-by: Kelvin Cheung --- v1: Fix the build error --- arch/mips/include/asm/mach-loongson32/dma.h | 4 ++++ arch/mips/include/asm/mach-loongson32/nand.h | 3 +-- arch/mips/loongson32/ls1b/board.c | 3 +++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/arch/mips/include/asm/mach-loongson32/dma.h b/arch/mips/include/asm/mach-loongson32/dma.h index ad1dec7..d3ae391 100644 --- a/arch/mips/include/asm/mach-loongson32/dma.h +++ b/arch/mips/include/asm/mach-loongson32/dma.h @@ -12,6 +12,8 @@ #ifndef __ASM_MACH_LOONGSON32_DMA_H #define __ASM_MACH_LOONGSON32_DMA_H +#include + #define LS1X_DMA_CHANNEL0 0 #define LS1X_DMA_CHANNEL1 1 #define LS1X_DMA_CHANNEL2 2 @@ -22,4 +24,6 @@ struct plat_ls1x_dma { extern struct plat_ls1x_dma ls1b_dma_pdata; +bool ls1x_dma_filter(struct dma_chan *chan, void *param); + #endif /* __ASM_MACH_LOONGSON32_DMA_H */ diff --git a/arch/mips/include/asm/mach-loongson32/nand.h b/arch/mips/include/asm/mach-loongson32/nand.h index e274912..a1f8704 100644 --- a/arch/mips/include/asm/mach-loongson32/nand.h +++ b/arch/mips/include/asm/mach-loongson32/nand.h @@ -21,10 +21,9 @@ struct plat_ls1x_nand { int hold_cycle; int wait_cycle; + bool (*dma_filter)(struct dma_chan *chan, void *param); }; extern struct plat_ls1x_nand ls1b_nand_pdata; -bool ls1x_dma_filter_fn(struct dma_chan *chan, void *param); - #endif /* __ASM_MACH_LOONGSON32_NAND_H */ diff --git a/arch/mips/loongson32/ls1b/board.c b/arch/mips/loongson32/ls1b/board.c index 38a1d40..dac1cbb 100644 --- a/arch/mips/loongson32/ls1b/board.c +++ b/arch/mips/loongson32/ls1b/board.c @@ -38,6 +38,9 @@ struct plat_ls1x_nand ls1x_nand_pdata = { .nr_parts = ARRAY_SIZE(ls1x_nand_parts), .hold_cycle = 0x2, .wait_cycle = 0xc, +#ifdef CONFIG_LOONGSON1_DMA + .dma_filter = ls1x_dma_filter, +#endif }; static const struct gpio_led ls1x_gpio_leds[] __initconst = { -- 1.9.1