From patchwork Sun Jan 6 08:09:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 154829 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp2339706ljp; Sun, 6 Jan 2019 00:10:32 -0800 (PST) X-Google-Smtp-Source: ALg8bN5YUn52ymzBeqT9gJtXr1UuTC5xcUGRTKbq8T6HFP+dhnqBOJQ2xc65W5p012puEkxUwIo3 X-Received: by 2002:a17:902:7b88:: with SMTP id w8mr56414667pll.320.1546762232558; Sun, 06 Jan 2019 00:10:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546762232; cv=none; d=google.com; s=arc-20160816; b=M6GzV9PQZPdfhA/TxkiWUg2arYgptpB1BUg5yBg7Ll9exug6ee9vWkc2HAH9ee9lsO uURrp3Mi6uVxLyhjxclETrZzhPtZTLV9gjCSpHa8MHQHRIqQWBWXRS5Ojwu3sbxLi6ox +Nn/i2Y7BRdZawkcye7Cg9aZcqhM3E+fYnTS+ha/gIlQdQ5ONN97qUHlXN0fjGNagRvh j8XVgc353QD4Qv88oSvZhMNpZmPyl0/QWumrvpGxt4Ef9uXgIjei2tYumd1sKSJ43bkA pjyD3NPhENjsH8BCPQMOkUvx4a035GQl9oBTZapvcHIRlAD3aEhO/48i1PRz+izzMp9h W6/g== 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 m7si6987503pgi.547.2019.01.06.00.10.32; Sun, 06 Jan 2019 00:10:32 -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 S1726534AbfAFIKa (ORCPT + 31 others); Sun, 6 Jan 2019 03:10:30 -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(-) -- 2.18.0 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)