From patchwork Tue Sep 23 14:18:15 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 4956751 Return-Path: X-Original-To: patchwork-dmaengine@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 76211BEEA6 for ; Tue, 23 Sep 2014 14:19:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1EECA200E6 for ; Tue, 23 Sep 2014 14:19:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A856C20136 for ; Tue, 23 Sep 2014 14:19:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752126AbaIWOTV (ORCPT ); Tue, 23 Sep 2014 10:19:21 -0400 Received: from mga14.intel.com ([192.55.52.115]:53993 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754196AbaIWOTV (ORCPT ); Tue, 23 Sep 2014 10:19:21 -0400 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP; 23 Sep 2014 07:09:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.04,580,1406617200"; d="scan'208";a="595606989" Received: from smile.fi.intel.com (HELO smile) ([10.237.72.76]) by fmsmga001.fm.intel.com with ESMTP; 23 Sep 2014 07:18:16 -0700 Received: from andy by smile with local (Exim 4.84) (envelope-from ) id 1XWQv1-00080T-HZ; Tue, 23 Sep 2014 17:18:15 +0300 From: Andy Shevchenko To: dmaengine@vger.kernel.org, "Koul, Vinod" , "Girdwood, Liam R" , "Chew, Kean Ho" , "pure . logic @ nexus-software . ie" Cc: Andy Shevchenko Subject: [PATCH v1 6/6] dmaengine: dw: export probe()/remove() and Co to users Date: Tue, 23 Sep 2014 17:18:15 +0300 Message-Id: <1411481895-30603-7-git-send-email-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1411481895-30603-1-git-send-email-andriy.shevchenko@linux.intel.com> References: <1411481895-30603-1-git-send-email-andriy.shevchenko@linux.intel.com> Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The driver library functions can be used directly by the compound devices such as ADSP or serial driver where DesignWare DMA IP is privately attached to the main hardware. Instead of creating a new platform device leaf they may call dw_dma_probe() with given struct dw_dma_chip directly and make sure that the main device is DMA capable. Signed-off-by: Andy Shevchenko --- drivers/dma/dw/internal.h | 29 +++-------------------------- include/linux/dma/dw.h | 27 +++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 26 deletions(-) diff --git a/drivers/dma/dw/internal.h b/drivers/dma/dw/internal.h index c55c3e0..4143973 100644 --- a/drivers/dma/dw/internal.h +++ b/drivers/dma/dw/internal.h @@ -8,39 +8,16 @@ * published by the Free Software Foundation. */ -#ifndef _DW_DMAC_INTERNAL_H -#define _DW_DMAC_INTERNAL_H - -#include +#ifndef _DMA_DW_INTERNAL_H +#define _DMA_DW_INTERNAL_H #include -#include #include "regs.h" -/** - * struct dw_dma_chip - representation of DesignWare DMA controller hardware - * @dev: struct device of the DMA controller - * @irq: irq line - * @regs: memory mapped I/O space - * @clk: hclk clock - * @dw: struct dw_dma that is filed by dw_dma_probe() - */ -struct dw_dma_chip { - struct device *dev; - int irq; - void __iomem *regs; - struct clk *clk; - struct dw_dma *dw; -}; - -/* Export to the platform drivers */ -int dw_dma_probe(struct dw_dma_chip *chip, struct dw_dma_platform_data *pdata); -int dw_dma_remove(struct dw_dma_chip *chip); - int dw_dma_disable(struct dw_dma_chip *chip); int dw_dma_enable(struct dw_dma_chip *chip); extern bool dw_dma_filter(struct dma_chan *chan, void *param); -#endif /* _DW_DMAC_INTERNAL_H */ +#endif /* _DMA_DW_INTERNAL_H */ diff --git a/include/linux/dma/dw.h b/include/linux/dma/dw.h index 2475613..7145644 100644 --- a/include/linux/dma/dw.h +++ b/include/linux/dma/dw.h @@ -3,6 +3,7 @@ * * Copyright (C) 2007 Atmel Corporation * Copyright (C) 2010-2011 ST Microelectronics + * Copyright (C) 2014 Intel Corporation * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as @@ -11,8 +12,34 @@ #ifndef _DMA_DW_H #define _DMA_DW_H +#include +#include #include +#include + +struct dw_dma; + +/** + * struct dw_dma_chip - representation of DesignWare DMA controller hardware + * @dev: struct device of the DMA controller + * @irq: irq line + * @regs: memory mapped I/O space + * @clk: hclk clock + * @dw: struct dw_dma that is filed by dw_dma_probe() + */ +struct dw_dma_chip { + struct device *dev; + int irq; + void __iomem *regs; + struct clk *clk; + struct dw_dma *dw; +}; + +/* Export to the platform drivers */ +int dw_dma_probe(struct dw_dma_chip *chip, struct dw_dma_platform_data *pdata); +int dw_dma_remove(struct dw_dma_chip *chip); + /* DMA API extensions */ struct dw_desc;