From patchwork Mon Aug 26 16:45:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jorge Ramirez-Ortiz X-Patchwork-Id: 172176 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp4597252ily; Mon, 26 Aug 2019 09:45:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqzqHp5vzj+W2J0j+z/8lehT3Ppof3qYqbU7Bc9g5AM6oa9QFNHhzsaqKy6u8dIzELWVcgO9 X-Received: by 2002:aa7:8488:: with SMTP id u8mr21509575pfn.229.1566837927614; Mon, 26 Aug 2019 09:45:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566837920; cv=none; d=google.com; s=arc-20160816; b=mtO6vLEPP/R2Jrt7R4xBIKXS0q1hnJICLtrZFCH0bLMt3cY7Zcylh0r1LnoB9FUi81 iWSJq1J8WbbCBvk3djCgiPB6AOq5p3nb40f0tsLnPEL9Y+d690C9Bj9u/mlEXrIIC8LI mNC96gIlJCRvM7Sm1M1kT8DwG0eMp3Slw9Mqc21TvwBJteIONGBDdtT5kmOR2CIa4bah uUassdczwDdjFicRq2gQzlPiZzRTAlOX3UwMNP7QAZpHqISaA/9GAEjUhnUGJPRUqyTQ L4AiGq7RjHRY2BJnuNh/cVWkA2GXss0AAgbQEw4Pr6pMvlqRrzgGg/sFakP6apXKUWZt kHCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=BoMlESuV3B6tPWN9XWP2L6fpdT8XV6yqfKxT2xNxK2o=; b=ZN3cGW3Id5WXo9u9t8U3bhbknjW6HXmY06GuCw1TPPq1P5/lzhQfDtQEJJO2ekbgU4 CmmazPDRcd/bacSyMj08J+XgPCKPBpbg68rnbmocuIZ98LI1MnZPTt7lXsQXWcXVobSA 4YRwERM4UWFyPdnfcEytN7107CyfndrJSno/F/ZxOYECBz5BDfNw0X+5HluBlsun9lky XY4IsjrkDH6zGb1ea1T1wWdVSAfPuLsMBg6QBYo7N16aODBUSdo3bKaCav4Fhd1i30jU Y2GjJzFsBFvmJKaQ74Kq47PXzMfICpmojNhBly3kLVy6+QCGqBEQlN+oYv0gdMwCDF2R cMeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KabsJLk1; 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 r8si9371958pgr.243.2019.08.26.09.45.20; Mon, 26 Aug 2019 09:45:20 -0700 (PDT) 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=KabsJLk1; 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 S1732972AbfHZQpS (ORCPT + 16 others); Mon, 26 Aug 2019 12:45:18 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:46165 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732816AbfHZQpS (ORCPT ); Mon, 26 Aug 2019 12:45:18 -0400 Received: by mail-wr1-f65.google.com with SMTP id z1so15980481wru.13 for ; Mon, 26 Aug 2019 09:45:17 -0700 (PDT) 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 :mime-version:content-transfer-encoding; bh=BoMlESuV3B6tPWN9XWP2L6fpdT8XV6yqfKxT2xNxK2o=; b=KabsJLk1ZzmKq1DlMZEp/k29ZN2rr4yrR+8FbU+6lJZgjPEJAUiZYYegw4EjL9CI/+ HUracAwaQVCCkTBDakDUb5s4M8ROZsTl3Zz72EdmhuUkE8xP2r+Xrq8kFBZUjwmIxYiF 4SukMlm006PTTDVg8EHnqFDH81vNuIk3jCy+dKF//AF6TRPrgC60ZBONZKv9I4B9NvC+ jEfHHjGd1OlGPoh+dGeRIJnJPHBq+wKiJa6nzTxmailqFW308PmAKHWn5EtbCyIVBFvf 0yMEtDR9P+bt1hi+IWD19RTpVBIovgRJ0hlnV9jz0OLdtnyWZ3nn2SQOrjHtYhg/asOX f5sQ== 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:mime-version:content-transfer-encoding; bh=BoMlESuV3B6tPWN9XWP2L6fpdT8XV6yqfKxT2xNxK2o=; b=tKCOExluzA6twn6NLIL7kUPG/g7PDL/VE+MOpvAr3cxqT+vE3OwvzP1HXCKBgplg+Z W0RJ+f/bXrk0vvb9V2NSiIPmpNAyQctO8MIgAZRXcDnxYbjF44KVZFDPgOL7g9lWRtoA EIHutiTe20dAXSPAgSMSLy2CS6qjHBlR1tIIBY1XVRzLFdkiy7wcVY/R7fCxkzk9DSJS WN5D8z4C+zXUUaamlPjJU9tLQyu1PVrAes103fwdcWi0cR/+EEI38EC/iSVMz9zWKZLB aPufT1PWQtucy9SccJbqFeGel7zW06kR4SeUDZceLtkBCrNv/w2IB3An/G66Gj/4N75R YZSA== X-Gm-Message-State: APjAAAV09A+QyQnRYAchT4KjPnY6Hlw5QpaXNkqSIMh/cbTZ8SHi6ydy XdUNjIxIveRYGO4TI5Qibl+Gml5TbnE= X-Received: by 2002:a5d:4490:: with SMTP id j16mr23161619wrq.335.1566837916391; Mon, 26 Aug 2019 09:45:16 -0700 (PDT) Received: from localhost.localdomain (124.red-83-36-179.dynamicip.rima-tde.net. [83.36.179.124]) by smtp.gmail.com with ESMTPSA id l62sm77872wml.13.2019.08.26.09.45.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 26 Aug 2019 09:45:15 -0700 (PDT) From: Jorge Ramirez-Ortiz To: jorge.ramirez-ortiz@linaro.org, sboyd@kernel.org, agross@kernel.org, mturquette@baylibre.com Cc: bjorn.andersson@linaro.org, niklas.cassel@linaro.org, linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/5] clk: qcom: hfpll: get parent clock names from DT Date: Mon, 26 Aug 2019 18:45:08 +0200 Message-Id: <20190826164510.6425-3-jorge.ramirez-ortiz@linaro.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190826164510.6425-1-jorge.ramirez-ortiz@linaro.org> References: <20190826164510.6425-1-jorge.ramirez-ortiz@linaro.org> MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Allow accessing the parent clock name required for the driver operation using the device tree node. This permits extending the driver to other platforms without having to modify its source code. For backwards compatibility leave the previous value as default. Co-developed-by: Niklas Cassel Signed-off-by: Niklas Cassel Signed-off-by: Jorge Ramirez-Ortiz Reviewed-by: Bjorn Andersson --- drivers/clk/qcom/hfpll.c | 8 ++++++++ 1 file changed, 8 insertions(+) -- 2.22.0 diff --git a/drivers/clk/qcom/hfpll.c b/drivers/clk/qcom/hfpll.c index a6de7101430c..87b7f46d27e0 100644 --- a/drivers/clk/qcom/hfpll.c +++ b/drivers/clk/qcom/hfpll.c @@ -52,6 +52,7 @@ static int qcom_hfpll_probe(struct platform_device *pdev) void __iomem *base; struct regmap *regmap; struct clk_hfpll *h; + struct clk *pclk; struct clk_init_data init = { .parent_names = (const char *[]){ "xo" }, .num_parents = 1, @@ -75,6 +76,13 @@ static int qcom_hfpll_probe(struct platform_device *pdev) 0, &init.name)) return -ENODEV; + /* get parent clock from device tree (optional) */ + pclk = devm_clk_get(dev, "xo"); + if (!IS_ERR(pclk)) + init.parent_names = (const char *[]){ __clk_get_name(pclk) }; + else if (PTR_ERR(pclk) == -EPROBE_DEFER) + return -EPROBE_DEFER; + h->d = &hdata; h->clkr.hw.init = &init; spin_lock_init(&h->lock);