Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp876278pxb; Tue, 1 Feb 2022 12:14:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJxxc6HGe+vGjmcq0OhHhV+St3eqihiYL8YmRdRh6SFB8u8nRnmE9OirFN11/t4QgJB7WBlB X-Received: by 2002:a05:6a00:be4:: with SMTP id x36mr25990121pfu.77.1643746462796; Tue, 01 Feb 2022 12:14:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643746462; cv=none; d=google.com; s=arc-20160816; b=dS2VrhodSnIhoqwVcf4roRDTZHXl1ALVrW8MufXLvsdQF20PnwbFGPxAIBKbe/SHvj E8/mM+MY+5ZhBtgVrP6V6U6tU0fP/bKkAQgcEYDLpHCOSsZmRYw0h8kgQQ9pXPMf3M3+ kaFwStw8drlppBa1T05YcFo/vHetYdagDnvuahUA9W0Xn2yQEeb6UsixDGi/OtKAZHPy XjDB2075LBXn4GwSgmXB5tIrivwW74buSBhLppzw0CtRuiD9AaeylJyuPZKkeNsWcZTA d2FZl+TWbtSQpLfOtFct7HM421vLtMC2QBd9UgE9tWJY3wqFLEBWfQWjLmDXTJ6CXVEd Mqrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=rH1lZm8gZxW1NFBYJVtdrw+1w0JEyr4V064wVqtHF4w=; b=PPdkLM3lupVYrHK74EJTdaXIChXNQZI3tdtt85iiQvNMeTBdHmBFBFfiKb9OyoFwry G26KcjDvjfd8xMofOa6uNP86h3m5rxbJy30U07v3tlo1Balt8rNjQccK33Wt8+7uJihw Y7Nv30fhOyLRCowsPgkXe57vnubUuAyVSBASMsTKTAC7VJp5nVbrScG8Xv8yeds6l2qU aA45wlEUkLp5/gWcg8ism6CylmFbH6F6/j/RYy/o490kiZ4v0j5Pzc4ylZs8xc+7/dKk skF3xsPFcIPVPHYF+yDuSxzqL9D9GHLCUcd+D8l7mX0BxWikD+3ITxFOvDWnDNEhN5wn SxVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@goldelico.com header.s=strato-dkim-0002 header.b=kQmHUfwP; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f7si15911008pgc.3.2022.02.01.12.14.10; Tue, 01 Feb 2022 12:14:22 -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=pass header.i=@goldelico.com header.s=strato-dkim-0002 header.b=kQmHUfwP; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377615AbiAaM2B (ORCPT + 99 others); Mon, 31 Jan 2022 07:28:01 -0500 Received: from mo4-p04-ob.smtp.rzone.de ([85.215.255.124]:45165 "EHLO mo4-p04-ob.smtp.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377185AbiAaM1e (ORCPT ); Mon, 31 Jan 2022 07:27:34 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1643632023; s=strato-dkim-0002; d=goldelico.com; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Cc:Date: From:Subject:Sender; bh=rH1lZm8gZxW1NFBYJVtdrw+1w0JEyr4V064wVqtHF4w=; b=kQmHUfwP1aB560+N57NVDmPw8QBkXb1Uy1XOw19sjbUzEdT6Cy2M7n+HMEhuOY76bQ VLtc+E5v4YyzJIB7k2oRKhd3/qh4zD8JhyJ8rL2tyxsbw+T+KWkyqm5unlDZdkOfSCFI M4QsWFg9kc072amAwnsNc6FoXEc4xstLStmtanNsaoGcdz+JHip8NCafy8Dmdu30Cddb R42kgDZQpD6NXQOZCRm3ZI1oVcmR4n+/oKRgwUTncmO16Dqz1FwrA/o+PG233qMYZ+3B J+WKHRTFasYxavczggRUquM8LJGnXUwUevloOs/28q4/4NYjuU2Id9PAwaif0qrTgbc9 J7Qg== Authentication-Results: strato.com; dkim=none X-RZG-AUTH: ":JGIXVUS7cutRB/49FwqZ7WcJeFKiMhflhwDubTJ9o12DNOsPj0lByOdcK1L0" X-RZG-CLASS-ID: mo00 Received: from iMac.fritz.box by smtp.strato.de (RZmta 47.38.0 DYNA|AUTH) with ESMTPSA id j5fc80y0VCR3u8p (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Mon, 31 Jan 2022 13:27:03 +0100 (CET) From: "H. Nikolaus Schaller" To: Paul Cercueil , Rob Herring , Mark Rutland , Thomas Bogendoerfer , "H. Nikolaus Schaller" , Geert Uytterhoeven , Kees Cook , "Eric W. Biederman" , Miquel Raynal , David Airlie , Daniel Vetter , Neil Armstrong , Robert Foss , Laurent Pinchart , Jernej Skrabec , Harry Wentland , Sam Ravnborg , Maxime Ripard , Hans Verkuil , Liam Girdwood , Mark Brown , Paul Boddie , Andrzej Hajda , Kieran Bingham Cc: devicetree@vger.kernel.org, linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, letux-kernel@openphoenux.org, Jonas Karlman , dri-devel@lists.freedesktop.org Subject: [PATCH v12 7/9] drm/bridge: display-connector: add ddc-en gpio support Date: Mon, 31 Jan 2022 13:26:53 +0100 Message-Id: <77a7a1daaf381e1651be38adb62f9af9dd6c8fc5.1643632014.git.hns@goldelico.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org "hdmi-connector.yaml" bindings defines an optional property "ddc-en-gpios" for a single gpio to enable DDC operation. Usually this controls +5V power on the HDMI connector. This +5V may also be needed for HPD. This was not reflected in code. Now, the driver activates the ddc gpio after probe and deactivates after remove so it is "almost on". But only if this driver is loaded (and not e.g. blacklisted as module). Signed-off-by: H. Nikolaus Schaller --- drivers/gpu/drm/bridge/display-connector.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/drivers/gpu/drm/bridge/display-connector.c b/drivers/gpu/drm/bridge/display-connector.c index d24f5b90feabf..555395e301096 100644 --- a/drivers/gpu/drm/bridge/display-connector.c +++ b/drivers/gpu/drm/bridge/display-connector.c @@ -24,6 +24,7 @@ struct display_connector { int hpd_irq; struct regulator *dp_pwr; + struct gpio_desc *ddc_en; }; static inline struct display_connector * @@ -345,6 +346,19 @@ static int display_connector_probe(struct platform_device *pdev) } } + /* enable DDC */ + if (type == DRM_MODE_CONNECTOR_HDMIA) { + conn->ddc_en = devm_gpiod_get_optional(&pdev->dev, "ddc-en", + GPIOD_OUT_HIGH); + + if (IS_ERR(conn->ddc_en)) { + dev_err(&pdev->dev, "Couldn't get ddc-en gpio\n"); + return PTR_ERR(conn->ddc_en); + } + + gpiod_set_value(conn->ddc_en, 1); + } + conn->bridge.funcs = &display_connector_bridge_funcs; conn->bridge.of_node = pdev->dev.of_node; @@ -373,6 +387,9 @@ static int display_connector_remove(struct platform_device *pdev) { struct display_connector *conn = platform_get_drvdata(pdev); + if (conn->ddc_en) + gpiod_set_value(conn->ddc_en, 0); + if (conn->dp_pwr) regulator_disable(conn->dp_pwr); -- 2.33.0