Re: [PATCH 2/3] drm/sun4i/sun4i_hdmi_enc: call cec_s_conn_info()

2019-08-28 Thread Maxime Ripard
On Fri, Aug 23, 2019 at 01:24:26PM +0200, Hans Verkuil wrote:
> Set the connector info for the CEC adapter. This helps
> userspace to associate the CEC device with the HDMI connector.
>
> Tested on a Cubieboard.
>
> Signed-off-by: Hans Verkuil 
> Tested-by: Hans Verkuil 

Acked-by: Maxime Ripard 

Thanks!
Maxime

--
Maxime Ripard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com


signature.asc
Description: PGP signature
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

[PATCH 2/3] drm/sun4i/sun4i_hdmi_enc: call cec_s_conn_info()

2019-08-25 Thread Hans Verkuil
Set the connector info for the CEC adapter. This helps
userspace to associate the CEC device with the HDMI connector.

Tested on a Cubieboard.

Signed-off-by: Hans Verkuil 
Tested-by: Hans Verkuil 
---
 drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c 
b/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c
index 9c3f99339b82..22f082c32e1f 100644
--- a/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c
+++ b/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c
@@ -489,6 +489,7 @@ static int sun4i_hdmi_bind(struct device *dev, struct 
device *master,
 {
struct platform_device *pdev = to_platform_device(dev);
struct drm_device *drm = data;
+   struct cec_connector_info conn_info;
struct sun4i_drv *drv = drm->dev_private;
struct sun4i_hdmi *hdmi;
struct resource *res;
@@ -628,8 +629,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(_hdmi_cec_pin_ops,
-   hdmi, "sun4i", CEC_CAP_TRANSMIT | CEC_CAP_LOG_ADDRS |
-   CEC_CAP_PASSTHROUGH | CEC_CAP_RC);
+   hdmi, "sun4i", CEC_CAP_DEFAULTS | CEC_CAP_CONNECTOR_INFO);
ret = PTR_ERR_OR_ZERO(hdmi->cec_adap);
if (ret < 0)
goto err_cleanup_connector;
@@ -647,6 +647,8 @@ static int sun4i_hdmi_bind(struct device *dev, struct 
device *master,
"Couldn't initialise the HDMI connector\n");
goto err_cleanup_connector;
}
+   cec_fill_conn_info_from_drm(_info, >connector);
+   cec_s_conn_info(hdmi->cec_adap, _info);
 
/* There is no HPD interrupt, so we need to poll the controller */
hdmi->connector.polled = DRM_CONNECTOR_POLL_CONNECT |
-- 
2.20.1

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel