From patchwork Wed Feb 12 17:59:24 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Dooks X-Patchwork-Id: 3639651 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 6A4499F369 for ; Wed, 12 Feb 2014 17:59:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9CD642012B for ; Wed, 12 Feb 2014 17:59:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7279020160 for ; Wed, 12 Feb 2014 17:59:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752240AbaBLR7f (ORCPT ); Wed, 12 Feb 2014 12:59:35 -0500 Received: from 82-68-191-81.dsl.posilan.com ([82.68.191.81]:56546 "EHLO rainbowdash.ducie.codethink.co.uk" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752779AbaBLR7c (ORCPT ); Wed, 12 Feb 2014 12:59:32 -0500 Received: from ben by rainbowdash.ducie.codethink.co.uk with local (Exim 4.82) (envelope-from ) id 1WDe5m-0001rL-RC; Wed, 12 Feb 2014 17:59:26 +0000 From: Ben Dooks To: linux-sh@vger.kernel.org Cc: linux-kernel@lists.codethink.co.uk, Ben Dooks Subject: [PATCH 5/5] shdmac: wire r8a7790 Date: Wed, 12 Feb 2014 17:59:24 +0000 Message-Id: <1392227964-7088-6-git-send-email-ben.dooks@codethink.co.uk> X-Mailer: git-send-email 1.8.5.3 In-Reply-To: <1392227964-7088-1-git-send-email-ben.dooks@codethink.co.uk> References: <1392227964-7088-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.6 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, does not yet moved the other of-dma user yet. --- drivers/dma/sh/shdmac.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/drivers/dma/sh/shdmac.c b/drivers/dma/sh/shdmac.c index 0d765c0..8af2082 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,9 +694,15 @@ 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 */