From patchwork Fri Apr 14 10:25:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans Verkuil X-Patchwork-Id: 9681085 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 50B6E60132 for ; Fri, 14 Apr 2017 10:25:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 420ED281B7 for ; Fri, 14 Apr 2017 10:25:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 36F3628673; Fri, 14 Apr 2017 10:25:28 +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=-4.2 required=2.0 tests=BAYES_00, 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 009AE281B7 for ; Fri, 14 Apr 2017 10:25:27 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id F253A6E998; Fri, 14 Apr 2017 10:25:26 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from lb1-smtp-cloud2.xs4all.net (lb1-smtp-cloud2.xs4all.net [194.109.24.21]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3E7F06E99A for ; Fri, 14 Apr 2017 10:25:25 +0000 (UTC) Received: from tschai.lan ([46.9.235.119]) by smtp-cloud2.xs4all.net with ESMTP id 8ARJ1v0082bEJta01ARPSR; Fri, 14 Apr 2017 12:25:23 +0200 Received: from tschai.fritz.box (localhost [127.0.0.1]) by tschai.lan (Postfix) with ESMTPSA id 707A8185C23; Fri, 14 Apr 2017 12:25:12 +0200 (CEST) From: Hans Verkuil To: linux-media@vger.kernel.org Subject: [PATCH 2/8] omapdrm: encoder-tpd12s015: keep ls_oe_gpio high if CEC is enabled Date: Fri, 14 Apr 2017 12:25:06 +0200 Message-Id: <20170414102512.48834-3-hverkuil@xs4all.nl> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170414102512.48834-1-hverkuil@xs4all.nl> References: <20170414102512.48834-1-hverkuil@xs4all.nl> Cc: Tomi Valkeinen , Hans Verkuil , dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Hans Verkuil When the OMAP4 CEC support is enabled the CEC pin should always be on. So keep ls_oe_gpio high when CONFIG_OMAP4_DSS_HDMI_CEC is set. Background: even if the HPD is low it should still be possible to use CEC. Some displays will set the HPD low when they go into standby or when they switch to another input, but CEC is still available and able to wake up/change input for such a display. This is explicitly allowed by the CEC standard. Signed-off-by: Hans Verkuil --- drivers/gpu/drm/omapdrm/displays/encoder-tpd12s015.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/gpu/drm/omapdrm/displays/encoder-tpd12s015.c b/drivers/gpu/drm/omapdrm/displays/encoder-tpd12s015.c index 58276a48112e..757554e6d62f 100644 --- a/drivers/gpu/drm/omapdrm/displays/encoder-tpd12s015.c +++ b/drivers/gpu/drm/omapdrm/displays/encoder-tpd12s015.c @@ -46,6 +46,9 @@ static int tpd_connect(struct omap_dss_device *dssdev, dssdev->dst = dst; gpiod_set_value_cansleep(ddata->ct_cp_hpd_gpio, 1); +#ifdef CONFIG_OMAP4_DSS_HDMI_CEC + gpiod_set_value_cansleep(ddata->ls_oe_gpio, 1); +#endif /* DC-DC converter needs at max 300us to get to 90% of 5V */ udelay(300); @@ -64,6 +67,7 @@ static void tpd_disconnect(struct omap_dss_device *dssdev, return; gpiod_set_value_cansleep(ddata->ct_cp_hpd_gpio, 0); + gpiod_set_value_cansleep(ddata->ls_oe_gpio, 0); dst->src = NULL; dssdev->dst = NULL; @@ -146,11 +150,15 @@ static int tpd_read_edid(struct omap_dss_device *dssdev, if (!gpiod_get_value_cansleep(ddata->hpd_gpio)) return -ENODEV; +#ifndef CONFIG_OMAP4_DSS_HDMI_CEC gpiod_set_value_cansleep(ddata->ls_oe_gpio, 1); +#endif r = in->ops.hdmi->read_edid(in, edid, len); +#ifndef CONFIG_OMAP4_DSS_HDMI_CEC gpiod_set_value_cansleep(ddata->ls_oe_gpio, 0); +#endif return r; }