From patchwork Tue Jan 17 00:52:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 9519705 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 2E552601C3 for ; Tue, 17 Jan 2017 00:53:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1918328339 for ; Tue, 17 Jan 2017 00:53:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0DFA528441; Tue, 17 Jan 2017 00:53:05 +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.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID 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 BE50028339 for ; Tue, 17 Jan 2017 00:53:04 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A7D9C6E599; Tue, 17 Jan 2017 00:53:02 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pf0-x232.google.com (mail-pf0-x232.google.com [IPv6:2607:f8b0:400e:c00::232]) by gabe.freedesktop.org (Postfix) with ESMTPS id B9F906E599 for ; Tue, 17 Jan 2017 00:53:01 +0000 (UTC) Received: by mail-pf0-x232.google.com with SMTP id y143so57196782pfb.0 for ; Mon, 16 Jan 2017 16:53:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=o2upXYjWmfaMmIKtkrtAWcv9SJuF68mVRfAmxFc85Oc=; b=cvkml/iDsxr6Js6SOofXZLsLXu3Hq9YM5BpuschaEPizuSHi4LS6KXiNjtzDDuEM8w BIqN0npkQVB+72ap1Zdpif3wEEqysMC7dT+0KUR0Z+4kR9QNr9CwY8LOHKuTpB2rPu7i ykrj/2sY/okfrk4wRedIOPeKjGoyPKyVjqftI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=o2upXYjWmfaMmIKtkrtAWcv9SJuF68mVRfAmxFc85Oc=; b=tlzoSEeLi15Tu3apftJ8DVEplWcoIwuZNCO8wf5m63i8yCGNbx90je2KS34PntmeLO X4up9R4nX50W4ytnkTYuTEnTnQ8Ypxv1oxwPz4oeVaOy2oloXvw1nWrdFKOKwRrvV73D 1uiu8/zBt3JtnnAHpoyDGkQqnh4sMACwU3MM6NbC1RuNa/bTM87QUcQj2z7COGXe8WsI aod53xzkzCHxXwV2t4hu2O/1KdX/klBFX1ZbdPMZnQJalzs+Qhn8qZ+VLlP7XZjisyWQ 3IPwW0Uti0JO6fj3XK95MDFzj+M7d6PrPvCUOFbkmgTLgKf4eTACtODoQ3iO/gY0+t/m rwDg== X-Gm-Message-State: AIkVDXLR+6T0Rk+zeJaK7Cv0QBye+tt0zuMG7d7GZwh5joRGBODPyf8v0YDptKsqmiClHR7K X-Received: by 10.98.35.25 with SMTP id j25mr33424986pfj.35.1484614381364; Mon, 16 Jan 2017 16:53:01 -0800 (PST) Received: from localhost.localdomain ([2601:1c2:1002:83f0:4e72:b9ff:fe99:466a]) by smtp.gmail.com with ESMTPSA id q19sm50220516pfl.21.2017.01.16.16.53.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 16 Jan 2017 16:53:00 -0800 (PST) From: John Stultz To: lkml Subject: [PATCH 5/6] drm/bridge: adv7511: Reuse __adv7511_power_on/off() when probing EDID Date: Mon, 16 Jan 2017 16:52:51 -0800 Message-Id: <1484614372-15342-6-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1484614372-15342-1-git-send-email-john.stultz@linaro.org> References: <1484614372-15342-1-git-send-email-john.stultz@linaro.org> Cc: dri-devel@lists.freedesktop.org, Wolfram Sang , Laurent Pinchart 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 Thus this patch changes the EDID probing logic so that we re-use the __adv7511_power_on/off() calls instead of duplciating logic. This does change behavior slightly as it adds the HPD signal pulse to the EDID probe path, but Archit has had a patch to add HPD signal pulse to the EDID probe path before, so this should address the cases where that helped. Cc: David Airlie Cc: Archit Taneja Cc: Wolfram Sang Cc: Lars-Peter Clausen Cc: Laurent Pinchart Cc: dri-devel@lists.freedesktop.org Signed-off-by: John Stultz Reviewed-by: Laurent Pinchart --- v4: Reworded commit message, focusing on re-use and HPD pulse behavior change. --- drivers/gpu/drm/bridge/adv7511/adv7511_drv.c | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c index 12f2876..d216f61 100644 --- a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c +++ b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c @@ -573,24 +573,13 @@ static int adv7511_get_modes(struct adv7511 *adv7511, unsigned int count; /* Reading the EDID only works if the device is powered */ - if (!adv7511->powered) { - regmap_update_bits(adv7511->regmap, ADV7511_REG_POWER, - ADV7511_POWER_POWER_DOWN, 0); - if (adv7511->i2c_main->irq) { - regmap_write(adv7511->regmap, ADV7511_REG_INT_ENABLE(0), - ADV7511_INT0_EDID_READY); - regmap_write(adv7511->regmap, ADV7511_REG_INT_ENABLE(1), - ADV7511_INT1_DDC_ERROR); - } - adv7511->current_edid_segment = -1; - } + if (!adv7511->powered) + __adv7511_power_on(adv7511); edid = drm_do_get_edid(connector, adv7511_get_edid_block, adv7511); if (!adv7511->powered) - regmap_update_bits(adv7511->regmap, ADV7511_REG_POWER, - ADV7511_POWER_POWER_DOWN, - ADV7511_POWER_POWER_DOWN); + __adv7511_power_off(adv7511); kfree(adv7511->edid); adv7511->edid = edid;