From patchwork Thu Apr 7 13:20:35 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 65318 Delivered-To: patch@linaro.org Received: by 10.112.43.237 with SMTP id z13csp74847lbl; Thu, 7 Apr 2016 06:21:00 -0700 (PDT) X-Received: by 10.66.132.103 with SMTP id ot7mr4701248pab.27.1460035260101; Thu, 07 Apr 2016 06:21:00 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 16si88411pfo.244.2016.04.07.06.20.59; Thu, 07 Apr 2016 06:21:00 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756057AbcDGNU7 (ORCPT + 13 others); Thu, 7 Apr 2016 09:20:59 -0400 Received: from mail-lf0-f43.google.com ([209.85.215.43]:35365 "EHLO mail-lf0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751589AbcDGNU6 (ORCPT ); Thu, 7 Apr 2016 09:20:58 -0400 Received: by mail-lf0-f43.google.com with SMTP id c126so56888168lfb.2 for ; Thu, 07 Apr 2016 06:20:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=4xhtMv5OO+OpQ2gfpjm5G6wNW/kcwd7WyX8fY3mHoA4=; b=GztYAWo5Lf0HR9EbVQ1qYUaVtexWbkCczjumLpNsjjPKykFitdb0odITxO3V6cxWN2 xUY216TX1o/DYH63eLy9E/S06kksf6EYkUUxnn2NhJvXEUebPDq3AlRw6hI7cTKQcYB5 EYmVY+QoKlqT61GFv4qN2jd428eE4ejFlVRbE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=4xhtMv5OO+OpQ2gfpjm5G6wNW/kcwd7WyX8fY3mHoA4=; b=JfPZPdulkqWBKrzeTKs8hCODJK408aSGJsjNNoMJaI69QfnlLegfradqboR/+668x8 rOpH1j4zJSj1RUjGvC4qT9QqOelF6k3TEykLtO0kY9UdC+syAguNQY5AjpxX+96BnVcL 4xR5PgflM916qJgNztJQ540glk0qXpD4lGbqFQ8GedLS/p2N8rVpkMovXuJ4a1qy5o9M 2Kp4SkjknSrOkY3vVvyxbzsuTKlELVpPlmAHZKNR5EcWOOQrdWoKeJ99KT/5Qz5cqjlW 5d0JhrK45UGMYjG/B+XqrOwRblPx8on5aRIOfv3RMI6WiWxwjMVBBzblhzqLlsqUc2CX Lxzw== X-Gm-Message-State: AD7BkJKzVSgbcXT7lJ/SoTuJ7hRoB36JQIBw8fjs5Q+TMuhlhJ2g1Dui6VvwiPmuO+Os4wKM X-Received: by 10.25.136.84 with SMTP id k81mr1474934lfd.78.1460035256939; Thu, 07 Apr 2016 06:20:56 -0700 (PDT) Received: from localhost.localdomain ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id e141sm1279018lfe.18.2016.04.07.06.20.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Apr 2016 06:20:56 -0700 (PDT) From: Linus Walleij To: "Rafael J. Wysocki" , Wolfram Sang , Mark Brown , Ulf Hansson Cc: linux-pm@vger.kernel.org, Linus Walleij Subject: [PATCH 1/3] PM / sleep: add a helper function to inherit child ignorance Date: Thu, 7 Apr 2016 15:20:35 +0200 Message-Id: <1460035237-12037-2-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 2.4.3 In-Reply-To: <1460035237-12037-1-git-send-email-linus.walleij@linaro.org> References: <1460035237-12037-1-git-send-email-linus.walleij@linaro.org> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org A few subsystems dealing with peripherals on slow buses with transfer-oriented runtime PM will need to inherit the child ignorance property of their parent hardware devices. Especially struct i2c_adapter and struct spi_master needs this. This adds a helper function to deal with this and make it clear what is going on. Cc: Wolfram Sang Cc: Mark Brown Cc: Ulf Hansson Signed-off-by: Linus Walleij --- include/linux/device.h | 7 +++++++ 1 file changed, 7 insertions(+) -- 2.4.3 -- To unsubscribe from this list: send the line "unsubscribe linux-pm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/include/linux/device.h b/include/linux/device.h index 002c59728dbe..675c09e62239 100644 --- a/include/linux/device.h +++ b/include/linux/device.h @@ -961,6 +961,13 @@ static inline void pm_suspend_ignore_children(struct device *dev, bool enable) dev->power.ignore_children = enable; } +static inline void pm_suspend_inherit_ignore_children(struct device *dev) +{ + if (!dev->parent) + return; + dev->power.ignore_children = dev->parent->power.ignore_children; +} + static inline void dev_pm_syscore_device(struct device *dev, bool val) { #ifdef CONFIG_PM_SLEEP