From patchwork Mon Apr 7 20:07:09 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Dooks X-Patchwork-Id: 3946991 Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 47AD49F371 for ; Mon, 7 Apr 2014 20:07:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7DC962024C for ; Mon, 7 Apr 2014 20:07:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7C1C720200 for ; Mon, 7 Apr 2014 20:07:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755936AbaDGUHo (ORCPT ); Mon, 7 Apr 2014 16:07:44 -0400 Received: from ducie-dc1.codethink.co.uk ([185.25.241.215]:51312 "EHLO ducie-dc1.codethink.co.uk" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1755860AbaDGUHn (ORCPT ); Mon, 7 Apr 2014 16:07:43 -0400 Received: from localhost (localhost [127.0.0.1]) by ducie-dc1.codethink.co.uk (Postfix) with ESMTP id DED5C4679AC; Mon, 7 Apr 2014 21:07:41 +0100 (BST) X-Virus-Scanned: Debian amavisd-new at ducie-dc1.codethink.co.uk Received: from ducie-dc1.codethink.co.uk ([127.0.0.1]) by localhost (ducie-dc1.codethink.co.uk [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id mhux5Xhsmm2C; Mon, 7 Apr 2014 21:07:37 +0100 (BST) Received: from rainbowdash.ducie.codethink.co.uk (rainbowdash.dyn.ducie.codethink.co.uk [10.24.1.133]) by ducie-dc1.codethink.co.uk (Postfix) with ESMTPS id 4451B4662B0; Mon, 7 Apr 2014 21:07:12 +0100 (BST) Received: from ben by rainbowdash.ducie.codethink.co.uk with local (Exim 4.82) (envelope-from ) id 1WXFp1-0007bL-Kv; Mon, 07 Apr 2014 21:07:11 +0100 From: Ben Dooks To: linux-kernel@lists.codethink.co.uk, dmaengine@vger.kernel.org Cc: vinod.koul@intel.com, dan.j.williams@intel.com, linux-sh@vger.kernel.org, magnus.damm@opensource.se, horms@verge.net.au, g.liakhovetski@gmx.d, kuninori.morimoto.gx@renesas.com, devicetree@vger.kernel.org, Ben Dooks Subject: [PATCH 9/9] DMA: shdma: wire r8a7790 Date: Mon, 7 Apr 2014 21:07:09 +0100 Message-Id: <1396901229-29117-10-git-send-email-ben.dooks@codethink.co.uk> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1396901229-29117-1-git-send-email-ben.dooks@codethink.co.uk> References: <1396901229-29117-1-git-send-email-ben.dooks@codethink.co.uk> 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.2 required=5.0 tests=BAYES_00, 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 Add support for R8A7790 with new device tree code. Signed-off-by: Ben Dooks --- drivers/dma/sh/shdmac.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/drivers/dma/sh/shdmac.c b/drivers/dma/sh/shdmac.c index 0d765c0..84ba8d1 100644 --- a/drivers/dma/sh/shdmac.c +++ b/drivers/dma/sh/shdmac.c @@ -677,7 +677,8 @@ static const struct shdma_ops sh_dmae_shdma_ops = { }; static const struct of_device_id sh_dmae_of_match[] = { - {.compatible = "renesas,shdma-r8a73a4", .data = r8a73a4_shdma_devid,}, + { .compatible = "renesas,shdma-r8a73a4", .data = r8a73a4_shdma_devid }, + { .compatible = "renesas,dma-r8a7790", .data = &shdma_arm_info }, {} }; MODULE_DEVICE_TABLE(of, sh_dmae_of_match); @@ -693,10 +694,17 @@ static int sh_dmae_probe(struct platform_device *pdev) struct dma_device *dma_dev; struct resource *chan, *dmars, *errirq_res, *chanirq_res; - if (pdev->dev.of_node) - pdata = of_match_device(sh_dmae_of_match, &pdev->dev)->data; - else + if (pdev->dev.of_node) { + const struct of_device_id *match; + + match = of_match_device(sh_dmae_of_match, &pdev->dev); + if (match->data == r8a73a4_shdma_devid) + pdata = match->data; + else + pdata = sh_dma_probe_of(pdev, match); + } else { pdata = dev_get_platdata(&pdev->dev); + } /* get platform data */ if (!pdata || !pdata->channel_num)