Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758649AbbKUOL5 (ORCPT ); Sat, 21 Nov 2015 09:11:57 -0500 Received: from mail-ig0-f179.google.com ([209.85.213.179]:34301 "EHLO mail-ig0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751449AbbKUOL4 (ORCPT ); Sat, 21 Nov 2015 09:11:56 -0500 MIME-Version: 1.0 In-Reply-To: <20151121132202.GE26072@sirena.org.uk> References: <1448006247-4749-1-git-send-email-saurabh.truth@gmail.com> <20151121132202.GE26072@sirena.org.uk> Date: Sat, 21 Nov 2015 19:41:54 +0530 Message-ID: Subject: Re: [PATCH] regulator: of: simplifing the parsing code From: Saurabh Sengar To: Mark Brown Cc: Liam Girdwood , linux-kernel@vger.kernel.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 Content-Length: 1591 Lines: 37 On 21 November 2015 at 18:52, Mark Brown wrote: > On Fri, Nov 20, 2015 at 01:27:27PM +0530, Saurabh Sengar wrote: > >> I also have concern related to how we are passing 'regulator-mode' and >> 'regulator-initial-mode'. Currently this require a extra function to be >> set in 'of_map_mode', which can be avoided. >> These two parameters can be set directly from the device tree as in below patch: >> https://lkml.org/lkml/2014/1/16/263 > > No, they can't - the values we set for modes in the DT are defined per > regulator and we need to translate these into the regulator API > definitions. > What I want to say is there are only 4 possible values which can be set for initial_mode and suspend_state modes: #define REGULATOR_MODE_FAST 0x1 #define REGULATOR_MODE_NORMAL 0x2 #define REGULATOR_MODE_IDLE 0x4 #define REGULATOR_MODE_STANDBY 0x8 these are defined in include/linux/regulator/consumer.h (core regulator file). 'of_map_modes' of each regulator driver ultimately set these values only. I want to suggest that these values can directly be pass from dts. Different dts can pass different values according to the regulator they are using, no need to decode them from of_map_modes function. Let me know your comments on this. Regards, Saurabh -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/