[PATCH 19/49] staging: hikey9xx/gpu: add a copy of set_reg() function there

Mauro Carvalho Chehab mchehab+huawei at kernel.org
Wed Aug 19 11:45:47 UTC 2020


This function has a too generic name to export it as a
symbol. Also, we should likely use some other macro instead.

So, for now, just copy it into the Kirin9xx dsi module, in order
for the driver to build.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei at kernel.org>
---
 .../staging/hikey9xx/gpu/kirin9xx_dw_drm_dsi.c  | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/hikey9xx/gpu/kirin9xx_dw_drm_dsi.c b/drivers/staging/hikey9xx/gpu/kirin9xx_dw_drm_dsi.c
index cfb6bfd1c338..cba81ee2639d 100644
--- a/drivers/staging/hikey9xx/gpu/kirin9xx_dw_drm_dsi.c
+++ b/drivers/staging/hikey9xx/gpu/kirin9xx_dw_drm_dsi.c
@@ -37,7 +37,6 @@
 #else
 #include "kirin960_dpe_reg.h"
 #endif
-#include "kirin9xx_drm_dpe_utils.h"
 #include "kirin9xx_drm_drv.h"
 
 #if defined (CONFIG_DRM_HISI_KIRIN970)
@@ -270,6 +269,22 @@ static const struct dsi_phy_range dphy_range_info[] = {
 	{ 1000000,  1500000,   0,    0 }
 };
 
+/*
+ * Except for debug, this is identical to the one defined at
+ * kirin9xx_drm_dpe_utils.h.
+ */
+static void set_reg(char __iomem *addr, uint32_t val, uint8_t bw,
+		    uint8_t bs)
+{
+	u32 mask = (1UL << bw) - 1UL;
+	u32 tmp = 0;
+
+	tmp = inp32(addr);
+	tmp &= ~(mask << bs);
+
+	outp32(addr, tmp | ((val & mask) << bs));
+}
+
 void dsi_set_output_client(struct drm_device *dev)
 {
 	struct drm_connector_list_iter conn_iter;
-- 
2.26.2



More information about the dri-devel mailing list