Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755967AbcJ3MDE (ORCPT ); Sun, 30 Oct 2016 08:03:04 -0400 Received: from mail-qk0-f172.google.com ([209.85.220.172]:35803 "EHLO mail-qk0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754160AbcJ3MDD (ORCPT ); Sun, 30 Oct 2016 08:03:03 -0400 MIME-Version: 1.0 In-Reply-To: <20161029184031.adjybckguxzfu3pq@sirena.org.uk> References: <20161026190054.11968-1-ahaslam@baylibre.com> <20161026190054.11968-2-ahaslam@baylibre.com> <20161028182250.df6p6setaauxsezu@sirena.org.uk> <20161029184031.adjybckguxzfu3pq@sirena.org.uk> From: Axel Haslam Date: Sun, 30 Oct 2016 13:02:21 +0100 Message-ID: Subject: Re: [RFC 1/3] regulator: core: Add over current changed event To: Mark Brown Cc: Liam Girdwood , Kevin Hilman , Sekhar Nori , David Lechner , 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: 1178 Lines: 29 Hi Mark, On Sat, Oct 29, 2016 at 8:40 PM, Mark Brown wrote: > On Fri, Oct 28, 2016 at 09:41:44PM +0200, Axel Haslam wrote: > >> i think today each time an event occurs a notification is sent with the >> corresponding flag(s) set. > > Right, so I think the problem here is actually that you called this > REGULATOR_EVENT_OVER_CURRENT_CHANGE with the _CHANGE on the end which > means it's just saying that the user has to go poll to see if the device > is or is not over current separately at which point you may as well pull > in all the other error things into what you're polling for. If you'd > dropped the _CHANGE it'd be consistent with the other events we have for > errors and fine. The event REGULATOR_EVENT_OVER_CURRENT allready exists. what is missing and what i would need form the usb driver, is a way for the consumer to know that the over current condition is over. since i cannot do this with get mode, and get status is not exported, We can do this adding a more generic event flag: REGULATOR_EVENT_ERRORS_CLEARED that would be sent by the supply when all errors are over, and the regulator is back to normal operation. Regards Axel.