From patchwork Tue Aug 13 11:02:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dariusz Marcinkiewicz X-Patchwork-Id: 11095269 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 CF00F1398 for ; Thu, 15 Aug 2019 08:36:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C198F2811A for ; Thu, 15 Aug 2019 08:36:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B50D32876B; Thu, 15 Aug 2019 08:36:44 +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 66D582876B for ; Thu, 15 Aug 2019 08:36:44 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 40C026E8F6; Thu, 15 Aug 2019 08:35:01 +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 A77906E0EF for ; Tue, 13 Aug 2019 11:03:49 +0000 (UTC) Received: by mail-qt1-x84a.google.com with SMTP id 41so93679536qtm.4 for ; Tue, 13 Aug 2019 04:03:49 -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=JFe3WsyopcIZtTBiQtYHBao+Udp1c/OlBUm6fPMqutlTj4kOpePDizoAUvefzabg9q UfnO0F4FMd4uscV57szy4/TL5yxUJCT6KIA/CzBcz/jGrfzuSI/g5VkdamNkW7GhfMBr 8j3YTefAWs7NogSnIkSyPRj04tL4SWp5CHJNpVd7q7aU/IK0WPLNSDKpKvRDT2nhIRSY UgZYpDgwlr6SbMs/hTKSIqRiaLz5btCx/Fd5ylYWOoFmjb791T14xjqMOQWpOH11AW1j ZLh1VVqsEtuMMHcOPtL/4qBwPzVKh3AtrgsYuPSGNbh5Hg886rl0fva3N/1nrDK2wTT1 oFpQ== X-Gm-Message-State: APjAAAWkDmPYB+qVjkdLrH/e3cbzWpG9clGmmFK7E7KCGhq9r8lQ5RuR epVPc0Vn2AbdCfAsRUqAuox6syutSa73a81LL3yat6Wo6E4GZ+9qmcK4M/yg6CWegr6M52nQc35 61dIxDyg9EsZEXNu9NVJYnLPbGaYp2mFjeK6+T5vPmyVsXNfdgK982GJ+1VL8HvVc/03ftnbLAA == X-Google-Smtp-Source: APXvYqyDDzweTJoOpSrCJBhYFA2bPdcntFbwhRbcFvhSWKkyE6mKScSn8KJ6qn2GtAZSopDoFcKlju1Uov8= X-Received: by 2002:ae9:f812:: with SMTP id x18mr26524005qkh.290.1565694228612; Tue, 13 Aug 2019 04:03:48 -0700 (PDT) Date: Tue, 13 Aug 2019 13:02:34 +0200 In-Reply-To: <20190813110300.83025-1-darekm@google.com> Message-Id: <20190813110300.83025-3-darekm@google.com> Mime-Version: 1.0 References: <20190813110300.83025-1-darekm@google.com> X-Mailer: git-send-email 2.23.0.rc1.153.gdeed80330f-goog Subject: [PATCH v6 2/8] 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=WONVccTIDftVGDULY91dHjvEzbQk3VhS9tlpsFUt/enibyOhbHo3b0DFcLewogMBDc xloAzgsKjOvC4JHqImA6XZqZ9jRNJ5EK4ZOiClT3bWa5BIHWdOsUPHw3sAG+6mNN+Wfu U8Abd4dxv6ucp2qlfEgK5xSyVYx2UF+yjDweJ+zWobe6kv0lykLYshfNTbDfIMe1Hfxn b+h7b0wcWnyH7KRBwS/M5bb+p26QB/Lh2KK1QgTroLTD2RlwxcRwJaSIJglkwTT8ESJp jRZAETsPoZjKR9LScyy1NPY89PdS90jvaEbg1HjVQGGD98Z3zzDrfnyPal6oeYj+jqDh +eyw== 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 , Neil Armstrong , open list , Laurent Pinchart , 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. 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 --- 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; }