From patchwork Fri Jul 19 16:29:26 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guennadi Liakhovetski X-Patchwork-Id: 2830603 Return-Path: X-Original-To: patchwork-linux-sh@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 9D2D2C0319 for ; Fri, 19 Jul 2013 16:29:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B024020336 for ; Fri, 19 Jul 2013 16:29:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8F2662033F for ; Fri, 19 Jul 2013 16:29:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760871Ab3GSQ3l (ORCPT ); Fri, 19 Jul 2013 12:29:41 -0400 Received: from moutng.kundenserver.de ([212.227.17.9]:49819 "EHLO moutng.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754828Ab3GSQ3j (ORCPT ); Fri, 19 Jul 2013 12:29:39 -0400 Received: from axis700.grange (dslb-178-006-255-036.pools.arcor-ip.net [178.6.255.36]) by mrelayeu.kundenserver.de (node=mrbap0) with ESMTP (Nemesis) id 0MUCN0-1UaGg144Uk-00R4is; Fri, 19 Jul 2013 18:29:36 +0200 Received: from 6a.grange (6a.grange [192.168.1.11]) by axis700.grange (Postfix) with ESMTPS id 5A20A40BB3; Fri, 19 Jul 2013 18:29:35 +0200 (CEST) Received: from lyakh by 6a.grange with local (Exim 4.72) (envelope-from ) id 1V0DYk-0007rN-TN; Fri, 19 Jul 2013 18:29:34 +0200 From: Guennadi Liakhovetski To: linux-kernel@vger.kernel.org Cc: linux-sh@vger.kernel.org, Magnus Damm , Simon Horman , Vinod Koul , Laurent Pinchart , Sergei Shtylyov , Guennadi Liakhovetski Subject: [PATCH v2 01/15] DMA: shdma: add support for DMAC configuration data, supplied via device ID Date: Fri, 19 Jul 2013 18:29:26 +0200 Message-Id: <1374251374-30186-2-git-send-email-g.liakhovetski@gmx.de> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1374251374-30186-1-git-send-email-g.liakhovetski@gmx.de> References: <1374251374-30186-1-git-send-email-g.liakhovetski@gmx.de> X-Provags-ID: V02:K0:XKP4FdBuXBZSDpN2rTSg6tatjIw0UK6U4biW1jIr6CS SpZNS6Mr+6STu4vjAR+cJL6FozvYQ8fRr8wRY67zr+tMq1JI/p tyy+OcHyer0ToQT/HNB0mdTxZext/m3FwPasD8nZeLlw6CVvF5 X1pbn2iIAAf2ErAG/b1oKO/1RIPKagwjGsT8AxSdaQngY6uKA+ 7J6Mdms2R5bdVozOfwhNlanOk5oYR2yWmq5BijgCq29l1QCxIJ 3rtsjVSbk/YlZfNjs291RRsQJMLJPbio7p1IXlgIb72c4x2syf eDS/UUCzOLzAnqXTy9TYZxbPVDyuLHFh+7QDVuDW5odATKczPT 0X1ZzIkF9hr2t56An8sodIwZaqiVq/ud9gxrY9Wiq5JBBKQ4/q BffhFcq8kxw6A== Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 This is going to facilitate DT support by eliminating the need in AUXDATA and avoiding creating complex DT data. This also fits well with DMAC devices, because SoCs with them often have multiple identical DMAC instances and it is perfectly valid to use a single configuration data set for all of them. Signed-off-by: Guennadi Liakhovetski --- drivers/dma/sh/Makefile | 2 ++ drivers/dma/sh/{shdma.c => shdmac.c} | 11 ++++++++++- 2 files changed, 12 insertions(+), 1 deletions(-) rename drivers/dma/sh/{shdma.c => shdmac.c} (98%) diff --git a/drivers/dma/sh/Makefile b/drivers/dma/sh/Makefile index c962138..893ee09 100644 --- a/drivers/dma/sh/Makefile +++ b/drivers/dma/sh/Makefile @@ -1,3 +1,5 @@ obj-$(CONFIG_SH_DMAE_BASE) += shdma-base.o shdma-of.o obj-$(CONFIG_SH_DMAE) += shdma.o +shdma-y := shdmac.o +shdma-objs := $(shdma-y) obj-$(CONFIG_SUDMAC) += sudmac.o diff --git a/drivers/dma/sh/shdma.c b/drivers/dma/sh/shdmac.c similarity index 98% rename from drivers/dma/sh/shdma.c rename to drivers/dma/sh/shdmac.c index 5153af1..751a4e3 100644 --- a/drivers/dma/sh/shdma.c +++ b/drivers/dma/sh/shdmac.c @@ -665,7 +665,7 @@ static const struct shdma_ops sh_dmae_shdma_ops = { static int sh_dmae_probe(struct platform_device *pdev) { - struct sh_dmae_pdata *pdata = pdev->dev.platform_data; + struct sh_dmae_pdata *pdata; unsigned long irqflags = IRQF_DISABLED, chan_flag[SH_DMAE_MAX_CHANNELS] = {}; int errirq, chan_irq[SH_DMAE_MAX_CHANNELS]; @@ -674,6 +674,8 @@ static int sh_dmae_probe(struct platform_device *pdev) struct dma_device *dma_dev; struct resource *chan, *dmars, *errirq_res, *chanirq_res; + pdata = (void *)pdev->id_entry->driver_data ? : pdev->dev.platform_data; + /* get platform data */ if (!pdata || !pdata->channel_num) return -ENODEV; @@ -903,6 +905,12 @@ static const struct of_device_id sh_dmae_of_match[] = { }; MODULE_DEVICE_TABLE(of, sh_dmae_of_match); +const struct platform_device_id sh_dmae_id_table[] = { + {.name = SH_DMAE_DRV_NAME,}, + {} +}; +MODULE_DEVICE_TABLE(platform, sh_dmae_id_table); + static struct platform_driver sh_dmae_driver = { .driver = { .owner = THIS_MODULE, @@ -912,6 +920,7 @@ static struct platform_driver sh_dmae_driver = { }, .remove = sh_dmae_remove, .shutdown = sh_dmae_shutdown, + .id_table = sh_dmae_id_table, }; static int __init sh_dmae_init(void)