Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp2599498ybh; Mon, 9 Mar 2020 09:06:55 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvRL0uVXW5BShjqlgNk9aX9nMhFVqJ4UfS84spQB7zH5PJe+I78sqdJeTo7q1ukWVD1hvot X-Received: by 2002:a9d:6e87:: with SMTP id a7mr13308669otr.352.1583770015573; Mon, 09 Mar 2020 09:06:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583770015; cv=none; d=google.com; s=arc-20160816; b=tFLCxZ4szmq4bSQ/9xNMbcBOgjoO73MJI+zSPk1u7UMNDXxkhJr91hK9EI9nuzWFeT Mb9HMfICaJYekvuqNbgZbHkbZyYO/wIYt03FxTwlNz72xQuraW9tBgRphw36QMiUvZeQ ZpixAjDsIn78MtKYFyg38KZOsmfGoGibrVpEMZ/WKfpYJWLp0so9330yjz2PZtlkTj25 clHY0bTTTVWy1esKPKN9PJyp4vnuKqtl8rpZ6GusHHqsdL94ThhBk45FeNwcNskww0EV XQyLT67EKnM39DMHOxlroBQmjAEveLIsT4f+ieTQ5rQsrHmYx5op6b8Vrni4KLppwngN bfkQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=IHHvQ+pmQ7VMRfAVLVlynUFBpp4jqTmwPpHIDCZzXmA=; b=he8Jcc0HxTyWteyF0lxhgsqXhXNmGuGJPAaL7Vrr2v9U//1yNe00LfViDLKwO/WZOW CGiFE0J8HM9UQkGBxPzAKmm2ADPHAMd8eOjZXHbkyfHZvDoDeM6TdOzBotGLMibOjuve gM9s4R7xjhsuJz7q2DvlQESU6G7HWsnYdQvFU5wFaWLpwdgcROWh/rGtKEMGLL1y9djy kI75qFzcaZu+MyZAb8/qze+x3BQ7UA0H6EKQ4090ebuvzp7WSro77xyUtcJMBW7eQMxx sBzqxMhzFl0POZa/vwyTyYmOo433S4c3/6YD1h9pfnZBYNVW4OgaL9UbkEioBdKCR8mv jdJA== 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 s14si3410512otp.243.2020.03.09.09.06.38; Mon, 09 Mar 2020 09:06:55 -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 S1727175AbgCIQEj (ORCPT + 99 others); Mon, 9 Mar 2020 12:04:39 -0400 Received: from mail.manjaro.org ([176.9.38.148]:42118 "EHLO mail.manjaro.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726703AbgCIQEj (ORCPT ); Mon, 9 Mar 2020 12:04:39 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.manjaro.org (Postfix) with ESMTP id C3FCE370239A; Mon, 9 Mar 2020 17:04:37 +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 S4uHlTtv556r; Mon, 9 Mar 2020 17:04:34 +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 1/2] dt-bindings: power: supply: cw2015_battery: add device tree binding documentation Date: Mon, 9 Mar 2020 17:03:45 +0100 Message-Id: <20200309160346.2203680-2-t.schramm@manjaro.org> In-Reply-To: <20200309160346.2203680-1-t.schramm@manjaro.org> References: <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 patch adds the dts binding schema for the cw2015 fuel gauge. Signed-off-by: Tobias Schramm --- .../bindings/power/supply/cw2015_battery.yaml | 84 +++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 Documentation/devicetree/bindings/power/supply/cw2015_battery.yaml diff --git a/Documentation/devicetree/bindings/power/supply/cw2015_battery.yaml b/Documentation/devicetree/bindings/power/supply/cw2015_battery.yaml new file mode 100644 index 000000000000..ebd4814ea58d --- /dev/null +++ b/Documentation/devicetree/bindings/power/supply/cw2015_battery.yaml @@ -0,0 +1,84 @@ +# SPDX-License-Identifier: GPL-2.0 +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/power/supply/cw2015_battery.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Battery driver for CW2015 shuntless fule gauge by CellWise. + +maintainers: + - Tobias Schramm + +description: | + The driver can utilize information from a simple-battery linked via a + phandle in monitored-battery. If specified the driver uses the + charge-full-design-microamp-hours property of the battery. + + The contents of the byte array in cellwise,bat-config-info describes + characteristics of the battery used. The format of this binary blob + is not publicly descibed and currently unknown. + +properties: + compatible: + const: cellwise,cw2015 + + reg: + items: + - description: i2c address + + cellwise,bat-config-info: + description: + Specifies the binary battery parameter blob + allOf: + - $ref: /schemas/types.yaml#definitions/uint8-array + items: + - minItems: 64 + maxItems: 64 + + cellwise,monitor-interval-ms: + description: + Specifies the interval in milliseconds gauge values are polled at + $ref: /schemas/types.yaml#/definitions/uint32 + + power-supplies: + description: + Specifies supplies used for charging the battery connected to this gauge + allOf: + - $ref: /schemas/types.yaml#/definitions/phandle-array + - minItems: 1 + maxItems: 8 # Should be enough + + monitored-battery: + description: + Specifies the phandle of a simple-battery connected to this gauge + $ref: /schemas/types.yaml#/definitions/phandle + +required: + - compatible + - reg + +examples: + - | + i2c { + #address-cells = <1>; + #size-cells = <0>; + + cw2015@62 { + compatible = "cellwise,cw201x"; + reg = <0x62>; + cellwise,bat-config-info = /bits/ 8 < + 0x17 0x67 0x80 0x73 0x6E 0x6C 0x6B 0x63 + 0x77 0x51 0x5C 0x58 0x50 0x4C 0x48 0x36 + 0x15 0x0C 0x0C 0x19 0x5B 0x7D 0x6F 0x69 + 0x69 0x5B 0x0C 0x29 0x20 0x40 0x52 0x59 + 0x57 0x56 0x54 0x4F 0x3B 0x1F 0x7F 0x17 + 0x06 0x1A 0x30 0x5A 0x85 0x93 0x96 0x2D + 0x48 0x77 0x9C 0xB3 0x80 0x52 0x94 0xCB + 0x2F 0x00 0x64 0xA5 0xB5 0x11 0xF0 0x11 + >; + cellwise,monitor-interval-ms = <5000>; + monitored-battery = <&bat>; + power-supplies = <&mains_charger>, <&usb_charger>; + }; + }; + -- 2.24.1