From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.9 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, FROM_EXCESS_BASE64,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5E625C43381 for ; Mon, 25 Mar 2019 06:18:53 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2B7122075E for ; Mon, 25 Mar 2019 06:18:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="BPkJPcg6" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2B7122075E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=siol.net Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=DetJTlNQcNoBBEQEdi2bjJUAn+eFJzkjIw4l5qV4Bkc=; b=BPkJPcg6BLmacd O8etUCHa5BtXIvPxQvUAkA3zsZKVD8dgaKaENQKoFCgzwl85BTEFiAAkn8To4hkERJUm3V4IEZLTo XMJsoUnRCeRp/2lTjiUuR9i+GmOS3AMMnabdYV039DyKFEIr/IhzWWZ4M8nbqcC/342yevDwjrHxW krMZ6/pgA1iSNTp3+qVlpN0fDDNE4z2spbC/EXdhssOmBEiQN6F0IUIOF9DQKvYvoMfnFe9mnc0bx IF4RulOx+vSZ71IPpPSumN3INOtRVcqPjW0B2P7dwMy6gzAHe2pwmmb+SaFRvJXHPw1gwldqDLF8Q VZW6vNJhA2WNyiJ3Q3Bg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h8IwW-0003dT-JJ; Mon, 25 Mar 2019 06:18:44 +0000 Received: from mailoutvs16.siol.net ([185.57.226.207] helo=mail.siol.net) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h8IwP-0003cl-Jv for linux-arm-kernel@lists.infradead.org; Mon, 25 Mar 2019 06:18:41 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.siol.net (Zimbra) with ESMTP id 5F30D521313; Mon, 25 Mar 2019 07:18:27 +0100 (CET) X-Virus-Scanned: amavisd-new at psrvmta12.zcs-production.pri Received: from mail.siol.net ([127.0.0.1]) by localhost (psrvmta12.zcs-production.pri [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id GspQSRoBxfG7; Mon, 25 Mar 2019 07:18:27 +0100 (CET) Received: from mail.siol.net (localhost [127.0.0.1]) by mail.siol.net (Zimbra) with ESMTPS id D7E7B5212F2; Mon, 25 Mar 2019 07:18:26 +0100 (CET) Received: from jernej-laptop.localnet (cpe-86-58-52-202.static.triera.net [86.58.52.202]) (Authenticated sender: jernej.skrabec@siol.net) by mail.siol.net (Zimbra) with ESMTPA id 1ADD552139E; Mon, 25 Mar 2019 07:18:25 +0100 (CET) From: Jernej =?utf-8?B?xaBrcmFiZWM=?= To: Laurent Pinchart Subject: Re: [PATCH 1/2] drm/bridge/synopsys: dw-hdmi: Add an option to suppress loading CEC driver Date: Mon, 25 Mar 2019 07:18:24 +0100 Message-ID: <2258732.39EEuFg67f@jernej-laptop> In-Reply-To: <20190325013531.GB4540@pendragon.ideasonboard.com> References: <20190324212144.3652-1-jernej.skrabec@siol.net> <20190324212144.3652-2-jernej.skrabec@siol.net> <20190325013531.GB4540@pendragon.ideasonboard.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190324_231837_823368_F40858AD X-CRM114-Status: GOOD ( 24.95 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: maxime.ripard@bootlin.com, airlied@linux.ie, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, a.hajda@samsung.com, wens@csie.org, daniel@ffwll.ch, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org Dne ponedeljek, 25. marec 2019 ob 02:35:31 CET je Laurent Pinchart napisal(a): > Hi Jernej, > > Thank you for the patch. > > On Sun, Mar 24, 2019 at 10:21:42PM +0100, Jernej Skrabec wrote: > > DW HDMI controller on some Allwinner SoCs has support for CEC, but due > > to additional logic put between CEC controller and pins, it doesn't work > > correctly, at least not with a lot of instrusive changes. Fortunately, > > it's still possible to bitbang protocol. > > > > For such cases, add a platform option to suppress loading CEC driver. If > > DW HDMI CEC driver would be loaded, it wouldn't work anyway and only > > cause a confusion with multiple /dev entries. > > > > Signed-off-by: Jernej Skrabec > > --- > > > > drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 2 +- > > include/drm/bridge/dw_hdmi.h | 2 ++ > > 2 files changed, 3 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c > > b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c index > > a63e5f0dae56..fdda26f8b056 100644 > > --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c > > +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c > > @@ -2634,7 +2634,7 @@ __dw_hdmi_probe(struct platform_device *pdev, > > > > hdmi->audio = platform_device_register_full(&pdevinfo); > > > > } > > > > - if (config0 & HDMI_CONFIG0_CEC) { > > + if (!plat_data->is_cec_unusable && (config0 & HDMI_CONFIG0_CEC)) { > > > > cec.hdmi = hdmi; > > cec.ops = &dw_hdmi_cec_ops; > > cec.irq = irq; > > > > diff --git a/include/drm/bridge/dw_hdmi.h b/include/drm/bridge/dw_hdmi.h > > index 66e70770cce5..764b8bcfa62c 100644 > > --- a/include/drm/bridge/dw_hdmi.h > > +++ b/include/drm/bridge/dw_hdmi.h > > @@ -144,6 +144,8 @@ struct dw_hdmi_plat_data { > > > > int (*configure_phy)(struct dw_hdmi *hdmi, > > > > const struct dw_hdmi_plat_data *pdata, > > unsigned long mpixelclock); > > > > + > > + unsigned int is_cec_unusable : 1; > > Strictly speaking your CEC controller isn't unusable, it's just a bit > difficult to use it according to your commit message. Would disable_cec > be a more appropriate field name ? And how difficult would it be to > support the hardware CEC controller, would that result in changes that > could be useful to other vendors too ? Ok, maybe naming of the variable is a bit harsh. Currently I don't know any other hardware with the same issue. While I don't know CEC protocol or DW HDMI CEC controller very well, I think it would be difficult to implement change of direction during ACK transmission. At that time, packet is not fully received or transmitted, so I doubt we could use any interrupt for that. In any case, I don't think it's worth the hassle and we should just use proven software implementation. Early attempt on fixing this on kernel provided by Allwinner resulted in very ugly code and I'm not sure it works 100% (driver based on i.MX6 one): https://github.com/jernejsk/OpenELEC-OPi2/blob/openelec-7.0/projects/H3/ patches/linux/linux-008-add-hw-hdmi-cec-support.patch#L1321 > > > }; > > > > struct dw_hdmi *dw_hdmi_probe(struct platform_device *pdev, _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel