[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <71e74aa8ff84a2f0b879c46a63d5f51f6d808348.1597833138.git.mchehab+huawei@kernel.org>
Date: Wed, 19 Aug 2020 13:45:38 +0200
From: Mauro Carvalho Chehab <mchehab+huawei@...nel.org>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: linuxarm@...wei.com, mauro.chehab@...wei.com,
Xiubin Zhang <zhangxiubin1@...wei.com>,
Mauro Carvalho Chehab <mchehab+huawei@...nel.org>,
John Stultz <john.stultz@...aro.org>,
Manivannan Sadhasivam <mani@...nel.org>,
Daniel Vetter <daniel@...ll.ch>,
dri-devel <dri-devel@...ts.freedesktop.org>,
Andrzej Hajda <a.hajda@...sung.com>,
Laurent Pinchart <laurent.pinchart@...asonboard.com>,
Neil Armstrong <narmstrong@...libre.com>,
Bogdan Togorean <bogdan.togorean@...log.com>,
Rob Clark <robdclark@...omium.org>,
Laurentiu Palcu <laurentiu.palcu@....com>,
Liwei Cai <cailiwei@...ilicon.com>,
Chen Feng <puck.chen@...ilicon.com>,
devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org
Subject: [PATCH 10/49] staging: hikey9xx/gpu: add debug prints for this driver
From: Xiubin Zhang <zhangxiubin1@...wei.com>
Add some debug prints on adv7535 and kirin_drm_drv.
Signed-off-by: Xiubin Zhang <zhangxiubin1@...wei.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@...nel.org>
---
drivers/staging/hikey9xx/gpu/hdmi/adv7535.c | 40 ++++++++++++++++++--
drivers/staging/hikey9xx/gpu/kirin_drm_drv.c | 2 +-
2 files changed, 37 insertions(+), 5 deletions(-)
diff --git a/drivers/staging/hikey9xx/gpu/hdmi/adv7535.c b/drivers/staging/hikey9xx/gpu/hdmi/adv7535.c
index a21a8f8b917e..04c1e7b9ca8e 100644
--- a/drivers/staging/hikey9xx/gpu/hdmi/adv7535.c
+++ b/drivers/staging/hikey9xx/gpu/hdmi/adv7535.c
@@ -28,7 +28,8 @@
#include "adv7535.h"
-#define HPD_ENABLE 1
+//#define HPD_ENABLE 1
+#define HPD_ENABLE 0
//#define TEST_COLORBAR_DISPLAY
#ifdef CONFIG_HDMI_ADV7511_AUDIO
extern int adv7511_audio_init(struct device *dev);
@@ -785,19 +786,25 @@ adv7511_detect(struct adv7511 *adv7511,
{
enum drm_connector_status status;
unsigned int val;
+ unsigned int time = 0;
#if HPD_ENABLE
bool hpd;
#endif
int ret;
ret = regmap_read(adv7511->regmap, ADV7511_REG_STATUS, &val);
- if (ret < 0)
+ if (ret < 0) {
+ DRM_ERROR("regmap_read fail, ret = %d \n", ret);
return connector_status_disconnected;
+ }
- if (val & ADV7511_STATUS_HPD)
+ if (val & ADV7511_STATUS_HPD) {
+ DRM_INFO("connected : regmap_read val = 0x%x \n", val);
status = connector_status_connected;
- else
+ } else {
+ DRM_INFO("disconnected : regmap_read val = 0x%x \n", val);
status = connector_status_disconnected;
+ }
#if HPD_ENABLE
hpd = adv7511_hpd(adv7511);
@@ -820,7 +827,32 @@ adv7511_detect(struct adv7511 *adv7511,
}
#endif
+ if (status == connector_status_disconnected) {
+ do {
+ ret = regmap_read(adv7511->regmap, ADV7511_REG_STATUS, &val);
+ if (ret < 0) {
+ DRM_ERROR("regmap_read fail, ret = %d \n", ret);
+ return connector_status_disconnected;
+ }
+
+ if (val & ADV7511_STATUS_HPD) {
+ DRM_INFO("connected : regmap_read val = 0x%x \n", val);
+ status = connector_status_connected;
+ } else {
+ DRM_INFO("disconnected : regmap_read val = 0x%x \n", val);
+ status = connector_status_disconnected;
+ }
+ time ++;
+ mdelay(20);
+ } while (status == connector_status_disconnected && time < 10);
+ }
+
+ if (time >= 10)
+ DRM_ERROR("Read connector status timout, time = %d \n", time);
+
adv7511->status = status;
+
+ DRM_INFO("hdmi connector status = %d \n", status);
return status;
}
diff --git a/drivers/staging/hikey9xx/gpu/kirin_drm_drv.c b/drivers/staging/hikey9xx/gpu/kirin_drm_drv.c
index 958aafa1a09c..ec1f668f2d21 100644
--- a/drivers/staging/hikey9xx/gpu/kirin_drm_drv.c
+++ b/drivers/staging/hikey9xx/gpu/kirin_drm_drv.c
@@ -144,7 +144,7 @@ static int kirin_drm_kms_init(struct drm_device *dev)
/* init kms poll for handling hpd */
drm_kms_helper_poll_init(dev);
-#if 0
+#if 1
/* force detection after connectors init */
(void)drm_helper_hpd_irq_event(dev);
#endif
--
2.26.2
Powered by blists - more mailing lists