From mboxrd@z Thu Jan 1 00:00:00 1970 From: Furquan Shaikh Subject: Re: [PATCH 0/7] Implement generic regulator constraints parsing for ACPI and OF Date: Wed, 25 Jan 2017 08:56:42 -0800 Message-ID: References: <20170125000641.25520-1-furquan@chromium.org> <20170125124911.dxveow7bo3zw5jcc@sirena.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org To: "Rafael J. Wysocki" Cc: Mark Brown , "Rafael J . Wysocki" , Liam Girdwood , Tony Lindgren , Dmitry Torokhov , Len Brown , Greg Kroah-Hartman , Lorenzo Pieralisi , Hanjun Guo , Will Deacon , Rob Herring , Sathyanarayana Nujella , Heikki Krogerus , Adam Thomson , Linus Walleij , Alexandre Courbot , linux-gpio@vger.kernel.org, ACPI Devel Maling List , Linux List-Id: linux-acpi@vger.kernel.org On Wed, Jan 25, 2017 at 4:55 AM, Rafael J. Wysocki wrote: > > On Wed, Jan 25, 2017 at 1:49 PM, Mark Brown wrote: > > On Tue, Jan 24, 2017 at 04:06:34PM -0800, Furquan Shaikh wrote: > > > >> Since regulator properties remain the same across OF and ACPI > >> regulators, this series of patches provides common routine for > >> obtaining regulation constraints from device tree and ACPI nodes. In > > > > As Lorenzo explained this is really not a good idea, ACPI has a power > > management model which is just being ignored here. If you're producing > > systems using ACPI you really need to use ACPI in a joined up fashion > > rather than just blindly importing all DT bindings into ACPI. While > > there are many areas where ACPI just doesn't do anything and as a result > > it does make sense to reuse existing DT bindings there are also plenty > > of areas where work has been done on the ACPI side. Regulators and > > power management are definitely one of those areas. > > This is exactly right. :-) > > Thanks, > Rafael I understand that ACPI provides its own bindings to allow firmware to control power management and thus regulators have been a part of the firmware control. However, there are use cases where the kernel driver wishes to control the regulator to manage power to the device irrespective of the way regulator is passed in (ACPI/OF). That is the reason why the recent change to add ACPI support to fixed regulators was done (https://github.com/torvalds/linux/blob/master/drivers/regulator/fixed.c#L100). It needs regulators for USB driver. Similarly, other drivers like ELAN touchscreen that plan to control power to the device in a generic way irrespective of OF/ACPI need to control regulators in kernel itself. The above change for adding ACPI support to fixed regulators is currently parsing only limited parameters and also does not work the same way for ACPI and OF, though it ends to introduce the regulators in a way similar to OF. We need to support existing drivers and use cases for power management in both OF and ACPI environments (keeping in mind that suspend to idle bypasses parts of firmware) without needing to change all the drivers. How can we achieve this? From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751773AbdAYQ5I (ORCPT ); Wed, 25 Jan 2017 11:57:08 -0500 Received: from mail-qt0-f180.google.com ([209.85.216.180]:36353 "EHLO mail-qt0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751343AbdAYQ5G (ORCPT ); Wed, 25 Jan 2017 11:57:06 -0500 MIME-Version: 1.0 In-Reply-To: References: <20170125000641.25520-1-furquan@chromium.org> <20170125124911.dxveow7bo3zw5jcc@sirena.org.uk> From: Furquan Shaikh Date: Wed, 25 Jan 2017 08:56:42 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 0/7] Implement generic regulator constraints parsing for ACPI and OF To: "Rafael J. Wysocki" Cc: Mark Brown , "Rafael J . Wysocki" , Liam Girdwood , Tony Lindgren , Dmitry Torokhov , Len Brown , Greg Kroah-Hartman , Lorenzo Pieralisi , Hanjun Guo , Will Deacon , Rob Herring , Sathyanarayana Nujella , Heikki Krogerus , Adam Thomson , Linus Walleij , Alexandre Courbot , linux-gpio@vger.kernel.org, ACPI Devel Maling List , Linux Kernel Mailing List , Linux OMAP Mailing List , Mark Rutland , Aaron Durbin , dlaurie@chromium.org Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 25, 2017 at 4:55 AM, Rafael J. Wysocki wrote: > > On Wed, Jan 25, 2017 at 1:49 PM, Mark Brown wrote: > > On Tue, Jan 24, 2017 at 04:06:34PM -0800, Furquan Shaikh wrote: > > > >> Since regulator properties remain the same across OF and ACPI > >> regulators, this series of patches provides common routine for > >> obtaining regulation constraints from device tree and ACPI nodes. In > > > > As Lorenzo explained this is really not a good idea, ACPI has a power > > management model which is just being ignored here. If you're producing > > systems using ACPI you really need to use ACPI in a joined up fashion > > rather than just blindly importing all DT bindings into ACPI. While > > there are many areas where ACPI just doesn't do anything and as a result > > it does make sense to reuse existing DT bindings there are also plenty > > of areas where work has been done on the ACPI side. Regulators and > > power management are definitely one of those areas. > > This is exactly right. :-) > > Thanks, > Rafael I understand that ACPI provides its own bindings to allow firmware to control power management and thus regulators have been a part of the firmware control. However, there are use cases where the kernel driver wishes to control the regulator to manage power to the device irrespective of the way regulator is passed in (ACPI/OF). That is the reason why the recent change to add ACPI support to fixed regulators was done (https://github.com/torvalds/linux/blob/master/drivers/regulator/fixed.c#L100). It needs regulators for USB driver. Similarly, other drivers like ELAN touchscreen that plan to control power to the device in a generic way irrespective of OF/ACPI need to control regulators in kernel itself. The above change for adding ACPI support to fixed regulators is currently parsing only limited parameters and also does not work the same way for ACPI and OF, though it ends to introduce the regulators in a way similar to OF. We need to support existing drivers and use cases for power management in both OF and ACPI environments (keeping in mind that suspend to idle bypasses parts of firmware) without needing to change all the drivers. How can we achieve this?