From patchwork Wed Aug 14 10:44:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Dariusz Marcinkiewicz X-Patchwork-Id: 11095231 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id ADBD31823 for ; Thu, 15 Aug 2019 08:35:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9D35D2811A for ; Thu, 15 Aug 2019 08:35:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9122C2861E; Thu, 15 Aug 2019 08:35:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0E3C72872A for ; Thu, 15 Aug 2019 08:35:52 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5EF326E8DD; Thu, 15 Aug 2019 08:34:59 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qt1-x849.google.com (mail-qt1-x849.google.com [IPv6:2607:f8b0:4864:20::849]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0451A6E586 for ; Wed, 14 Aug 2019 10:45:39 +0000 (UTC) Received: by mail-qt1-x849.google.com with SMTP id c22so11449755qta.8 for ; Wed, 14 Aug 2019 03:45:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=whkfqsEcOyHsXcg5UupuMappSEEYC3tS9spKNSQ45vY=; b=Wp11L4fYOLlC9tMBonDTQzXyG5UdDFeFXtAHJ7n6k7hztGbVVY3RRAuZy2q/pBMij4 2TD8HdgeYnQ3yxvnJX/k6dwBAdmCAz7ThlOmJR2l1CKsfxvAwMom+syGyxH8EBvc1r5m 8DTcmhHAqrdIQF3Uf+vdsYGduMn3hp1Sj96dkbkJHAxz/3ZwsmRLZdjweYmMSxVnsQgY qNbd6oUUrraOqktytpki7xa/akrV/BtbaGNdBwfSt9ngVVJEOjOoEIFWioXZVzQP9e4p xh73xXVBVa5qCQ7nIRx61pDHH68XIQ7uECTCqVyc1jRif783E0eYEAJsheyMqQisPSl1 E60w== X-Gm-Message-State: APjAAAXg5Nc0dJK3mnEiFrZ8aiIgyQtOVoV7eCke6DrxgtxXcFumcEeF NrlxTvUMEKL963h7km1uFpaTAmdS1bzODndzyzGMxtccT6kWjocDvZhf7PFQBQhqBvjTtuHfnRA 97AFL649R8XFyDIAI5wHqFuQ1zb56pu0nzsfENo4eCjf59US/pPNOiBh+C8qnar3ndchBjjuxoA == X-Google-Smtp-Source: APXvYqxHlqOydou7FHll2RQCwIW2DiCralOJoGRp5boteOB7sUX3ztNjURofheCSvry1mZkjIGCRSLWNdxc= X-Received: by 2002:a05:620a:1467:: with SMTP id j7mr31340962qkl.445.1565779538812; Wed, 14 Aug 2019 03:45:38 -0700 (PDT) Date: Wed, 14 Aug 2019 12:44:59 +0200 In-Reply-To: <20190814104520.6001-1-darekm@google.com> Message-Id: <20190814104520.6001-2-darekm@google.com> Mime-Version: 1.0 References: <20190814104520.6001-1-darekm@google.com> X-Mailer: git-send-email 2.23.0.rc1.153.gdeed80330f-goog Subject: [PATCH v7 1/9] drm_dp_cec: add connector info support. From: Dariusz Marcinkiewicz To: dri-devel@lists.freedesktop.org, linux-media@vger.kernel.org, hverkuil-cisco@xs4all.nl X-Mailman-Approved-At: Thu, 15 Aug 2019 08:34:55 +0000 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=whkfqsEcOyHsXcg5UupuMappSEEYC3tS9spKNSQ45vY=; b=bFURKDlMw/AD0iK6Imh+IC0s8NWb8bXmrZPtvaG6c1bz3fBGInljs3qd9HxoF9Ladt JxuMf6NxMJZTqlD5i8OLK5nR+443EaeKi2N5kizixGX6djoqUzd5EpMxa5eSFPEJAe1e F0cYGel4XHYwVhpoZSBtSyZCirm3UOdvnH1NW3Izx//VVhd7c8msSJBhR2Yi6am9AUwW KrJZ/jm6UxGC++/jschouG9yFS7G2Yxx48fYdbx3i0s4RbZuKLclurLeFWA2IXLahwHt ht9QXRtE/SZnWYYO3verOc70cvm4BxlJoqyL8FEhJpp5uJ+vUbOJBqLgSg14IUne5hCe nfhQ== X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , nouveau@lists.freedesktop.org, Dhinakaran Pandiyan , Anthony Koo , David Francis , amd-gfx@lists.freedesktop.org, "Jerry \(Fangzhi\) Zuo" , Ben Skeggs , Leo Li , intel-gfx@lists.freedesktop.org, Maxime Ripard , Rodrigo Vivi , Sean Paul , Thomas Lim , linux-kernel@vger.kernel.org, Manasi Navare , Alex Deucher , Dariusz Marcinkiewicz , =?utf-8?q?Christian_K=C3=B6nig?= Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Pass the connector info to the CEC adapter. This makes it possible to associate the CEC adapter with the corresponding drm connector. Signed-off-by: Dariusz Marcinkiewicz Signed-off-by: Hans Verkuil Tested-by: Hans Verkuil Reviewed-by: Lyude Paul Acked-by: Alex Deucher Reviewed-by: Ben Skeggs Reviewed-by: Ville Syrjälä --- .../display/amdgpu_dm/amdgpu_dm_mst_types.c | 2 +- drivers/gpu/drm/drm_dp_cec.c | 25 ++++++++++++------- drivers/gpu/drm/i915/display/intel_dp.c | 4 +-- drivers/gpu/drm/nouveau/nouveau_connector.c | 3 +-- include/drm/drm_dp_helper.h | 17 ++++++------- 5 files changed, 27 insertions(+), 24 deletions(-) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c index 16218a202b591..5ec14efd4d8cb 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c @@ -416,7 +416,7 @@ void amdgpu_dm_initialize_dp_connector(struct amdgpu_display_manager *dm, drm_dp_aux_register(&aconnector->dm_dp_aux.aux); drm_dp_cec_register_connector(&aconnector->dm_dp_aux.aux, - aconnector->base.name, dm->adev->dev); + &aconnector->base); aconnector->mst_mgr.cbs = &dm_mst_cbs; drm_dp_mst_topology_mgr_init( &aconnector->mst_mgr, diff --git a/drivers/gpu/drm/drm_dp_cec.c b/drivers/gpu/drm/drm_dp_cec.c index b15cee85b702b..b457c16c3a8bb 100644 --- a/drivers/gpu/drm/drm_dp_cec.c +++ b/drivers/gpu/drm/drm_dp_cec.c @@ -8,7 +8,9 @@ #include #include #include +#include #include +#include #include /* @@ -295,7 +297,10 @@ static void drm_dp_cec_unregister_work(struct work_struct *work) */ void drm_dp_cec_set_edid(struct drm_dp_aux *aux, const struct edid *edid) { - u32 cec_caps = CEC_CAP_DEFAULTS | CEC_CAP_NEEDS_HPD; + struct drm_connector *connector = aux->cec.connector; + u32 cec_caps = CEC_CAP_DEFAULTS | CEC_CAP_NEEDS_HPD | + CEC_CAP_CONNECTOR_INFO; + struct cec_connector_info conn_info; unsigned int num_las = 1; u8 cap; @@ -344,13 +349,17 @@ void drm_dp_cec_set_edid(struct drm_dp_aux *aux, const struct edid *edid) /* Create a new adapter */ aux->cec.adap = cec_allocate_adapter(&drm_dp_cec_adap_ops, - aux, aux->cec.name, cec_caps, + aux, connector->name, cec_caps, num_las); if (IS_ERR(aux->cec.adap)) { aux->cec.adap = NULL; goto unlock; } - if (cec_register_adapter(aux->cec.adap, aux->cec.parent)) { + + cec_fill_conn_info_from_drm(&conn_info, connector); + cec_s_conn_info(aux->cec.adap, &conn_info); + + if (cec_register_adapter(aux->cec.adap, connector->dev->dev)) { cec_delete_adapter(aux->cec.adap); aux->cec.adap = NULL; } else { @@ -406,22 +415,20 @@ EXPORT_SYMBOL(drm_dp_cec_unset_edid); /** * drm_dp_cec_register_connector() - register a new connector * @aux: DisplayPort AUX channel - * @name: name of the CEC device - * @parent: parent device + * @connector: drm connector * * A new connector was registered with associated CEC adapter name and * CEC adapter parent device. After registering the name and parent * drm_dp_cec_set_edid() is called to check if the connector supports * CEC and to register a CEC adapter if that is the case. */ -void drm_dp_cec_register_connector(struct drm_dp_aux *aux, const char *name, - struct device *parent) +void drm_dp_cec_register_connector(struct drm_dp_aux *aux, + struct drm_connector *connector) { WARN_ON(aux->cec.adap); if (WARN_ON(!aux->transfer)) return; - aux->cec.name = name; - aux->cec.parent = parent; + aux->cec.connector = connector; INIT_DELAYED_WORK(&aux->cec.unregister_work, drm_dp_cec_unregister_work); } diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c index 1092499115760..de2486fe7bf2d 100644 --- a/drivers/gpu/drm/i915/display/intel_dp.c +++ b/drivers/gpu/drm/i915/display/intel_dp.c @@ -5497,7 +5497,6 @@ static int intel_dp_connector_register(struct drm_connector *connector) { struct intel_dp *intel_dp = intel_attached_dp(connector); - struct drm_device *dev = connector->dev; int ret; ret = intel_connector_register(connector); @@ -5512,8 +5511,7 @@ intel_dp_connector_register(struct drm_connector *connector) intel_dp->aux.dev = connector->kdev; ret = drm_dp_aux_register(&intel_dp->aux); if (!ret) - drm_dp_cec_register_connector(&intel_dp->aux, - connector->name, dev->dev); + drm_dp_cec_register_connector(&intel_dp->aux, connector); return ret; } diff --git a/drivers/gpu/drm/nouveau/nouveau_connector.c b/drivers/gpu/drm/nouveau/nouveau_connector.c index 330d7d29a6e34..8aa703347eb54 100644 --- a/drivers/gpu/drm/nouveau/nouveau_connector.c +++ b/drivers/gpu/drm/nouveau/nouveau_connector.c @@ -1416,8 +1416,7 @@ nouveau_connector_create(struct drm_device *dev, switch (type) { case DRM_MODE_CONNECTOR_DisplayPort: case DRM_MODE_CONNECTOR_eDP: - drm_dp_cec_register_connector(&nv_connector->aux, - connector->name, dev->dev); + drm_dp_cec_register_connector(&nv_connector->aux, connector); break; } diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h index 8364502f92cfe..7972b925a952b 100644 --- a/include/drm/drm_dp_helper.h +++ b/include/drm/drm_dp_helper.h @@ -1230,20 +1230,19 @@ struct drm_dp_aux_msg { struct cec_adapter; struct edid; +struct drm_connector; /** * struct drm_dp_aux_cec - DisplayPort CEC-Tunneling-over-AUX * @lock: mutex protecting this struct * @adap: the CEC adapter for CEC-Tunneling-over-AUX support. - * @name: name of the CEC adapter - * @parent: parent device of the CEC adapter + * @connector: the connector this CEC adapter is associated with * @unregister_work: unregister the CEC adapter */ struct drm_dp_aux_cec { struct mutex lock; struct cec_adapter *adap; - const char *name; - struct device *parent; + struct drm_connector *connector; struct delayed_work unregister_work; }; @@ -1451,8 +1450,8 @@ drm_dp_has_quirk(const struct drm_dp_desc *desc, enum drm_dp_quirk quirk) #ifdef CONFIG_DRM_DP_CEC void drm_dp_cec_irq(struct drm_dp_aux *aux); -void drm_dp_cec_register_connector(struct drm_dp_aux *aux, const char *name, - struct device *parent); +void drm_dp_cec_register_connector(struct drm_dp_aux *aux, + struct drm_connector *connector); void drm_dp_cec_unregister_connector(struct drm_dp_aux *aux); void drm_dp_cec_set_edid(struct drm_dp_aux *aux, const struct edid *edid); void drm_dp_cec_unset_edid(struct drm_dp_aux *aux); @@ -1461,9 +1460,9 @@ static inline void drm_dp_cec_irq(struct drm_dp_aux *aux) { } -static inline void drm_dp_cec_register_connector(struct drm_dp_aux *aux, - const char *name, - struct device *parent) +static inline void +drm_dp_cec_register_connector(struct drm_dp_aux *aux, + struct drm_connector *connector) { } From patchwork Wed Aug 14 10:45:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Dariusz Marcinkiewicz X-Patchwork-Id: 11095289 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 92C451399 for ; Thu, 15 Aug 2019 08:37:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 83DD72811A for ; Thu, 15 Aug 2019 08:37:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 77CE92884A; Thu, 15 Aug 2019 08:37:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 3019E2811A for ; Thu, 15 Aug 2019 08:37:18 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2FF796E92C; Thu, 15 Aug 2019 08:35:09 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-vk1-xa4a.google.com (mail-vk1-xa4a.google.com [IPv6:2607:f8b0:4864:20::a4a]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3DAB06E529 for ; Wed, 14 Aug 2019 10:45:46 +0000 (UTC) Received: by mail-vk1-xa4a.google.com with SMTP id x71so38019047vkd.15 for ; Wed, 14 Aug 2019 03:45:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=suzgW5VW6Ng90prgpz/ghvx/fVcho6Pl4urYZ0d0Q0c=; b=Vw4KKCjzDhH06wwYONQQUicxJhvK7eoRSfchJqmDYYjKmBqbkjr1KTe1tGV4U5mC2Q OI9iorhK3UIvqMJKm17tEchKt00yGc0uHoe2jRSWzwZoJngL0RkCdbjKgVShZogfRouC NHCRIzkifuynK+rNNUlyvOwFMiJq+PIWm8gkMfcl48slATY/AcMZBdM0HjRHOos5dhMT 9d/bw2yQzoZOJtpm8jfD84c+3+nRcBO2Thk2+MGcWsjdsFe/9AKoTZY47/I+JWqoXBEJ 0EiOW4uFJuLpzO4Wu/kNZECMeWb6AUqOqmqRuYv/Qu7DiZguPj4myybDfYcO7yitdwp/ cmwQ== X-Gm-Message-State: APjAAAX5mkTrQjKRdOGwjUO4bwdybdGEB9Mu45LTw8YZ9PCR1RPM5EPf lSd6JG7KFvxP8lfnPBsX1k08i2Xlphf15Be0zyuztvaVwj0qXtv7WHmI95sCdFvrSnjH4daXcBL GhHq0AzxmOJXiHQyyq6GFMfaTDsjpfzPIPHcJBq9rHAa7FAlveSPgTaELKKT6G73LZbYT7MfuRA == X-Google-Smtp-Source: APXvYqy2T8ZzD5xkHgUSqk7raFy1jd0urGCFCByhxKXfqSbhhtzmjZm/8Oyftss+nvV1arSJ2jUJFkSDHpQ= X-Received: by 2002:a1f:93cd:: with SMTP id v196mr11075937vkd.84.1565779544819; Wed, 14 Aug 2019 03:45:44 -0700 (PDT) Date: Wed, 14 Aug 2019 12:45:00 +0200 In-Reply-To: <20190814104520.6001-1-darekm@google.com> Message-Id: <20190814104520.6001-3-darekm@google.com> Mime-Version: 1.0 References: <20190814104520.6001-1-darekm@google.com> X-Mailer: git-send-email 2.23.0.rc1.153.gdeed80330f-goog Subject: [PATCH v7 2/9] drm/i915/intel_hdmi: use cec_notifier_conn_(un)register From: Dariusz Marcinkiewicz To: dri-devel@lists.freedesktop.org, linux-media@vger.kernel.org, hverkuil-cisco@xs4all.nl X-Mailman-Approved-At: Thu, 15 Aug 2019 08:34:55 +0000 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=suzgW5VW6Ng90prgpz/ghvx/fVcho6Pl4urYZ0d0Q0c=; b=Mv4TEqYa23uJDtobaDY6OSoe+shBIF5XVxXALV+QFVPinFL0cqfxETuiYnTHfikeS0 beLlJ1+BBIyTAhKd1JqnpQo3tivf3SZ9z9nk7oObNoNce/6RSi9vJcKeItZ2Ap6i16TF sO16PNkbi+BrhuokCdIAorhyUJfLy4AtshgXt9ebmMQnJJ4M0k+SuwLsbI7Bsm4wqfct I0WU4v/LGzR40UT/Gan8eztP4Nk3Z3k9qcxdtOaJVCJucEb4gb4HXBGf3mNS7bdkYmZf laScErz8C4mR2ZvF1JR64oYbIgVooQF19lNDFb3YDWHqMnlxLTlgGCYy+McMlra+GR7H AOwQ== X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, Rodrigo Vivi , Dariusz Marcinkiewicz Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Use the new cec_notifier_conn_(un)register() functions to (un)register the notifier for the HDMI connector, and fill in the cec_connector_info. Signed-off-by: Dariusz Marcinkiewicz Signed-off-by: Hans Verkuil Tested-by: Hans Verkuil Reviewed-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/intel_hdmi.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_hdmi.c b/drivers/gpu/drm/i915/display/intel_hdmi.c index b1ca8e5bdb56d..9fcf2c58c29c5 100644 --- a/drivers/gpu/drm/i915/display/intel_hdmi.c +++ b/drivers/gpu/drm/i915/display/intel_hdmi.c @@ -2752,8 +2752,9 @@ intel_hdmi_connector_register(struct drm_connector *connector) static void intel_hdmi_destroy(struct drm_connector *connector) { - if (intel_attached_hdmi(connector)->cec_notifier) - cec_notifier_put(intel_attached_hdmi(connector)->cec_notifier); + struct cec_notifier *n = intel_attached_hdmi(connector)->cec_notifier; + + cec_notifier_conn_unregister(n); intel_connector_destroy(connector); } @@ -3068,6 +3069,7 @@ void intel_hdmi_init_connector(struct intel_digital_port *intel_dig_port, struct drm_device *dev = intel_encoder->base.dev; struct drm_i915_private *dev_priv = to_i915(dev); enum port port = intel_encoder->port; + struct cec_connector_info conn_info; DRM_DEBUG_KMS("Adding HDMI connector on port %c\n", port_name(port)); @@ -3120,8 +3122,11 @@ void intel_hdmi_init_connector(struct intel_digital_port *intel_dig_port, I915_WRITE(PEG_BAND_GAP_DATA, (temp & ~0xf) | 0xd); } - intel_hdmi->cec_notifier = cec_notifier_get_conn(dev->dev, - port_identifier(port)); + cec_fill_conn_info_from_drm(&conn_info, connector); + + intel_hdmi->cec_notifier = + cec_notifier_conn_register(dev->dev, port_identifier(port), + &conn_info); if (!intel_hdmi->cec_notifier) DRM_DEBUG_KMS("CEC notifier get failed\n"); } From patchwork Wed Aug 14 10:45:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dariusz Marcinkiewicz X-Patchwork-Id: 11095253 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CD8051398 for ; Thu, 15 Aug 2019 08:36:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BF6C72876B for ; Thu, 15 Aug 2019 08:36:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B339F2884A; Thu, 15 Aug 2019 08:36:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6A20D2876B for ; Thu, 15 Aug 2019 08:36:20 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A292B6E901; Thu, 15 Aug 2019 08:35:02 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qk1-x749.google.com (mail-qk1-x749.google.com [IPv6:2607:f8b0:4864:20::749]) by gabe.freedesktop.org (Postfix) with ESMTPS id 811A66E529 for ; Wed, 14 Aug 2019 10:45:52 +0000 (UTC) Received: by mail-qk1-x749.google.com with SMTP id d11so99177421qkb.20 for ; Wed, 14 Aug 2019 03:45:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=8XQAtQU5Jlu+LsGTeIXfkeaCQsZPIsgrkBYJbMGoesk=; b=N7JmyJCkqXyjftG66iWqW7GILkxXAFNZXMMvGWxVoafIUFY88ZuAWNAyUSfIP9zXYr yE7umGrWBiVzQQ6YwdIYibORL50DvYxkrbmk3wqm7LNwAo+NmlJRq4wC6NnPYypt69YV KoOOUwFEg6Q/CbAMjt3Qb6QgFQYGANiZXYvPODG4iV8fRSb+Qx3pSFoTeW/v2Nv0Yw6E w8s+VG9rBOwMJuzkHY5ZYV7J6jr/w7FmWqBkYz//anhOzje8mwAtngJrrbZVFGrUfSsS 0MyJ1GMD6xTGSKzn8yftwbv121i2UHlmIHbvwbIWwRZf4x7zJSQDY1muKSt5P6JywY+Y cTGw== X-Gm-Message-State: APjAAAXJX7wKHXul1vZaDhjbT3z2XLIUTd+oy9C4D5AZ2IhcHdFID61h qa95gGTwtj14+bw7B+VcCdrJs8fIEruxvrLY1QaWuue9Aa/BtbtXubuTrCC8u5lkIMtPunkRT4t tsnpgNcpFq0cM0Lyu3aIVp/vEWxeJDRsIhYaKjEzsdZ2YI9BzUOi7EiJTCdnWJo5eFlaNNk8lUg == X-Google-Smtp-Source: APXvYqwFkux6bJUDOmhEL2ANd2DCyCR/Ryr/QNHOfXxiv2yXbVUydh25N5n46qj8ALQfXM0+XquobHEFP2Y= X-Received: by 2002:a05:6214:1254:: with SMTP id q20mr2062924qvv.164.1565779550564; Wed, 14 Aug 2019 03:45:50 -0700 (PDT) Date: Wed, 14 Aug 2019 12:45:01 +0200 In-Reply-To: <20190814104520.6001-1-darekm@google.com> Message-Id: <20190814104520.6001-4-darekm@google.com> Mime-Version: 1.0 References: <20190814104520.6001-1-darekm@google.com> X-Mailer: git-send-email 2.23.0.rc1.153.gdeed80330f-goog Subject: [PATCH v7 3/9] dw-hdmi-cec: use cec_notifier_cec_adap_(un)register From: Dariusz Marcinkiewicz To: dri-devel@lists.freedesktop.org, linux-media@vger.kernel.org, hverkuil-cisco@xs4all.nl X-Mailman-Approved-At: Thu, 15 Aug 2019 08:34:55 +0000 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=8XQAtQU5Jlu+LsGTeIXfkeaCQsZPIsgrkBYJbMGoesk=; b=wAGnbRj9PtduDVibdtuPHio7e/rJAlCgqGevJw5McsZd2dItB2v8f3QDxCwHSu8HnM hUudYGzKO7cP39DlSJRj4tGIzVVVD7YI5T4VmE5kX9Ysovpeys+pbhVZL19mRvhyQd+8 VLquRzmzP4RRraDhLhZzueBc3kZpUJqwnpT6b3CROj2A6T+JhMWMJRGpUjKUox6rDt72 F111botUFvVQxo0CP38qO0gmkZYQiQLXbzFf6gL2kTKpae0HQtsskmb1ezaYubpNWNwX 5o8X9kKoMAeofuebkUCLBd1/FR6Cd1qGADTZ3sbk+bh6Qg+9HVOoW6nWSeNsHZJ8SYh1 pu9Q== X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kate Stewart , Jernej Skrabec , Jonas Karlman , David Airlie , Greg Kroah-Hartman , Neil Armstrong , linux-kernel@vger.kernel.org, Laurent Pinchart , Thomas Gleixner , Dariusz Marcinkiewicz , Allison Randal Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Use the new cec_notifier_cec_adap_(un)register() functions to (un)register the notifier for the CEC adapter. Also adds CEC_CAP_CONNECTOR_INFO capability to the adapter. Changes since v3: - add CEC_CAP_CONNECTOR_INFO to cec_allocate_adapter, - replace CEC_CAP_LOG_ADDRS | CEC_CAP_TRANSMIT | CEC_CAP_RC | CEC_CAP_PASSTHROUGH with CEC_CAP_DEFAULTS. Signed-off-by: Dariusz Marcinkiewicz Signed-off-by: Hans Verkuil Tested-by: Hans Verkuil Reviewed-by: Neil Armstrong --- drivers/gpu/drm/bridge/synopsys/dw-hdmi-cec.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-cec.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-cec.c index 0f949978d3fcd..ac1e001d08829 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-cec.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-cec.c @@ -256,8 +256,8 @@ static int dw_hdmi_cec_probe(struct platform_device *pdev) dw_hdmi_write(cec, 0, HDMI_CEC_POLARITY); cec->adap = cec_allocate_adapter(&dw_hdmi_cec_ops, cec, "dw_hdmi", - CEC_CAP_LOG_ADDRS | CEC_CAP_TRANSMIT | - CEC_CAP_RC | CEC_CAP_PASSTHROUGH, + CEC_CAP_DEFAULTS | + CEC_CAP_CONNECTOR_INFO, CEC_MAX_LOG_ADDRS); if (IS_ERR(cec->adap)) return PTR_ERR(cec->adap); @@ -278,13 +278,14 @@ static int dw_hdmi_cec_probe(struct platform_device *pdev) if (ret < 0) return ret; - cec->notify = cec_notifier_get(pdev->dev.parent); + cec->notify = cec_notifier_cec_adap_register(pdev->dev.parent, + NULL, cec->adap); if (!cec->notify) return -ENOMEM; ret = cec_register_adapter(cec->adap, pdev->dev.parent); if (ret < 0) { - cec_notifier_put(cec->notify); + cec_notifier_cec_adap_unregister(cec->notify); return ret; } @@ -294,8 +295,6 @@ static int dw_hdmi_cec_probe(struct platform_device *pdev) */ devm_remove_action(&pdev->dev, dw_hdmi_cec_del, cec); - cec_register_cec_notifier(cec->adap, cec->notify); - return 0; } @@ -303,8 +302,8 @@ static int dw_hdmi_cec_remove(struct platform_device *pdev) { struct dw_hdmi_cec *cec = platform_get_drvdata(pdev); + cec_notifier_cec_adap_unregister(cec->notify); cec_unregister_adapter(cec->adap); - cec_notifier_put(cec->notify); return 0; } From patchwork Wed Aug 14 10:45:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dariusz Marcinkiewicz X-Patchwork-Id: 11095263 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6F06F1398 for ; Thu, 15 Aug 2019 08:36:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5E7AD2811A for ; Thu, 15 Aug 2019 08:36:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 52C5A28842; Thu, 15 Aug 2019 08:36:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 02F602811A for ; Thu, 15 Aug 2019 08:36:34 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id F37D26E928; Thu, 15 Aug 2019 08:35:08 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-yb1-xb4a.google.com (mail-yb1-xb4a.google.com [IPv6:2607:f8b0:4864:20::b4a]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5FECF6E48C for ; Wed, 14 Aug 2019 10:45:58 +0000 (UTC) Received: by mail-yb1-xb4a.google.com with SMTP id 15so19145142ybj.12 for ; Wed, 14 Aug 2019 03:45:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=rNr4ZPVQiRY9460rK+p/RjWfP2XiBB6EuRKjHiRo/qQ=; b=taYiOc2gjQIop7K+eUVL0X2hiYFkEkIQ+2njMiMj5R/0+wxeMtHSjHqs7I9yoLvh0o HrLWeY6fChI2NTGng2Ng/rO6yz81Pu7OVnjIxs7hkN+j5wxosgyMPGAb6Y70C0edrvsa CXTWrAMBI3qaw8ZXa3xuewdCFb7QCtDNTLrSQEUjpdcw+QlB5PAItOkZ5ft5Ynk/uAcQ /VhWOIo4HW5XmHKOFNT/LwLw3HKvDUDBAWuY5TU7fdZVMlQHrQ8rf8LnUEvIaWBy2Y3V I5H0REg1ED+zXe8XhDX0Ykc98GaHNCUmz3bqFtiXbNJgpxcHiRJLlFb62Dm5SQtsr8wj RcjQ== X-Gm-Message-State: APjAAAVE/nNowEh5ciOehLu80kTuodYWWm6C5veHoJUQKez2TfSjtP2c GsjPzVr9+2MAkXo+rvBzsgbOVc2zve5pPyc4GlNQu0v7NsesP/4tTs/SIabSFY6NfM1O3WUGZQd XpTvqFaIZv5A9gBSggpI/68t+Pob2dSQGjdhqsV8HTBymXLE0r5arX55Ccoa2JcFip5pue/ntIg == X-Google-Smtp-Source: APXvYqz8wuc7rzzPcMc9pN4pp2/JhTt0TqdoYblYW39TykuwcgtmhPOpuh0zTFZfEq05jYjRSZf+uFC6HSU= X-Received: by 2002:a81:70c7:: with SMTP id l190mr20647337ywc.280.1565779557384; Wed, 14 Aug 2019 03:45:57 -0700 (PDT) Date: Wed, 14 Aug 2019 12:45:02 +0200 In-Reply-To: <20190814104520.6001-1-darekm@google.com> Message-Id: <20190814104520.6001-5-darekm@google.com> Mime-Version: 1.0 References: <20190814104520.6001-1-darekm@google.com> X-Mailer: git-send-email 2.23.0.rc1.153.gdeed80330f-goog Subject: [PATCH v7 4/9] tda9950: use cec_notifier_cec_adap_(un)register From: Dariusz Marcinkiewicz To: dri-devel@lists.freedesktop.org, linux-media@vger.kernel.org, hverkuil-cisco@xs4all.nl X-Mailman-Approved-At: Thu, 15 Aug 2019 08:34:55 +0000 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=rNr4ZPVQiRY9460rK+p/RjWfP2XiBB6EuRKjHiRo/qQ=; b=JpSL21bCCCvwbK2FjwB7E/jnKcDm9D41KjRfUN/ZMV7CAuObTU2sAjHT/9QBhYs1vA I0O2sbz4SZhkiL3bvhimKAowi+0b9jhvA+I9Qoyx0qUQxXPKNMHSGGg6PAoC31fKpGDk FaHmng7SEUEvXHHxyzi2lpMXoBFZK/QNPB3aEwjAnDzaTOQ/oiT1Ex7XJAR8Z0EEt+uA eZP4Vgt9tLhRZySmfka/MsnvyU6VjakU63Vc0P/Jcq03iFvt8kJ1LEwzecXQN9yLJa8z wJzSIzXSAO3eKnLA1Tbl6K0ZnzkKBZpHSkmkivhlLZOryY7AcVuDJ21jFv9c4oyt82L+ 6nww== X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, Hans Verkuil , Russell King , Colin Ian King , Thomas Gleixner , Dariusz Marcinkiewicz , Enrico Weigelt Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Use the new cec_notifier_cec_adap_(un)register() functions to (un)register the notifier for the CEC adapter. Signed-off-by: Dariusz Marcinkiewicz Signed-off-by: Hans Verkuil Tested-by: Hans Verkuil --- drivers/gpu/drm/i2c/tda9950.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/i2c/tda9950.c b/drivers/gpu/drm/i2c/tda9950.c index 8039fc0d83db4..a5a75bdeb7a5f 100644 --- a/drivers/gpu/drm/i2c/tda9950.c +++ b/drivers/gpu/drm/i2c/tda9950.c @@ -420,7 +420,8 @@ static int tda9950_probe(struct i2c_client *client, priv->hdmi = glue->parent; priv->adap = cec_allocate_adapter(&tda9950_cec_ops, priv, "tda9950", - CEC_CAP_DEFAULTS, + CEC_CAP_DEFAULTS | + CEC_CAP_CONNECTOR_INFO, CEC_MAX_LOG_ADDRS); if (IS_ERR(priv->adap)) return PTR_ERR(priv->adap); @@ -457,13 +458,14 @@ static int tda9950_probe(struct i2c_client *client, if (ret < 0) return ret; - priv->notify = cec_notifier_get(priv->hdmi); + priv->notify = cec_notifier_cec_adap_register(priv->hdmi, NULL, + priv->adap); if (!priv->notify) return -ENOMEM; ret = cec_register_adapter(priv->adap, priv->hdmi); if (ret < 0) { - cec_notifier_put(priv->notify); + cec_notifier_cec_adap_unregister(priv->notify); return ret; } @@ -473,8 +475,6 @@ static int tda9950_probe(struct i2c_client *client, */ devm_remove_action(dev, tda9950_cec_del, priv); - cec_register_cec_notifier(priv->adap, priv->notify); - return 0; } @@ -482,8 +482,8 @@ static int tda9950_remove(struct i2c_client *client) { struct tda9950_priv *priv = i2c_get_clientdata(client); + cec_notifier_cec_adap_unregister(priv->notify); cec_unregister_adapter(priv->adap); - cec_notifier_put(priv->notify); return 0; } From patchwork Wed Aug 14 10:45:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dariusz Marcinkiewicz X-Patchwork-Id: 11095239 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D95CE1398 for ; Thu, 15 Aug 2019 08:36:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C96B62811A for ; Thu, 15 Aug 2019 08:36:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BD8222872A; Thu, 15 Aug 2019 08:36:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 66E312811A for ; Thu, 15 Aug 2019 08:36:04 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 048B16E933; Thu, 15 Aug 2019 08:35:10 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qt1-x84a.google.com (mail-qt1-x84a.google.com [IPv6:2607:f8b0:4864:20::84a]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1B7236E4D0 for ; Wed, 14 Aug 2019 10:46:03 +0000 (UTC) Received: by mail-qt1-x84a.google.com with SMTP id x11so5666528qtm.11 for ; Wed, 14 Aug 2019 03:46:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=oqxTqOJ6wCf7PGIZgAVYYI7HoO4jjy5hivlKoMqmAi8=; b=uGlDS5GDeyvR45LS0eyvtGHGdMGNbHUKi+TCM5wOFE33Zb9Ln4N+draZTlEWVUhKAW yoZ5Hy0Nngc+yJvWMV2+qYLLxiC0gDo0nxJ0QvGoEgsNPeuZIk/8i4FD7bvJZfbY06DS cobC+vqwr0wKeZ3IDg6zI0FG1dul2oIoIi2V735nd5dz3tuA68shm1q68QJjfQSz6rSQ olQk+Mkx2m1f7B5wZ05LFhfrgNUOxLSFtAFKTsHPytMpVCbCDPhm1TNPSEuWi1ELCXqg IZRJfUTPDR3VvITcPp1lBkyYgHOrcrsajbvU16blktJ6HzbFCaN6PBVoJ5VpXHIhGnSY hT9Q== X-Gm-Message-State: APjAAAU4hlZ9aX2ku1EqD246tUGCTBisfxMmlc71wICRiU3CTwjkl/aP K+WHQO4ecnmUsFb+nypEaYFO47hxA3/q+S/TzkD/xolqZxHNjgmeSv9EkBuWzrIkfFIYzMg1eWu lD16FmzMlNGP1ayOST4c0+dHSyJ2+6hgQRf3UUK0Fawi0DbaSqXKEVis+1cstNsz/L0p5aBdrMQ == X-Google-Smtp-Source: APXvYqxndkg4Q+ED4/lezsuSHat0LDTAfINlPw7TAr+Ihx0C8cuCGXv8RYvMevn8UpDiFGyUQnXhsJKUyCk= X-Received: by 2002:ae9:efc6:: with SMTP id d189mr36226585qkg.323.1565779561325; Wed, 14 Aug 2019 03:46:01 -0700 (PDT) Date: Wed, 14 Aug 2019 12:45:03 +0200 In-Reply-To: <20190814104520.6001-1-darekm@google.com> Message-Id: <20190814104520.6001-6-darekm@google.com> Mime-Version: 1.0 References: <20190814104520.6001-1-darekm@google.com> X-Mailer: git-send-email 2.23.0.rc1.153.gdeed80330f-goog Subject: [PATCH v7 5/9] drm: tda998x: use cec_notifier_conn_(un)register From: Dariusz Marcinkiewicz To: dri-devel@lists.freedesktop.org, linux-media@vger.kernel.org, hverkuil-cisco@xs4all.nl X-Mailman-Approved-At: Thu, 15 Aug 2019 08:34:55 +0000 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=oqxTqOJ6wCf7PGIZgAVYYI7HoO4jjy5hivlKoMqmAi8=; b=O7+xZW9bVaxSWLElxmDAgFZSh2+lPWcqmgSViEd8bkRDj0bp4mgJ3aKj3/JJReW7M6 8W8L4XAfcY2PE/zXAxS2HQ6+seXxNiEQ0uDRM6mocKWiWwTtUN74Dpf+YJXhJ0Xz0xW8 UpsEzUith0hcInJf/ShGRE4oqG8QWIdbiNAUjVFAk3TyU9U6m62E3fwx83wmmjGudsno 0DmGq9PspzDOZFKaK+30voK1ou3xLzWx4HKHvwIngGUSEmmkZ67xQNLD/ex+PxU25Lr9 w30JZzYLpxT5+gh/lXRWhqew3KtFUSydGxrEtLswNpHpEQv8o5DRYcyEEXqaHHr4lSOf c6hw== X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , Dariusz Marcinkiewicz , Russell King , linux-kernel@vger.kernel.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Use the new cec_notifier_conn_(un)register() functions to (un)register the notifier for the HDMI connector, and fill in the cec_connector_info. Changes since v6: - move cec_notifier_conn_unregister to tda998x_bridge_detach, - add a mutex protecting accesses to a CEC notifier. Changes since v2: - cec_notifier_phys_addr_invalidate where appropriate, - don't check for NULL notifier before calling cec_notifier_conn_unregister. Changes since v1: Add memory barrier to make sure that the notifier becomes visible to the irq thread once it is fully constructed. Signed-off-by: Dariusz Marcinkiewicz Tested-by: Hans Verkuil --- drivers/gpu/drm/i2c/tda998x_drv.c | 36 +++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/i2c/tda998x_drv.c b/drivers/gpu/drm/i2c/tda998x_drv.c index 61e042918a7fc..643480415473f 100644 --- a/drivers/gpu/drm/i2c/tda998x_drv.c +++ b/drivers/gpu/drm/i2c/tda998x_drv.c @@ -82,6 +82,8 @@ struct tda998x_priv { u8 audio_port_enable[AUDIO_ROUTE_NUM]; struct tda9950_glue cec_glue; struct gpio_desc *calib; + + struct mutex cec_notifiy_mutex; struct cec_notifier *cec_notify; }; @@ -805,8 +807,11 @@ static irqreturn_t tda998x_irq_thread(int irq, void *data) tda998x_edid_delay_start(priv); } else { schedule_work(&priv->detect_work); - cec_notifier_set_phys_addr(priv->cec_notify, - CEC_PHYS_ADDR_INVALID); + + mutex_lock(&priv->cec_notifiy_mutex); + cec_notifier_phys_addr_invalidate( + priv->cec_notify); + mutex_unlock(&priv->cec_notifiy_mutex); } handled = true; @@ -1331,6 +1336,8 @@ static int tda998x_connector_init(struct tda998x_priv *priv, struct drm_device *drm) { struct drm_connector *connector = &priv->connector; + struct cec_connector_info conn_info; + struct cec_notifier *notifier; int ret; connector->interlace_allowed = 1; @@ -1347,6 +1354,16 @@ static int tda998x_connector_init(struct tda998x_priv *priv, if (ret) return ret; + cec_fill_conn_info_from_drm(&conn_info, connector); + + notifier = cec_notifier_conn_register(priv->cec_glue.parent, + NULL, &conn_info); + return -ENOMEM; + + mutex_lock(&priv->cec_notifiy_mutex); + priv->cec_notify = notifier; + mutex_unlock(&priv->cec_notifiy_mutex); + drm_connector_attach_encoder(&priv->connector, priv->bridge.encoder); @@ -1366,6 +1383,11 @@ static void tda998x_bridge_detach(struct drm_bridge *bridge) { struct tda998x_priv *priv = bridge_to_tda998x_priv(bridge); + mutex_lock(&priv->cec_notifiy_mutex); + cec_notifier_conn_unregister(priv->cec_notify); + priv->cec_notify = NULL; + mutex_unlock(&priv->cec_notifiy_mutex); + drm_connector_cleanup(&priv->connector); } @@ -1789,9 +1811,6 @@ static void tda998x_destroy(struct device *dev) cancel_work_sync(&priv->detect_work); i2c_unregister_device(priv->cec); - - if (priv->cec_notify) - cec_notifier_put(priv->cec_notify); } static int tda998x_create(struct device *dev) @@ -1812,6 +1831,7 @@ static int tda998x_create(struct device *dev) mutex_init(&priv->mutex); /* protect the page access */ mutex_init(&priv->audio_mutex); /* protect access from audio thread */ mutex_init(&priv->edid_mutex); + mutex_init(&priv->cec_notifiy_mutex); INIT_LIST_HEAD(&priv->bridge.list); init_waitqueue_head(&priv->edid_delay_waitq); timer_setup(&priv->edid_delay_timer, tda998x_edid_delay_done, 0); @@ -1916,12 +1936,6 @@ static int tda998x_create(struct device *dev) cec_write(priv, REG_CEC_RXSHPDINTENA, CEC_RXSHPDLEV_HPD); } - priv->cec_notify = cec_notifier_get(dev); - if (!priv->cec_notify) { - ret = -ENOMEM; - goto fail; - } - priv->cec_glue.parent = dev; priv->cec_glue.data = priv; priv->cec_glue.init = tda998x_cec_hook_init; From patchwork Wed Aug 14 10:45:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dariusz Marcinkiewicz X-Patchwork-Id: 11095261 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6688E1823 for ; Thu, 15 Aug 2019 08:36:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 57EAF2811A for ; Thu, 15 Aug 2019 08:36:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4C5AD2884A; Thu, 15 Aug 2019 08:36:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 043652811A for ; Thu, 15 Aug 2019 08:36:28 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CC5EB6E8F2; Thu, 15 Aug 2019 08:35:00 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-vk1-xa49.google.com (mail-vk1-xa49.google.com [IPv6:2607:f8b0:4864:20::a49]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5E5466E586 for ; Wed, 14 Aug 2019 10:46:07 +0000 (UTC) Received: by mail-vk1-xa49.google.com with SMTP id a189so218769vkc.20 for ; Wed, 14 Aug 2019 03:46:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=ip9lF/U/ATkDBCN52xa8MDYElKkFg+n6UubAPvcwdoQ=; b=DMK261pt/2v6KZ8BSYlQ8LmNRvbZmR8gF4xdhP1eLNyowqxkNsvnbeoNoseKItZZtM h4yzNCBr7Z/GD5AQHIh/3eTJpY7GG9vaHWoJTfWz+ZUDkFTsq7HxOqcSvSW2aYZh1W5l hxKrXaGA5FdssmAXSncksa+2Em69XnMUITyw20p3OPjAER4Qo2PGHyma9gViEDFijAHd SWmahRLVa+iFZ2MTLQ1OW+s7Xbazx+zF/eQ8p+m6R5svTvejwHmhcVygxFaZznGzCIrv JBtTzQHyh/iwmIGvRQzfFyfbKKizl4ZyQtC0thNwUTGpF57lLzjcQcqZ5IoRFJnSgIiX T5Fw== X-Gm-Message-State: APjAAAUOgBxsSmII9bTIkKI6BUdZQn8jZ50kRCGxEzCj2h2jJq2Ysb8v pNL3uChInnQLlqPQ0TASBEOXtHzgqbxYhJ780WnWcNl2l4c9chCaz6Lj4RSoR9jzPsWduwOt25i pXwEfiW6aUNKUC3tX3fxGnEotIw7S0yAbuTLwBB0a9V3XDSfCRLqU1qN8XKK4BjRc3YwnPfQGkw == X-Google-Smtp-Source: APXvYqwGg7hw59XwQ3AoqIYTskYl0MYRgXJ3/2BQi9vOdN3sJqPR7IXY8Z+n4jhAc2KsrudW5ux/QIYpifE= X-Received: by 2002:a9f:31cb:: with SMTP id w11mr1312328uad.40.1565779566021; Wed, 14 Aug 2019 03:46:06 -0700 (PDT) Date: Wed, 14 Aug 2019 12:45:04 +0200 In-Reply-To: <20190814104520.6001-1-darekm@google.com> Message-Id: <20190814104520.6001-7-darekm@google.com> Mime-Version: 1.0 References: <20190814104520.6001-1-darekm@google.com> X-Mailer: git-send-email 2.23.0.rc1.153.gdeed80330f-goog Subject: [PATCH v7 6/9] drm: sti: use cec_notifier_conn_(un)register From: Dariusz Marcinkiewicz To: dri-devel@lists.freedesktop.org, linux-media@vger.kernel.org, hverkuil-cisco@xs4all.nl X-Mailman-Approved-At: Thu, 15 Aug 2019 08:34:55 +0000 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=ip9lF/U/ATkDBCN52xa8MDYElKkFg+n6UubAPvcwdoQ=; b=F2Wq7/qUI6063Ggfg3uy2V3WIYVkgW+HoapIrUNMvS/Au5Ol/B3SFcoj9sFM+0KgCc gQE4un4mzyXTwEQwzAcnUBqN9C+SR18fqVsQngsR7F4KNXrZvBjhZTdhpkxLn/izafXm BhC5HxllnxCQutzM3IO0JMWrPSAIlFmQslLTovcX2NXXe1wqmkL6r6wdgsBlpQILWXHo 2ViQHXy2254GlWPNkq8h0euVbw3X1Y1tQ8euOn7iCvdz76QpJ24vR+Z94ANGtN9E/uwi W3fA0elafMMJGCcfZANHXF+xR8IoeRlkM0tMATTs0LOmj482BenDoUea4hWpgQ9uM/GA iH4w== X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , linux-kernel@vger.kernel.org, Dariusz Marcinkiewicz , Vincent Abriou Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Use the new cec_notifier_conn_(un)register() functions to (un)register the notifier for the HDMI connector, and fill in the cec_connector_info. Changes since v2: Don't invalidate physical address before unregistering the notifier. Signed-off-by: Dariusz Marcinkiewicz Acked-by: Hans Verkuil --- drivers/gpu/drm/sti/sti_hdmi.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/sti/sti_hdmi.c b/drivers/gpu/drm/sti/sti_hdmi.c index 9862c322f0c4a..bd15902b825ad 100644 --- a/drivers/gpu/drm/sti/sti_hdmi.c +++ b/drivers/gpu/drm/sti/sti_hdmi.c @@ -1256,6 +1256,7 @@ static int sti_hdmi_bind(struct device *dev, struct device *master, void *data) struct drm_device *drm_dev = data; struct drm_encoder *encoder; struct sti_hdmi_connector *connector; + struct cec_connector_info conn_info; struct drm_connector *drm_connector; struct drm_bridge *bridge; int err; @@ -1318,6 +1319,14 @@ static int sti_hdmi_bind(struct device *dev, struct device *master, void *data) goto err_sysfs; } + cec_fill_conn_info_from_drm(&conn_info, drm_connector); + hdmi->notifier = cec_notifier_conn_register(&hdmi->dev, NULL, + &conn_info); + if (!hdmi->notifier) { + hdmi->drm_connector = NULL; + return -ENOMEM; + } + /* Enable default interrupts */ hdmi_write(hdmi, HDMI_DEFAULT_INT, HDMI_INT_EN); @@ -1331,6 +1340,9 @@ static int sti_hdmi_bind(struct device *dev, struct device *master, void *data) static void sti_hdmi_unbind(struct device *dev, struct device *master, void *data) { + struct sti_hdmi *hdmi = dev_get_drvdata(dev); + + cec_notifier_conn_unregister(hdmi->notifier); } static const struct component_ops sti_hdmi_ops = { @@ -1436,10 +1448,6 @@ static int sti_hdmi_probe(struct platform_device *pdev) goto release_adapter; } - hdmi->notifier = cec_notifier_get(&pdev->dev); - if (!hdmi->notifier) - goto release_adapter; - hdmi->reset = devm_reset_control_get(dev, "hdmi"); /* Take hdmi out of reset */ if (!IS_ERR(hdmi->reset)) @@ -1459,14 +1467,11 @@ static int sti_hdmi_remove(struct platform_device *pdev) { struct sti_hdmi *hdmi = dev_get_drvdata(&pdev->dev); - cec_notifier_set_phys_addr(hdmi->notifier, CEC_PHYS_ADDR_INVALID); - i2c_put_adapter(hdmi->ddc_adapt); if (hdmi->audio_pdev) platform_device_unregister(hdmi->audio_pdev); component_del(&pdev->dev, &sti_hdmi_ops); - cec_notifier_put(hdmi->notifier); return 0; } From patchwork Wed Aug 14 10:45:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dariusz Marcinkiewicz X-Patchwork-Id: 11095267 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2C17C1399 for ; Thu, 15 Aug 2019 08:36:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1E4D52811A for ; Thu, 15 Aug 2019 08:36:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 12A0628842; Thu, 15 Aug 2019 08:36:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id ADABE2811A for ; Thu, 15 Aug 2019 08:36:42 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 880C86E905; Thu, 15 Aug 2019 08:35:03 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-vk1-xa49.google.com (mail-vk1-xa49.google.com [IPv6:2607:f8b0:4864:20::a49]) by gabe.freedesktop.org (Postfix) with ESMTPS id C90186E5BB for ; Wed, 14 Aug 2019 10:46:11 +0000 (UTC) Received: by mail-vk1-xa49.google.com with SMTP id y187so6679714vkf.2 for ; Wed, 14 Aug 2019 03:46:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=saq5XDceOIgoGr9TXKhDgKirX3SqKoE0qoHBi968/xk=; b=jrOK1Vc0n3UMi96yqUGDBkgo/Zp7DkX6WqSvNp0PKh9uKkamSjVI36ufgNbTDQG/H/ 2qC4m3RmsaXyGC99wQOJ23KugQNhYxg3w9iZ0n/1NIeBHTiKFK//ZvT5Sv4jzC4XEDXN ysP0njufKmtYvmaU/7Bi+htjG+SA7iXbUlql2pTSscS5dbOI14QtFEU2qFn5xa+12K+6 OEO0m8ndNmg1YqxwMWvhb5j+hcXRwyrwLTW3weHRwW/c96svSdjPIIuA9o2PLozjNyg/ ZuBfy3S0PqrRR7L7NXDCKzFHBrTsUP4ZVugeWebtVFCe+nwv2LHt2nJMCrxKBBFVvYLD /tmw== X-Gm-Message-State: APjAAAXuwN0Z8RLQKwFmR6NxsvwcI7eDcurI52Vcuzq6Lewg9BcPaT82 72dQcnKgtNmNsJwuOOwXfHnCTNUztABWC8hE1+zJiTPMoM9YfQ2WJ7mYHEVM4qU6GsRlnQ0EFlO 4DTUO3Z0QURK/8ypmwlAa+YFfElLNfFIYFjlvp59HYBnMaQF98G9ZoevXEG86pW998ebE4Fc0Ew == X-Google-Smtp-Source: APXvYqyoT5pUd+WeFrXBYZxNE0G3jZZLgp89mH7NfYSTWCCaTY8Y54tIFMMw/d4PPiauoCVTHqxHY+kI17c= X-Received: by 2002:ac5:cdad:: with SMTP id l13mr9148123vka.30.1565779570656; Wed, 14 Aug 2019 03:46:10 -0700 (PDT) Date: Wed, 14 Aug 2019 12:45:05 +0200 In-Reply-To: <20190814104520.6001-1-darekm@google.com> Message-Id: <20190814104520.6001-8-darekm@google.com> Mime-Version: 1.0 References: <20190814104520.6001-1-darekm@google.com> X-Mailer: git-send-email 2.23.0.rc1.153.gdeed80330f-goog Subject: [PATCH v7 7/9] drm: tegra: use cec_notifier_conn_(un)register From: Dariusz Marcinkiewicz To: dri-devel@lists.freedesktop.org, linux-media@vger.kernel.org, hverkuil-cisco@xs4all.nl X-Mailman-Approved-At: Thu, 15 Aug 2019 08:34:55 +0000 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=saq5XDceOIgoGr9TXKhDgKirX3SqKoE0qoHBi968/xk=; b=qHDnRpQM4FQsTdQ5gtW17elm8fjJAy+ftuSFwl3seP2A/RZCy3vUgZqi1oZvyDumPB 0Ywwj7FkrvBNiaRh79/tLI+OvZ1GEIZxWGGGS11bToRsPclnktx5ydUOPcoV/ceGedU5 j1ZohdoTULS7l4DG4E0oJIA8PGiv25MlfXgEXGINrCSWlIDU/utNRX87TiyQNzVxcfB0 QITWLROiiBxsMYizA0WIK++f+g8MnJYRvv3JfrZGDFxRKujJdFUCdsBLjO+lvxPnlrbw oO2mtZwBbqa7HcAUnZBC8eE/ortohmS+Ysn//uZpJx0oFLxoJTSC4l28xIFknZMupCVu 2tBQ== X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , linux-kernel@vger.kernel.org, Jonathan Hunter , Thierry Reding , linux-tegra@vger.kernel.org, Dariusz Marcinkiewicz Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Use the new cec_notifier_conn_(un)register() functions to (un)register the notifier for the HDMI connector, and fill in the cec_connector_info. Changes since v4: - only create a CEC notifier for HDMI connectors Signed-off-by: Dariusz Marcinkiewicz Tested-by: Hans Verkuil Acked-by: Hans Verkuil Acked-by: Thierry Reding --- drivers/gpu/drm/tegra/output.c | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/tegra/output.c b/drivers/gpu/drm/tegra/output.c index bdcaa4c7168cf..34373734ff689 100644 --- a/drivers/gpu/drm/tegra/output.c +++ b/drivers/gpu/drm/tegra/output.c @@ -70,6 +70,11 @@ tegra_output_connector_detect(struct drm_connector *connector, bool force) void tegra_output_connector_destroy(struct drm_connector *connector) { + struct tegra_output *output = connector_to_output(connector); + + if (output->cec) + cec_notifier_conn_unregister(output->cec); + drm_connector_unregister(connector); drm_connector_cleanup(connector); } @@ -163,18 +168,11 @@ int tegra_output_probe(struct tegra_output *output) disable_irq(output->hpd_irq); } - output->cec = cec_notifier_get(output->dev); - if (!output->cec) - return -ENOMEM; - return 0; } void tegra_output_remove(struct tegra_output *output) { - if (output->cec) - cec_notifier_put(output->cec); - if (output->hpd_gpio) free_irq(output->hpd_irq, output); @@ -184,6 +182,7 @@ void tegra_output_remove(struct tegra_output *output) int tegra_output_init(struct drm_device *drm, struct tegra_output *output) { + int connector_type; int err; if (output->panel) { @@ -199,6 +198,21 @@ int tegra_output_init(struct drm_device *drm, struct tegra_output *output) if (output->hpd_gpio) enable_irq(output->hpd_irq); + connector_type = output->connector.connector_type; + /* + * Create a CEC notifier for HDMI connector. + */ + if (connector_type == DRM_MODE_CONNECTOR_HDMIA || + connector_type == DRM_MODE_CONNECTOR_HDMIB) { + struct cec_connector_info conn_info; + + cec_fill_conn_info_from_drm(&conn_info, &output->connector); + output->cec = cec_notifier_conn_register(output->dev, NULL, + &conn_info); + if (!output->cec) + return -ENOMEM; + } + return 0; } From patchwork Wed Aug 14 10:45:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dariusz Marcinkiewicz X-Patchwork-Id: 11095245 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 355D31399 for ; Thu, 15 Aug 2019 08:36:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 251CB2811A for ; Thu, 15 Aug 2019 08:36:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 18F8328842; Thu, 15 Aug 2019 08:36:10 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id ACF622811A for ; Thu, 15 Aug 2019 08:36:09 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A45416E8F0; Thu, 15 Aug 2019 08:35:00 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qk1-x749.google.com (mail-qk1-x749.google.com [IPv6:2607:f8b0:4864:20::749]) by gabe.freedesktop.org (Postfix) with ESMTPS id 61B426E5D5 for ; Wed, 14 Aug 2019 10:46:18 +0000 (UTC) Received: by mail-qk1-x749.google.com with SMTP id o4so10286575qkg.11 for ; Wed, 14 Aug 2019 03:46:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=Of6ed+SG6IaRF067LO6aebfGQ9pAYa64vgMYvUHNVMc=; b=NhgTvb+QG0NA4gMxZ4P8iBKi9gcUMaZq0TgV8neA6vXrdF8cyoV4FcLmFPMvcGjovP XOlabuJ0pfpRqX6TzNvtAFxoFb0ps2rtiYlHjzgB3M/hPu0Oz07oVKKUd0GVe8qL3tdF +dbNSc4j3NrjqGxImJ4hfs7bgMXopIm6WnsJDMTtDMUtBl+ZyJZ86FoyKaPWi0yC7iJI 8RjmaNiEmaipawwvQDxO+yAPtrcsKsxDjvqS0vUrXmivM7FKKGr3RPSbWyzxTQJ6hUWc yH0Af30WAu9mf75iLrFLtnZ4ZHV69nRb2f8vn0KmQhqGhbfXobvrf59HT4uSUvQJPOK7 DPCw== X-Gm-Message-State: APjAAAX5GrOu8tJCgAuF02GZdJjsQU6roNjTzCkS5sss+xurtOtJzEEw 2a6M0Vgq6+W1kntW5sL63/iGBvXglyFNpVTsavJ+MtHZd/iBIC8LE456NvBW6GBMzIMglVcEnK/ o3DFCt68lji4RXAptsdUe6mNcHJF42vG5ytyDRcESQs5OwmhsAqAZMYTOwY1QJy57ApD312hNIw == X-Google-Smtp-Source: APXvYqzRIDRZ2MlmouED+7HElSdB1DiQyMUAc5s2wc3KSNN39lyA3J65UQ3BVwSlBpRozPHTUNpk/Wsi8hk= X-Received: by 2002:a37:9a0b:: with SMTP id c11mr38400400qke.204.1565779576568; Wed, 14 Aug 2019 03:46:16 -0700 (PDT) Date: Wed, 14 Aug 2019 12:45:06 +0200 In-Reply-To: <20190814104520.6001-1-darekm@google.com> Message-Id: <20190814104520.6001-9-darekm@google.com> Mime-Version: 1.0 References: <20190814104520.6001-1-darekm@google.com> X-Mailer: git-send-email 2.23.0.rc1.153.gdeed80330f-goog Subject: [PATCH v7 8/9] drm: dw-hdmi: use cec_notifier_conn_(un)register From: Dariusz Marcinkiewicz To: dri-devel@lists.freedesktop.org, linux-media@vger.kernel.org, hverkuil-cisco@xs4all.nl X-Mailman-Approved-At: Thu, 15 Aug 2019 08:34:55 +0000 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=Of6ed+SG6IaRF067LO6aebfGQ9pAYa64vgMYvUHNVMc=; b=Q4S02tkSwCa+AAL66y9IabaihDxTpB+CHn7R/Er11fsINdYMVHZwHUiT0c0BP5Fzhe cmdCxKM/Nnz/pGTTTOZKHNlTYyoefj0PNbkcziJqnndV6Xm1gEYrDQ4XF5SRuipUmaiY 3vLR4+hMqyZS1eVZa6Uq0MFKVsT54qUcUYyofaaVwbyGmazjxICiUDxfelIp9z2ufBqL 0xIbAjF0qwllvf9J7QANMWcv+l570obH0ZcOIETKnXcrjicphS4Fh5irJNnepNhVmXtX vBA4gOgRSZkgb0UUhQ7ZoWT1KnXxW1GUxDWFqLkdkoDkJUUpDQZf9GoSCR3ZH4NaS4QL Zlcw== X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jernej Skrabec , Jonas Karlman , David Airlie , Neil Armstrong , Douglas Anderson , linux-kernel@vger.kernel.org, Sean Paul , Laurent Pinchart , Dariusz Marcinkiewicz , Sam Ravnborg Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Use the new cec_notifier_conn_(un)register() functions to (un)register the notifier for the HDMI connector, and fill in the cec_connector_info. Changes since v6: - move cec_notifier_conn_unregister to a bridge detach function, - add a mutex protecting a CEC notifier. Changes since v4: - typo fix Changes since v2: - removed unnecessary NULL check before a call to cec_notifier_conn_unregister, - use cec_notifier_phys_addr_invalidate to invalidate physical address. Changes since v1: Add memory barrier to make sure that the notifier becomes visible to the irq thread once it is fully constructed. Signed-off-by: Dariusz Marcinkiewicz Acked-by: Hans Verkuil Tested-by: Hans Verkuil Reviewed-by: Neil Armstrong --- drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 45 +++++++++++++++-------- 1 file changed, 30 insertions(+), 15 deletions(-) diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c index 83b94b66e464e..55162c9092f71 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c @@ -190,6 +190,7 @@ struct dw_hdmi { void (*enable_audio)(struct dw_hdmi *hdmi); void (*disable_audio)(struct dw_hdmi *hdmi); + struct mutex cec_notifier_mutex; struct cec_notifier *cec_notifier; }; @@ -2194,6 +2195,8 @@ static int dw_hdmi_bridge_attach(struct drm_bridge *bridge) struct dw_hdmi *hdmi = bridge->driver_private; struct drm_encoder *encoder = bridge->encoder; struct drm_connector *connector = &hdmi->connector; + struct cec_connector_info conn_info; + struct cec_notifier *notifier; connector->interlace_allowed = 1; connector->polled = DRM_CONNECTOR_POLL_HPD; @@ -2207,9 +2210,29 @@ static int dw_hdmi_bridge_attach(struct drm_bridge *bridge) drm_connector_attach_encoder(connector, encoder); + cec_fill_conn_info_from_drm(&conn_info, connector); + + notifier = cec_notifier_conn_register(hdmi->dev, NULL, &conn_info); + if (!notifier) + return -ENOMEM; + + mutex_lock(&hdmi->cec_notifier_mutex); + hdmi->cec_notifier = notifier; + mutex_unlock(&hdmi->cec_notifier_mutex); + return 0; } +static void dw_hdmi_bridge_detach(struct drm_bridge *bridge) +{ + struct dw_hdmi *hdmi = bridge->driver_private; + + mutex_lock(&hdmi->cec_notifier_mutex); + cec_notifier_conn_unregister(hdmi->cec_notifier); + hdmi->cec_notifier = NULL; + mutex_unlock(&hdmi->cec_notifier_mutex); +} + static enum drm_mode_status dw_hdmi_bridge_mode_valid(struct drm_bridge *bridge, const struct drm_display_mode *mode) @@ -2266,6 +2289,7 @@ static void dw_hdmi_bridge_enable(struct drm_bridge *bridge) static const struct drm_bridge_funcs dw_hdmi_bridge_funcs = { .attach = dw_hdmi_bridge_attach, + .detach = dw_hdmi_bridge_detach, .enable = dw_hdmi_bridge_enable, .disable = dw_hdmi_bridge_disable, .mode_set = dw_hdmi_bridge_mode_set, @@ -2373,9 +2397,11 @@ static irqreturn_t dw_hdmi_irq(int irq, void *dev_id) phy_stat & HDMI_PHY_HPD, phy_stat & HDMI_PHY_RX_SENSE); - if ((phy_stat & (HDMI_PHY_RX_SENSE | HDMI_PHY_HPD)) == 0) - cec_notifier_set_phys_addr(hdmi->cec_notifier, - CEC_PHYS_ADDR_INVALID); + if ((phy_stat & (HDMI_PHY_RX_SENSE | HDMI_PHY_HPD)) == 0) { + mutex_lock(&hdmi->cec_notifier_mutex); + cec_notifier_phys_addr_invalidate(hdmi->cec_notifier); + mutex_unlock(&hdmi->cec_notifier_mutex); + } } if (intr_stat & HDMI_IH_PHY_STAT0_HPD) { @@ -2561,6 +2587,7 @@ __dw_hdmi_probe(struct platform_device *pdev, mutex_init(&hdmi->mutex); mutex_init(&hdmi->audio_mutex); + mutex_init(&hdmi->cec_notifier_mutex); spin_lock_init(&hdmi->audio_lock); ddc_node = of_parse_phandle(np, "ddc-i2c-bus", 0); @@ -2693,12 +2720,6 @@ __dw_hdmi_probe(struct platform_device *pdev, if (ret) goto err_iahb; - hdmi->cec_notifier = cec_notifier_get(dev); - if (!hdmi->cec_notifier) { - ret = -ENOMEM; - goto err_iahb; - } - /* * To prevent overflows in HDMI_IH_FC_STAT2, set the clk regenerator * N and cts values before enabling phy @@ -2796,9 +2817,6 @@ __dw_hdmi_probe(struct platform_device *pdev, hdmi->ddc = NULL; } - if (hdmi->cec_notifier) - cec_notifier_put(hdmi->cec_notifier); - clk_disable_unprepare(hdmi->iahb_clk); if (hdmi->cec_clk) clk_disable_unprepare(hdmi->cec_clk); @@ -2820,9 +2838,6 @@ static void __dw_hdmi_remove(struct dw_hdmi *hdmi) /* Disable all interrupts */ hdmi_writeb(hdmi, ~0, HDMI_IH_MUTE_PHY_STAT0); - if (hdmi->cec_notifier) - cec_notifier_put(hdmi->cec_notifier); - clk_disable_unprepare(hdmi->iahb_clk); clk_disable_unprepare(hdmi->isfr_clk); if (hdmi->cec_clk) From patchwork Wed Aug 14 10:45:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dariusz Marcinkiewicz X-Patchwork-Id: 11095343 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8CF1A1398 for ; Thu, 15 Aug 2019 08:39:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7E78828842 for ; Thu, 15 Aug 2019 08:39:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7274828872; Thu, 15 Aug 2019 08:39:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 03AA028842 for ; Thu, 15 Aug 2019 08:39:04 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 626076E923; Thu, 15 Aug 2019 08:38:51 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-vk1-xa4a.google.com (mail-vk1-xa4a.google.com [IPv6:2607:f8b0:4864:20::a4a]) by gabe.freedesktop.org (Postfix) with ESMTPS id CB19B6E4D0 for ; Wed, 14 Aug 2019 10:46:22 +0000 (UTC) Received: by mail-vk1-xa4a.google.com with SMTP id a189so219043vkc.20 for ; Wed, 14 Aug 2019 03:46:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=4SGVKzSfOWWb5eHKsBAlwwo8FxZigEPwWxwM+lh0QRU=; b=sUANcyfvBbBspgJg/4J+8X+JL4GA6lQO/+rfWrG28Dq8/0lfjrVte0u0lqedTPfmnE sItR2utxcLY8lKXYjlmbyYbIh7bx75P9kWkx5s1hbSdhlTwQCRRmjgqOIB1uT28V4/DG 1TNRebZTwaZR2iFq8I+p0DjJBm7Vn7JxG3E8RX1hS47Z2MTW6AuatrtkROMXxXK3VZUn 4LHlenpiWkHhPPfvpwc0N3MGMnT0AKZAWL9AiFYDIEIv3iE+eOWsSUQ/p3uEwBby/MuS PIun5wcirBkqrfY5SJDXwx0I7EJwh4PctQJeXrbk9cnW5lHrgrkc0YtpWoVWW2Q7jjan KvUQ== X-Gm-Message-State: APjAAAXHqpKpfkr/TyxfkejkwYS21F7Puv+FNYzAK/n3tY7FkbZXQTiI j/8XDAMP9RDH2+e31rlrMiaSRO/HfZ0cS0+QZVMeHF2grdU1gFwAG+p82Hw7ey4dXBYTSVWFPMN 24RZcUla/4bdU9cmBYM2Mj2XRm65t3gbn0Ar/NjEPUdfwS+iYCWAuYL2ZxOQ+T1trX31WX0gWdw == X-Google-Smtp-Source: APXvYqwXZ7fmlU6P4H/oUbMNN/nO/AXuHUc6uhtW6sQQPOnLTG3uAvcrMDgfHUcNa4GJlUXADTntNKvmw/Q= X-Received: by 2002:a1f:7c0e:: with SMTP id x14mr6828024vkc.0.1565779581300; Wed, 14 Aug 2019 03:46:21 -0700 (PDT) Date: Wed, 14 Aug 2019 12:45:07 +0200 In-Reply-To: <20190814104520.6001-1-darekm@google.com> Message-Id: <20190814104520.6001-10-darekm@google.com> Mime-Version: 1.0 References: <20190814104520.6001-1-darekm@google.com> X-Mailer: git-send-email 2.23.0.rc1.153.gdeed80330f-goog Subject: [PATCH v7 9/9] drm: exynos: exynos_hdmi: use cec_notifier_conn_(un)register From: Dariusz Marcinkiewicz To: dri-devel@lists.freedesktop.org, linux-media@vger.kernel.org, hverkuil-cisco@xs4all.nl X-Mailman-Approved-At: Thu, 15 Aug 2019 08:34:55 +0000 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=4SGVKzSfOWWb5eHKsBAlwwo8FxZigEPwWxwM+lh0QRU=; b=jsibvCEaVrpw/TIVu7voxbDfejQBHrmB5WikoOLqMXW3Sz6KSshq9AHg5uJF+51H7A BzZGy+I1w9PPt7wVhSUK1mLfrAROtdLA6BauC8IvBF3UYhGVr/xbBxog/ugoCPM08jgm RMlTYL2a2K6mkw858Ip783T1xBDXOaH3+AcaRHMUV7TcYiCYF6fTPu7GjLFmxSHARTgm LedOl5171OM4hR+KhMB2EWKKFvjnL99MoEryuXx36fhWtPGML6nkft+ugutYtG9IS063 f74pWb3nL7BZ1SXUsllZ71l9xdLWb1j9bQeDEa5Oba66jqEZ8cwGCnOWBlCxSYXjQBAe Eq7Q== X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-samsung-soc@vger.kernel.org, David Airlie , Seung-Woo Kim , linux-kernel@vger.kernel.org, Krzysztof Kozlowski , Kyungmin Park , Kukjin Kim , Dariusz Marcinkiewicz , linux-arm-kernel@lists.infradead.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Use the new cec_notifier_conn_(un)register() functions to (un)register the notifier for the HDMI connector, and fill in the cec_connector_info. Changes since v2: - removed unnecessary call to invalidate phys address before deregistering the notifier, - use cec_notifier_phys_addr_invalidate instead of setting invalid address on a notifier. Signed-off-by: Dariusz Marcinkiewicz Tested-by: Hans Verkuil Acked-by: Hans Verkuil Reviewed-by: Sylwester Nawrocki --- drivers/gpu/drm/exynos/exynos_hdmi.c | 31 ++++++++++++++++------------ 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c index bc1565f1822ab..d532b468d9af5 100644 --- a/drivers/gpu/drm/exynos/exynos_hdmi.c +++ b/drivers/gpu/drm/exynos/exynos_hdmi.c @@ -852,6 +852,10 @@ static enum drm_connector_status hdmi_detect(struct drm_connector *connector, static void hdmi_connector_destroy(struct drm_connector *connector) { + struct hdmi_context *hdata = connector_to_hdmi(connector); + + cec_notifier_conn_unregister(hdata->notifier); + drm_connector_unregister(connector); drm_connector_cleanup(connector); } @@ -935,6 +939,7 @@ static int hdmi_create_connector(struct drm_encoder *encoder) { struct hdmi_context *hdata = encoder_to_hdmi(encoder); struct drm_connector *connector = &hdata->connector; + struct cec_connector_info conn_info; int ret; connector->interlace_allowed = true; @@ -957,6 +962,15 @@ static int hdmi_create_connector(struct drm_encoder *encoder) DRM_DEV_ERROR(hdata->dev, "Failed to attach bridge\n"); } + cec_fill_conn_info_from_drm(&conn_info, connector); + + hdata->notifier = cec_notifier_conn_register(hdata->dev, NULL, + &conn_info); + if (hdata->notifier == NULL) { + ret = -ENOMEM; + DRM_DEV_ERROR(hdata->dev, "Failed to allocate CEC notifier\n"); + } + return ret; } @@ -1528,8 +1542,8 @@ static void hdmi_disable(struct drm_encoder *encoder) */ mutex_unlock(&hdata->mutex); cancel_delayed_work(&hdata->hotplug_work); - cec_notifier_set_phys_addr(hdata->notifier, - CEC_PHYS_ADDR_INVALID); + if (hdata->notifier) + cec_notifier_phys_addr_invalidate(hdata->notifier); return; } @@ -2006,12 +2020,6 @@ static int hdmi_probe(struct platform_device *pdev) } } - hdata->notifier = cec_notifier_get(&pdev->dev); - if (hdata->notifier == NULL) { - ret = -ENOMEM; - goto err_hdmiphy; - } - pm_runtime_enable(dev); audio_infoframe = &hdata->audio.infoframe; @@ -2023,7 +2031,7 @@ static int hdmi_probe(struct platform_device *pdev) ret = hdmi_register_audio_device(hdata); if (ret) - goto err_notifier_put; + goto err_runtime_disable; ret = component_add(&pdev->dev, &hdmi_component_ops); if (ret) @@ -2034,8 +2042,7 @@ static int hdmi_probe(struct platform_device *pdev) err_unregister_audio: platform_device_unregister(hdata->audio.pdev); -err_notifier_put: - cec_notifier_put(hdata->notifier); +err_runtime_disable: pm_runtime_disable(dev); err_hdmiphy: @@ -2054,12 +2061,10 @@ static int hdmi_remove(struct platform_device *pdev) struct hdmi_context *hdata = platform_get_drvdata(pdev); cancel_delayed_work_sync(&hdata->hotplug_work); - cec_notifier_set_phys_addr(hdata->notifier, CEC_PHYS_ADDR_INVALID); component_del(&pdev->dev, &hdmi_component_ops); platform_device_unregister(hdata->audio.pdev); - cec_notifier_put(hdata->notifier); pm_runtime_disable(&pdev->dev); if (!IS_ERR(hdata->reg_hdmi_en))