From patchwork Mon Aug 10 11:59:56 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 52225 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f71.google.com (mail-la0-f71.google.com [209.85.215.71]) by patches.linaro.org (Postfix) with ESMTPS id 915BD22919 for ; Mon, 10 Aug 2015 12:00:12 +0000 (UTC) Received: by labia3 with SMTP id ia3sf38825398lab.1 for ; Mon, 10 Aug 2015 05:00:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=WPMOYbNayw2uJpRYTjDtsQ+HFKixwxxNzwAM9RPrCus=; b=H/c+jkRcaQ/IQJoZvm/DO+7wwOKZ0UWqq9GSi7sRPrUxZ8LRFsup2LB598nxBG/oHm PsxLxhcFedqFRq2sGPMHEdvtsfwc43fT30TznRtmhmzzGF587myI1DAgHMERitrDUv3d jo3KFDVPnjcy1n9G0GhQDB5AWKCdrVv5C1nUFTWfx5oKNSJW56/aHnjgYXungXGxWfus tQvZlQyVfJ3dYWZAf8pfGhzBmxWys1FzyRbtq4Za2gfuWME3icAF0Vrx7n2XN4iyOr8g RCVkUhjc24+ecORX6jAvd9RwW0umGKVd2kXnZHeKKma9lgJMrWshFBmvpW8bL+t/yCSO yG3A== X-Gm-Message-State: ALoCoQl/vb2GDZOD/3vKlxm4dZNUtNvWgTJtZIc9ze27MMIp/mnG+v0gAkZwLMOHEcVsgnFeC5Du X-Received: by 10.180.12.205 with SMTP id a13mr3608157wic.4.1439208011579; Mon, 10 Aug 2015 05:00:11 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.20.201 with SMTP id p9ls365503lae.42.gmail; Mon, 10 Aug 2015 05:00:11 -0700 (PDT) X-Received: by 10.152.178.133 with SMTP id cy5mr7219138lac.42.1439208011345; Mon, 10 Aug 2015 05:00:11 -0700 (PDT) Received: from mail-lb0-f169.google.com (mail-lb0-f169.google.com. [209.85.217.169]) by mx.google.com with ESMTPS id dd5si13320900lad.159.2015.08.10.05.00.11 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Aug 2015 05:00:11 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.169 as permitted sender) client-ip=209.85.217.169; Received: by lbbtg9 with SMTP id tg9so55805173lbb.1 for ; Mon, 10 Aug 2015 05:00:11 -0700 (PDT) X-Received: by 10.152.22.99 with SMTP id c3mr20334803laf.32.1439208011206; Mon, 10 Aug 2015 05:00:11 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.7.198 with SMTP id l6csp1888402lba; Mon, 10 Aug 2015 05:00:10 -0700 (PDT) X-Received: by 10.70.47.3 with SMTP id z3mr14139582pdm.120.1439208009992; Mon, 10 Aug 2015 05:00:09 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x3si18675964pdp.208.2015.08.10.05.00.09; Mon, 10 Aug 2015 05:00:09 -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; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751309AbbHJMAG (ORCPT + 6 others); Mon, 10 Aug 2015 08:00:06 -0400 Received: from mail-wi0-f180.google.com ([209.85.212.180]:37004 "EHLO mail-wi0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932214AbbHJL77 (ORCPT ); Mon, 10 Aug 2015 07:59:59 -0400 Received: by wibhh20 with SMTP id hh20so147344812wib.0 for ; Mon, 10 Aug 2015 04:59:58 -0700 (PDT) X-Received: by 10.180.107.70 with SMTP id ha6mr22949209wib.20.1439207998558; Mon, 10 Aug 2015 04:59:58 -0700 (PDT) Received: from localhost.localdomain (host-92-13-246-184.as43234.net. [92.13.246.184]) by smtp.gmail.com with ESMTPSA id hn2sm29105790wjc.45.2015.08.10.04.59.57 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 10 Aug 2015 04:59:57 -0700 (PDT) From: Srinivas Kandagatla To: dri-devel@lists.freedesktop.org, robdclark@gmail.com Cc: David Airlie , linux-kernel@vger.kernel.org, Rob Herring , linux-arm-msm@vger.kernel.org, Srinivas Kandagatla Subject: [PATCH RFC 5/5] drm/msm/hdmi: remove _clk suffix from clock names. Date: Mon, 10 Aug 2015 12:59:56 +0100 Message-Id: <1439207996-31028-1-git-send-email-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1439207923-30812-1-git-send-email-srinivas.kandagatla@linaro.org> References: <1439207923-30812-1-git-send-email-srinivas.kandagatla@linaro.org> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: srinivas.kandagatla@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.169 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , This patch modifies the driver to support clock names without _clk suffix, usage of clk names with _clk suffix seems to be non-standard and picked up everytime in DT patch review. So lets fix this and make the other clk names deprecated till we decide to remove them forever. Signed-off-by: Srinivas Kandagatla --- drivers/gpu/drm/msm/hdmi/hdmi.c | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.c b/drivers/gpu/drm/msm/hdmi/hdmi.c index e918889..c454d32 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi.c @@ -69,6 +69,24 @@ static void hdmi_destroy(struct hdmi *hdmi) platform_set_drvdata(hdmi->pdev, NULL); } +static struct clk *hdmi_clk_get(struct device *dev, const char *id) +{ + char clk_name[32]; + struct clk *clk; + + snprintf(clk_name, sizeof(clk_name), "%s_clk", id); + clk = devm_clk_get(dev, clk_name); + if (IS_ERR(clk)) { + clk = devm_clk_get(dev, id); + if (IS_ERR(clk)) + return ERR_CAST(clk); + } else { + dev_warn(dev, "binding deprecated for %s\n", clk_name); + } + + return clk; +} + /* construct hdmi at bind/probe time, grab all the resources. If * we are to EPROBE_DEFER we want to do it here, rather than later * at modeset_init() time @@ -158,7 +176,7 @@ static struct hdmi *hdmi_init(struct platform_device *pdev) for (i = 0; i < config->hpd_clk_cnt; i++) { struct clk *clk; - clk = devm_clk_get(&pdev->dev, config->hpd_clk_names[i]); + clk = hdmi_clk_get(&pdev->dev, config->hpd_clk_names[i]); if (IS_ERR(clk)) { ret = PTR_ERR(clk); dev_err(&pdev->dev, "failed to get hpd clk: %s (%d)\n", @@ -175,10 +193,11 @@ static struct hdmi *hdmi_init(struct platform_device *pdev) ret = -ENOMEM; goto fail; } + for (i = 0; i < config->pwr_clk_cnt; i++) { struct clk *clk; - clk = devm_clk_get(&pdev->dev, config->pwr_clk_names[i]); + clk = hdmi_clk_get(&pdev->dev, config->pwr_clk_names[i]); if (IS_ERR(clk)) { ret = PTR_ERR(clk); dev_err(&pdev->dev, "failed to get pwr clk: %s (%d)\n", @@ -296,7 +315,7 @@ static struct hdmi_platform_config hdmi_tx_8660_config = { }; static const char *hpd_reg_names_8960[] = {"core-vdda", "hdmi-mux"}; -static const char *hpd_clk_names_8960[] = {"core_clk", "master_iface_clk", "slave_iface_clk"}; +static const char *hpd_clk_names_8960[] = {"core", "master_iface", "slave_iface"}; static struct hdmi_platform_config hdmi_tx_8960_config = { .phy_init = hdmi_phy_8960_init, @@ -306,8 +325,8 @@ static struct hdmi_platform_config hdmi_tx_8960_config = { static const char *pwr_reg_names_8x74[] = {"core-vdda", "core-vcc"}; static const char *hpd_reg_names_8x74[] = {"hpd-gdsc", "hpd-5v"}; -static const char *pwr_clk_names_8x74[] = {"extp_clk", "alt_iface_clk"}; -static const char *hpd_clk_names_8x74[] = {"iface_clk", "core_clk", "mdp_core_clk"}; +static const char *pwr_clk_names_8x74[] = {"extp", "alt_iface"}; +static const char *hpd_clk_names_8x74[] = {"iface", "core", "mdp_core"}; static unsigned long hpd_clk_freq_8x74[] = {0, 19200000, 0}; static struct hdmi_platform_config hdmi_tx_8074_config = {