From patchwork Wed Dec 6 01:42:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: JiaJie Ho X-Patchwork-Id: 174258 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp3824715vqy; Tue, 5 Dec 2023 17:43:25 -0800 (PST) X-Google-Smtp-Source: AGHT+IGxKz67kNenf+OoDq6PJwAPs+zatv65Wgr6AGMPOUML1tFL4D/Bd/VLfFf5Eo+DQoyX64kY X-Received: by 2002:a17:90a:d304:b0:286:9204:da51 with SMTP id p4-20020a17090ad30400b002869204da51mr2488103pju.34.1701827005327; Tue, 05 Dec 2023 17:43:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701827005; cv=none; d=google.com; s=arc-20160816; b=hSdWyK+8VXEd38hr1k5dThD+2+VrMur0A97WslSwPw0AGYs2PINhtP5zzetsYHarMJ tVNRJZuTm0oy+dr+/mrBwRjkL7TDoBF9p91Ru68c98Ba7b0Tj7/uEcovRTVzoAhSP26s /gDSEeO6owZTQi1JqgA4u+v/YQdcJAD8OngMe7PbsAg863hBDvRJG1AcwNRffxjlQVOU DLwOboSehGbiNszJx7ACADGGEU2NwURHFbav1EOo5iAFJ4nDJAiuk0JDZFdWvUO6iO/H 9AR/oGu5BZvv12dehweoo7WAL5w/JZvlR61Jx0z/7nhY5epUK8kQKOwsxYa0L4/WT9px MDJg== 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:to:from; bh=a4fpxVKKZm6wH5zj6qZUcNUc7ragnXTWWaABRVQDPVg=; fh=UgaLgXimiH774VNrJn8BUBFGfqqCiPxvq9A+qX5vBXk=; b=B6VmNejSYqVbIm6HVaKXRQzx89y4HItcRi8YA2iOdDnP4OFpXr1phyWTQbUIDjKvIq 3n1m/9t39vQOUqEr1ywW9pO3AaJsTfs3nhAiAtGlE9K4iRt0SzSpg5FMYSqyOJCqXzav JkSjiet9nQNMolz0bh2Y01NcZTk7Kh3Z3a1a+BqvEDxkNQTQa9bFfs/54WSqvK2gCJZV mcWFVBO2BH2mch+NgD5Inuql0SReparAWbiC5Ix2CiP7IsQ+5nXF4l5sMgE6WXdBbMYF caHyxMuNvuodr9LHRpn1KoiyAcxqRevUrQWQvHRJlYf8rK6C19TUwXCipsrz/kEzq187 BtWg== 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:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id il6-20020a17090b164600b002747da1ef66si10633533pjb.53.2023.12.05.17.43.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Dec 2023 17:43:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (Postfix) with ESMTP id 6AB20804C214; Tue, 5 Dec 2023 17:43:22 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376544AbjLFBmu convert rfc822-to-8bit (ORCPT + 99 others); Tue, 5 Dec 2023 20:42:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56746 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376502AbjLFBmp (ORCPT ); Tue, 5 Dec 2023 20:42:45 -0500 Received: from ex01.ufhost.com (ex01.ufhost.com [61.152.239.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3CB111AA; Tue, 5 Dec 2023 17:42:52 -0800 (PST) Received: from EXMBX165.cuchost.com (unknown [175.102.18.54]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "EXMBX165", Issuer "EXMBX165" (not verified)) by ex01.ufhost.com (Postfix) with ESMTP id 0CF6024E284; Wed, 6 Dec 2023 09:42:51 +0800 (CST) Received: from EXMBX068.cuchost.com (172.16.6.68) by EXMBX165.cuchost.com (172.16.6.75) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Wed, 6 Dec 2023 09:42:51 +0800 Received: from ubuntu.localdomain (202.188.176.82) by EXMBX068.cuchost.com (172.16.6.68) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Wed, 6 Dec 2023 09:42:47 +0800 From: Jia Jie Ho To: Olivia Mackall , Herbert Xu , Rob Herring , "Krzysztof Kozlowski" , Conor Dooley , , , Subject: [PATCH 3/3] hwrng: starfive - Add suspend-to-idle support Date: Wed, 6 Dec 2023 09:42:36 +0800 Message-ID: <20231206014236.1109832-4-jiajie.ho@starfivetech.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231206014236.1109832-1-jiajie.ho@starfivetech.com> References: <20231206014236.1109832-1-jiajie.ho@starfivetech.com> MIME-Version: 1.0 X-Originating-IP: [202.188.176.82] X-ClientProxiedBy: EXCAS066.cuchost.com (172.16.6.26) To EXMBX068.cuchost.com (172.16.6.68) X-YovoleRuleAgent: yovoleflag X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email 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 (groat.vger.email [0.0.0.0]); Tue, 05 Dec 2023 17:43:22 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784494953765631929 X-GMAIL-MSGID: 1784494953765631929 Define SET_SYSTEM_SLEEP_PM_OPS for StarFive TRNG driver. Signed-off-by: Jia Jie Ho --- drivers/char/hw_random/jh7110-trng.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/char/hw_random/jh7110-trng.c b/drivers/char/hw_random/jh7110-trng.c index 46272a9e5964..2f77f811a383 100644 --- a/drivers/char/hw_random/jh7110-trng.c +++ b/drivers/char/hw_random/jh7110-trng.c @@ -369,8 +369,12 @@ static int __maybe_unused starfive_trng_resume(struct device *dev) return 0; } -static DEFINE_SIMPLE_DEV_PM_OPS(starfive_trng_pm_ops, starfive_trng_suspend, - starfive_trng_resume); +static const struct dev_pm_ops starfive_trng_pm_ops = { + SET_SYSTEM_SLEEP_PM_OPS(starfive_trng_suspend, + starfive_trng_resume) + SET_RUNTIME_PM_OPS(starfive_trng_suspend, + starfive_trng_resume, NULL) +}; static const struct of_device_id trng_dt_ids[] __maybe_unused = { { .compatible = "starfive,jh7110-trng" },