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: 6985391 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 884B2C05AC for ; Mon, 10 Aug 2015 15:15:38 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A1A1A2071E for ; Mon, 10 Aug 2015 15:15:37 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id B9A7C2070A for ; Mon, 10 Aug 2015 15:15:36 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 122546E5A1; Mon, 10 Aug 2015 08:15:30 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wi0-f175.google.com (mail-wi0-f175.google.com [209.85.212.175]) by gabe.freedesktop.org (Postfix) with ESMTPS id BDA336E4BB for ; Mon, 10 Aug 2015 04:59:59 -0700 (PDT) Received: by wicja10 with SMTP id ja10so34123775wic.1 for ; Mon, 10 Aug 2015 04:59:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=s5hXg2bf+n0j8y7MhDZ0zoUJOdfUggtz4wnxWhkzT0g=; b=GW0SnRSAIL0wN1pKVxUhL85hw9Omkt8lxuYBzH/iGKj2ANLE9bv+GrQ47PNBVIaz+m sn2R2/VrjX98PzRdd0lRi/CH1WpCGrSd6sqsxOzvcSkmbzlvZn602qVWSP6ggxyoYzUQ Yml2QO5TLCldGklF0FurRUMKkudbWxA1ezL36J056nqYU1pfkM0tgeTNWdceOQ3wVpss N6nRtMkGFH5peG1UTF8/3xGhCrB6+TzJiJi6WYnmhuIW8RqHJI682cehnlhO9ApA4qgi s0wzTLDzCMV4qSxks6X9bUIR4dyrLQ9e/DnZHjM5DaoRChl2eGUpDcvU9LrBrshV2qVk mTFA== X-Gm-Message-State: ALoCoQkmY+ZHk7aaiHoCjGgr7dtX+LH5cJb7Q/2jfWjaGRrb+45RXANRoCMdsve1y30U3nn/Z/4a 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 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> X-Mailman-Approved-At: Mon, 10 Aug 2015 08:15:26 -0700 Cc: linux-arm-msm@vger.kernel.org, Rob Herring , Srinivas Kandagatla , linux-kernel@vger.kernel.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-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 = {