From patchwork Thu Jan 31 02:01:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 157104 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp6645821jaa; Wed, 30 Jan 2019 18:02:01 -0800 (PST) X-Google-Smtp-Source: ALg8bN4mOYRLBwLLKx8t+QcHLLtJtduy0yCnLTcH1cofiWST/3IrgF9ogeEpXejz9LxzVzQneyMs X-Received: by 2002:a17:902:6948:: with SMTP id k8mr32312638plt.2.1548900121244; Wed, 30 Jan 2019 18:02:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548900121; cv=none; d=google.com; s=arc-20160816; b=OpNR5ssPjY0MrjHGDYCzcfFNo6GS8m4f+iKcJkNebOTWrVIUWpQ+aaQNmKG2SFTaz/ 6A6f7qmA+KWvd8LH/IHDouSPL+9AEr3qAIiLEJU8bodxu2Qml05IGllYbCKByYNwQtKk mDREZWRx1XJ9T9lObsxXm9DwAKvVvHRCmnZbN+Rjh8zH1cEN40ZXrdlX9AKqcLvarKVu 2/CTbqM/sxAu4EdVsXl4PB9Icf9LAxRVKZmb9dgNFcaI9O/1cszciHHovqqcRPPtUXS1 jqJeBFbBowCG7s5j+ej42hAfmRyyCJBbyjLU9XdltB0SW9XMbyLjcM5VKzaPNEAaVIVs nL3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=HjDYVVjAsz/4oVbkOE/Mrv8HvKO47yQvu96bDy25tg8=; b=orI7zVYIdfzVVZ8w4CHKCiq4oiU5oUtb7AZGddI6/IgAsDvvmhXlVRngqGnJdfa1Oh qjePAxashEdEXRghlfavhv0XTcZ6q6ArM7pVSAtupH9kSyMWQiXiBioOkHRKdycd3u+p Z1IQAfvVNGxRJPaF28YzC5WQeEg/Kts00F4HQJzwmVV6RK+MQCBVUIrNd6FFHCEZTjRL MvtxaDmAIhFZpYSGD/2YFO3AmBaRFAm/hAHb40QgseYtdykH5Oj9DEhyn9UNzJ2cC+FX TAVlTT0PuHfkwg5phVljknnSEI6EnEY9vCv67p2dQpBAsCi1HOJ8w3+BZnA/YfvusTAv Nz/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PP4P6uEI; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-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 n128si2977852pga.423.2019.01.30.18.02.00; Wed, 30 Jan 2019 18:02:01 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-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=PP4P6uEI; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-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 S1726445AbfAaCB7 (ORCPT + 15 others); Wed, 30 Jan 2019 21:01:59 -0500 Received: from mail-pg1-f196.google.com ([209.85.215.196]:46779 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725535AbfAaCB6 (ORCPT ); Wed, 30 Jan 2019 21:01:58 -0500 Received: by mail-pg1-f196.google.com with SMTP id w7so651906pgp.13 for ; Wed, 30 Jan 2019 18:01:58 -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; bh=HjDYVVjAsz/4oVbkOE/Mrv8HvKO47yQvu96bDy25tg8=; b=PP4P6uEIkFYFypugevC/CAzFdBY6dZKtcvfDvBvdZ1JCQqxL4y9hkjulkEFOAPkR8k a/UccZS5SiJRyGU81gNEh11LpNFPCpB+/r9K3+6fqa6TjQr3YF6EGvIAMauEAFnsJXr1 vJYkjuMNUp/1Sr3gboSU9vrV+XWX+o5BHKZCM= 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; bh=HjDYVVjAsz/4oVbkOE/Mrv8HvKO47yQvu96bDy25tg8=; b=e9aUBEFTnDDzgW5XlwjCsVNczeGCK+IJ2kAOetdHF48Ecr6D+lb3MYfpyvyxVDWiXy 9MExxVysPK++Nqq18uteGlia7PVmpa6eP8p6VB+4YqJDaxOgN1ttgJaaHtKDf2gRU2g9 iQFsagr13NlLVR9OoGgoKq03ZpjAkQa4UCryhkox+fo0AQv9xzYgnKPAm/sLrY+iejNf AD6m0oBm+NAGW1+AHDnmAhDtiPGLQMm13Wbm00mQgJb3CZ1Vi4c754aqEz8NMLhgU4Is RLOE0Pm5/QPRusm/xe6V+eUjkxgGjR6c4vz3/qYCNKhiWN07VFPKGbg8WKk35b5phzUB 2P0A== X-Gm-Message-State: AJcUuke8F/DV9q/vDk1vbH19+H49v0Wqc2IS0tzdNDhYJ/E5SEwodGz8 r3xcysTVvZNobPEKoY8gSLMqtQ== X-Received: by 2002:a62:528e:: with SMTP id g136mr34406859pfb.111.1548900117539; Wed, 30 Jan 2019 18:01:57 -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 n78sm4957822pfk.19.2019.01.30.18.01.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 30 Jan 2019 18:01:56 -0800 (PST) From: Bjorn Andersson To: Russell King , Greg Kroah-Hartman , Ulf Hansson Cc: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Sai Prakash Ranjan Subject: [RESEND PATCH] amba: Allow pclk to be controlled by power domain Date: Wed, 30 Jan 2019 18:01:41 -0800 Message-Id: <20190131020141.28352-1-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.18.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@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 --- Resending this separate from the series it was originally part of. drivers/amba/bus.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) -- 2.18.0 Tested-by: Sai Prakash Ranjan 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)