Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2395314imu; Sun, 6 Jan 2019 00:12:16 -0800 (PST) X-Google-Smtp-Source: ALg8bN5K6Ijxy6HRGD9qSkRdK2hN9JnoqZ4aevfQA1oN+cQvwqm0fcPN8zsyUMO8louVpHXq6VVo X-Received: by 2002:a63:cf02:: with SMTP id j2mr7189198pgg.113.1546762336598; Sun, 06 Jan 2019 00:12:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546762336; cv=none; d=google.com; s=arc-20160816; b=YUEW1D4vyyqM+if0MMeau8ysfhG8dGXydx6xZeZwr1LRvYaeucjlck99YmYme0tKLd vjq1xd7iJLiEtYyOwN/593NdEV4Bi84Dz7eQUPmBcQrNBNCaHa2JvBF/x0xM9qckPyi0 ZlObr8Pg4+lSvAW5EjxhJPP9CdBeOVGksjf7VqW6+mxCXnbwq0yuY+WzXE8Or1N0Au6F uUrWmA2XArJod5u3iNYQPobZKwz5b+Q3E8+Kmmz7beCF/RmkLKWJdO7WVP7R0JQxGV9o RgWGARizauO6OCauYFsfHdc6nJVyH/9aroj89eM24b0dVWzCMPnj0rDJHhLD4STBDfcX j4mQ== 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:dkim-signature; bh=6eOA+KowDamTwt9THtkpVEpyZ4rKdyAZPpHHkjZU05U=; b=O3+GVjTv7A23Goj8veQrF7TspgzAh5o7bPOSVfFWtNhA6X0AwwI/tqENnU7GYVkqSx S+fBe7/7+ou/B0KyJNmUd6MhWOkEb3tV61DcUiqTSX4rRoxp9SKpUE6pfb22I0UDu313 IkHHERYDAxAwR1PSBt369IAQIFsAY8oQG4x2YJhBsj426eEV8XddDkwo369f9nRoOrTN 8wkuWGKSgDkrJ0Riw419H7G4lFc/1EjqwCoMV8RjkoFBdwCSdryZBKgwW+l83fhn/1tW iOUFi7YzD1aX2tTrKKKRJwqBtA7mbXDXYRYTb1gcsKpmgIjjcd5xCfehOKTpQkiK+zMl RhBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=H11IiDTl; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x12si5242684plo.164.2019.01.06.00.11.59; Sun, 06 Jan 2019 00:12:16 -0800 (PST) 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; dkim=pass header.i=@linaro.org header.s=google header.b=H11IiDTl; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726530AbfAFIK3 (ORCPT + 99 others); Sun, 6 Jan 2019 03:10:29 -0500 Received: from mail-pg1-f196.google.com ([209.85.215.196]:43498 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726507AbfAFIK0 (ORCPT ); Sun, 6 Jan 2019 03:10:26 -0500 Received: by mail-pg1-f196.google.com with SMTP id v28so19330219pgk.10 for ; Sun, 06 Jan 2019 00:10:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=6eOA+KowDamTwt9THtkpVEpyZ4rKdyAZPpHHkjZU05U=; b=H11IiDTlL5rZfxXSyBdWWhB7DFh/XlD+/c/114NySGh8MmITVRdvbhjs6E7FsSaaff fM5tHLsRhilrX4qaIoz/I+0ftniQ8xlVkxAVonc86P9QFkX1MdlwgvtmG7LXrgyWGDUW qRJVsc4czoqwwMSTQtlpVz8r46GlA0DNiYF84= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=6eOA+KowDamTwt9THtkpVEpyZ4rKdyAZPpHHkjZU05U=; b=r8403is5q/3vTsW7pub6OQNFBEgF9ysXjhbWDZhary/roak9QSQ0fYfR2ThMV22VTB j7WZudNPlliN21l+jHC3zJe34PfbtJj7/H1IFibNhXgAfTfWeBHNQ5zMTE7DWEstlTS1 5X+ClXd8+fes/qTUMzec52n9JKHmuVV0j7c41XybS6VVKE9/TEkpLrdpiW0FK5LTQcZU OM3t2800IMkoa41rX1CmhW06BvFTt6ayR/8fp4vDswLF8oFPMtSB9mzTuFivP85CdTVf +tfxQYSLAiQLoQ3+aRRg6OnxMbX8vrcPHZiAY79rPs18wEvOoND5d0pCTItmTmDG5uV2 GJVg== X-Gm-Message-State: AJcUukdlc4W602OQC4wqSfuVE6GXqjAmYjXJgk+ZumEPqFtjh+5WGD9m tOLL5Eh3s5sOHP6p4V+t6JAYGg== X-Received: by 2002:a63:a064:: with SMTP id u36mr7136362pgn.145.1546762224050; Sun, 06 Jan 2019 00:10:24 -0800 (PST) Received: from localhost.localdomain (104-188-17-28.lightspeed.sndgca.sbcglobal.net. [104.188.17.28]) by smtp.gmail.com with ESMTPSA id v190sm90763364pfv.26.2019.01.06.00.10.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 06 Jan 2019 00:10:23 -0800 (PST) From: Bjorn Andersson To: Russell King , Ulf Hansson Cc: Andy Gross , David Brown , Rob Herring , Mark Rutland , Arun Kumar Neelakantam , linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 6/7] amba: Allow pclk to be controlled by power domain Date: Sun, 6 Jan 2019 00:09:14 -0800 Message-Id: <20190106080915.4493-7-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20190106080915.4493-1-bjorn.andersson@linaro.org> References: <20190106080915.4493-1-bjorn.andersson@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On the Qualcomm SDM845 platform the apb_pclk is controlled as part of the QDSS power/clock domain. Handle this by allowing amba to operate without direct apb_pclk control, when a powerdomain is attached and no clock is described. Signed-off-by: Bjorn Andersson --- Changes since v1: - New patch drivers/amba/bus.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/amba/bus.c b/drivers/amba/bus.c index 41b706403ef7..3e13050c6d59 100644 --- a/drivers/amba/bus.c +++ b/drivers/amba/bus.c @@ -219,8 +219,13 @@ static int amba_get_enable_pclk(struct amba_device *pcdev) int ret; pcdev->pclk = clk_get(&pcdev->dev, "apb_pclk"); - if (IS_ERR(pcdev->pclk)) - return PTR_ERR(pcdev->pclk); + if (IS_ERR(pcdev->pclk)) { + /* Continue with no clock specified, but pm_domain attached */ + if (PTR_ERR(pcdev->pclk) == -ENOENT && pcdev->dev.pm_domain) + pcdev->pclk = NULL; + else + return PTR_ERR(pcdev->pclk); + } ret = clk_prepare_enable(pcdev->pclk); if (ret) -- 2.18.0