Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1784633ybb; Sat, 21 Mar 2020 05:54:00 -0700 (PDT) X-Google-Smtp-Source: ADFU+vttjuCD50JGIMjIpPV7R7OMWwYQN2knsGZJwKjyVn/zznlFG/VfZd2mGxVVzuAOsZLC60bS X-Received: by 2002:a9d:1920:: with SMTP id j32mr10348455ota.221.1584795240681; Sat, 21 Mar 2020 05:54:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584795240; cv=none; d=google.com; s=arc-20160816; b=NiKVT3fGmrqxrWXGMNr8KJL2LLrwqEj9hlZ/qWuzEOw7+sM4gsVtp8q4aGEkCN/7iL OvlvxCJTVB4ZJqz7PC5FvcBY9CfLLrOnd8EgkZ2SJoW+HuTkqCkJ00X8vFXTq9U5os/g Be+SCNPFqyPeHxVwme6+CB+2FJLgqF499NHUO09JU6Si0V33uwpNmwDuAYVicqjUwtxz okU9rV6uRgsGXTgo7X4EwrRAJpFBAUDY/hDqDxDNAxRZR7tTfRtrXZ2tHDSuYhsphNZ+ ze4G3/Epl2cWfa3fQdKiKvw4CIm8EjuL/OZA5a6NcIBqs7VFb4B0L63VnxFRQDh1jX+4 ZENA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=h9ug9T6rmfCPj9X87FyExEJYmanYIVVUdp5gSfooeUE=; b=eramWD01AwlXqmyCRbZFBeou1Z6wjI68vfVLv6FdhGRW47x43khe1HPt6SLsoT/eMn vjYLQ1qk474AHsKHpr/zQdpiQoOMeFc6ioJdyk0DlA5ReitT87VVKhMfrqKSm5y1un0g kFUU1rjJQlaLVpxGO0RD3VvYzJhfj9+fzkcyu2ff4+iPefeoFqOujhWdcTwmRXEiEouB GAlO/jlFX1s0QA/rYn8vEVwgP5RC6kjUut4jDg95b2btQB5olxYQYQ+1/uLb/S2mfTZi QrKA0T6K1UeNB3e+ewmzpvCR9OCL1FxZwKz9gk0sXYHA7UsYE4BS02MfPC7WB4OJ3mFz +YPA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 l11si4556187otk.207.2020.03.21.05.53.47; Sat, 21 Mar 2020 05:54:00 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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 linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727264AbgCUMx3 (ORCPT + 99 others); Sat, 21 Mar 2020 08:53:29 -0400 Received: from mail.manjaro.org ([176.9.38.148]:37078 "EHLO mail.manjaro.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726192AbgCUMx3 (ORCPT ); Sat, 21 Mar 2020 08:53:29 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.manjaro.org (Postfix) with ESMTP id BA73237E5074; Sat, 21 Mar 2020 13:53:27 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at manjaro.org Received: from mail.manjaro.org ([127.0.0.1]) by localhost (manjaro.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id tcVmSE4T3BKl; Sat, 21 Mar 2020 13:53:25 +0100 (CET) From: Tobias Schramm To: Rob Herring Cc: Sebastian Reichel , Mark Rutland , linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Tobias Schramm Subject: [PATCH v6 0/3] Add support for CellWise cw2015 fuel gauge Date: Sat, 21 Mar 2020 13:52:38 +0100 Message-Id: <20200321125241.3072123-1-t.schramm@manjaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patchset adds support for the CellWise cw2015 fuel gauge. The CellWise cw2015 fuel gauge is a shuntless, single-cell Li-Ion fuel gauge. It is used in the pine64 Pinebook Pro laptop. This is v6 of the patchset. This version fixes binding issues found by Rob. I've kept the cellwise,battery-profile property in the device tree. Its content describes characteristics of the battery built into a device. The exact format is unknown and not publicly documented. It is likely comprised of some key parameters of the battery (chemistry, voltages, design capacity) and parameters for tuning the internal state of charge approximation function. Since v2 CellWise has confirmed to me that the only way to obtain the profile blob is to mail them batteries for testing. Thus we will need to keep that property. In general I'm not 100 % sure about my json-schema binding for the gauge. It is my first time ever writing a json-schema binding and I'm not sure whether properties like power-supplies or monitored-battery need to be added to a separate, common schema for power supplies or not. Best Regards, Tobias Schramm Changelog: v2: * Change subject to "Add support for CellWise cw2015 fuel gauge" * Rewrite bindings as json-schema * Use default power-supplies handling * Use regmap for register access * Use standard simple-battery node * Replace printk/pr_* by dev_{dbg,info,warn,err} * Use cancel_delayed_work_sync in remove * General code cleanup v3: * Incorporate review by Andy * Add cellwise vendor prefix * Rename cellwise,bat-config-info property to cellwise,battery-profile * Remove most state of charge post-processing * Use fwnode interface * General code cleanup * Lots of code style fixes v4: * Implement additional changes requested by Andy * Use fwnode inline wrappers * Clean up waiting for gauge * Minor code style fixes v5: * Clean up includes * Handle errors during device property parsing * Refactor device property parsing * Replace i2c->probe by i2c->probe_new * More code style fixes v6: * Fix bindings according to review by Rob Tobias Schramm (3): dt-bindings: Document cellwise vendor-prefix dt-bindings: power: supply: add cw2015_battery bindings power: supply: add CellWise cw2015 fuel gauge driver .../bindings/power/supply/cw2015_battery.yaml | 82 ++ .../devicetree/bindings/vendor-prefixes.yaml | 2 + MAINTAINERS | 6 + drivers/power/supply/Kconfig | 11 + drivers/power/supply/Makefile | 1 + drivers/power/supply/cw2015_battery.c | 749 ++++++++++++++++++ 6 files changed, 851 insertions(+) create mode 100644 Documentation/devicetree/bindings/power/supply/cw2015_battery.yaml create mode 100644 drivers/power/supply/cw2015_battery.c -- 2.24.1