aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2017-11-23 14:57:52 +0100
committerHans Verkuil <hans.verkuil@cisco.com>2017-12-01 18:11:23 +0100
commitffb7ca6d3a2b7ac8499f98796d529d670f48fb5c (patch)
tree11e59aa0674b67eaa7fa6352d431a3e81b70c0a5
parent2e15d5285ebc414bf477c38c2962a1d6d3ae8cff (diff)
sun4i_hdmi_enc: support CEC error injectioncubie
The cec pin framework now supports error injection and since this driver is based on that framework allow this to be enabled. Also use CEC_CAP_DEFAULTS to simplify cec_pin_allocate_adapter. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
-rw-r--r--drivers/gpu/drm/sun4i/Kconfig7
-rw-r--r--drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c6
2 files changed, 11 insertions, 2 deletions
diff --git a/drivers/gpu/drm/sun4i/Kconfig b/drivers/gpu/drm/sun4i/Kconfig
index 882d85db9053..99b9183c2780 100644
--- a/drivers/gpu/drm/sun4i/Kconfig
+++ b/drivers/gpu/drm/sun4i/Kconfig
@@ -31,6 +31,13 @@ config DRM_SUN4I_HDMI_CEC
Choose this option if you have an Allwinner SoC with an HDMI
controller and want to use CEC.
+config DRM_SUN4I_HDMI_CEC_ERROR_INJ
+ bool "Enable CEC error injection support"
+ depends on DRM_SUN4I_HDMI_CEC && DEBUG_FS
+ select CEC_PIN_ERROR_INJ
+ ---help---
+ This option enables CEC error injection using debugfs.
+
config DRM_SUN4I_BACKEND
tristate "Support for Allwinner A10 Display Engine Backend"
default DRM_SUN4I
diff --git a/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c b/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c
index dc2f550f54ff..6d19d2ac68d1 100644
--- a/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c
+++ b/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c
@@ -583,8 +583,7 @@ static int sun4i_hdmi_bind(struct device *dev, struct device *master,
#ifdef CONFIG_DRM_SUN4I_HDMI_CEC
hdmi->cec_adap = cec_pin_allocate_adapter(&sun4i_hdmi_cec_pin_ops,
- hdmi, "sun4i", CEC_CAP_TRANSMIT | CEC_CAP_LOG_ADDRS |
- CEC_CAP_PASSTHROUGH | CEC_CAP_RC);
+ hdmi, "sun4i", CEC_CAP_DEFAULTS);
ret = PTR_ERR_OR_ZERO(hdmi->cec_adap);
if (ret < 0)
goto err_cleanup_connector;
@@ -610,6 +609,9 @@ static int sun4i_hdmi_bind(struct device *dev, struct device *master,
ret = cec_register_adapter(hdmi->cec_adap, dev);
if (ret < 0)
goto err_cleanup_connector;
+#ifdef CONFIG_DRM_SUN4I_HDMI_CEC_ERROR_INJ
+ cec_pin_enable_error_inj(hdmi->cec_adap);
+#endif
drm_mode_connector_attach_encoder(&hdmi->connector, &hdmi->encoder);
return 0;

Privacy Policy