From patchwork Tue May 4 05:28:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Guo X-Patchwork-Id: 430799 Delivered-To: patch@linaro.org Received: by 2002:a02:c901:0:0:0:0:0 with SMTP id t1csp3474896jao; Mon, 3 May 2021 22:29:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw9kQUhVYSiV8hrPsRtmcVWUIrbXB0AzSO/4U1WJNig42WLb1ZwDJzvVLHwfPMn4Pu8eaFP X-Received: by 2002:aa7:9299:0:b029:21d:7ad1:2320 with SMTP id j25-20020aa792990000b029021d7ad12320mr22366034pfa.22.1620106148833; Mon, 03 May 2021 22:29:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620106148; cv=none; d=google.com; s=arc-20160816; b=nih0hEZgxj6r7pNkbZ5VED1BSsjcMSzaCkGJ0W/yZboWByyTXW6ZJ3e28Qthm3D+27 TIr+b42POKxYTZk+bA4D/DHfy9ZNUFt+l9WhpaAxoH340j9dM/t35oGQ9W8CQ7Jmwhyc NrlK6wHXpUPfDALBLeQSknoMjuNWIRS0nf/A6eAHF79uDI5GgtqM2UZgwkMY6pkqwzld gvWxwN69CimAotMsexQPIp3qsCp7J/34Vf3GhTU73GaYiZ0oUWMXPUxz6WixrxPuiAG7 mD7IR9JZ+6JuYtOFnFv1DT8cj0WvUiq9lwHjKyuiQCpX7iLYPQhYsK5RaBVw+oWsmD/4 CKdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=RjDDEQHznq8kml6OFuSumxrNRPKtAVnBXfVZoTIOBJk=; b=FbbHEwd23thYesd5swLRK8E0CcKkCJvwGRLi1KR6hmIMCn7g5Tt8QvLjoroGftqJVr l7SQpfdkelNPsLjNeFjXds9hrkYwxlR9jHPst5+AQmpQRPyJuYiKUMpOMwWh/oJoGLNv z7eFZRRsEbEAHvZJzx6rreQjIrcPZfcdZII8UBKVBv8cTSNRaZmKiry4gyeG3mhBGX3P Xa6n5PLh7YFEui02mbAgY+QS60LOXF213r7AuqtEu/tTUGGCHRkSXYLjDdjR2TZHtNkb mw/rsTcamGkfMzPwtYmYOJFjOeRkI3UpsS91mGcjUUpecj62Taxh/YTYHIQ5WzugdmOU jrrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=edgEPWYj; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-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. [23.128.96.18]) by mx.google.com with ESMTP id x7si2109914pgp.564.2021.05.03.22.29.08; Mon, 03 May 2021 22:29:08 -0700 (PDT) Received-SPF: pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=edgEPWYj; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-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 S229813AbhEDFaA (ORCPT + 6 others); Tue, 4 May 2021 01:30:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50320 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229807AbhEDFaA (ORCPT ); Tue, 4 May 2021 01:30:00 -0400 Received: from mail-pf1-x434.google.com (mail-pf1-x434.google.com [IPv6:2607:f8b0:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3AE2AC061761 for ; Mon, 3 May 2021 22:29:06 -0700 (PDT) Received: by mail-pf1-x434.google.com with SMTP id e15so6276865pfv.10 for ; Mon, 03 May 2021 22:29:06 -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; bh=RjDDEQHznq8kml6OFuSumxrNRPKtAVnBXfVZoTIOBJk=; b=edgEPWYjMfQl/NgTn+F1VvmFuUMWGV24gxVRojOLOPXRI+FlPOHqeNJk/nxxslIspB TJT0B4FJFt+m1zV05deFvgTn2PptV4eK+ipoUViTipPkBLXOVw7BU0iYqlOQ5vjQ0n/G O8L6u8vTTQIHh5GORy2FZtAGt6Y6JQT49QaOgCKiunlUSu13Y+id5bQJVs7YmGohvrBv uOdFcmOIlydzqv3O7kBgZ28ZqGdMPAsmuvURkRZRXTqN6mFbEwxp3aYiJHjS2wt/nnN7 brmHt2hnwcS4XkeFTGE8NJZ1GcpfY05IXCAIG2+3uKxHDbAqxT+I8TcLtpkQVfOp2+kn 3cwA== 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=RjDDEQHznq8kml6OFuSumxrNRPKtAVnBXfVZoTIOBJk=; b=EQ3Canszw+hPf9e1fRrKHzYyxRuSvdG000uUDMbbHqsEOeZuOvUusHUy4x1u5vHfqD VqlIMFD3BdQaYdZXu4MyeE1BCBKZTjmuk9hwh5ftBWp6LmuPTrPdrFqVgx17oXRcpcCH vPpqNYsyLicm+hQWfg3uqfXqcOymHnOidodkY+swRnPc8EXsKr/BMzzje0o4puD+8xeW 3OtbnRmX25GsfL37tcq72INR1z00jZiD72UPgNGDwS+mBpV7afmSg8SMyxz1Uout0oHw Y9c+BtG8VsuN31aGmXo4P1mxIckDzSfOHB49VFTh5JGQhz6py7u/c1hHDfTz+OaDVfnW xpvA== X-Gm-Message-State: AOAM533SbcCW8WrMw7Y6Wpv4lGebujDDP4KR9wCFW0jaYWKyoBYo76Bs aJ9r+vOMjpD9YiOYnSzEOs66sw== X-Received: by 2002:a17:90b:4b45:: with SMTP id mi5mr3000570pjb.197.1620106145767; Mon, 03 May 2021 22:29:05 -0700 (PDT) Received: from localhost.localdomain (80.251.214.228.16clouds.com. [80.251.214.228]) by smtp.gmail.com with ESMTPSA id 145sm5933229pfv.196.2021.05.03.22.29.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 May 2021 22:29:05 -0700 (PDT) From: Shawn Guo To: Stephen Boyd Cc: Bjorn Andersson , Rob Herring , Sivaprakash Murugesan , Benjamin Li , devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, Shawn Guo Subject: [PATCH 4/5] clk: qcom: a53-pll: Pass freq_tbl via match data Date: Tue, 4 May 2021 13:28:43 +0800 Message-Id: <20210504052844.21096-5-shawn.guo@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210504052844.21096-1-shawn.guo@linaro.org> References: <20210504052844.21096-1-shawn.guo@linaro.org> Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org The frequency table is SoC specific. Instead of hard coding, pass it via match data, so that the driver can work for more than just MSM8916. This is a preparation change for adding MSM8939 A53PLL support. Signed-off-by: Shawn Guo --- drivers/clk/qcom/a53-pll.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) -- 2.17.1 diff --git a/drivers/clk/qcom/a53-pll.c b/drivers/clk/qcom/a53-pll.c index 964f5ab7d02f..bfa048dc01ec 100644 --- a/drivers/clk/qcom/a53-pll.c +++ b/drivers/clk/qcom/a53-pll.c @@ -15,7 +15,7 @@ #include "clk-pll.h" #include "clk-regmap.h" -static const struct pll_freq_tbl a53pll_freq[] = { +static const struct pll_freq_tbl msm8916_freq[] = { { 998400000, 52, 0x0, 0x1, 0 }, { 1094400000, 57, 0x0, 0x1, 0 }, { 1152000000, 62, 0x0, 0x1, 0 }, @@ -43,8 +43,13 @@ static int qcom_a53pll_probe(struct platform_device *pdev) void __iomem *base; struct clk_init_data init = { }; const char *clk_name = NULL; + const struct pll_freq_tbl *freq_tbl; int ret; + freq_tbl = device_get_match_data(&pdev->dev); + if (!freq_tbl) + return -ENODEV; + pll = devm_kzalloc(dev, sizeof(*pll), GFP_KERNEL); if (!pll) return -ENOMEM; @@ -65,7 +70,7 @@ static int qcom_a53pll_probe(struct platform_device *pdev) pll->mode_reg = 0x00; pll->status_reg = 0x1c; pll->status_bit = 16; - pll->freq_tbl = a53pll_freq; + pll->freq_tbl = freq_tbl; of_property_read_string(pdev->dev.of_node, "clock-output-names", &clk_name); @@ -92,7 +97,7 @@ static int qcom_a53pll_probe(struct platform_device *pdev) } static const struct of_device_id qcom_a53pll_match_table[] = { - { .compatible = "qcom,msm8916-a53pll" }, + { .compatible = "qcom,msm8916-a53pll", .data = msm8916_freq }, { } };