From patchwork Wed Jun 4 16:14:12 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Dooks X-Patchwork-Id: 4295471 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 190539F326 for ; Wed, 4 Jun 2014 16:14:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4FEAE20251 for ; Wed, 4 Jun 2014 16:14:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 738AB20274 for ; Wed, 4 Jun 2014 16:14:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751261AbaFDQOi (ORCPT ); Wed, 4 Jun 2014 12:14:38 -0400 Received: from ducie-dc1.codethink.co.uk ([185.25.241.215]:56416 "EHLO ducie-dc1.codethink.co.uk" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1751662AbaFDQOh (ORCPT ); Wed, 4 Jun 2014 12:14:37 -0400 Received: from localhost (localhost [127.0.0.1]) by ducie-dc1.codethink.co.uk (Postfix) with ESMTP id C222E4679AC; Wed, 4 Jun 2014 17:14:36 +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 Nd7FPz2UeksS; Wed, 4 Jun 2014 17:14:31 +0100 (BST) Received: from rainbowdash.ducie.codethink.co.uk (rainbowdash.dyn.ducie.codethink.co.uk [10.24.1.179]) by ducie-dc1.codethink.co.uk (Postfix) with ESMTPS id 5DAAF46721D; Wed, 4 Jun 2014 17:14:19 +0100 (BST) Received: from ben by rainbowdash.ducie.codethink.co.uk with local (Exim 4.82_1-5b7a7c0-XX) (envelope-from ) id 1WsDpT-00086a-3L; Wed, 04 Jun 2014 17:14:19 +0100 From: Ben Dooks To: linux-sh@vger.kernel.org Cc: laurent.pinchart@ideasonboard.com, Ben Dooks Subject: [PATCH 5/8] shdmac: fdt: wire r8a7790 for device tree usage. Date: Wed, 4 Jun 2014 17:14:12 +0100 Message-Id: <1401898455-31064-6-git-send-email-ben.dooks@codethink.co.uk> X-Mailer: git-send-email 2.0.0.rc2 In-Reply-To: <1401898455-31064-1-git-send-email-ben.dooks@codethink.co.uk> References: <1401898455-31064-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.5 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 Note, not yet converted the only other user to dt yet 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 146d5df..e525f80 100644 --- a/drivers/dma/sh/shdmac.c +++ b/drivers/dma/sh/shdmac.c @@ -680,7 +680,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); @@ -699,10 +700,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)