Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp5865406ybi; Tue, 4 Jun 2019 13:44:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqxDfkc+ph3V6vlUJbwJhCpimfa9p3jqInRitO3VMqOb5/DsVBXZtNW+hkCKwQ0uLzyVfn9P X-Received: by 2002:a63:2224:: with SMTP id i36mr679456pgi.70.1559681040095; Tue, 04 Jun 2019 13:44:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559681040; cv=none; d=google.com; s=arc-20160816; b=MBAPM8UQceyYj72DZSpyCkEWnPvHvcXkg1MPVfYizGmiJ0EqSSBkF6RmufAcKGwu0h yM2P/NuX0yPuxqNt+yR3R4RFjp5SKtOw28oeoqsSm3aT3/jhzOETsfx+L0TZyF12RIXb YzioKOuokB/px5bE67YlE8ekhtsZxHZcADqwHsNygn3pgHvs6pWkIT+dUf7zuYvsMfo+ wnDVytJ2bK6EsAIttodR1cAepc9O2X2pbKjLPENy0JrMxem1cbU8FF7VO8OUfOECyddt dDce/Avcu/53svxeM5exch1UTbmZELBtMr34b37KPkysSUaYDGcNN3xCquleF+wtYbHt AUoQ== 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=NL5DPTKKMNZWvD7Hnx1KIRpy/8nRGAMXIh44aNGHSaY=; b=B2Um0/dX4FzvJhWqQq1bO1oCTduwNBQwIZQq002m9X1chxh4SGKMcVdUpoaECuWSlE FH7w8xrT+nne/NdeXJxnqwXLY+jQP6UBe2PYFVPj4o3QT0c9zJ/pOQxcPWYLO540wU1d fr39eORB4eTIyjqG2TiderermHoMeSNsSwKm+LS2nB4HnCQ/t8vAr/aQI7dJUMHQB8UJ OPkKOdpvEuAnilidHKE656pIobwG0y63DxvowHvhwruUdyZXHfqeEmBzqX+d865+bgId P9dBmMog471gWSLB5tDA0q+zEzaEtucJuSOzw+9SFJmXCBrhCOO6A8mP+6n27P1F+qm5 mq+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=TVOLIvqX; 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 i1si25262036pfd.258.2019.06.04.13.43.43; Tue, 04 Jun 2019 13:44:00 -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=TVOLIvqX; 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 S1726559AbfFDUmf (ORCPT + 99 others); Tue, 4 Jun 2019 16:42:35 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:47082 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726427AbfFDUmd (ORCPT ); Tue, 4 Jun 2019 16:42:33 -0400 Received: by mail-pf1-f196.google.com with SMTP id y11so13371262pfm.13 for ; Tue, 04 Jun 2019 13:42:33 -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=NL5DPTKKMNZWvD7Hnx1KIRpy/8nRGAMXIh44aNGHSaY=; b=TVOLIvqXNvIKZDyIwK8wpLxqIpKlUqfTCiUrsEkG21UZPFVpKJ6u/ERmqbwBnZ100J MXZP+S/ZMqjo48TC2q466d1DX8mhAZ31orqtTrnRjWiiiEZT++FMmvnf+4CFvTY0hdRh jRJliijhyE9rK1ULJ56hNMxT1YaXl3L8Q43wg= 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=NL5DPTKKMNZWvD7Hnx1KIRpy/8nRGAMXIh44aNGHSaY=; b=rraWdk24X7UNNNlR3WRYzHJ5xLnTz9GAoY80Nrg1OWpgdw13OIF+cUORoODGupyu34 8PEUN0f7m8jNKU8v9P+yV9LnOUTR3TqFOaXl1mG8Cvuh6w6ZOEpaW9CQdudbzjo9uuF9 c1eMnpCmAS4djFQv1qC3Y60iaGKJeLOnmNCIbsPj8N0WNkLdj3yYq/gRkwHTqwVsbiiE DxEbtIGvCUczKcHI84zW6IlMlooRaMusytAV6Pyu5RZ64YS3C2pZgcdGRADIW6+bpA0s D01XPk0hTAqIFiU4187RUbPAqwykatglJLKgMKLrPTw8k6/ag+ZrqWSLSgkDyD1gZWXF 4gdA== X-Gm-Message-State: APjAAAWJ5VJjSDuSb5Chzuw4DR0n9F/S+0KEv+sn3NNz8a/+FdDh6+Ye +M1YL0AedPfofaQ/UvYy0ugLdw== X-Received: by 2002:a63:2bd1:: with SMTP id r200mr633202pgr.202.1559680952939; Tue, 04 Jun 2019 13:42: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 m5sm11553616pgn.59.2019.06.04.13.42.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Jun 2019 13:42:32 -0700 (PDT) From: Douglas Anderson To: Sean Paul , Heiko Stuebner , Sandy Huang , Andrzej Hajda , Laurent Pinchart Cc: linux-rockchip@lists.infradead.org, Neil Armstrong , mka@chromium.org, Douglas Anderson , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, David Airlie , linux-arm-kernel@lists.infradead.org, Daniel Vetter Subject: [PATCH v3 2/2] drm/rockchip: dw_hdmi: Handle suspend/resume Date: Tue, 4 Jun 2019 13:42:07 -0700 Message-Id: <20190604204207.168085-2-dianders@chromium.org> X-Mailer: git-send-email 2.22.0.rc1.311.g5d7573a151-goog In-Reply-To: <20190604204207.168085-1-dianders@chromium.org> References: <20190604204207.168085-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 --- Changes in v3: - dw_hdmi_resume() is now a void function (Laurent) Changes in v2: - Add forgotten static (Laurent) - No empty stub for suspend (Laurent) drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c index 4cdc9f86c2e5..7bb0f922b303 100644 --- a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c +++ b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c @@ -542,11 +542,25 @@ static int dw_hdmi_rockchip_remove(struct platform_device *pdev) return 0; } +static int __maybe_unused dw_hdmi_rockchip_resume(struct device *dev) +{ + struct rockchip_hdmi *hdmi = dev_get_drvdata(dev); + + dw_hdmi_resume(hdmi->hdmi); + + return 0; +} + +static const struct dev_pm_ops dw_hdmi_rockchip_pm = { + SET_SYSTEM_SLEEP_PM_OPS(NULL, 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.22.0.rc1.311.g5d7573a151-goog