From patchwork Thu Mar 9 22:50:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Reichel X-Patchwork-Id: 661207 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D14B6C76188 for ; Thu, 9 Mar 2023 22:50:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231395AbjCIWu6 (ORCPT ); Thu, 9 Mar 2023 17:50:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56306 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231303AbjCIWuy (ORCPT ); Thu, 9 Mar 2023 17:50:54 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F127DF8656; Thu, 9 Mar 2023 14:50:48 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 8C749B820C6; Thu, 9 Mar 2023 22:50:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 05051C4339E; Thu, 9 Mar 2023 22:50:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1678402246; bh=iCMgj+CPrlEuf1ZGNOclyieKYt4V6/ejryH1dc1Ea6g=; h=From:To:Cc:Subject:Date:From; b=CIn1tilWaisniSGHJ3/x27i7Zyc215rJ8lNNLSQ4z6+KXGMT/XFVXxG8EAzs53XKj puCH3jUhybLnNv38JLR8qwjc7W7tLbEpAMbxDCFfT6k7VG6z+WTmeZ0JVVRHBFHbUL 2Y/Oi+gBIOLrGetm8Uzh752LBak7sjEhBdAR6jLnh3+jScPJxLlomkB4iEfCZE5Q4r g1dq4HNRik6ZMZ0gaw/HYCk4pJpRo8s5BTXD0C1YKmiCEJgyowyX6GZXI2pCDdidmu NCZo95LFnijsU66gTJJBcqnmf7IMbSVFUgHTQ329V4Sr+S+2SgnCelmLgh7GzWxg5l El+BnBfUOLz7A== Received: by mercury (Postfix, from userid 1000) id 57A03106083C; Thu, 9 Mar 2023 23:50:43 +0100 (CET) From: Sebastian Reichel To: Sebastian Reichel Cc: Linus Walleij , Matti Vaittinen , Rob Herring , Krzysztof Kozlowski , linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org Subject: [PATCHv1 00/11] Add DT support for generic ADC battery Date: Thu, 9 Mar 2023 23:50:30 +0100 Message-Id: <20230309225041.477440-1-sre@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Hi, This series cleans up the generic ADC battery driver and adds devicetree support. The plan is to use the driver to add upstream support for a handheld thermal camera. Instead of reading and exposing the monitored battery data manually I started the series with an addition to the power-supply core, which allows automatic handling of the static battery information. It simplifies the generic-adc-battery driver a lot and should also be useful for other battery drivers. -- Sebastian Sebastian Reichel (11): dt-bindings: power: supply: adc-battery: add binding power: supply: core: auto-exposure of simple-battery data power: supply: generic-adc-battery: convert to managed resources power: supply: generic-adc-battery: fix unit scaling power: supply: generic-adc-battery: drop jitter delay support power: supply: generic-adc-battery: drop charge now support power: supply: generic-adc-battery: drop memory alloc error message power: supply: generic-adc-battery: use simple-battery API power: supply: generic-adc-battery: simplify read_channel logic power: supply: generic-adc-battery: add DT support power: supply: generic-adc-battery: update copyright info .../bindings/power/supply/adc-battery.yaml | 67 ++++++ drivers/power/supply/generic-adc-battery.c | 221 +++++------------- drivers/power/supply/power_supply_core.c | 153 ++++++++++-- drivers/power/supply/power_supply_sysfs.c | 16 ++ include/linux/power/generic-adc-battery.h | 23 -- include/linux/power_supply.h | 31 +++ 6 files changed, 301 insertions(+), 210 deletions(-) create mode 100644 Documentation/devicetree/bindings/power/supply/adc-battery.yaml delete mode 100644 include/linux/power/generic-adc-battery.h