From patchwork Thu Mar 16 03:31:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Zhong X-Patchwork-Id: 9627059 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 0885560244 for ; Thu, 16 Mar 2017 03:32:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F076026E4F for ; Thu, 16 Mar 2017 03:31:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E3F6427F9F; Thu, 16 Mar 2017 03:31:59 +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=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A8CE126E4F for ; Thu, 16 Mar 2017 03:31:59 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E04EF6E9C7; Thu, 16 Mar 2017 03:31:58 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pg0-f66.google.com (mail-pg0-f66.google.com [74.125.83.66]) by gabe.freedesktop.org (Postfix) with ESMTPS id 528D66E9C7 for ; Thu, 16 Mar 2017 03:31:57 +0000 (UTC) Received: by mail-pg0-f66.google.com with SMTP id b5so4384338pgg.1 for ; Wed, 15 Mar 2017 20:31:57 -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=A6LDNUuyE8TDi/bjpjworHkzCGOVBQurBhqSIgljwqw=; b=o731W928dKZR5gUkJg97XXUdaQhSutHuYv5E5twqqI9NqCOcy263qJGL+qVTfQcgzX TMgmoeZAWziZztg1l/AeKE/00apt3FFs0ITFkJQbcVg3fnFO5ewhWWehCbGXwQpBaFJM +je/TWFwdfUGRAhx1kMdpjCrudlCqF2FmXKNBZipEVhn8/x33+udGOMy7ir1080uHjnR 7jYJXP73uhGmc6sRWK3b94DEeiXHnsqKrIqZDJhxmzuRpkZWyPxxyGFs4rEkbGgq0lAo qP9zOdd9otgfRNsToNH/e0FB9ejnqHF+UlD/zrZ76l1n4woHN72VATVPkHtWZVV5SUpO aUzA== X-Gm-Message-State: AFeK/H3p6CTjJxRp7V4syFFDP9l42kxNERsW1hkmvb0Ydn2YlG6GGVCvRPu1JaZnL7ssBg== X-Received: by 10.99.66.197 with SMTP id p188mr7517982pga.107.1489635116949; Wed, 15 Mar 2017 20:31:56 -0700 (PDT) Received: from localhost.localdomain ([103.29.142.67]) by smtp.gmail.com with ESMTPSA id 19sm6781023pfo.50.2017.03.15.20.31.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 15 Mar 2017 20:31:56 -0700 (PDT) From: Chris Zhong To: linux-rockchip@lists.infradead.org Subject: [PATCH v2 1/4] drm/rockchip/dsi: check phy_cfg_clk only for RK3399 Date: Thu, 16 Mar 2017 11:31:44 +0800 Message-Id: <1489635107-21327-2-git-send-email-zyw@rock-chips.com> X-Mailer: git-send-email 2.6.3 In-Reply-To: <1489635107-21327-1-git-send-email-zyw@rock-chips.com> References: <1489635107-21327-1-git-send-email-zyw@rock-chips.com> Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Chris Zhong , linux-arm-kernel@lists.infradead.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 --- Changes in v2: None drivers/gpu/drm/rockchip/dw-mipi-dsi.c | 10 ++++------ 1 file changed, 4 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..11c4166 100644 --- a/drivers/gpu/drm/rockchip/dw-mipi-dsi.c +++ b/drivers/gpu/drm/rockchip/dw-mipi-dsi.c @@ -1227,15 +1227,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 == &rk3399_mipi_dsi_drv_data) { + 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);