Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2471754imm; Mon, 16 Jul 2018 08:33:48 -0700 (PDT) X-Google-Smtp-Source: AAOMgpflDXFkR002uz+5fSuszbaE5vDgmyRuVoLg8NcGQz8eXPcsyKpUhnL13pARyJ39a6Zr3pU3 X-Received: by 2002:a63:2803:: with SMTP id o3-v6mr16051952pgo.158.1531755228649; Mon, 16 Jul 2018 08:33:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531755228; cv=none; d=google.com; s=arc-20160816; b=GQaZS+qWNJRA0mFhkxk1vSqRX/MoZJOkYFTS5mbBJ+tRO73C783MMkwbWIPvW+MaKn 2dz7m1STON+4KjfMTF7hunu1hwVx1MEJ4kTyOXTdOnjDSOwYpNfs4Mu+s3waNL1LHcTT H5/j2Zqh5M2SpW1ddtjqeENFAdi8pAmTPF0RHxZt250rv8RD9rePHCVGFniUQv9KkLDO BgzDBo5WnmR8/SDJpuRUiSCPpWQA6XYF2zcrsQAN94LM2CQ0fnhLhP+n+QGr8VeV9K7F Tpck/oKPf+mT+y/aNFc+WCYhqtuAkZBlmEAEZj8US6ZQzgFa/TMPQefbd5nH8L/XU4Dh RnPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=eabdPPYdkHRiS6r2LjCAwKm8/fUXIA3lb2Q4Y7wsJtE=; b=jjBmKUT1MezwTwcL8YVZ7hSYcY6astWRa7/pTcCCweDaxu1unG34Fty+b4nDHCTwZq I64Tn8mSYDqD9vlf2mUt5BjyDRm1WT9zRaaLsaGbt1NHIS2P9bbe+xDVcZVl0iBfbIxg TM076bwf8GRVk/JNam5Wc3dF1NhMshNxfz2ixgqdTqhei09jemjNwkoN3RW2h5KmMrfc T0PkJh5Vq8EGHLtCg9Fzn1GeYXng80h5yS7LjbGfR+LpnsyonwV77Qpa0Jt7x/nCUJtO 57WE2Udjo9c/fyILmaXH7NsyRbStGSe2S+hLp4x0p5BrBQBvQtnhXQzbz1Lxm1g7ZZ0j oRSA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 9-v6si31166025pla.59.2018.07.16.08.33.33; Mon, 16 Jul 2018 08:33:48 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730811AbeGPP6v (ORCPT + 99 others); Mon, 16 Jul 2018 11:58:51 -0400 Received: from andre.telenet-ops.be ([195.130.132.53]:34086 "EHLO andre.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728752AbeGPP6v (ORCPT ); Mon, 16 Jul 2018 11:58:51 -0400 Received: from ramsan.of.borg ([84.194.111.163]) by andre.telenet-ops.be with bizsmtp id BTWu1y00D3XaVaC01TWuJq; Mon, 16 Jul 2018 17:30:54 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtp (Exim 4.86_2) (envelope-from ) id 1ff5Sg-0007Mp-2K; Mon, 16 Jul 2018 17:30:54 +0200 Received: from geert by rox.of.borg with local (Exim 4.90_1) (envelope-from ) id 1ff5Sg-0000UI-0P; Mon, 16 Jul 2018 17:30:54 +0200 From: Geert Uytterhoeven To: Marek Vasut , Liam Girdwood , Mark Brown Cc: "Rafael J . Wysocki" , Pavel Machek , Len Brown , linux-pm@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH v4 0/3] regulator: bd9571mwv: Add support for toggle power switches Date: Mon, 16 Jul 2018 17:30:49 +0200 Message-Id: <20180716153052.1830-1-geert+renesas@glider.be> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi all, The ROHM BD9571MWV PMIC on the Renesas Salvator-X(S) and ULCB development boards supports DDR Backup Power, which means that the DDR power rails can be kept powered while the main SoC is powered down. This patch series extends the support for DDR backup mode (see commit 6eb0bfae6973eb6a ("regulator: bd9571mwv: Add support for backup mode")) to systems with toggle instead of momentary power switches. With a toggle power switch (or level signal), the following steps must be followed exactly: 1. Configure PMIC for backup mode, which changes the role of the power switch to a wake-up switch, 2. Switch accessory power switch off, to prepare for system suspend, which is a manual step not controlled by software, 3. Suspend system, 4. Switch accessory power switch on, to resume. Unlike on systems with a momentary toggle switch, an additional step 2 must be performed in between step 1 and step 3. Hence step 1 can no longer be handled in the PMIC's suspend callback. This patch series allows performing step 1 when the user writes "on" to the PMIC's "backup_mode" virtual file in sysfs, e.g. echo on > /sys/bus/i2c/drivers/bd9571mwv/*/bd9571mwv-regulator*/backup_mode Conversely, writing "off" reverts the role of the accessory switch to a power switch. Note that unlike with momentary switches, backup mode is not enabled by default, as enabling it prevents the board from being powered off using the power switch, which may confuse the user. Changes compared to v3: - Fix build error and warning if !CONFIG_PM_SLEEP, - Improve patch description and comment, - Add Acked-by. Changes compared to v2: - Drop 'PM / wakeup: Add callback for wake-up change notification', - New patch 'regulator: bd9571mwv: Use "backup_mode" sysfs file instead of "wake_up"', - Replace use of "wake_up" sysfs file and extra callback for wake-up change notification by custom "backup_mode" sysfs file, - New patch ;regulator: bd9571mwv: Document "backup_mode" sysfs file'. Changes compared to v1: - Improve patch descriptions, - Drop "return;" at end of function. This has been tested on Salvator-XS. For testing, this series is also available in the topic/bd9571-toggle-power-switch-v4 branch of my renesas-drivers git repository at git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers.git. Thanks for applying! Geert Uytterhoeven (3): regulator: bd9571mwv: Use "backup_mode" sysfs file instead of "wake_up" regulator: bd9571mwv: Add support for toggle power switches regulator: bd9571mwv: Document "backup_mode" sysfs file .../testing/sysfs-driver-bd9571mwv-regulator | 27 +++++++ drivers/regulator/bd9571mwv-regulator.c | 72 +++++++++++++++++-- 2 files changed, 94 insertions(+), 5 deletions(-) create mode 100644 Documentation/ABI/testing/sysfs-driver-bd9571mwv-regulator -- 2.17.1