From patchwork Thu Feb 15 20:45:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jordan Crouse X-Patchwork-Id: 10223521 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 9FE74601D7 for ; Thu, 15 Feb 2018 20:45:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8E8612873C for ; Thu, 15 Feb 2018 20:45:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 80FEE28A33; Thu, 15 Feb 2018 20:45:52 +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.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID 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 A94D72873C for ; Thu, 15 Feb 2018 20:45:51 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6E4066E559; Thu, 15 Feb 2018 20:45:50 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from smtp.codeaurora.org (smtp.codeaurora.org [198.145.29.96]) by gabe.freedesktop.org (Postfix) with ESMTPS id E08F56E559; Thu, 15 Feb 2018 20:45:49 +0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 1000) id C6B6C6079C; Thu, 15 Feb 2018 20:45:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1518727549; bh=fJmweUI9WhbQUc16whL1QLBQj/C6l9LNtPYa3WUBxNY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=B8y4hFkeb2FjDrW/ytSpS/b5ZSmjEPhdi7tkwPzuf7paGLjQkv6dDBPVzQNRkB8Vx KRjZ3OhegFusQfmucNoDCwzYKD8VZuTzKL/ytRuisCYSSZxbx5OfUtLlJmnSKDQBOF vVcwLwSgb+wGdVF6/+kU9dUW/kXpHoNMtZpPxs/4= Received: from jcrouse-lnx.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: jcrouse@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 3353360386; Thu, 15 Feb 2018 20:45:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1518727549; bh=fJmweUI9WhbQUc16whL1QLBQj/C6l9LNtPYa3WUBxNY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=B8y4hFkeb2FjDrW/ytSpS/b5ZSmjEPhdi7tkwPzuf7paGLjQkv6dDBPVzQNRkB8Vx KRjZ3OhegFusQfmucNoDCwzYKD8VZuTzKL/ytRuisCYSSZxbx5OfUtLlJmnSKDQBOF vVcwLwSgb+wGdVF6/+kU9dUW/kXpHoNMtZpPxs/4= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 3353360386 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=jcrouse@codeaurora.org From: Jordan Crouse To: seanpaul@chromium.org Subject: [PATCH] drm/msm/dpu: Remove unused code and move the header Date: Thu, 15 Feb 2018 13:45:35 -0700 Message-Id: <20180215204535.29510-1-jcrouse@codeaurora.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180215201512.GD25422@jcrouse-lnx.qualcomm.com> References: <20180215201512.GD25422@jcrouse-lnx.qualcomm.com> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: freedreno@lists.freedesktop.org, jeykumar@quicinc.com, linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, nganji@quicinc.com, abhinavk@quicinc.com, airlied@redhat.com, hoegsberg@chromium.org, mkavm@quicinc.com, chandanu@quicinc.com MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Remove unused code from dpu_io_util.c. The functions are only used inside of the msm driver so remove the EXPORT_SYMBOL tags and move the header dpu_io_util.h from include/linux. Signed-off-by: Jordan Crouse Reviewed-by: Rob Clark --- drivers/gpu/drm/msm/dp/dp_parser.h | 2 +- drivers/gpu/drm/msm/dpu_io_util.c | 154 ++------------------- .../linux => drivers/gpu/drm/msm}/dpu_io_util.h | 10 -- drivers/gpu/drm/msm/dpu_power_handle.c | 1 - drivers/gpu/drm/msm/dpu_power_handle.h | 2 +- drivers/gpu/drm/msm/dpu_rsc_priv.h | 1 - drivers/gpu/drm/msm/msm_drv.h | 1 - 7 files changed, 14 insertions(+), 157 deletions(-) rename {include/linux => drivers/gpu/drm/msm}/dpu_io_util.h (86%) diff --git a/drivers/gpu/drm/msm/dp/dp_parser.h b/drivers/gpu/drm/msm/dp/dp_parser.h index a9cfd03fa5ed..703acb010c8b 100644 --- a/drivers/gpu/drm/msm/dp/dp_parser.h +++ b/drivers/gpu/drm/msm/dp/dp_parser.h @@ -15,7 +15,7 @@ #ifndef _DP_PARSER_H_ #define _DP_PARSER_H_ -#include +#include "dpu_io_util.h" #define DP_LABEL "MDSS DP DISPLAY" #define AUX_CFG_LEN 10 diff --git a/drivers/gpu/drm/msm/dpu_io_util.c b/drivers/gpu/drm/msm/dpu_io_util.c index a18bc992c136..f39ae38e4cfa 100644 --- a/drivers/gpu/drm/msm/dpu_io_util.c +++ b/drivers/gpu/drm/msm/dpu_io_util.c @@ -16,9 +16,9 @@ #include #include #include -#include -#define MAX_I2C_CMDS 16 +#include "dpu_io_util.h" + void dss_reg_w(struct dss_io_data *io, u32 offset, u32 value, u32 debug) { u32 in_val; @@ -42,8 +42,7 @@ void dss_reg_w(struct dss_io_data *io, u32 offset, u32 value, u32 debug) (u32)(unsigned long)(io->base + offset), value, in_val); } -} /* dss_reg_w */ -EXPORT_SYMBOL(dss_reg_w); +} u32 dss_reg_r(struct dss_io_data *io, u32 offset, u32 debug) { @@ -67,30 +66,7 @@ u32 dss_reg_r(struct dss_io_data *io, u32 offset, u32 debug) (u32)(unsigned long)(io->base + offset), value); return value; -} /* dss_reg_r */ -EXPORT_SYMBOL(dss_reg_r); - -void dss_reg_dump(void __iomem *base, u32 length, const char *prefix, - u32 debug) -{ - if (debug) - print_hex_dump(KERN_INFO, prefix, DUMP_PREFIX_OFFSET, 32, 4, - (void *)base, length, false); -} /* dss_reg_dump */ -EXPORT_SYMBOL(dss_reg_dump); - -static struct resource *msm_dss_get_res_byname(struct platform_device *pdev, - unsigned int type, const char *name) -{ - struct resource *res = NULL; - - res = platform_get_resource_byname(pdev, type, name); - if (!res) - DEV_ERR("%s: '%s' resource not found\n", __func__, name); - - return res; -} /* msm_dss_get_res_byname */ -EXPORT_SYMBOL(msm_dss_get_res_byname); +} int msm_dss_ioremap_byname(struct platform_device *pdev, struct dss_io_data *io_data, const char *name) @@ -103,7 +79,7 @@ int msm_dss_ioremap_byname(struct platform_device *pdev, return -EINVAL; } - res = msm_dss_get_res_byname(pdev, IORESOURCE_MEM, name); + res = platform_get_resource_byname(pdev, IORESOURCE_MEM, name); if (!res) { DEV_ERR("%pS->%s: '%s' msm_dss_get_res_byname failed\n", __builtin_return_address(0), __func__, name); @@ -119,8 +95,7 @@ int msm_dss_ioremap_byname(struct platform_device *pdev, } return 0; -} /* msm_dss_ioremap_byname */ -EXPORT_SYMBOL(msm_dss_ioremap_byname); +} void msm_dss_iounmap(struct dss_io_data *io_data) { @@ -135,8 +110,7 @@ void msm_dss_iounmap(struct dss_io_data *io_data) io_data->base = NULL; } io_data->len = 0; -} /* msm_dss_iounmap */ -EXPORT_SYMBOL(msm_dss_iounmap); +} int msm_dss_config_vreg(struct device *dev, struct dss_vreg *in_vreg, int num_vreg, int config) @@ -211,8 +185,7 @@ if (type == DSS_REG_LDO) goto vreg_unconfig; } return rc; -} /* msm_dss_config_vreg */ -EXPORT_SYMBOL(msm_dss_config_vreg); +} int msm_dss_enable_vreg(struct dss_vreg *in_vreg, int num_vreg, int enable) { @@ -283,48 +256,7 @@ int msm_dss_enable_vreg(struct dss_vreg *in_vreg, int num_vreg, int enable) } return rc; -} /* msm_dss_enable_vreg */ -EXPORT_SYMBOL(msm_dss_enable_vreg); - -int msm_dss_enable_gpio(struct dss_gpio *in_gpio, int num_gpio, int enable) -{ - int i = 0, rc = 0; - - if (enable) { - for (i = 0; i < num_gpio; i++) { - DEV_DBG("%pS->%s: %s enable\n", - __builtin_return_address(0), __func__, - in_gpio[i].gpio_name); - - rc = gpio_request(in_gpio[i].gpio, - in_gpio[i].gpio_name); - if (rc < 0) { - DEV_ERR("%pS->%s: %s enable failed\n", - __builtin_return_address(0), __func__, - in_gpio[i].gpio_name); - goto disable_gpio; - } - gpio_set_value(in_gpio[i].gpio, in_gpio[i].value); - } - } else { - for (i = num_gpio-1; i >= 0; i--) { - DEV_DBG("%pS->%s: %s disable\n", - __builtin_return_address(0), __func__, - in_gpio[i].gpio_name); - if (in_gpio[i].gpio) - gpio_free(in_gpio[i].gpio); - } - } - return rc; - -disable_gpio: - for (i--; i >= 0; i--) - if (in_gpio[i].gpio) - gpio_free(in_gpio[i].gpio); - - return rc; -} /* msm_dss_enable_gpio */ -EXPORT_SYMBOL(msm_dss_enable_gpio); +} void msm_dss_put_clk(struct dss_clk *clk_arry, int num_clk) { @@ -335,8 +267,7 @@ void msm_dss_put_clk(struct dss_clk *clk_arry, int num_clk) clk_put(clk_arry[i].clk); clk_arry[i].clk = NULL; } -} /* msm_dss_put_clk */ -EXPORT_SYMBOL(msm_dss_put_clk); +} int msm_dss_get_clk(struct device *dev, struct dss_clk *clk_arry, int num_clk) { @@ -363,8 +294,7 @@ int msm_dss_get_clk(struct device *dev, struct dss_clk *clk_arry, int num_clk) } return rc; -} /* msm_dss_get_clk */ -EXPORT_SYMBOL(msm_dss_get_clk); +} int msm_dss_clk_set_rate(struct dss_clk *clk_arry, int num_clk) { @@ -397,8 +327,7 @@ int msm_dss_clk_set_rate(struct dss_clk *clk_arry, int num_clk) } return rc; -} /* msm_dss_clk_set_rate */ -EXPORT_SYMBOL(msm_dss_clk_set_rate); +} int msm_dss_enable_clk(struct dss_clk *clk_arry, int num_clk, int enable) { @@ -445,63 +374,4 @@ int msm_dss_enable_clk(struct dss_clk *clk_arry, int num_clk, int enable) } return rc; -} /* msm_dss_enable_clk */ -EXPORT_SYMBOL(msm_dss_enable_clk); - - -int dpu_i2c_byte_read(struct i2c_client *client, uint8_t slave_addr, - uint8_t reg_offset, uint8_t *read_buf) -{ - struct i2c_msg msgs[2]; - int ret = -1; - - pr_debug("%s: reading from slave_addr=[%x] and offset=[%x]\n", - __func__, slave_addr, reg_offset); - - msgs[0].addr = slave_addr >> 1; - msgs[0].flags = 0; - msgs[0].buf = ®_offset; - msgs[0].len = 1; - - msgs[1].addr = slave_addr >> 1; - msgs[1].flags = I2C_M_RD; - msgs[1].buf = read_buf; - msgs[1].len = 1; - - ret = i2c_transfer(client->adapter, msgs, 2); - if (ret < 1) { - pr_err("%s: I2C READ FAILED=[%d]\n", __func__, ret); - return -EACCES; - } - pr_debug("%s: i2c buf is [%x]\n", __func__, *read_buf); - return 0; -} -EXPORT_SYMBOL(dpu_i2c_byte_read); - -int dpu_i2c_byte_write(struct i2c_client *client, uint8_t slave_addr, - uint8_t reg_offset, uint8_t *value) -{ - struct i2c_msg msgs[1]; - uint8_t data[2]; - int status = -EACCES; - - pr_debug("%s: writing from slave_addr=[%x] and offset=[%x]\n", - __func__, slave_addr, reg_offset); - - data[0] = reg_offset; - data[1] = *value; - - msgs[0].addr = slave_addr >> 1; - msgs[0].flags = 0; - msgs[0].len = 2; - msgs[0].buf = data; - - status = i2c_transfer(client->adapter, msgs, 1); - if (status < 1) { - pr_err("I2C WRITE FAILED=[%d]\n", status); - return -EACCES; - } - pr_debug("%s: I2C write status=%x\n", __func__, status); - return status; } -EXPORT_SYMBOL(dpu_i2c_byte_write); diff --git a/include/linux/dpu_io_util.h b/drivers/gpu/drm/msm/dpu_io_util.h similarity index 86% rename from include/linux/dpu_io_util.h rename to drivers/gpu/drm/msm/dpu_io_util.h index 7c7389999577..c590bd38e940 100644 --- a/include/linux/dpu_io_util.h +++ b/drivers/gpu/drm/msm/dpu_io_util.h @@ -35,7 +35,6 @@ struct dss_io_data { void dss_reg_w(struct dss_io_data *io, u32 offset, u32 value, u32 debug); u32 dss_reg_r(struct dss_io_data *io, u32 offset, u32 debug); -void dss_reg_dump(void __iomem *base, u32 len, const char *prefix, u32 debug); #define DSS_REG_W_ND(io, offset, val) dss_reg_w(io, offset, val, false) #define DSS_REG_W(io, offset, val) dss_reg_w(io, offset, val, true) @@ -69,7 +68,6 @@ struct dss_gpio { enum dss_clk_type { DSS_CLK_AHB, /* no set rate. rate controlled through rpm */ DSS_CLK_PCLK, - DSS_CLK_OTHER, }; struct dss_clk { @@ -93,9 +91,6 @@ int msm_dss_ioremap_byname(struct platform_device *pdev, struct dss_io_data *io_data, const char *name); void msm_dss_iounmap(struct dss_io_data *io_data); -int msm_dss_enable_gpio(struct dss_gpio *in_gpio, int num_gpio, int enable); -int msm_dss_gpio_enable(struct dss_gpio *in_gpio, int num_gpio, int enable); - int msm_dss_config_vreg(struct device *dev, struct dss_vreg *in_vreg, int num_vreg, int config); int msm_dss_enable_vreg(struct dss_vreg *in_vreg, int num_vreg, int enable); @@ -105,9 +100,4 @@ void msm_dss_put_clk(struct dss_clk *clk_arry, int num_clk); int msm_dss_clk_set_rate(struct dss_clk *clk_arry, int num_clk); int msm_dss_enable_clk(struct dss_clk *clk_arry, int num_clk, int enable); -int dpu_i2c_byte_read(struct i2c_client *client, uint8_t slave_addr, - uint8_t reg_offset, uint8_t *read_buf); -int dpu_i2c_byte_write(struct i2c_client *client, uint8_t slave_addr, - uint8_t reg_offset, uint8_t *value); - #endif /* __DPU_IO_UTIL_H__ */ diff --git a/drivers/gpu/drm/msm/dpu_power_handle.c b/drivers/gpu/drm/msm/dpu_power_handle.c index 477ea9f2778c..48c7d1b6072b 100644 --- a/drivers/gpu/drm/msm/dpu_power_handle.c +++ b/drivers/gpu/drm/msm/dpu_power_handle.c @@ -25,7 +25,6 @@ #include #include #endif -#include #include #include "dpu_power_handle.h" diff --git a/drivers/gpu/drm/msm/dpu_power_handle.h b/drivers/gpu/drm/msm/dpu_power_handle.h index 25a00b1589be..5e270becf9a9 100644 --- a/drivers/gpu/drm/msm/dpu_power_handle.h +++ b/drivers/gpu/drm/msm/dpu_power_handle.h @@ -21,7 +21,7 @@ #define DPU_POWER_HANDLE_ENABLE_BUS_IB_QUOTA 1600000000 #define DPU_POWER_HANDLE_DISABLE_BUS_IB_QUOTA 0 -#include +#include "dpu_io_util.h" /* event will be triggered before power handler disable */ #define DPU_POWER_EVENT_PRE_DISABLE 0x1 diff --git a/drivers/gpu/drm/msm/dpu_rsc_priv.h b/drivers/gpu/drm/msm/dpu_rsc_priv.h index b28a339be17a..29751832eeb9 100644 --- a/drivers/gpu/drm/msm/dpu_rsc_priv.h +++ b/drivers/gpu/drm/msm/dpu_rsc_priv.h @@ -15,7 +15,6 @@ #define _DPU_RSC_PRIV_H_ #include -#include #include #include diff --git a/drivers/gpu/drm/msm/msm_drv.h b/drivers/gpu/drm/msm/msm_drv.h index 6c2f24b34fd0..c2b8059eb8ff 100644 --- a/drivers/gpu/drm/msm/msm_drv.h +++ b/drivers/gpu/drm/msm/msm_drv.h @@ -33,7 +33,6 @@ #include #include #include -#include #include #include