From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5F87CC10F13 for ; Mon, 15 Apr 2019 01:47:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2DA8B20833 for ; Mon, 15 Apr 2019 01:47:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=castello.eng.br header.i=@castello.eng.br header.b="jvMlnyAn" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726906AbfDOBrS (ORCPT ); Sun, 14 Apr 2019 21:47:18 -0400 Received: from gateway22.websitewelcome.com ([192.185.46.131]:24347 "EHLO gateway22.websitewelcome.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726277AbfDOBrS (ORCPT ); Sun, 14 Apr 2019 21:47:18 -0400 Received: from cm10.websitewelcome.com (cm10.websitewelcome.com [100.42.49.4]) by gateway22.websitewelcome.com (Postfix) with ESMTP id C375A8AC2 for ; Sun, 14 Apr 2019 20:26:59 -0500 (CDT) Received: from br164.hostgator.com.br ([192.185.176.180]) by cmsmtp with SMTP id FqOhhppiZ2PzOFqOhhODGS; Sun, 14 Apr 2019 20:26:59 -0500 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=castello.eng.br; s=default; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=ehx28VB6y1uEnwmkJnSgWnLiQGhYihbomMudxDm1/0U=; b=jvMlnyAneE5syeHXostqrU0y5 i9TGJHVlNWMGJx065L0LgTxxAJISj10oyFH5/D1QFIiJ9Sp6F5zF7DpQkIW6yiaPoqYzbSUTS1gpJ Ptgq3t/BfJzoO4e/WE+dcsiqYnY/wV7Bik82H6B6YGeZu5TyRih796dlx1fsxeGdY0kTRNdVqILf4 2qgsTFnNMzonj4bjDsDareeFvlQKBqDYti2XGuZSb7cDFta6POIf+yxZR8N9/TZRq2H4MY4IOlFyy 7iPMTth0ogCz7ExjZc9n8Mdi7IVS1KTILR/K+ZTcXw9h9xI/jLg/KP3h9S0JaEtw8XWkNGOsVd2sC j70A/4zNg==; Received: from [191.191.240.251] (port=33232 helo=localhost.localdomain) by br164.hostgator.com.br with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.91) (envelope-from ) id 1hFqOf-000Uj7-Kx; Sun, 14 Apr 2019 22:26:59 -0300 From: Matheus Castello To: sre@kernel.org, krzk@kernel.org, robh+dt@kernel.org Cc: mark.rutland@arm.com, cw00.choi@samsung.com, b.zolnierkie@samsung.com, lee.jones@linaro.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Matheus Castello Subject: [PATCH v2 0/4] power: supply: MAX17040: Add IRQ for low level and alert SOC changes Date: Sun, 14 Apr 2019 22:26:31 -0300 Message-Id: <20190415012635.6369-1-matheus@castello.eng.br> X-Mailer: git-send-email 2.17.0 In-Reply-To: References: X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - br164.hostgator.com.br X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - castello.eng.br X-BWhitelist: no X-Source-IP: 191.191.240.251 X-Source-L: No X-Exim-ID: 1hFqOf-000Uj7-Kx X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: (localhost.localdomain) [191.191.240.251]:33232 X-Source-Auth: matheus@castello.eng.br X-Email-Count: 11 X-Source-Cap: Y2FzdGUyNDg7Y2FzdGUyNDg7YnIxNjQuaG9zdGdhdG9yLmNvbS5icg== X-Local-Domain: yes Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This series add IRQ handler for low level SOC alert, define a devicetree binding attribute to configure the alert level threshold and check for changes in SOC for send uevents. Max17040 have a pin for alert host about low level state of charge and this alert can be configured in a threshold from 1% up to 32% of SOC. Tested on Toradex Colibri iMX7D, with a SparkFun Lipo Fuel Gauge module based on MAXIM MAX17043. Thanks Krzysztof Kozlowski for your time reviewing it, and forgive me for the delay in working on it, now I'm back to the patchs. Let me know what you think about the fixes and I'm open to maintainers suggestions. Changes since v1: (Suggested by Krzysztof Kozlowski) - Put common code from max17040_work and max17040_thread_handler in a function - Code style fixes - Define mask and low level threshold alert default - Check return value from max17040_set_soc_threshold - Set low level state of charge threshold before IRQ - CC maintainers from drivers/mfd/max14577 - Use flags from FDT client->flags instead hard coded it - Mention interrupts on DT Documentation - Fix "maxim,max77836-battery" missed from DT Documentation - Fix commit description Matheus Castello (4): power: supply: max17040: Add IRQ handler for low SOC alert dt-bindings: power: supply: Max17040: Add low level SOC alert threshold power: supply: max17040: Config alert SOC low level threshold from FDT power: supply: max17040: Send uevent in SOC changes .../power/supply/max17040_battery.txt | 24 ++++ drivers/power/supply/max17040_battery.c | 118 +++++++++++++++++- 2 files changed, 138 insertions(+), 4 deletions(-) create mode 100644 Documentation/devicetree/bindings/power/supply/max17040_battery.txt -- 2.17.0