From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S941731AbcJYM4d (ORCPT ); Tue, 25 Oct 2016 08:56:33 -0400 Received: from mail-qt0-f182.google.com ([209.85.216.182]:37775 "EHLO mail-qt0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934427AbcJYM4a (ORCPT ); Tue, 25 Oct 2016 08:56:30 -0400 MIME-Version: 1.0 In-Reply-To: <20161024181937.GP17252@sirena.org.uk> References: <20161024164634.4330-1-ahaslam@baylibre.com> <20161024164634.4330-10-ahaslam@baylibre.com> <20161024175320.GO17252@sirena.org.uk> <20161024181937.GP17252@sirena.org.uk> From: Axel Haslam Date: Tue, 25 Oct 2016 14:55:48 +0200 Message-ID: Subject: Re: [PATCH/RFT v2 09/17] regulator: fixed: Add over current event To: Mark Brown Cc: Greg KH , Johan Hovold , robh+dt@kernel.org, Sekhar Nori , Alan Stern , Kevin Hilman , Sergei Shtylyov , David Lechner , manjunath.goudar@linaro.org, Alexandre Bailon , linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.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 Hi Mark, On Mon, Oct 24, 2016 at 8:19 PM, Mark Brown wrote: > On Mon, Oct 24, 2016 at 08:11:40PM +0200, Axel Haslam wrote: >> On Mon, Oct 24, 2016 at 7:53 PM, Mark Brown wrote: > >> > does it make sense to report this as a mode, we don't report other error >> > conditions as modes but instead use REGULATOR_STATUS_ with the >> > get_status() operation? > >> I used mode, because when the regulator toggles the overcurrent >> line, it means that it has entered a current limited mode, at least the >> regulator im looking at. ill change to STATUS > > That's not what regulator modes are - please look at the documentation > for the defines here. They're about the quality of regulation. To be able to use regulator to handle the overcurrent pin, i need to be able to somehow retrieve the over current pin state from the regulator driver. As i was trying your suggestion, i remembered why i thought i should use mode instead of status: Status seems to be for internal regulator driver use, there is no regulator_get_status, function and REGULATOR_STATUS_* are defined in driver.h and not in consumer.h as REGULATOR_MODE_* it seems that status is only used to print sysfs info. Would you be ok if i allow consumers to get the status via a new "regulator_get_status" call? Regards Axel. From mboxrd@z Thu Jan 1 00:00:00 1970 From: ahaslam@baylibre.com (Axel Haslam) Date: Tue, 25 Oct 2016 14:55:48 +0200 Subject: [PATCH/RFT v2 09/17] regulator: fixed: Add over current event In-Reply-To: <20161024181937.GP17252@sirena.org.uk> References: <20161024164634.4330-1-ahaslam@baylibre.com> <20161024164634.4330-10-ahaslam@baylibre.com> <20161024175320.GO17252@sirena.org.uk> <20161024181937.GP17252@sirena.org.uk> Message-ID: To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org Hi Mark, On Mon, Oct 24, 2016 at 8:19 PM, Mark Brown wrote: > On Mon, Oct 24, 2016 at 08:11:40PM +0200, Axel Haslam wrote: >> On Mon, Oct 24, 2016 at 7:53 PM, Mark Brown wrote: > >> > does it make sense to report this as a mode, we don't report other error >> > conditions as modes but instead use REGULATOR_STATUS_ with the >> > get_status() operation? > >> I used mode, because when the regulator toggles the overcurrent >> line, it means that it has entered a current limited mode, at least the >> regulator im looking at. ill change to STATUS > > That's not what regulator modes are - please look at the documentation > for the defines here. They're about the quality of regulation. To be able to use regulator to handle the overcurrent pin, i need to be able to somehow retrieve the over current pin state from the regulator driver. As i was trying your suggestion, i remembered why i thought i should use mode instead of status: Status seems to be for internal regulator driver use, there is no regulator_get_status, function and REGULATOR_STATUS_* are defined in driver.h and not in consumer.h as REGULATOR_MODE_* it seems that status is only used to print sysfs info. Would you be ok if i allow consumers to get the status via a new "regulator_get_status" call? Regards Axel.