From patchwork Mon Oct 29 14:35:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marco Felsch X-Patchwork-Id: 10659367 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AEEB914DE for ; Mon, 29 Oct 2018 14:35:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 960B728923 for ; Mon, 29 Oct 2018 14:35:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 86E992996B; Mon, 29 Oct 2018 14:35:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CB0E728923 for ; Mon, 29 Oct 2018 14:35:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726537AbeJ2XY1 (ORCPT ); Mon, 29 Oct 2018 19:24:27 -0400 Received: from metis.ext.pengutronix.de ([85.220.165.71]:51397 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726212AbeJ2XY1 (ORCPT ); Mon, 29 Oct 2018 19:24:27 -0400 Received: from dude.hi.pengutronix.de ([2001:67c:670:100:1d::7]) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1gH8da-0004S7-KN; Mon, 29 Oct 2018 15:35:26 +0100 Received: from mfe by dude.hi.pengutronix.de with local (Exim 4.91) (envelope-from ) id 1gH8dY-0007PS-Ny; Mon, 29 Oct 2018 15:35:24 +0100 From: Marco Felsch To: jdelvare@suse.com, linux@roeck-us.net Cc: linux-hwmon@vger.kernel.org, tpiepho@impinj.com, dmitry.torokhov@gmail.com, kernel@pengutronix.de Subject: [PATCH v2 1/2] dt-binding: hwmon: add gpio-brownout bindings Date: Mon, 29 Oct 2018 15:35:20 +0100 Message-Id: <20181029143521.22122-2-m.felsch@pengutronix.de> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181029143521.22122-1-m.felsch@pengutronix.de> References: <20181029143521.22122-1-m.felsch@pengutronix.de> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::7 X-SA-Exim-Mail-From: mfe@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-hwmon@vger.kernel.org Sender: linux-hwmon-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add dt-bindings for gpio-brownout detection devices. Such a device determines the voltage good/bad state by the gpio line level. Signed-off-by: Marco Felsch --- .../bindings/hwmon/gpio-brownout.txt | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 Documentation/devicetree/bindings/hwmon/gpio-brownout.txt diff --git a/Documentation/devicetree/bindings/hwmon/gpio-brownout.txt b/Documentation/devicetree/bindings/hwmon/gpio-brownout.txt new file mode 100644 index 000000000000..f3272befc8f8 --- /dev/null +++ b/Documentation/devicetree/bindings/hwmon/gpio-brownout.txt @@ -0,0 +1,32 @@ +Device-Tree bindings for GPIO line brownout detection + +Required properties: +- compatible: Must be "gpio-brownout" +- gpio-brownout,sense-gpios: This gpio is used to detect a brownout. The gpio + must support interrupts. + +Optional properties: +- gpio-brownout,dev-list: A list of i2c or spi device phandles. All + listed devices will be released from their drivers in the order they listed + upon a brownout detection. This can be helpful to avoid a interrupt flood, + because some system designs power off all external devices immediately and + keep the host on for a certain time. + +Example: + +i2c3 { + temp_core: lm75@48 { }; + temp_chassis: lm75@49 { }; +}; + +spi1 { + ts: ad7879@1 { }; +}; + +/ { + gpio_brownout { + compatible = "gpio-brownout"; + gpio-brownout,sense-gpios = <&gpio3 3 GPIO_ACTIVE_LOW>; + gpio-brownout,dev-list = <&temp_core &ts>; + }; +};