Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp7749287yba; Thu, 2 May 2019 15:45:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqzBub3l1ajG/GZ+px40DhvfwkC+R6xjhDEUBfhxTYdsXay1h4cPMMTXn9LZGHd4FSWJ5ssU X-Received: by 2002:a62:160b:: with SMTP id 11mr5667944pfw.88.1556837115556; Thu, 02 May 2019 15:45:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556837115; cv=none; d=google.com; s=arc-20160816; b=nqc8qIvM1Yv8obGM8WOaTHMj7DdCs+XGgwL7IsHLvTXayEdR/IObeZlrmUW+DU+2C3 tjTMsd9oNwWKbJ6mCi8lnc7JI749LigWO1nIZZrrSIJb531YMy37nkgHAJXjkWfXUnUB riDBsyO3RD1YC3o7dR1viyZZfstMbtzd7cfodWEP0ErlFxb96kidH5s7SJ6nVo1mx4EF rfWz1ncWB3W1LP+YWON5WSRZpws+xioyreX6nYDYgwGO1KCF/sts1JIqefU5fejLcZTY 1OLaA3uGEWPaR+lQLBq/oozkiWJFfsLDCLB0IgnM1CLf5jhBZ9d1GudTKJpBcaxW+5yt Uj7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=gBFW9ct9L9kxaMD7soK1MmMiGB02h+kun9/xHdLdz90=; b=QMd0sTtwUqYtEe7JIQwE6J6pQnXB7I5o5gzeSQpb0P6CcSyYTKlZK+msTpsuKhof8A 9iI/W/gDNBjsjP3rzFDhMzp567P4QGEVYTYu6L1R0Ky3MgPYndO3HUtGpa/czpGxnxSV ciDfOjFGQV/KMS1sUf4O3KGQ8PJUFW9nwRX4d+HwOBI22rE++nws2gs1im0ipe0mL1we vq0uw0bgCRKkUSX+ydCzXFL5MiC/W2AJRX6yNcWi792Idm4dtbCcIb8AgYZkAz6EzU/I eyAc4U70AxNNhYJceRKh0idvGLX6SFneMqcybxc6bebpu7WT1BApgW4b348xfaThQM4z W4rQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=T2KhVqVd; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f9si305505pgr.577.2019.05.02.15.44.59; Thu, 02 May 2019 15:45:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=T2KhVqVd; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726322AbfEBWif (ORCPT + 99 others); Thu, 2 May 2019 18:38:35 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:36756 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726022AbfEBWid (ORCPT ); Thu, 2 May 2019 18:38:33 -0400 Received: by mail-pg1-f195.google.com with SMTP id 85so1717145pgc.3 for ; Thu, 02 May 2019 15:38:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=gBFW9ct9L9kxaMD7soK1MmMiGB02h+kun9/xHdLdz90=; b=T2KhVqVdwh/tHXA/wuJoYTbXZFKGkASbAuQ7K5ZNHDkBqe7WFxueRi4ZQzm45gLf4R Eprg1hoU+uGGZPCaZsQ10mK8879RYaj1HzX7E6Gkx+D50IZ2JbFyfHeg0wUOiVob+Vuq GJ/ylfxE9UI2yU1NYWDMzrpIvzCZQxrMahzGM= 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:mime-version:content-transfer-encoding; bh=gBFW9ct9L9kxaMD7soK1MmMiGB02h+kun9/xHdLdz90=; b=OcGGwCzViQVEgOzBQyVTQbNasqD2k7gH0sBFP2g4bJ+bbHKNwUnkBzU4CEARHJeAH9 svS4vtdg+D4LxSOLxkKoUniXjw0eDO22Sedi3pyyu2H2gfpWRWgJXEig1w60AH9j/l3S bzi0FrHkVJ4xuY+tClybNavYTQTmNIv61DTNUW+5yQH6/FsoY8DR+UQYKh3gmJFuIcCJ cBiDW1Q/t8Ud0ghsGuHXePc1lY5Cq8H10EeM2I6/3rLokEzz+J9sCqjgbFTOLWNiqeQd dx032zaFWAVoDFfBiE3Ern3xc2cFkYTVu+f67WE8VBoYUuWTHorxNeqbBGN1KqeYMcLH GtEw== X-Gm-Message-State: APjAAAXcc4pg9j+KAVMcEKKDiCqUQ1EwS/SBIC7WiNpdXsRFH8DEwBrz l9BeosE/v9HaUZxtPrCvwJHOSA== X-Received: by 2002:a63:9dc8:: with SMTP id i191mr6416756pgd.91.1556836712382; Thu, 02 May 2019 15:38:32 -0700 (PDT) Received: from tictac2.mtv.corp.google.com ([2620:15c:202:1:24fa:e766:52c9:e3b2]) by smtp.gmail.com with ESMTPSA id k186sm244151pfc.137.2019.05.02.15.38.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 02 May 2019 15:38:31 -0700 (PDT) From: Douglas Anderson To: Heiko Stuebner , Sandy Huang , Andrzej Hajda , Laurent Pinchart Cc: linux-rockchip@lists.infradead.org, Neil Armstrong , mka@chromium.org, Sean Paul , Douglas Anderson , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, David Airlie , linux-arm-kernel@lists.infradead.org, Daniel Vetter Subject: [PATCH 2/2] drm/rockchip: dw_hdmi: Handle suspend/resume Date: Thu, 2 May 2019 15:38:08 -0700 Message-Id: <20190502223808.185180-2-dianders@chromium.org> X-Mailer: git-send-email 2.21.0.1020.gf2820cf01a-goog In-Reply-To: <20190502223808.185180-1-dianders@chromium.org> References: <20190502223808.185180-1-dianders@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Rockchip rk3288-based Chromebooks when you do a suspend/resume cycle: 1. You lose the ability to detect an HDMI device being plugged in. 2. If you're using the i2c bus built in to dw_hdmi then it stops working. Let's call the core dw-hdmi's suspend/resume functions to restore things. NOTE: in downstream Chrome OS (based on kernel 3.14) we used the "late/early" versions of suspend/resume because we found that the VOP was sometimes resuming before dw_hdmi and then calling into us before we were fully resumed. For now I have gone back to the normal suspend/resume because I can't reproduce the problems. Signed-off-by: Douglas Anderson --- drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c index 4cdc9f86c2e5..deb0e8c30c03 100644 --- a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c +++ b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c @@ -542,11 +542,31 @@ static int dw_hdmi_rockchip_remove(struct platform_device *pdev) return 0; } +static int __maybe_unused dw_hdmi_rockchip_suspend(struct device *dev) +{ + struct rockchip_hdmi *hdmi = dev_get_drvdata(dev); + + return dw_hdmi_suspend(hdmi->hdmi); +} + +static int __maybe_unused dw_hdmi_rockchip_resume(struct device *dev) +{ + struct rockchip_hdmi *hdmi = dev_get_drvdata(dev); + + return dw_hdmi_resume(hdmi->hdmi); +} + +const struct dev_pm_ops dw_hdmi_rockchip_pm = { + SET_SYSTEM_SLEEP_PM_OPS(dw_hdmi_rockchip_suspend, + dw_hdmi_rockchip_resume) +}; + struct platform_driver dw_hdmi_rockchip_pltfm_driver = { .probe = dw_hdmi_rockchip_probe, .remove = dw_hdmi_rockchip_remove, .driver = { .name = "dwhdmi-rockchip", + .pm = &dw_hdmi_rockchip_pm, .of_match_table = dw_hdmi_rockchip_dt_ids, }, }; -- 2.21.0.1020.gf2820cf01a-goog