From patchwork Thu May 11 13:42:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quentin Schulz X-Patchwork-Id: 99649 Delivered-To: patch@linaro.org Received: by 10.140.96.100 with SMTP id j91csp738474qge; Thu, 11 May 2017 06:42:44 -0700 (PDT) X-Received: by 10.99.115.14 with SMTP id o14mr384452pgc.31.1494510164636; Thu, 11 May 2017 06:42:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1494510164; cv=none; d=google.com; s=arc-20160816; b=f8cDnnjin6fRzdNmSQ9uMuDWLI96I1W+j67z/zQ92T6apC8tzMO6v0xqHahkU00baJ udVaH+pyqFY7XU+iWNNCH/CHtLi2OCzSbF9OR8SB/tbgyrfoXUsGrxjtaeMs5031uUWl bUGmNhfO2F7sXiXXcDJ9oKnzlCWC/gkRe5aNJn8whDHOYeccmGfaeAJfrgcMQSpGFn/S 1t6/mrO29GtO6XiGCB3JRmn7QLurXWGPvudkvaOfIIbFpQYQJlG0Bi0i+QXvLUQ5rsgO DXIMOddDUSazd9EGvslrWhO/zHMqNVwNVl8cXg9KTkikQZX5RF1cjNZGzzC7YqMgYjmU IA7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=EhHFCJBVCRWQKZF0VhbswD5H5sb6PqutKsGPtNMttnI=; b=coCEJqmecTeg5PH1hK4Bv/eLHageU0zoevlTqX7EG7RFjl/eajdvaRYJiApnJcd1s9 0jz7PblZpwaD176n3GYJzR4TMgAF0g6jNd0CVgVgFKJ2McXYC1pjAwDAoWztKaTpBpzn hF1OtJcrKA1jYnB6N2IT0sU+xAlelfdLu5QEEeE6aJhn4cPwQhSoVC4Hw1SFslkvwHMM YGbeh3zZptiqhsSCBCgrJb2rFXHaGZigYsVi+GKlCC3C/TmTKEZNKWAmU8A+Vy0aXWeY c06gPWRm6xNTyjqmQlmWek06QMzvJdwluAoWO1rT9+Bk8BKCkS3FWwkeUrUtjdWTVuGR MngA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q201si159733pfq.383.2017.05.11.06.42.44; Thu, 11 May 2017 06:42:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756093AbdEKNmm (ORCPT + 7 others); Thu, 11 May 2017 09:42:42 -0400 Received: from mail.free-electrons.com ([62.4.15.54]:34103 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755504AbdEKNmm (ORCPT ); Thu, 11 May 2017 09:42:42 -0400 Received: by mail.free-electrons.com (Postfix, from userid 110) id 3905221D00; Thu, 11 May 2017 15:42:40 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.free-electrons.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT shortcircuit=ham autolearn=disabled version=3.4.0 Received: from localhost.localdomain (LStLambert-657-1-97-87.w90-63.abo.wanadoo.fr [90.63.216.87]) by mail.free-electrons.com (Postfix) with ESMTPSA id ED2A220E09; Thu, 11 May 2017 15:42:39 +0200 (CEST) From: Quentin Schulz To: sre@kernel.org, robh+dt@kernel.org, mark.rutland@arm.com, wens@csie.org Cc: Quentin Schulz , linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, liam@networkimprov.net, thomas.petazzoni@free-electrons.com, linux-sunxi@googlegroups.com Subject: [PATCH 0/4] set battery info on AXP20X and AXP22X from DT Date: Thu, 11 May 2017 15:42:16 +0200 Message-Id: <20170511134221.5569-1-quentin.schulz@free-electrons.com> X-Mailer: git-send-email 2.11.0 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org X-Powers AXP20X and AXP22X are capable of setting battery constant charge current to limit the current supplied to the battery. The battery driver already offers the ability to modify the constant charge current via sysfs but the driver will probe with the default value of 1500mA. They are also able to tell the system when to shut down due to the supplied power being too low. This patch series adds the ability to set this power threshold from the battery DT node. The constant charge current is critical for batteries as if it is higher than the supported constant charge current, it might severly/irreversibly damages or kills the battery. This patch series aims at offering the ability to set the maximal supported constant charge current from Device Tree which will be used at driver probing to set the default constant charge current, thus making sure we stay out of the unsupported range as little time as possible (the default constant current charge will still be 1500mA from powering up the board to the driver probing unless the bootloader takes care of it beforehand). We still offer the user the ability to change the maximal constant charge current from sysfs for those who would like to switch the battery attached to their board, so they can set an appropriate constant current charge and take advantage of higher constant current charge. Quentin Quentin Schulz (4): power: supply: axp20x_battery: add support for DT battery dt-bindings: power: battery: add constant-charge-current-max-microamp property power: supply: power_supply_core: add constant-charge-current optional property power: supply: axp20x_battery: add DT support for battery max constant charge current .../devicetree/bindings/power/supply/battery.txt | 2 + drivers/power/supply/axp20x_battery.c | 88 ++++++++++++++++++++-- drivers/power/supply/power_supply_core.c | 3 + include/linux/power_supply.h | 1 + 4 files changed, 86 insertions(+), 8 deletions(-) -- 2.11.0 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html