Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp1010142ybh; Thu, 12 Mar 2020 15:25:42 -0700 (PDT) X-Google-Smtp-Source: ADFU+vse0QNSyasKAyg/HlurvOxdk1ch0mNkL2eAn6QhwxSyYik6PsW9MdsNx8v6+BOaJ/+7ySh+ X-Received: by 2002:a9d:20e2:: with SMTP id x89mr7755428ota.252.1584051942154; Thu, 12 Mar 2020 15:25:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584051942; cv=none; d=google.com; s=arc-20160816; b=LLUw8ncl9eBAfNf5rAMuAqWiejCTEdhRrU+nMGkGQRH8Oj7XxnG+sZtc209qE6K5iW +92xZb8VTqSsCfwJaKpQ8byat9Uajo6CYSPVytyZQHZa6mW6QxM0BQadwzFeZ4XWR/Qv shXgI3aDBdFNmPjJbXqmng0I1ysNZMrF2uyU2fyq001n011wHd43JXNCe3iCT+QM9L7l xbNAd6qTXfjUGvBghUrPoxjf5kIrOwJ2Ihpn3jMMpZ/lhyW7RWsQIeb+dycyiyJkR7HX pydNeGprnjE9+W07COoLV1YolW+Qor13iffdic8R8Dk5a6oTMP9BonM1xSGC1dIyPZpK SsQA== 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=Ntvyr+w/d7m6yez82LtcMQJ7DgmQzPZgjRf35dqNa3M=; b=VFqzHO8dsaCdHifHRa7NsKbUfI3DiCyhKCNVTdhXNo7QUkONa3rR1kuAsV59fkduqy I1HSkps3SbgDcBRon61sh8esUSK1717yfkcURlbkMK+dfDX6tcAjfjhqXEWP8/qu7aDU 5kjvJlQMhUGUohoaEyKw+YNT3/5b70+BGZRs3Wtu1cxIHLFsYYDkYI7tLM6R4tpWntNl RUJCbGxUOKJTB4iM0xdYjZCshpRb9DHfdTMdHwL8inxkRuVkb6fnKuLI369tsNuiAroL 6c+xOeuHdEvmVpj4c0Ph+m3m8uDqQ+urMjExgN4oSLSi9YqlET0V3VwVTeuuIuaTY9CL Vdog== 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 h11si3672004otj.170.2020.03.12.15.25.30; Thu, 12 Mar 2020 15:25:42 -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 S1726863AbgCLWZH (ORCPT + 99 others); Thu, 12 Mar 2020 18:25:07 -0400 Received: from mail.manjaro.org ([176.9.38.148]:58904 "EHLO mail.manjaro.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726837AbgCLWZG (ORCPT ); Thu, 12 Mar 2020 18:25:06 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.manjaro.org (Postfix) with ESMTP id BD4E337025EA; Thu, 12 Mar 2020 23:25:04 +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 Izw5plUVv6Rt; Thu, 12 Mar 2020 23:25:00 +0100 (CET) From: Tobias Schramm To: Andy Shevchenko , Sebastian Reichel , Rob Herring , Mark Rutland , Daniel Thompson 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 v4 2/3] dt-bindings: power: supply: add cw2015_battery bindings Date: Thu, 12 Mar 2020 23:24:47 +0100 Message-Id: <20200312222448.25097-3-t.schramm@manjaro.org> In-Reply-To: <20200312222448.25097-1-t.schramm@manjaro.org> References: <20200312222448.25097-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 | 83 +++++++++++++++++++ 1 file changed, 83 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..f789882312da --- /dev/null +++ b/Documentation/devicetree/bindings/power/supply/cw2015_battery.yaml @@ -0,0 +1,83 @@ +# 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 fuel 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. + +properties: + compatible: + const: cellwise,cw2015 + + reg: + items: + - description: i2c address + + cellwise,battery-profile: + description: | + This property specifies characteristics of the battery used. The format + of this binary blob is kept secret by CellWise. The only way to obtain + it is to mail two batteries to a test facility of CellWise and receive + back a test report with the binary 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,battery-profile = /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