Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp363516ybh; Wed, 11 Mar 2020 02:34:04 -0700 (PDT) X-Google-Smtp-Source: ADFU+vv/mRnvICD5E6aRyHSikx7k/26kF6NykG4pPzhalVd/qeqhqNVwNyJsfzn6toayAdhxrLvu X-Received: by 2002:a4a:240f:: with SMTP id m15mr110984oof.85.1583919244013; Wed, 11 Mar 2020 02:34:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583919244; cv=none; d=google.com; s=arc-20160816; b=mfls2YBmU9yul0pzYlEjpkcJCx2Pg6zKj876fIkCi2GPz0so2kItRdp0Eq6Out3aKf djtYWiRwbiiJM2/NWH9agyUIDnUgmSXPRaxt4JFOxUlErYU2au/7kAQvvTHj9xqZRPUN 137O1rtZd8CQNU8vqCYho6JSKyBSQqOntph1IZWAERGyoTG6py+ymVmgP25hwabawL8D PZofY5V/2tDN2HTmHEXdRZ9p4c9y7qRKQKTXbeGlM+CPpy9KuRUYvZLQcVxqpwoy48ta Hew84LyDxI5hMFozZnQZkHlUHKYAXTuYNfOS4Xrv561FO/uaYg/a1fBt75eGlmtMO81c VJOQ== 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=ZFh5Qo1Au5D3seN7OiLgyNEfTB2XSKzAlTjgduLh7xY=; b=vV4Y90M9uPldXCvqVoSSdjmBxEVKMllZa2ncTUs3oJ3ZDxBmLKkCXQdI7LgQNfAp9C uiMoDficd43QzwsRXt+gXZKZ4Ol9KWMzDEzsY4jye3FZuRFcHeU80qjXp7wXxVHC8QY4 Hrlsm5zYRoobA3lTGp20exoqmbbUvBzrFhvdH2W1S1yYj+l6siSUjKBfMc2+ZbQ5nKVA XIh0U9kNnoNpKOl7lxVJ74WRPSlXK7b7+IB47p8wYO0DY5GGxmNCORdEsh3N2tycImlH cB/jjNoVHCo8LMGGGAFU4xhjtoq7Vddrp28FtmVYGLoFrqPTRWVvZDKK1bqUJTaZJRCz i8MQ== 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 e9si900219oig.116.2020.03.11.02.33.51; Wed, 11 Mar 2020 02:34:04 -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 S1728653AbgCKJbm (ORCPT + 99 others); Wed, 11 Mar 2020 05:31:42 -0400 Received: from mail.manjaro.org ([176.9.38.148]:38072 "EHLO mail.manjaro.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726934AbgCKJbl (ORCPT ); Wed, 11 Mar 2020 05:31:41 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.manjaro.org (Postfix) with ESMTP id B7B813702434; Wed, 11 Mar 2020 10:31:39 +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 7nuUTOLPg9mT; Wed, 11 Mar 2020 10:31:37 +0100 (CET) From: Tobias Schramm To: Andy Shevchenko , Sebastian Reichel , Rob Herring , Mark Rutland Cc: Maxime Ripard , Sam Ravnborg , Heiko Stuebner , Stephan Gerhold , Mark Brown , Mauro Carvalho Chehab , "David S. Miller" , Greg Kroah-Hartman , Jonathan Cameron , linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Tobias Schramm Subject: [PATCH v3 0/3] Add support for CellWise cw2015 fuel gauge Date: Wed, 11 Mar 2020 10:30:40 +0100 Message-Id: <20200311093043.3636807-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 v3 of the patchset. This version incorporates a review by Andy and includes a commit documenting the cellwise vendor prefix which I forgot to send in v2. 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 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 | 83 ++ .../devicetree/bindings/vendor-prefixes.yaml | 2 + MAINTAINERS | 6 + drivers/power/supply/Kconfig | 8 + drivers/power/supply/Makefile | 1 + drivers/power/supply/cw2015_battery.c | 785 ++++++++++++++++++ 6 files changed, 885 insertions(+) create mode 100644 Documentation/devicetree/bindings/power/supply/cw2015_battery.yaml create mode 100644 drivers/power/supply/cw2015_battery.c -- 2.24.1