From patchwork Thu May 2 22:38:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 10927705 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A94FE1395 for ; Thu, 2 May 2019 22:38:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 957B81FF83 for ; Thu, 2 May 2019 22:38:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 897E82640A; Thu, 2 May 2019 22:38:43 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 36D0A1FF83 for ; Thu, 2 May 2019 22:38:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=xIsw4v7cCoA49/G0COv5GpEw/V3rrXgg5YpicwC4Nds=; b=r3v/4QWcyA+/c/ KBAAGpSWh0MbtHLpiDMNG+47vwGJ43UKv/jRLFO7mohYakdDgyQ8X+Ngeyn38ArTrio4gJt5bQWTZ 95jV+U+fli8reHGkPYIucfy5Q/gi9p3+rAPgcxhwZlVSrur9cXnB+wQrPkhmMjpd2TSaR+vTlv8Da KxYohc9t3yCVTSJs24s8y4GIjM2okCzzUX6iC6qwg7f4+jsOJUjz3rkE9jlIYCFI8AtJBW/wLM40v qPSA8h5Mk9j5Pa3BRKh0NXxh5EYZwIeKtgMmIoDCZjY8nWrqVMPxSKydZVOqL2syPUxBk1meBKuBL UyyS6gE82bsxCee1IUdA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hMKLd-0007im-43; Thu, 02 May 2019 22:38:37 +0000 Received: from mail-pg1-x541.google.com ([2607:f8b0:4864:20::541]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hMKLY-0007hA-Ul for linux-arm-kernel@lists.infradead.org; Thu, 02 May 2019 22:38:34 +0000 Received: by mail-pg1-x541.google.com with SMTP id j26so1716461pgl.5 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=P6q4EczgHVzXUazxbFswL1TkoBNCOuSTwK6co05fuX4y5pO8IN36AMggEa3fgbjtHR gQxPVZYv2o/JSpyrAk+zN6pl9b8Pf3BePHtVza1z8M1gl+l7lJ5+oTB1m+6zstb8ce7F CXxRSO+7wajyz1FrnZ9Nc4I0CtpR/jlTuMMth9zi9Xm2YdoO4rktPRyf1kKao+4PTrWm cFyBz47B+JeQ3tSXJBTTlLoyZyrLIldjbsOEydrK7o8TkVjLJT9YEzxxE757HsQxjDbc 6SOeyuQL9atyugotkdWWI/8BWDznv05LFaQ/S0gizi7MAVhIZdekJpMnuKVlQNKG8zUi hk2g== X-Gm-Message-State: APjAAAVZsLiiMsZWXswQio93smCGlJnZW6J6REDc3DvmoZ+naM1AHBib TKxAXUCuzKLajcojcVMwbKD4ow== X-Google-Smtp-Source: APXvYqzq5JvWDWnU2WBxay5i7m7nGGZ4xrgcUbqlp6Nq6J2U3j8kQ26AAp/Vh8DDfS/M+iUafD66nQ== 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190502_153832_988078_629D7B27 X-CRM114-Status: GOOD ( 11.87 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Neil Armstrong , David Airlie , Douglas Anderson , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, mka@chromium.org, Sean Paul , Daniel Vetter , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Reviewed-by: Heiko Stuebner Reviewed-by: Laurent Pinchart --- 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, }, };