Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp2598452ybh; Mon, 9 Mar 2020 09:05:52 -0700 (PDT) X-Google-Smtp-Source: ADFU+vv+6++/nVqkkxOvJfjV5BlZw1qEr3dXkYIQkbEC0n7Wo31nO6upXD+HE858cmoOQj57/Y7R X-Received: by 2002:aca:aa8b:: with SMTP id t133mr6491oie.95.1583769952473; Mon, 09 Mar 2020 09:05:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583769952; cv=none; d=google.com; s=arc-20160816; b=xrBOqWfcq2HUZYRw7ukR8AhHwJyf7aCQyUhagcPsx1Sckk66qCoOvP3llCR6ive7EN WH1OR7koH/x+aNAY6PuRHPsHTAtEprKW50QzNOedtCaV9iIx0228/BMKmKvVVUWBMuj/ O94+5W3ZljMJnKu56gub8yajv62so7MugzcqgivWFI3LQeUGLN8sgPSSYEUVuC2cHix8 bx8kfHw+BbwPS3zgL0oKxn8EokP23N1CCFGnJRf+WC5zhsa0MXJNVMdFhIdgmp/i2HNg h7eie3TgH+tIvN/6zY7gtMFGY4N9og7UJ7fFcZ9dB5fj1Mp1bcgmqXtInTiDgA6Dsduq 7gmg== 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=4BupHM/uEWtygEcVz4T/mMr7eLT1k2RFlB19GX9l9Dc=; b=RWBDQVI1TTni2cFCFVmiWYCw3q9ijafH3ZfsDUVLo+YlBR9vWF5hEjZ/INNmzRx8H2 DDrrj04BgV9hyAg/9MoT8PsqhIg9IHFB9tyT1yQ+DQE9KXevj0C0YhY8yIG3KQ6NoTt6 JaSmBLjkwx19bDSPEbFvxz7gildL+y3uKIbUJtXJcllvwFFCCIN9oCllalidjEEhGFOg BYRNheQGHI0GXwsF8jQWAQt/C0SlacvKU289DW1ylLIcjEceAuHxZ4IQnQvXh99saCYf aOPcHcqZPk7NZcHkG/9ByDggrzJIbU6WrGb2e6wNaM2+TL0iIt+KGT6nFAF079NjkpCj 9ukw== 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 j18si2973926oib.191.2020.03.09.09.05.32; Mon, 09 Mar 2020 09:05:52 -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 S1727143AbgCIQEX (ORCPT + 99 others); Mon, 9 Mar 2020 12:04:23 -0400 Received: from mail.manjaro.org ([176.9.38.148]:42068 "EHLO mail.manjaro.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726926AbgCIQEW (ORCPT ); Mon, 9 Mar 2020 12:04:22 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.manjaro.org (Postfix) with ESMTP id 30EC03702399; Mon, 9 Mar 2020 17:04:21 +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 n1f4Bhx4d8nd; Mon, 9 Mar 2020 17:04:18 +0100 (CET) From: Tobias Schramm To: Sebastian Reichel , Rob Herring , Mark Rutland Cc: Mauro Carvalho Chehab , "David S. Miller" , Greg Kroah-Hartman , Jonathan Cameron , Andy Shevchenko , linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Tobias Schramm Subject: [PATCH v2 0/2] Add support for CellWise cw2015 fuel gauge Date: Mon, 9 Mar 2020 17:03:44 +0100 Message-Id: <20200309160346.2203680-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 v2 of a patchset I sent in late 2019. Took me some time to get around to prepare a v2 but here it is. I've kept the cellwise,bat-config-info 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 composed of some key parameters of the battery (chemistry, voltages, design capacity) and parameters for tuning the internal state of charge approximation function. 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 Tobias Schramm (2): dt-bindings: power: supply: cw2015_battery: add device tree binding documentation power: supply: add CellWise cw2015 fuel gauge driver .../bindings/power/supply/cw2015_battery.yaml | 84 ++ MAINTAINERS | 6 + drivers/power/supply/Kconfig | 6 + drivers/power/supply/Makefile | 1 + drivers/power/supply/cw2015_battery.c | 891 ++++++++++++++++++ 5 files changed, 988 insertions(+) create mode 100644 Documentation/devicetree/bindings/power/supply/cw2015_battery.yaml create mode 100644 drivers/power/supply/cw2015_battery.c -- 2.24.1