Received: by 2002:ac0:8c9a:0:0:0:0:0 with SMTP id r26csp4043483ima; Mon, 4 Feb 2019 09:16:09 -0800 (PST) X-Google-Smtp-Source: AHgI3IbQAeMr5zeE/ezpVRvKs/XkCnIzZZYJOaWq6cueplZr6XAH/AMIykXdSqedUeAAlCrks0fn X-Received: by 2002:a17:902:2c03:: with SMTP id m3mr427528plb.125.1549300569449; Mon, 04 Feb 2019 09:16:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549300569; cv=none; d=google.com; s=arc-20160816; b=eMrLWCIdwELbqTV7R7beUzz9yPY7JP5s5YUKg0yRYHjH3kGtA6joDpCGcqTGl9+uon PCgHYEl/og+334dYkT9m6QRpWpe1ycndyn1wYdAirBnaLTnXQQZjiipiU84DciKhQxsw hGDM2EIpUTViYtnGAC/09xIiHddtHtclEYbxj5Wg4nFm/nfv5S84Y5hlnwUzDy11CvQw +VvKf0br2bO0uhUAFtLSIj1g0QiQstoWNe6wJw9pRzuSYYoF1ycxbbTQNORtJ7pVYsix 3BRx3GNFk1iutEEJWzPqFSxfz6CizqqoGwqtDz6ZATndevZGImAoBDLBOT7Vy64KF962 7Puw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=xrxxwUJ2Kps6JdOs2cw9qE4YuHS4i1K4mPQAz6mBPGs=; b=HAPREE1OM0TpqJa/MDhWwZupx1UwWm5u6d0bHxBBROHsfR9NAg1QXBBLnNqjhSxVG3 qpLPHeaqnaoWX/UV2J2uXCJ2DxCj/BEneg0sUhmRlmCu46u5I/SUEOKHHW9pWlbWo1fv r+lz1R6cdEkZVnBKTp303NUrSsYxvVhJKZu1Z5pdFrGxZAa2V5qKerZn0HBmU9zzLJhK Z59CMM3SD1iR13fYy7cavEW2sBS1TRDgWUDVXLyOrV/Ytvn9gddXfxrkomwbOiikULxR 9Fov2BZxEeaBdoVjCBb6vBqjFFa/7F8VZHvfjHiWXduylrWZJr5Z6BqBJ8D2h0S+DGOk YWUA== 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 l24si492702pgj.171.2019.02.04.09.15.52; Mon, 04 Feb 2019 09:16:09 -0800 (PST) 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 S1731546AbfBDP4J (ORCPT + 99 others); Mon, 4 Feb 2019 10:56:09 -0500 Received: from muru.com ([72.249.23.125]:37442 "EHLO muru.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728275AbfBDP4I (ORCPT ); Mon, 4 Feb 2019 10:56:08 -0500 Received: from atomide.com (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTPS id B9D1E808C; Mon, 4 Feb 2019 15:56:16 +0000 (UTC) Date: Mon, 4 Feb 2019 07:56:04 -0800 From: Tony Lindgren To: Andreas Kemnade Cc: linux@armlinux.org.uk, khilman@kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, letux-kernel@openphoenux.org Subject: Re: [PATCH] omap3: give off mode enable a more prominent place Message-ID: <20190204155604.GH5720@atomide.com> References: <20190202055827.12956-1-andreas@kemnade.info> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190202055827.12956-1-andreas@kemnade.info> User-Agent: Mutt/1.11.2 (2019-01-07) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Andreas Kemnade [190202 06:01]: > Enabling off mode was only reachable deeply hidden > in the debugfs. As powersaving is an important feature, > move the option out of its shady place. How about let's enable always if we have the twl4030 configured to allow it? You can just check if the dts has "ti,twl4030-power-idle" or "ti,twl4030-power-idle-osc-off" properties set. In order to enable deeper idle states, the user space still needs to idle the UARTs and possibly other hardware blocking idle. So we should be safe there. > The debugfs file can still be used to override the default. Yes let's keep the debugfs switch around. But it should be optional for CONFIG_DEBUGFS like I think it now is. > --- a/arch/arm/mach-omap2/pm34xx.c > +++ b/arch/arm/mach-omap2/pm34xx.c > @@ -416,7 +416,12 @@ static int __init pwrdms_setup(struct powerdomain *pwrdm, void *unused) > if (!pwrst) > return -ENOMEM; > pwrst->pwrdm = pwrdm; > - pwrst->next_state = PWRDM_POWER_RET; > + > + if (IS_ENABLED(CONFIG_OMAP3_PM_OFFMODE)) > + pwrst->next_state = PWRDM_POWER_OFF; > + else > + pwrst->next_state = PWRDM_POWER_RET; > + > list_add(&pwrst->node, &pwrst_list); > > if (pwrdm_has_hdwr_sar(pwrdm)) You can check for the PMIC properties by adding a function for omap3_pm_check_pmic() or similar and call it from omap3_pm_init(). And then you can set the needed flags in omap3_pm_check_pmic() such as omap3_has_twl and off mode. You might want to make it somewhat PMIC independent as in theory somebody may still want to add support for other PMICs such as cpacp for omap3 although that's unlikely. Regards, Tony