From patchwork Mon Jul 23 04:08:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matheus Castello X-Patchwork-Id: 10539625 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 19112112B for ; Mon, 23 Jul 2018 04:59:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 028FB27853 for ; Mon, 23 Jul 2018 04:59:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EA4BF28524; Mon, 23 Jul 2018 04:59:24 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 9C0D827853 for ; Mon, 23 Jul 2018 04:59:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728017AbeGWF6n (ORCPT ); Mon, 23 Jul 2018 01:58:43 -0400 Received: from gateway20.websitewelcome.com ([192.185.59.4]:25701 "EHLO gateway20.websitewelcome.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727765AbeGWF6n (ORCPT ); Mon, 23 Jul 2018 01:58:43 -0400 Received: from cm14.websitewelcome.com (cm14.websitewelcome.com [100.42.49.7]) by gateway20.websitewelcome.com (Postfix) with ESMTP id 88E56400CB4F6 for ; Sun, 22 Jul 2018 23:09:28 -0500 (CDT) Received: from br164.hostgator.com.br ([192.185.176.180]) by cmsmtp with SMTP id hSA4fqKu8kBj6hSA4fB9LR; Sun, 22 Jul 2018 23:09:28 -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=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:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=gJVPbSk8857ZuGk+QxKMuYs5yDFc6WURhmrUyWbVopE=; b=V8mF7mLan7WuQZHhQs0W4Btj6a in/OmnpeF30FNmgKSDA7l9f4KgWNEfVUbwBNpb7ZLSq9FiDOl8vLS19cjy+HHCxLXSA2yknxPQihb 40o7csNwcDg3aOXsJg+dtYrNb+/PbfafMJODUmkAOjUK7auRZAx9TQuGMmepqPzcWR4dfWAi5bPqp WQJrw64u/4ZHq2sMwddyG8W3FN+acJOk+H9OcE0yt/Bm7nZSpHLUc0ZcDg9ljziQrYfM7jj9wwksZ 9wZwlve20i9G5C0+cLLkApDrMdiC3JxVl0GYeQhGWpfUK/SODJBt1JzyxCszmpyaX4lIFppqi6yUf QFPrFy9Q==; Received: from [191.189.20.114] (port=7927 helo=localhost.localdomain) by br164.hostgator.com.br with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.91) (envelope-from ) id 1fhSA3-001oyu-H1; Mon, 23 Jul 2018 01:09:28 -0300 From: Matheus Castello To: sre@kernel.org Cc: robh+dt@kernel.org, mark.rutland@arm.com, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Matheus Castello Subject: [PATCH 0/4] power: supply: MAX17040: Add IRQ for low level and alert SOC changes Date: Mon, 23 Jul 2018 00:08:12 -0400 Message-Id: <20180723040816.19455-1-matheus@castello.eng.br> X-Mailer: git-send-email 2.13.3 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.189.20.114 X-Source-L: No X-Exim-ID: 1fhSA3-001oyu-H1 X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: (localhost.localdomain) [191.189.20.114]:7927 X-Source-Auth: matheus@castello.eng.br X-Email-Count: 3 X-Source-Cap: Y2FzdGUyNDg7Y2FzdGUyNDg7YnIxNjQuaG9zdGdhdG9yLmNvbS5icg== X-Local-Domain: yes Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Raspberry Pi Zero W, with a SparkFun Lipo Fuel Gauge module based on MAXIM MAX17043. Matheus Castello (4): power: supply: max17040: Add IRQ handler for low SOC alert power: supply: max17040: Config alert SOC low level threshold from FDT dt-bindings: power: supply: Max17040: Add low level SOC alert threshold power: supply: max17040: Send uevent in SOC changes .../bindings/power/supply/max17040_battery.txt | 24 ++++++ drivers/power/supply/max17040_battery.c | 95 ++++++++++++++++++++++ 2 files changed, 119 insertions(+) create mode 100644 Documentation/devicetree/bindings/power/supply/max17040_battery.txt