From: Hans Verkuil <hverkuil-cisco@xs4all.nl> To: linux-media@vger.kernel.org Cc: Dariusz Marcinkiewicz <darekm@google.com>, dri-devel@lists.freedesktop.org, Cheng-yi Chiang <cychiang@chromium.org>, Hans Verkuil <hverkuil-cisco@xs4all.nl> Subject: [PATCHv8 13/13] drm/vc4/vc4_hdmi: fill in connector info Date: Mon, 24 Jun 2019 18:03:30 +0200 [thread overview] Message-ID: <20190624160330.38048-14-hverkuil-cisco@xs4all.nl> (raw) In-Reply-To: <20190624160330.38048-1-hverkuil-cisco@xs4all.nl> From: Dariusz Marcinkiewicz <darekm@google.com> Fill in the connector info, allowing userspace to associate the CEC device with the drm connector. Signed-off-by: Dariusz Marcinkiewicz <darekm@google.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> --- drivers/gpu/drm/vc4/vc4_hdmi.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c index 99fc8569e0f5..a998bb35b375 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -1279,6 +1279,9 @@ static const struct cec_adap_ops vc4_hdmi_cec_adap_ops = { static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data) { +#ifdef CONFIG_DRM_VC4_HDMI_CEC + struct cec_connector_info conn_info; +#endif struct platform_device *pdev = to_platform_device(dev); struct drm_device *drm = dev_get_drvdata(master); struct vc4_dev *vc4 = drm->dev_private; @@ -1397,13 +1400,15 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data) #ifdef CONFIG_DRM_VC4_HDMI_CEC hdmi->cec_adap = cec_allocate_adapter(&vc4_hdmi_cec_adap_ops, vc4, "vc4", - CEC_CAP_TRANSMIT | - CEC_CAP_LOG_ADDRS | - CEC_CAP_PASSTHROUGH | - CEC_CAP_RC, 1); + CEC_CAP_DEFAULTS | + CEC_CAP_CONNECTOR_INFO, 1); ret = PTR_ERR_OR_ZERO(hdmi->cec_adap); if (ret < 0) goto err_destroy_conn; + + cec_fill_conn_info_from_drm(&conn_info, hdmi->connector); + cec_s_conn_info(hdmi->cec_adap, &conn_info); + HDMI_WRITE(VC4_HDMI_CPU_MASK_SET, 0xffffffff); value = HDMI_READ(VC4_HDMI_CEC_CNTRL_1); value &= ~VC4_HDMI_CEC_DIV_CLK_CNT_MASK; -- 2.20.1
WARNING: multiple messages have this Message-ID (diff)
From: Hans Verkuil <hverkuil-cisco@xs4all.nl> To: linux-media@vger.kernel.org Cc: Hans Verkuil <hverkuil-cisco@xs4all.nl>, Dariusz Marcinkiewicz <darekm@google.com>, dri-devel@lists.freedesktop.org, Cheng-yi Chiang <cychiang@chromium.org> Subject: [PATCHv8 13/13] drm/vc4/vc4_hdmi: fill in connector info Date: Mon, 24 Jun 2019 18:03:30 +0200 [thread overview] Message-ID: <20190624160330.38048-14-hverkuil-cisco@xs4all.nl> (raw) In-Reply-To: <20190624160330.38048-1-hverkuil-cisco@xs4all.nl> From: Dariusz Marcinkiewicz <darekm@google.com> Fill in the connector info, allowing userspace to associate the CEC device with the drm connector. Signed-off-by: Dariusz Marcinkiewicz <darekm@google.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> --- drivers/gpu/drm/vc4/vc4_hdmi.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c index 99fc8569e0f5..a998bb35b375 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -1279,6 +1279,9 @@ static const struct cec_adap_ops vc4_hdmi_cec_adap_ops = { static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data) { +#ifdef CONFIG_DRM_VC4_HDMI_CEC + struct cec_connector_info conn_info; +#endif struct platform_device *pdev = to_platform_device(dev); struct drm_device *drm = dev_get_drvdata(master); struct vc4_dev *vc4 = drm->dev_private; @@ -1397,13 +1400,15 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data) #ifdef CONFIG_DRM_VC4_HDMI_CEC hdmi->cec_adap = cec_allocate_adapter(&vc4_hdmi_cec_adap_ops, vc4, "vc4", - CEC_CAP_TRANSMIT | - CEC_CAP_LOG_ADDRS | - CEC_CAP_PASSTHROUGH | - CEC_CAP_RC, 1); + CEC_CAP_DEFAULTS | + CEC_CAP_CONNECTOR_INFO, 1); ret = PTR_ERR_OR_ZERO(hdmi->cec_adap); if (ret < 0) goto err_destroy_conn; + + cec_fill_conn_info_from_drm(&conn_info, hdmi->connector); + cec_s_conn_info(hdmi->cec_adap, &conn_info); + HDMI_WRITE(VC4_HDMI_CPU_MASK_SET, 0xffffffff); value = HDMI_READ(VC4_HDMI_CEC_CNTRL_1); value &= ~VC4_HDMI_CEC_DIV_CLK_CNT_MASK; -- 2.20.1 _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2019-06-24 16:03 UTC|newest] Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top 2019-06-24 16:03 [PATCHv8 00/13] cec: improve notifier support, add connector info Hans Verkuil 2019-06-24 16:03 ` Hans Verkuil 2019-06-24 16:03 ` [PATCHv8 01/13] cec-notifier: rename variable, check kstrdup Hans Verkuil 2019-06-24 16:03 ` Hans Verkuil 2019-06-25 7:07 ` [PATCHv8.1 01/13] cec-notifier: rename variables, check kstrdup and n->conn_name Hans Verkuil 2019-06-25 7:07 ` Hans Verkuil 2019-06-24 16:03 ` [PATCHv8 02/13] cec: add struct cec_connector_info support Hans Verkuil 2019-06-24 16:03 ` Hans Verkuil 2019-06-25 6:28 ` Hans Verkuil 2019-06-25 6:28 ` Hans Verkuil 2019-06-25 13:19 ` Dariusz Marcinkiewicz 2019-06-25 13:19 ` Dariusz Marcinkiewicz 2019-06-24 16:03 ` [PATCHv8 03/13] cec: add new notifier functions Hans Verkuil 2019-06-24 16:03 ` Hans Verkuil 2019-06-25 13:48 ` Dariusz Marcinkiewicz 2019-06-25 13:48 ` Dariusz Marcinkiewicz 2019-06-25 14:26 ` Hans Verkuil 2019-06-25 14:26 ` Hans Verkuil 2019-06-24 16:03 ` [PATCHv8 04/13] cec: expose the new connector info API Hans Verkuil 2019-06-24 16:03 ` Hans Verkuil 2019-06-25 13:59 ` Dariusz Marcinkiewicz 2019-06-25 13:59 ` Dariusz Marcinkiewicz 2019-06-25 14:28 ` Hans Verkuil 2019-06-25 14:28 ` Hans Verkuil 2019-06-24 16:03 ` [PATCHv8 05/13] cec: document CEC_ADAP_G_CONNECTOR_INFO Hans Verkuil 2019-06-24 16:03 ` Hans Verkuil 2019-06-24 16:03 ` [PATCHv8 06/13] drm_dp_cec: add connector info support Hans Verkuil 2019-06-24 16:03 ` Hans Verkuil 2019-06-24 16:03 ` [PATCHv8 07/13] drm/i915/intel_hdmi: use cec_notifier_conn_(un)register Hans Verkuil 2019-06-24 16:03 ` Hans Verkuil 2019-06-24 16:03 ` [PATCHv8 08/13] dw-hdmi-cec: use cec_notifier_cec_adap_(un)register Hans Verkuil 2019-06-24 16:03 ` Hans Verkuil 2019-06-24 16:03 ` [PATCHv8 09/13] dw-hdmi: use cec_notifier_conn_(un)register Hans Verkuil 2019-06-24 16:03 ` Hans Verkuil 2019-06-25 0:43 ` kbuild test robot 2019-06-25 0:43 ` kbuild test robot 2019-06-24 16:03 ` [PATCHv8 10/13] meson/ao-cec: use cec_notifier_cec_adap_(un)register Hans Verkuil 2019-06-24 16:03 ` Hans Verkuil 2019-06-24 16:03 ` [PATCHv8 11/13] tda9950: " Hans Verkuil 2019-06-24 16:03 ` Hans Verkuil 2019-06-24 16:03 ` [PATCHv8 12/13] tda998x: use cec_notifier_conn_(un)register Hans Verkuil 2019-06-24 16:03 ` Hans Verkuil 2019-06-24 22:37 ` kbuild test robot 2019-06-24 22:37 ` kbuild test robot 2019-06-24 16:03 ` Hans Verkuil [this message] 2019-06-24 16:03 ` [PATCHv8 13/13] drm/vc4/vc4_hdmi: fill in connector info Hans Verkuil
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20190624160330.38048-14-hverkuil-cisco@xs4all.nl \ --to=hverkuil-cisco@xs4all.nl \ --cc=cychiang@chromium.org \ --cc=darekm@google.com \ --cc=dri-devel@lists.freedesktop.org \ --cc=linux-media@vger.kernel.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.