Received: by 10.192.165.148 with SMTP id m20csp3700525imm; Mon, 23 Apr 2018 10:48:13 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+oKuKljCMTLVEZizFbDqgNbBs4dVNUDg+s04qRpksZAvPZtrRZ3Py31hMM+h62eyvjmDdx X-Received: by 10.99.143.75 with SMTP id r11mr17896288pgn.341.1524505693490; Mon, 23 Apr 2018 10:48:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524505693; cv=none; d=google.com; s=arc-20160816; b=OGSvytH49W9qV4Pu8PgrBYT49nflsbJ7G70/Z2cq5HUkRcExWebg/d8kZGPa0RLwmO +iakgpb6Aj4CMnaQA47Le+9ge+SkWcHYq7fbx0s6QjdJ2tonz/iEqsqk+5ML/WObYQFt Ov9UNTO+BDHwcbe3QDFKwsYshL3vCwLwskwvtuvjhk4usn2znSsGlTXG5D97kkJMykJE onQKTlJyS3YKklABCdP+rbhaWl9t5uVVKz3oYS07ELjiiQ5Ut10JCTxBbHUu365cgcH8 Knz7Q9Rl6mwN3AIJ2F6VtHn48DfINlMceteRKoGRnd53jIlHSVTDi25OaYXJYPf1U2uE 1myg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=+trjUfyGwgiMdK3onoZFNH0mjuEoKtFTIz55jDVYloc=; b=EKX55rf0oUtCwaEdSEZzoC/ngighTDPy/HwwGwyEfr8/dF3EcHLBBAm+NH5u4I5i7Q 5/UtzhYINyhhQZx4FhjkCnikrafVJ7xWyVvp0etROboTqN7hJzrXLX+foS/dglqdhvLc L9IFF8PFj6XfyudDYiYQhQbArpmhUQXoqYlvC1owwWFtFe3czFmrZH3/HuwHOkxVmq+x VstQ6IgJw63p7cdlB9IHWGNGyfoqSUmnLdcLb9R9Iy86nQSbkNSoTGhyIoKSRy9/GICG /VVrZFzK6W2iir4iAZcWmV4RiyQtkZSx9naOaJzJUIE+oFP0kz7v/LbH0qYhIGzIStn3 ZaLw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m185si11638267pfm.258.2018.04.23.10.47.59; Mon, 23 Apr 2018 10:48:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932313AbeDWRqW (ORCPT + 99 others); Mon, 23 Apr 2018 13:46:22 -0400 Received: from muru.com ([72.249.23.125]:38340 "EHLO muru.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932245AbeDWRqP (ORCPT ); Mon, 23 Apr 2018 13:46:15 -0400 Received: from hillo.muru.com (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTP id 635FA81AE; Mon, 23 Apr 2018 17:47:58 +0000 (UTC) From: Tony Lindgren To: linux-omap@vger.kernel.org Cc: Dave Gerlach , Greg Kroah-Hartman , Nishanth Menon , Suman Anna , Tero Kristo , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Paul Walmsley Subject: [PATCH 04/16] ARM: OMAP2+: Only probe SDMA via ti-sysc if configured in dts Date: Mon, 23 Apr 2018 10:45:37 -0700 Message-Id: <20180423174549.57412-5-tony@atomide.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180423174549.57412-1-tony@atomide.com> References: <20180423174549.57412-1-tony@atomide.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We still have some SDMA probing using omap_device_build() for the arch/arm/plat-omap/dma.c part that the dmaengine driver then uses. So we still need to ensure that omap_device_build() works even if we probe and manage the dmaengine driver via ti-sysc. And we don't want to call dev_pm_domain_set() as otherwise we'd also have omap_device try to manage the hardware in addition to ti-sysc. Cc: Paul Walmsley Signed-off-by: Tony Lindgren --- arch/arm/mach-omap2/omap_device.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/arch/arm/mach-omap2/omap_device.c b/arch/arm/mach-omap2/omap_device.c --- a/arch/arm/mach-omap2/omap_device.c +++ b/arch/arm/mach-omap2/omap_device.c @@ -143,7 +143,7 @@ static int omap_device_build_from_dt(struct platform_device *pdev) struct resource res; const char *oh_name; int oh_cnt, i, ret = 0; - bool device_active = false; + bool device_active = false, skip_pm_domain = false; oh_cnt = of_property_count_strings(node, "ti,hwmods"); if (oh_cnt <= 0) { @@ -151,8 +151,15 @@ static int omap_device_build_from_dt(struct platform_device *pdev) return -ENODEV; } + /* SDMA still needs special handling for omap_device_build() */ + ret = of_property_read_string_index(node, "ti,hwmods", 0, &oh_name); + if (!ret && (!strncmp("dma_system", oh_name, 10) || + !strncmp("dma", oh_name, 3))) + skip_pm_domain = true; + /* Use ti-sysc driver instead of omap_device? */ - if (!omap_hwmod_parse_module_range(NULL, node, &res)) + if (!skip_pm_domain && + !omap_hwmod_parse_module_range(NULL, node, &res)) return -ENODEV; hwmods = kzalloc(sizeof(struct omap_hwmod *) * oh_cnt, GFP_KERNEL); @@ -191,11 +198,12 @@ static int omap_device_build_from_dt(struct platform_device *pdev) r->name = dev_name(&pdev->dev); } - dev_pm_domain_set(&pdev->dev, &omap_device_pm_domain); - - if (device_active) { - omap_device_enable(pdev); - pm_runtime_set_active(&pdev->dev); + if (!skip_pm_domain) { + dev_pm_domain_set(&pdev->dev, &omap_device_pm_domain); + if (device_active) { + omap_device_enable(pdev); + pm_runtime_set_active(&pdev->dev); + } } odbfd_exit1: -- 2.17.0