From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932334AbcJZTBA (ORCPT ); Wed, 26 Oct 2016 15:01:00 -0400 Received: from mail-wm0-f53.google.com ([74.125.82.53]:35060 "EHLO mail-wm0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753838AbcJZTA7 (ORCPT ); Wed, 26 Oct 2016 15:00:59 -0400 From: ahaslam@baylibre.com To: broonie@kernel.org, lgirdwood@gmail.com, khilman@baylibre.com, nsekhar@ti.com, david@lechnology.com Cc: linux-kernel@vger.kernel.org, Axel Haslam Subject: [PATCH 0/3] regulator: Send events on over current condition Date: Wed, 26 Oct 2016 21:00:51 +0200 Message-Id: <20161026190054.11968-1-ahaslam@baylibre.com> X-Mailer: git-send-email 2.10.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Axel Haslam Some usb drivers rely on external power switches/regulators to handle the port vbus. Some of these drivers currently are still using gpios for the enable pin and also the over current indicator. We would like to move these drivers to use a regulator instead, because it makes the driver generic allowing to use in the future any type of regulator (maybe i2c based), And also it helps removing some code making DT migration simpler and avoiding to add new bindings each time. Vbus control is easy enough as the infrastructure to handle this is in place using a fixed regulator for the simple gpio case. Handling of the over current pin, however, needs some modifications to the regulator framework, to be able to transmit the over current pin status to the usb driver. This is an attempt to extend the fixed regulator to handle the over current pin, and send the status via a notification with minimal framework changes, avoiding to use get_status which would have to be exported to consumers or get_mode which is not supposed to be used for this purpose. Axel Haslam (3): regulator: core: Add over current changed event regulator: fixed: Handle optional overcurrent pin regulator: fixed: dt: Allow an optional over current pin .../bindings/regulator/fixed-regulator.txt | 4 ++ drivers/regulator/fixed.c | 55 ++++++++++++++++++++++ include/linux/regulator/consumer.h | 2 + include/linux/regulator/fixed.h | 3 ++ 4 files changed, 64 insertions(+) -- 1.9.1