Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753844AbbHJMAI (ORCPT ); Mon, 10 Aug 2015 08:00:08 -0400 Received: from mail-wi0-f177.google.com ([209.85.212.177]:38828 "EHLO mail-wi0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932259AbbHJL77 (ORCPT ); Mon, 10 Aug 2015 07:59:59 -0400 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-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3446 Lines: 90 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 = { -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/