From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752515AbcD0Sf4 (ORCPT ); Wed, 27 Apr 2016 14:35:56 -0400 Received: from mx1.redhat.com ([209.132.183.28]:32796 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751866AbcD0Sfz (ORCPT ); Wed, 27 Apr 2016 14:35:55 -0400 Subject: Re: [PATCH v2 3/3] regulator: axp20x: Fix axp22x ldo_io registration error on cold boot To: Mark Brown References: <1461765568-15828-1-git-send-email-hdegoede@redhat.com> <1461765568-15828-4-git-send-email-hdegoede@redhat.com> <20160427151219.GV3217@sirena.org.uk> <20160427154819.GY3217@sirena.org.uk> <20160427163008.GB3217@sirena.org.uk> Cc: Liam Girdwood , Maxime Ripard , Chen-Yu Tsai , Linux Kernel Mailing List From: Hans de Goede Message-ID: Date: Wed, 27 Apr 2016 20:35:48 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <20160427163008.GB3217@sirena.org.uk> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 27-04-16 18:30, Mark Brown wrote: > On Wed, Apr 27, 2016 at 06:04:53PM +0200, Hans de Goede wrote: >> On 27-04-16 17:48, Mark Brown wrote: > >>> Well, I guess someone can just measure what happens? > >> What happens will likely depend on the pmic input voltage, >> which can be either 5V from a charger / usb or can be approx >> 3.8V from a lion or lipo battery. All linear regulators in >> the axp20x / axp22x pmic are listed as having a max output >> voltage of 3.3V, this likely has to do with the minimum >> voltage drop compared to the input value. > > That sounds like it's a non-regulating bypass mode which is something we > support; if the regulator is in bypass mode we'll look for the voltage > from the parent rather than in the child regulator. No these regulators do not have pass-by mode, what I'm trying to say is that if the configured voltage gets to close to the supply (e.g. 3.8V on a 3.8V battery) that the actual output then will not be (even close to) what is configured due to the voltage drop all linear regulators have. My plan is to express this limitation using constraints in the dts, while exposing the full 0.7 - 3.8V range in the driver, so that the driver will no longer error out on the 0x1f register value it encounters on the first get_voltage after a cold boot. >> So in some conditions the output voltage at a 0x1f register >> value may very well be different then at others. IMHO we >> should just avoid any out of spec. values. > > As I've said before it'll be read only unless the system integrator > explicitly says otherwise. Ack. >> I believe that we really need to write an in-spec value to the >> register controlling the voltage, before enabling this regulator >> (which is done by selecting the mux to connect it to the pin). > > We have a strong policy that we don't touch the hardware unless we are > explicitly told it's OK to do so by the system integration, it's very > hard to tell if things are in general going to be safe and if we get > things wrong that could lead to physical damage. Ack, I understand. The way I'm proposing to fix this does exactly this. It will make us not touch the regulator unless there is a dts node giving constraints for it. Let me just send the new patch, that should make things clear. Regards, Hans