Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp641844ybl; Thu, 22 Aug 2019 02:35:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqxQqPoQW1IbsxcLC1KtWAkjifHAqoZGD48CQiW1ShReeWcVEDOOi1eM7U4QFIiGrUKcc7lt X-Received: by 2002:a17:902:61:: with SMTP id 88mr38501199pla.111.1566466529075; Thu, 22 Aug 2019 02:35:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566466529; cv=none; d=google.com; s=arc-20160816; b=mJjhqyPMbbFcO79+/vm2uGJSoCav72wVmSHmAfNwkiYr2+7632G/gn/7KAfISPWHO4 RnOT2jrUKC3Tkh2dMcNhqU4PR4ge2wx+3KcdduL/qMS4sZ2u6MClHXcbd9HraNvUCuXF 1v28LPn25ghWfbUESRpT6bnKN/SPBnYNGZ3xFQsFpco1aSFK71UygDWPwdT4YBUs7Y9Z elhgh6GfX/vjfLDwINfXxp6xfqTSHsWKhso4Vo/MG9zXuR0iF4cLWBDvYYO20ekE+ENQ BH7RYeMVwkaQm+j/OLwXfh4ksjNC2AYYNapkru3GhPoZVVqK5+8sJhCjQs//jd8NMva9 VYOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=XECiPBKamA4s9plRR9dp3caaiy6UCzPmqRyIvQeVSSs=; b=ERDfWSxYMGO50JC0RqQZPXupRD40TivdJDpJFuPVPzPpWlfRBOJS4R7GZbmkQg32B/ CGGma3MSUZvhxfHgaeyUKp7OefCk34PiZitpLyf+MoIpLaCuLl+sqRaD9k8qXZPrUKzB ikETboJ+xifCyO+aHwUh+OHEkmjP6zlvQoYT9TSFsASWEBYuT8aPu4dOJno6oj5oPkVQ qyT9diz+pk8wKQmnS4C2XoJ8PXw5idfsxEVxiGbYMKYLhu+NXo5fLQejCqRdaBe5mg2c f4IOGs8XmvlCAknCRLN+wF0Njkv3NlE0SjZzcTD7iepRS64dCjsaWXunHK6jC6me2eNr NLsw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f6si13950210plr.100.2019.08.22.02.35.13; Thu, 22 Aug 2019 02:35:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732092AbfHVILH (ORCPT + 99 others); Thu, 22 Aug 2019 04:11:07 -0400 Received: from lb2-smtp-cloud7.xs4all.net ([194.109.24.28]:49177 "EHLO lb2-smtp-cloud7.xs4all.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728519AbfHVILH (ORCPT ); Thu, 22 Aug 2019 04:11:07 -0400 Received: from [192.168.2.10] ([46.9.232.237]) by smtp-cloud7.xs4all.net with ESMTPA id 0iBRiabxwThuu0iBUij9WI; Thu, 22 Aug 2019 10:11:04 +0200 Subject: Re: [PATCH v7 6/9] drm: sti: use cec_notifier_conn_(un)register To: Dariusz Marcinkiewicz , dri-devel@lists.freedesktop.org, linux-media@vger.kernel.org Cc: David Airlie , linux-kernel@vger.kernel.org, Vincent Abriou , Benjamin Gaignard References: <20190814104520.6001-1-darekm@google.com> <20190814104520.6001-7-darekm@google.com> From: Hans Verkuil Message-ID: <00515839-a4bd-6721-8563-a16fbbaa7159@xs4all.nl> Date: Thu, 22 Aug 2019 10:11:00 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20190814104520.6001-7-darekm@google.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-CMAE-Envelope: MS4wfD3mDYGvx47Wy6gERwptdz9X8s4p9xGef0OydqGSa3W6iprNAGDQKaolMMAlvvLbecwFUP8VSGeaWtp8JPrSOzTzR4fO8gBnetG2oLLrOj0x9R9CuR/L d4j+MDawiw7eZ1qclL9j0/f+y48g7yfOzDLNtj/4YpaFMf+C927ewaJkf4XO4yCuWra7TaSB+vhvzGDE7e2OMzXvhr4wtm8gxkrQrDVvc1xSeKnh0ObKaHme oYRybMj0JalSyE6ZzZ0mElWR8L+nufhxluKkIZxAiJ+Z6VhySBHqpqSl53+cpshKEhLnxqzV+q/ERNBA5YqQw8v7CcmYlM/CeSr74my8V1xMxnSVWz4033R4 xHS00Ye/mqb7ipPOgzBtunZ82vma7RopOApctsb5nnO6TiQsjt4= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Adding Benjamin Gaignard. Benjamin, can you take a look at this and Ack it (or merge it if you prefer) and ideally test it as well. This is the only patch in this series that I could not test since I don't have any hardware. Regards, Hans On 8/14/19 12:45 PM, Dariusz Marcinkiewicz wrote: > 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 > --- > 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; > } > >