From patchwork Tue Jun 4 20:42:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 10976049 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 D90F614B6 for ; Tue, 4 Jun 2019 20:42:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C687426538 for ; Tue, 4 Jun 2019 20:42:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BA5CA2883C; Tue, 4 Jun 2019 20:42:38 +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 2E0C127F94 for ; Tue, 4 Jun 2019 20:42:38 +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: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:In-Reply-To:References: List-Owner; bh=ODXfvfTBmXRwTB/EslzDXbOzQQuSON//Xl3wv+xYXvg=; b=qXh+uiLkgs+kQR QjJIlu5DS2/eJ5G9UpNpPEMSbQ2ity4mZIuuZHknoa/tXRdX+9Z2Bs7RKqStF0p1pxKoGEjQpcP/+ Spj0092YTrx6Dle74wvqfz5vAYRwz3JsYrVotoGvNLFPuSKM0fCdX6E8iW0dlsh7WkwphAVUuCvoz qjn2I1IRLVODqQqXW6T3kLsM/eqTFwZxHQq2D0rD6GhFTlcy0QbM3ma9qrKPFO5ETc4+5oN5uRZDG O+1j83zti4m0AUvSyfI7ElX6P3UuUS9XRuuQ0TMYLAXuHgY6eU6mJ3uoWTtl7OjT60sie6+C65+N/ O/G7UXdm7RnFP4imUeYw==; 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 1hYGGR-0000Ry-Qu; Tue, 04 Jun 2019 20:42:35 +0000 Received: from mail-pl1-x643.google.com ([2607:f8b0:4864:20::643]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hYGGO-0000Qj-El for linux-rockchip@lists.infradead.org; Tue, 04 Jun 2019 20:42:34 +0000 Received: by mail-pl1-x643.google.com with SMTP id x7so7812688plr.12 for ; Tue, 04 Jun 2019 13:42: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:mime-version :content-transfer-encoding; bh=n/HYQ/vk4D8YwsOYcNtmXEt7k4Cw/SNCazVxbSK/MBw=; b=Oe/GAvOveh8cEnZRbjewFICZg+C+Mz/D/CnWC95t1aKO8nC/4h7shSTzLU1vBw2wNk Q1E2ChcF+TNLJ2tV6Ni7gtfIe57YJiqgABXAPEz6xUQT5FB5SryOZlCsF80LZflBgjCo x1xz8v+X7QR/1VrE0lLahDkyw4U3TwBM8X1Yg= 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:mime-version :content-transfer-encoding; bh=n/HYQ/vk4D8YwsOYcNtmXEt7k4Cw/SNCazVxbSK/MBw=; b=FFlvdbulUCOSm1l2d7cPp8sp12UA8UD9zScXQhc49xhotgge8924EMdBd0r8p86zdE Mh+SI8BnTWnm4y1mHaXwwPBlLaSWiCrRxoRmHxpeoINKxxCnnEcOnrcC2oRXp8h3gAYm iw0Vdghz/AxwEO8Bs3mtxkN4yazhAr30JSkMNW9WRoJV2N9uJ6O2X+We4k5fMpwm/daI +OQWkN2aMOQQ++ELtYPBinAiDiG2+i1mb/Lr5btGW1ubIZAg3TpS1tG47uauJYeBP3xI OXyafuRFisj65aYXIn/ozwEcE9XK0KAa/FjUzsEZ7vzBtC21BjjGq0XNk2xy3WR5+Wk0 W9Yg== X-Gm-Message-State: APjAAAUT7GjcB3Rg2FHNpSKXE+w6omIu3Q5fUtAuEHMRWoyghg+z3vnX myFIxerTlF+C74+9JO5sl+fvJw== X-Google-Smtp-Source: APXvYqxZ3/7BjsatDoJITrpZzUz7cdM4OD6rVIjnIvwx6bqgW4w4ZY2kqNMfOkqzav5S1V+S/pPOEw== X-Received: by 2002:a17:902:347:: with SMTP id 65mr39818136pld.232.1559680951603; Tue, 04 Jun 2019 13:42:31 -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.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Jun 2019 13:42:30 -0700 (PDT) From: Douglas Anderson To: Sean Paul , Heiko Stuebner , Sandy Huang , Andrzej Hajda , Laurent Pinchart Subject: [PATCH v3 1/2] drm: bridge: dw-hdmi: Add hook for resume Date: Tue, 4 Jun 2019 13:42:06 -0700 Message-Id: <20190604204207.168085-1-dianders@chromium.org> X-Mailer: git-send-email 2.22.0.rc1.311.g5d7573a151-goog MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190604_134232_516318_69956101 X-CRM114-Status: GOOD ( 19.21 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jonas Karlman , David Airlie , Neil Armstrong , Douglas Anderson , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, mka@chromium.org, Laurent Pinchart , Daniel Vetter , Sam Ravnborg , =?utf-8?b?VmlsbGUgU3lyasOkbMOk?= , Zheng Yang Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=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 add a hook to the core dw-hdmi driver so that we can call it in dw_hdmi-rockchip in the next commit. NOTE: the exact set of steps I've done here in resume come from looking at the normal dw_hdmi init sequence in upstream Linux plus the sequence that we did in downstream Chrome OS 3.14. Testing show that it seems to work, but if an extra step is needed or something here is not needed we could improve it. As part of this change we'll refactor the hardware init bits of dw-hdmi to happen all in one function and all at the same time. Since we need to init the interrupt mutes before we request the IRQ, this means moving the hardware init earlier in the function, but there should be no problems with that. Also as part of this we now unconditionally init the "i2c" parts of dw-hdmi, but again that ought to be fine. Signed-off-by: Douglas Anderson Reviewed-by: Laurent Pinchart Reviewed-by: Sean Paul --- Changes in v3: - Change resume to void function (Laurent) Changes in v2: - No empty stub for suspend (Laurent) - Refactor to use the same code in probe and resume (Laurent) - Unconditionally init i2c (seems OK + needed before hdmi->i2c init) - Combine "init" of i2c and "setup" of i2c (no reason to split) drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 48 ++++++++++++++--------- include/drm/bridge/dw_hdmi.h | 2 + 2 files changed, 31 insertions(+), 19 deletions(-) diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c index 66bd66bad44c..a00ccf123877 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c @@ -228,6 +228,13 @@ static void hdmi_mask_writeb(struct dw_hdmi *hdmi, u8 data, unsigned int reg, static void dw_hdmi_i2c_init(struct dw_hdmi *hdmi) { + hdmi_writeb(hdmi, HDMI_PHY_I2CM_INT_ADDR_DONE_POL, + HDMI_PHY_I2CM_INT_ADDR); + + hdmi_writeb(hdmi, HDMI_PHY_I2CM_CTLINT_ADDR_NAC_POL | + HDMI_PHY_I2CM_CTLINT_ADDR_ARBITRATION_POL, + HDMI_PHY_I2CM_CTLINT_ADDR); + /* Software reset */ hdmi_writeb(hdmi, 0x00, HDMI_I2CM_SOFTRSTZ); @@ -1926,16 +1933,6 @@ static int dw_hdmi_setup(struct dw_hdmi *hdmi, struct drm_display_mode *mode) return 0; } -static void dw_hdmi_setup_i2c(struct dw_hdmi *hdmi) -{ - hdmi_writeb(hdmi, HDMI_PHY_I2CM_INT_ADDR_DONE_POL, - HDMI_PHY_I2CM_INT_ADDR); - - hdmi_writeb(hdmi, HDMI_PHY_I2CM_CTLINT_ADDR_NAC_POL | - HDMI_PHY_I2CM_CTLINT_ADDR_ARBITRATION_POL, - HDMI_PHY_I2CM_CTLINT_ADDR); -} - static void initialize_hdmi_ih_mutes(struct dw_hdmi *hdmi) { u8 ih_mute; @@ -2436,6 +2433,21 @@ static const struct regmap_config hdmi_regmap_32bit_config = { .max_register = HDMI_I2CM_FS_SCL_LCNT_0_ADDR << 2, }; +static void dw_hdmi_init_hw(struct dw_hdmi *hdmi) +{ + initialize_hdmi_ih_mutes(hdmi); + + /* + * Reset HDMI DDC I2C master controller and mute I2CM interrupts. + * Even if we are using a separate i2c adapter doing this doesn't + * hurt. + */ + dw_hdmi_i2c_init(hdmi); + + if (hdmi->phy.ops->setup_hpd) + hdmi->phy.ops->setup_hpd(hdmi, hdmi->phy.data); +} + static struct dw_hdmi * __dw_hdmi_probe(struct platform_device *pdev, const struct dw_hdmi_plat_data *plat_data) @@ -2587,7 +2599,7 @@ __dw_hdmi_probe(struct platform_device *pdev, prod_id1 & HDMI_PRODUCT_ID1_HDCP ? "with" : "without", hdmi->phy.name); - initialize_hdmi_ih_mutes(hdmi); + dw_hdmi_init_hw(hdmi); irq = platform_get_irq(pdev, 0); if (irq < 0) { @@ -2626,10 +2638,6 @@ __dw_hdmi_probe(struct platform_device *pdev, hdmi->bridge.of_node = pdev->dev.of_node; #endif - dw_hdmi_setup_i2c(hdmi); - if (hdmi->phy.ops->setup_hpd) - hdmi->phy.ops->setup_hpd(hdmi, hdmi->phy.data); - memset(&pdevinfo, 0, sizeof(pdevinfo)); pdevinfo.parent = dev; pdevinfo.id = PLATFORM_DEVID_AUTO; @@ -2682,10 +2690,6 @@ __dw_hdmi_probe(struct platform_device *pdev, hdmi->cec = platform_device_register_full(&pdevinfo); } - /* Reset HDMI DDC I2C master controller and mute I2CM interrupts */ - if (hdmi->i2c) - dw_hdmi_i2c_init(hdmi); - return hdmi; err_iahb: @@ -2789,6 +2793,12 @@ void dw_hdmi_unbind(struct dw_hdmi *hdmi) } EXPORT_SYMBOL_GPL(dw_hdmi_unbind); +void dw_hdmi_resume(struct dw_hdmi *hdmi) +{ + dw_hdmi_init_hw(hdmi); +} +EXPORT_SYMBOL_GPL(dw_hdmi_resume); + MODULE_AUTHOR("Sascha Hauer "); MODULE_AUTHOR("Andy Yan "); MODULE_AUTHOR("Yakir Yang "); diff --git a/include/drm/bridge/dw_hdmi.h b/include/drm/bridge/dw_hdmi.h index 66e70770cce5..601243b56b69 100644 --- a/include/drm/bridge/dw_hdmi.h +++ b/include/drm/bridge/dw_hdmi.h @@ -154,6 +154,8 @@ struct dw_hdmi *dw_hdmi_bind(struct platform_device *pdev, struct drm_encoder *encoder, const struct dw_hdmi_plat_data *plat_data); +void dw_hdmi_resume(struct dw_hdmi *hdmi); + void dw_hdmi_setup_rx_sense(struct dw_hdmi *hdmi, bool hpd, bool rx_sense); void dw_hdmi_set_sample_rate(struct dw_hdmi *hdmi, unsigned int rate); From patchwork Tue Jun 4 20:42:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 10976053 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 6E82214B6 for ; Tue, 4 Jun 2019 20:42:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5CE4C27F94 for ; Tue, 4 Jun 2019 20:42:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4E34828841; Tue, 4 Jun 2019 20:42:47 +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 E83EB27F94 for ; Tue, 4 Jun 2019 20:42:45 +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=IYb/Dlq3ThR1gzP4yuTC/vdqblc6fz3ZY2wPMSoo82w=; b=hPdPmbC7zJjqFj HS7+xYWHx+l3HysECkPN4vEt/kYRQEEHhG4j8CHzW3NWgNBaXCT3yG14PJI+VLKWpVupCSujhbV4Z OeOB7QUIv+VXjFh+noxw0RGNjueNtVIwf1eFj+mbnVcXl2/90oQMdBjGTzOfxL8ocByTfrNMa7hTD nGM0s1DR7w8K7OwUioLk7RWpqn+FEr17he4H6aqjsaKeSf/ZUd4Cyv0u0HBqvM8lvJ/aa4HqeEvVc KZozww8an5DXTFtG8q+BDh+u97XCUM+5PtEOyqRzxkDPowHiZMy/wOjQ+py1ZvghrjpWI/GrC8vf2 X4VZ9lDeL2LsFLg22L2w==; 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 1hYGGY-0000c3-EJ; Tue, 04 Jun 2019 20:42:42 +0000 Received: from mail-pf1-x443.google.com ([2607:f8b0:4864:20::443]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hYGGP-0000Qy-Mo for linux-rockchip@lists.infradead.org; Tue, 04 Jun 2019 20:42:35 +0000 Received: by mail-pf1-x443.google.com with SMTP id c85so4606652pfc.1 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=cBtWTyUX3l2zOlCJuLqFqAc1hiesHAdlC8Jb3aataACbApHpJ2329tQTk19wdmpLwi X9a0do/KnWjIozfT2LnrT92/GGIXDYW4guUULWqiqwP43ApocAWEJnSiMqRdAwHMbvJO kLXB3UGHmH+fA91FRqVcQAQ1Kv6+bc1r5jWSq4XjKUTGJX8n0D/5718ROzyH3POE7Vmq tVVYC4CwNIa9AMdXT4pwDU3WROotHy4Gb+DvxgQnGj3hmTUbskZ+tIYPRtn3yQz6jz6P QSJ8tiB5iL6BipDAbl/DAw0vey2tzIA4yLuq495Cnpph7dhm5rPAiqokfR7/GZzCX79Y gXEg== X-Gm-Message-State: APjAAAWuqhRFH/255nH48HhBNRUF/kkt8EUy1cgmUXCHAk7dF9oe43Ef HflDBCOjpDt9dgPSa37FUZBsew== X-Google-Smtp-Source: APXvYqy6yGca0NfMnlay8Iio+11gDCTu9XCNqkdRwwop7IybVxYxXjJ3nlJNPRuR6O5jg/ll53xR3w== 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190604_134233_740947_7DBA8B03 X-CRM114-Status: GOOD ( 11.43 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Upstream kernel work for Rockchip platforms 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, Daniel Vetter , linux-arm-kernel@lists.infradead.org Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=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: Sean Paul --- 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, }, };