From patchwork Fri Mar 17 03:54:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Zhong X-Patchwork-Id: 9629743 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5192560249 for ; Fri, 17 Mar 2017 03:55:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3FEEE28631 for ; Fri, 17 Mar 2017 03:55:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 348FB28654; Fri, 17 Mar 2017 03:55:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.4 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_SORBS_SPAM autolearn=no version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id EFF1D28631 for ; Fri, 17 Mar 2017 03:55:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=CwUZWXLFTAoz8si7mGNNb1f9AID7Ggv/3yakQVRXlD4=; b=U4B+Er/NxsIpyGLgoJC/oKL/7k Vcj7fdnMl4z+rz2fvOTTebdxFlTYpMBsXvNHQlHaqYnf93lK+HWAFtLiT0Rz5wK/a/epRBDFTXRLS sQ8GDo8hZVYm7rUeGepySPheE48bpiEgNCCgMmRGhzwrTn6Bu3nCfBLuF4quwdlD12VUvP1XgLKAz uEzCgJxBSuKUHKWWFyIlOAJyArbRNK3HCV0D64Bkop8u7Qr9+UURasFyDHAf3GOb5CYzPpnahVDNm g+qe5X4IhiEu5JSliNDRfxnDRyMnDZntofk3ZEzj618+sQiiCI/ViDALOFQPKpTmlvXVMsUGPtm0Q xXQxdmwQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1coiz3-00079o-IC; Fri, 17 Mar 2017 03:55:21 +0000 Received: from mail-pg0-f66.google.com ([74.125.83.66]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1coiyf-0005bq-Gi; Fri, 17 Mar 2017 03:54:59 +0000 Received: by mail-pg0-f66.google.com with SMTP id b5so8245894pgg.1; Thu, 16 Mar 2017 20:54:37 -0700 (PDT) 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=FU8suNJ6+QqXEmuFNE1DROrjqR7jFu2BBaDHPObE7qw=; b=Ev9HUjsrg3hlO2V+5AEMljKsPlmJ3P2rQmByYrOFMzhqhMc5QijzOuodHnkcMkXqCb ciDfrbFkqaCWwJUOZdnp+QgIeYX/SvkArNLIe+8n3MwfUUs9kuOwg3eKYGvgtgVHNLah iozcAgozZ3E00YOAxYChLdO41GgaDR2MRuT+nRllx+cg5EEffKwjnLkBzd9Qc7lGuhUY 7VlFn48130b2ekaEIqGPtCEuyhmK9VhlyWSVprz4ToX/YEIPGx2B5m6AdIA7DCfzWoCQ IIocl5d2cgANCBp1cdVHZ4Y9LFUYnyTh3vX2bzhF1+WT/lQt4U4Z02fvmYSrGYGDdlr+ I35g== X-Gm-Message-State: AFeK/H1pDxMQ+oUikeRgfOqr822cR2a1Srbwf36HGod/pUOYP5qBTNkJm3jlnmhaLlIXmA== X-Received: by 10.84.232.129 with SMTP id i1mr17045505plk.129.1489722876781; Thu, 16 Mar 2017 20:54:36 -0700 (PDT) Received: from localhost.localdomain ([103.29.142.67]) by smtp.gmail.com with ESMTPSA id a77sm13221614pfj.1.2017.03.16.20.54.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 16 Mar 2017 20:54:36 -0700 (PDT) From: Chris Zhong To: linux-rockchip@lists.infradead.org Subject: [PATCH v3 1/4] drm/rockchip/dsi: check phy_cfg_clk only for RK3399 Date: Fri, 17 Mar 2017 11:54:21 +0800 Message-Id: <1489722865-22122-2-git-send-email-zyw@rock-chips.com> X-Mailer: git-send-email 2.6.3 In-Reply-To: <1489722865-22122-1-git-send-email-zyw@rock-chips.com> References: <1489722865-22122-1-git-send-email-zyw@rock-chips.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170316_205457_590584_7FC39383 X-CRM114-Status: GOOD ( 13.20 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Heiko Stuebner , David Airlie , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Chris Zhong , linux-arm-kernel@lists.infradead.org, Mark Yao MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP For RK3399, the phy_cfg_clk is a required clock, if phy_cfg_clk is disabled, MIPI phy can not work. Let's return a error if there is no phy_cfg_clk in dts property, when the pdata match RK3399. Signed-off-by: Chris Zhong Reviewed-by: Sean Paul --- Changes in v3: - add a DW_MIPI_NEEDS_PHY_CFG_CLK for RK3399 Changes in v2: None drivers/gpu/drm/rockchip/dw-mipi-dsi.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/rockchip/dw-mipi-dsi.c b/drivers/gpu/drm/rockchip/dw-mipi-dsi.c index f84f9ae..68f48b0 100644 --- a/drivers/gpu/drm/rockchip/dw-mipi-dsi.c +++ b/drivers/gpu/drm/rockchip/dw-mipi-dsi.c @@ -251,6 +251,8 @@ #define THS_PRE_PROGRAM_EN BIT(7) #define THS_ZERO_PROGRAM_EN BIT(6) +#define DW_MIPI_NEEDS_PHY_CFG_CLK BIT(0) + enum { BANDGAP_97_07, BANDGAP_98_05, @@ -279,6 +281,7 @@ struct dw_mipi_dsi_plat_data { u32 grf_switch_reg; u32 grf_dsi0_mode; u32 grf_dsi0_mode_reg; + unsigned int flags; unsigned int max_data_lanes; }; @@ -1136,6 +1139,7 @@ static struct dw_mipi_dsi_plat_data rk3399_mipi_dsi_drv_data = { .grf_switch_reg = RK3399_GRF_SOC_CON19, .grf_dsi0_mode = RK3399_GRF_DSI_MODE, .grf_dsi0_mode_reg = RK3399_GRF_SOC_CON22, + .flags = DW_MIPI_NEEDS_PHY_CFG_CLK, .max_data_lanes = 4, }; @@ -1227,15 +1231,13 @@ static int dw_mipi_dsi_bind(struct device *dev, struct device *master, clk_disable_unprepare(dsi->pclk); } - dsi->phy_cfg_clk = devm_clk_get(dev, "phy_cfg"); - if (IS_ERR(dsi->phy_cfg_clk)) { - ret = PTR_ERR(dsi->phy_cfg_clk); - if (ret != -ENOENT) { + if (pdata->flags & DW_MIPI_NEEDS_PHY_CFG_CLK) { + dsi->phy_cfg_clk = devm_clk_get(dev, "phy_cfg"); + if (IS_ERR(dsi->phy_cfg_clk)) { + ret = PTR_ERR(dsi->phy_cfg_clk); dev_err(dev, "Unable to get phy_cfg_clk: %d\n", ret); return ret; } - dsi->phy_cfg_clk = NULL; - dev_dbg(dev, "have not phy_cfg_clk\n"); } ret = clk_prepare_enable(dsi->pllref_clk);