Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3078789pxb; Sun, 31 Jan 2021 03:37:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJxOz3ENdApdgY60Fi6892xVDen9lD95HeZHAIJK+m/ysP5rwZwkG75TuzM8Eex5fORxwfvX X-Received: by 2002:a17:906:ce49:: with SMTP id se9mr12942956ejb.341.1612093019879; Sun, 31 Jan 2021 03:36:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612093019; cv=none; d=google.com; s=arc-20160816; b=nluQcn2ob4pXXtxG+kJ/j/N050I4RSTjHLaY9hYC+IzMY86324sSUTxTyayXYTBKVK +KAstMYgOrpvQnP9vbgAFCQt4wgMxde6hkO/1iWw+Hb11bvudJTZJle1pozTLfpRxGYE Gww6cVbmLO3E+pv7FauKal9MeZPEaf5LYmJNAosivBIx6E+oxxXFZPxEaufoBffZfCsO v5l0U6+sdGTF8iWHFpjmrvnHx1BY4jjWMxDLOrV2xZM0HaseQYJyKs4Dx85jrQ076wH1 83L8cY705753CKDmqD13LdApNSNZwelUOd2gGqLHhRlJy2G/EOTn0Dq+z4a6c4AcwfLb oLbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:content-transfer-encoding:mime-version :message-id:date:subject:cc:from:dkim-signature; bh=f1dMJBkuCpuzSoBdVy4qTTNPG0qSCGs+98UUW3VMWmQ=; b=lHlCKugq44dsZS9wQ096ZRQ/Ld6oDrbxS0oF3Egv+gcwgOtaq1KXnvtD7jpVwBWSGn hknk8Xhka5OIEfTQfW7cdJVWfW3SWryDxfiKvi4xKsoUTLAnMzG5cjxG0LxGpGSuIrex 44/wWspZ0CEtmJziCp0kdQcegHBNk5C2EF8xEC8bfek536mk8bKOM0Bn1qT1TEE1YZ2w fx/cOXceY6DEDQP6H4VgMioFNAH6WdelrquhkW58upBqrN3VWLFr/MBXZ53dvcJRqhC+ qBoqTMevXv9Acvt3OpHJtrO/vCqDK7HbzpUoxowJWuTZ3m7ZOGJqmdPKNhi7Tv5hM406 wKIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@aruko.org header.s=mail header.b=ivbh9MwR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aruko.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a3si9003938ejd.310.2021.01.31.03.36.34; Sun, 31 Jan 2021 03:36:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@aruko.org header.s=mail header.b=ivbh9MwR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aruko.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231492AbhAaLbu (ORCPT + 99 others); Sun, 31 Jan 2021 06:31:50 -0500 Received: from aruko.org ([45.79.249.221]:45562 "EHLO aruko.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230436AbhAaKD1 (ORCPT ); Sun, 31 Jan 2021 05:03:27 -0500 X-Greylist: delayed 386 seconds by postgrey-1.27 at vger.kernel.org; Sun, 31 Jan 2021 05:03:26 EST Received: from localhost.localdomain (unknown [213.111.80.72]) by aruko.org (Postfix) with ESMTPSA id 846097F490; Sun, 31 Jan 2021 09:56:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=aruko.org; s=mail; t=1612086979; bh=BR+v5+Lk98D4lDAW6A9QFAcr2Xt0wa+x6kocx5HNdWo=; h=From:To:Cc:Subject:Date; b=ivbh9MwRO2AXcUIv7cXD8CkWnS7ciFW5GM+j8AnnwD/ctqxV0yNwCfqLQFlh2QwC9 KH0RvaaE2BaO0poU2GRdJesve11fj6CztTcH9LKwj+WsdyjgGrIBec0mXK0d2qEYfA ArQ6FoQd3nlPLjQEb/8sPSDTQRw0Fd278MZxzyXg= From: Mykyta Poturai Cc: Mykyta Poturai , Andrzej Hajda , Neil Armstrong , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , David Airlie , Daniel Vetter , Sam Ravnborg , Boris Brezillon , Liu Ying , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] drm/bridge: dw-hdmi: Add DT binding to disable hotplug detect Date: Sun, 31 Jan 2021 11:55:35 +0200 Message-Id: <20210131095537.962292-1-ddone@aruko.org> X-Mailer: git-send-email 2.30.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add "disable-hpd" boolean binding for the device tree. When this option is turned on HPD-related IRQ is disabled and it is assumed that the HDMI connector is connected all the time. This may be useful in systems where it is impossible or undesirable to connect the HPD pin, or the connection is broken. Signed-off-by: Mykyta Poturai --- drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c index 0c79a9ba48bb..4ca0ac130beb 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c @@ -194,6 +194,7 @@ struct dw_hdmi { unsigned int audio_cts; unsigned int audio_n; bool audio_enable; + bool disable_hpd; unsigned int reg_shift; struct regmap *regm; @@ -1559,7 +1560,7 @@ static void dw_hdmi_phy_disable(struct dw_hdmi *hdmi, void *data) enum drm_connector_status dw_hdmi_phy_read_hpd(struct dw_hdmi *hdmi, void *data) { - return hdmi_readb(hdmi, HDMI_PHY_STAT0) & HDMI_PHY_HPD ? + return hdmi_readb(hdmi, HDMI_PHY_STAT0) & HDMI_PHY_HPD || hdmi->disable_hpd ? connector_status_connected : connector_status_disconnected; } EXPORT_SYMBOL_GPL(dw_hdmi_phy_read_hpd); @@ -1585,6 +1586,10 @@ void dw_hdmi_phy_setup_hpd(struct dw_hdmi *hdmi, void *data) * Configure the PHY RX SENSE and HPD interrupts polarities and clear * any pending interrupt. */ + + if (hdmi->disable_hpd) + return; + hdmi_writeb(hdmi, HDMI_PHY_HPD | HDMI_PHY_RX_SENSE, HDMI_PHY_POL0); hdmi_writeb(hdmi, HDMI_IH_PHY_STAT0_HPD | HDMI_IH_PHY_STAT0_RX_SENSE, HDMI_IH_PHY_STAT0); @@ -3212,6 +3217,10 @@ struct dw_hdmi *dw_hdmi_probe(struct platform_device *pdev, mutex_init(&hdmi->cec_notifier_mutex); spin_lock_init(&hdmi->audio_lock); + if (of_property_read_bool(np, "disable-hpd")) { + dev_info(hdmi->dev, "Disabling HPD\n"); + hdmi->disable_hpd = true; + } ddc_node = of_parse_phandle(np, "ddc-i2c-bus", 0); if (ddc_node) { hdmi->ddc = of_get_i2c_adapter_by_node(ddc_node); -- 2.30.0