Received: by 2002:a05:7412:b101:b0:e2:908c:2ebd with SMTP id az1csp2548875rdb; Wed, 15 Nov 2023 04:14:07 -0800 (PST) X-Google-Smtp-Source: AGHT+IFJMsTYKlCR+VPOEGkmEkl82ArNhuys2fHxYwlGc0WDTKlHQbJZSUVXDEH0d7QzFlhJWlBk X-Received: by 2002:a17:902:6b81:b0:1cc:c546:6425 with SMTP id p1-20020a1709026b8100b001ccc5466425mr4751141plk.59.1700050447393; Wed, 15 Nov 2023 04:14:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700050447; cv=none; d=google.com; s=arc-20160816; b=b5F/+xuorWEBs7PDyeu7re4Guikjna3YROjj3thlCPI1Wmg0CZ68yIG0OyCrK7R3Kp Rco7YsldyXovAvicSk5DckYSfKRgszxw9b08nGPRGJj4gyoCLxFtxPaggqKbnqLI0JfA cj2jiXrZVb/AmveqP0rDK/W34qfQwvYSIUnN8w/Ha5NH8q2Y6x6+M2dpi4yXmY7z+Tet TBiDKMLEq6yss5MxH30Ps2nRO4ZtoTByD5N4ovvYoSzrYCFMKat/5rND1gGb2ZerVc9k qf8TG8er5eGI+6H55OsjxxDsyMFon5VFP54DuP8xiYWNnPfWeWKRWJdEjE2RMAoeeZlZ WL0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=WcuYnKYAQkYjROqZJ8OgBWOSKmUGCInsdn+OyUOamtE=; fh=tuRwqhFTumQu2ECYJ6Qe2aJ9vkSVVqypQVV3QB9bBxE=; b=u0YU7gdbbTRZZZ2IDke1ITElTAEXrsoTVdQuIoz9pA912lhjM3sA2iOY6ksp/rxRed Z2yHcS7u2fha+OzNEC4LTNNhh+PbQq0YV4lsqQY3QT4J6hssUP2eFSZdT1v84Dk6qiaE dgRkmx5c/5zgUmJQhyqbOhfcyA5Gb1V3bje3DEi6QyLnPhxfy/FlPlCfAibq/y0ldsXa 9u3fFCv/M6xn1lNT/RJYScBezg5lQcFD7pyfuqoktRXLaS/jSQVRe8KcxIzPTqe85B9N GBbrXnce+CprJAVfkZznIHQ3iusNR9fB2ZFs1S+HuigFZGO9IE2vp4LX2AfxgNYwBEVL yQsA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id ix18-20020a170902f81200b001cc51ee5fb1si9638182plb.585.2023.11.15.04.14.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Nov 2023 04:14:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 4252F8184E37; Wed, 15 Nov 2023 04:14:06 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343727AbjKOMOD (ORCPT + 99 others); Wed, 15 Nov 2023 07:14:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50736 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234924AbjKOMNz (ORCPT ); Wed, 15 Nov 2023 07:13:55 -0500 Received: from mail11.truemail.it (mail11.truemail.it [217.194.8.81]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 21D7C121 for ; Wed, 15 Nov 2023 04:13:46 -0800 (PST) Received: from francesco-nb.pivistrello.it (93-49-2-63.ip317.fastwebnet.it [93.49.2.63]) by mail11.truemail.it (Postfix) with ESMTPA id F22302070A; Wed, 15 Nov 2023 13:13:42 +0100 (CET) From: Francesco Dolcini To: Adrien Grassein , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter Cc: Stefan Eichenberger , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Francesco Dolcini Subject: [PATCH v1 1/3] drm/bridge: lt8912b: Add suspend/resume support Date: Wed, 15 Nov 2023 13:13:36 +0100 Message-Id: <20231115121338.22959-2-francesco@dolcini.it> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231115121338.22959-1-francesco@dolcini.it> References: <20231115121338.22959-1-francesco@dolcini.it> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 15 Nov 2023 04:14:06 -0800 (PST) From: Stefan Eichenberger Add support for suspend and resume. The lt8912b will power off when going into suspend and power on when resuming. Signed-off-by: Stefan Eichenberger Signed-off-by: Francesco Dolcini --- drivers/gpu/drm/bridge/lontium-lt8912b.c | 28 ++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/drivers/gpu/drm/bridge/lontium-lt8912b.c b/drivers/gpu/drm/bridge/lontium-lt8912b.c index 03532efb893b..097ab04234b7 100644 --- a/drivers/gpu/drm/bridge/lontium-lt8912b.c +++ b/drivers/gpu/drm/bridge/lontium-lt8912b.c @@ -634,6 +634,33 @@ static const struct drm_bridge_funcs lt8912_bridge_funcs = { .get_edid = lt8912_bridge_get_edid, }; +static int lt8912_bridge_resume(struct device *dev) +{ + struct lt8912 *lt = dev_get_drvdata(dev); + int ret; + + ret = lt8912_hard_power_on(lt); + if (ret) + return ret; + + ret = lt8912_soft_power_on(lt); + if (ret) + return ret; + + return lt8912_video_on(lt); +} + +static int lt8912_bridge_suspend(struct device *dev) +{ + struct lt8912 *lt = dev_get_drvdata(dev); + + lt8912_hard_power_off(lt); + + return 0; +} + +static DEFINE_SIMPLE_DEV_PM_OPS(lt8912_bridge_pm_ops, lt8912_bridge_suspend, lt8912_bridge_resume); + static int lt8912_parse_dt(struct lt8912 *lt) { struct gpio_desc *gp_reset; @@ -770,6 +797,7 @@ static struct i2c_driver lt8912_i2c_driver = { .driver = { .name = "lt8912", .of_match_table = lt8912_dt_match, + .pm = pm_sleep_ptr(<8912_bridge_pm_ops), }, .probe = lt8912_probe, .remove = lt8912_remove, -- 2.25.1