Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp8810930imu; Tue, 4 Dec 2018 14:45:59 -0800 (PST) X-Google-Smtp-Source: AFSGD/UpcpJlOyeuTWQGstaTPq5bsNrkXPniT3UX5VIg1TNfTG5Xv/i79xDuFn070v6DBy9FdPLY X-Received: by 2002:a17:902:4025:: with SMTP id b34mr22076356pld.181.1543963559682; Tue, 04 Dec 2018 14:45:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543963559; cv=none; d=google.com; s=arc-20160816; b=DwxkMzF0I0Vj32xoZr7J/RjKhiq0e9WWkAfXb8+iRISN2YtjOP/8gpyyCCPrBtGpRn LHkG15NMcRUPdSusLZlTZ+tbr1U4VQ7voM+Mo7DQAtuyBwwNPPC1igXuQP9eFWMwy0OB WxkBT6tC9SGjsF1lm4L64lOABxiz9sydptBQDIni749AlNrDsWGey3rPgGF+Q2s94LL0 9McgUX5lpRnbmUhyeh3oNPWxQZY+2MTrk8F6bMnDEPCSFmPjTK8RQLLzKNaC5svMYNkW j+wwa+nQ9bHpy97RLcP41aFYnVMts7+09UhpePtygUciR7xRz+nt9AzgflsejLp/OV/d rrRQ== 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=X9a0MShRejczGXlfzag4OTdzWDGfbAzuHBv0f6t1FeA=; b=DjYa9DP9AtZDwJMBN0SxkG1xaJOtAnt3Fx6wocPP7ICglED5ZZZzBY1arBQ35XxZCX upjWm1G/tdnd6EG0vqGQUoFlOIiqQEYauGxiWPERNLJDwF03qsp+cU5CUcg6qY+HzLhc IX+eKanhMT5kmudGf6cihuIPbvpbvyAzg2ESs2gZIqOhmha8NDusZphJ4pS2HVgb73Cu 9EpBtSXlaz8C4+6KTHykV/PpMJ3DeaANW/uVOVgNDD67Om5dht9fQECrGgRSnaycpnzT YChqrkq+DQCBtFYYjR/YrqhjfaUq+TfxZ10R1AD4tKqfmzkJsuqQ3LFuD2Kd2CaVNi36 esww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="kupznE6/"; 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=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b131si16344676pga.51.2018.12.04.14.45.44; Tue, 04 Dec 2018 14:45:59 -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=@chromium.org header.s=google header.b="kupznE6/"; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726744AbeLDWnl (ORCPT + 99 others); Tue, 4 Dec 2018 17:43:41 -0500 Received: from mail-pg1-f196.google.com ([209.85.215.196]:34695 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726554AbeLDWnT (ORCPT ); Tue, 4 Dec 2018 17:43:19 -0500 Received: by mail-pg1-f196.google.com with SMTP id 17so8052460pgg.1 for ; Tue, 04 Dec 2018 14:43:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=X9a0MShRejczGXlfzag4OTdzWDGfbAzuHBv0f6t1FeA=; b=kupznE6/3p14T4HWafu9VvDuqzvHmGNKDZd+bAuzBKlHDC6z8I53mdhOouXkisWNZo 0xBMlsIfp3cnOl222NacGHA2om3tDIXMuOQMweWGfaWPFy+Wi+m9t0HgJB/CfINzHqiV 3Z+PhIDb0e6yAGLTqhRDnvrH954SgawyMQjxs= 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=X9a0MShRejczGXlfzag4OTdzWDGfbAzuHBv0f6t1FeA=; b=fFU836At/JQ04iEyJt1Pgh7PyY0uAwPf5JT53CPJD2IGUnyB4vVyhMNNj5sgxXdoLb 7OV0+cm/FMTOI5LS7RFGqZWdS8WXsL+kg4yXwflK+K1nfpq/7Hu29NEbhx3aIh1QCsZ6 /eRKwGynNzpZJknYjcnxppI5zYtQ20vaXm8Ctf1si+c1gqpNzsVPZuMoZ9x79hzBTl2L W2Qq0Zz5+FS/3mDGH8SkZmlQxcTjFnmooobeEMzPB50Xt/xCQcQg7joRcolD81SLa030 5DUcJ7p4lq/eQS3j+8+WHbTgXYNiFM1MwU2mFKGMfLMkLZpLOdjMMaHZdl05SS1r41hs PM3A== X-Gm-Message-State: AA+aEWaHMbOWXbSZlW3YLnM511c+K+fiZadpFg8lO7Cld4gQUDTuu1FE Zck3MvwS3BNLbY5iu/W2+oep6A== X-Received: by 2002:a63:3c44:: with SMTP id i4mr18060039pgn.286.1543963398453; Tue, 04 Dec 2018 14:43:18 -0800 (PST) Received: from mka.mtv.corp.google.com ([2620:15c:202:1:b6af:f85:ed6c:ac6a]) by smtp.gmail.com with ESMTPSA id y184sm21961917pgd.71.2018.12.04.14.43.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Dec 2018 14:43:17 -0800 (PST) From: Matthias Kaehlcke To: Rob Clark , David Airlie , Rob Herring , Mark Rutland , Andy Gross , David Brown Cc: Archit Taneja , Sean Paul , Rajesh Yadav , Douglas Anderson , Stephen Boyd , Jeykumar Sankaran , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Matthias Kaehlcke Subject: [PATCH v4 5/8] drm/msm/dsi: 10nm PHY: Get ref clock from the DT Date: Tue, 4 Dec 2018 14:42:31 -0800 Message-Id: <20181204224234.62619-6-mka@chromium.org> X-Mailer: git-send-email 2.20.0.rc1.387.gf8505762e3-goog In-Reply-To: <20181204224234.62619-1-mka@chromium.org> References: <20181204224234.62619-1-mka@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Get the ref clock of the PHY from the device tree instead of hardcoding its name and rate. Note: This change could break old out-of-tree DTS files that use the 10nm PHY Signed-off-by: Matthias Kaehlcke Reviewed-by: Douglas Anderson --- Changes in v4: - none Changes in v3: - fixed check for EPROBE_DEFER - added note to commit message about breaking old DTS files - added 'Reviewed-by: Douglas Anderson ' tag Changes in v2: - remove anonymous array in clk_init_data assignment - log error code if devm_clk_get() fails - don't log devm_clk_get() failures for -EPROBE_DEFER - updated commit message --- drivers/gpu/drm/msm/dsi/pll/dsi_pll_10nm.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/msm/dsi/pll/dsi_pll_10nm.c b/drivers/gpu/drm/msm/dsi/pll/dsi_pll_10nm.c index 4c03f0b7343ed..2d23372acd20d 100644 --- a/drivers/gpu/drm/msm/dsi/pll/dsi_pll_10nm.c +++ b/drivers/gpu/drm/msm/dsi/pll/dsi_pll_10nm.c @@ -91,6 +91,7 @@ struct dsi_pll_10nm { void __iomem *phy_cmn_mmio; void __iomem *mmio; + struct clk *vco_ref_clk; u64 vco_ref_clk_rate; u64 vco_current_rate; @@ -629,8 +630,9 @@ static int pll_10nm_register(struct dsi_pll_10nm *pll_10nm) { char clk_name[32], parent[32], vco_name[32]; char parent2[32], parent3[32], parent4[32]; + const char *ref_clk_name = __clk_get_name(pll_10nm->vco_ref_clk); struct clk_init_data vco_init = { - .parent_names = (const char *[]){ "xo" }, + .parent_names = &ref_clk_name, .num_parents = 1, .name = vco_name, .flags = CLK_IGNORE_UNUSED, @@ -786,6 +788,15 @@ struct msm_dsi_pll *msm_dsi_pll_10nm_init(struct platform_device *pdev, int id) pll_10nm->id = id; pll_10nm_list[id] = pll_10nm; + pll_10nm->vco_ref_clk = devm_clk_get(&pdev->dev, "ref"); + if (IS_ERR(pll_10nm->vco_ref_clk)) { + ret = PTR_ERR(pll_10nm->vco_ref_clk); + if (ret != -EPROBE_DEFER) + dev_err(&pdev->dev, "couldn't get 'ref' clock: %d\n", + ret); + return ERR_PTR(ret); + } + pll_10nm->phy_cmn_mmio = msm_ioremap(pdev, "dsi_phy", "DSI_PHY"); if (IS_ERR_OR_NULL(pll_10nm->phy_cmn_mmio)) { dev_err(&pdev->dev, "failed to map CMN PHY base\n"); -- 2.20.0.rc1.387.gf8505762e3-goog