Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1354734pxf; Fri, 12 Mar 2021 07:46:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJzQsZB/P/kzMD1AAyNlHt1pmNugk1YThr8yRaLec5ybb4+YogqNWrL1utRqSZVkQtsSigjh X-Received: by 2002:a17:906:4d85:: with SMTP id s5mr7754266eju.43.1615563987402; Fri, 12 Mar 2021 07:46:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615563987; cv=none; d=google.com; s=arc-20160816; b=CdqpoB6W9gTZAhmOAAOMIZlENZWQTU2rD+1fOHIupc58AlV6n7a5x2zHAuLE5Y2xYw YRVnNXcDGiJMeRuCu69On1upzB9mdnhHavg5kGmHd2M2oHVKaQmxbzL+S06s1wsgX76A 27171XcuwiTS6/OCxgoVG2TsVy+AWnN6MRI1kXntR4c2aSVYejVWQiSkFUqnZOdutNsA TmwssfYrN04BHrE5wVf88M/q3VNlIayy33rCgXx1lP46FF4yPt/Jdiv6p2C10d0ZAnSV yFGPhS3yyB0L/tO6gUrrS8dnvzuSKKk2RnEZ8DC/u5t1V+vl4w8yq2D1jKPDyMX+LJf9 ZevQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=02B6dJRapszqmX2HQS4Wvo1zQp9HVhZJzpXLajolBDI=; b=XUbByH6yOKh9uxhLHbe0leRk6/JDPeQo9jLkG71253aKAzAVgh9S/kqu/t3MxWp/DM yBmk46G4zI5S+n5aY6tBFlA0wKUc3/QSTQhthPWhRr/Xs3jRIdYFUsNHgfjQdzNma7QD DdILrmgY5KXuBy1oHXPWB7foa9Tie+jIujxBHJhmukXJY+my4apZ6tWSA3tcZVDmoRIy Z5fv41fTSMCZYIE2Vv2+KPTVmW5cu0d7AmAIpJw+YU470v/jnlnn6ROVCKk3briq6W50 kpoKsz0COP2+998s+VOwVKVnOXZZu97mHA/EDTcy9W1MjmNmsMtn5dkpWWxmRI3vGPtz UsGg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hc39si4416363ejc.125.2021.03.12.07.46.04; Fri, 12 Mar 2021 07:46:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232936AbhCLPo4 (ORCPT + 99 others); Fri, 12 Mar 2021 10:44:56 -0500 Received: from bhuna.collabora.co.uk ([46.235.227.227]:55604 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232524AbhCLPoO (ORCPT ); Fri, 12 Mar 2021 10:44:14 -0500 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: sre) with ESMTPSA id 82E301F46E7A Received: by jupiter.universe (Postfix, from userid 1000) id 34E1F4800DD; Fri, 12 Mar 2021 16:44:08 +0100 (CET) From: Sebastian Reichel To: Sebastian Reichel , Rob Herring Cc: linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Sebastian Reichel , kernel@collabora.com Subject: [PATCH 05/38] dt-bindings: power: supply: bq24257: Convert to DT schema format Date: Fri, 12 Mar 2021 16:43:24 +0100 Message-Id: <20210312154357.1561730-6-sebastian.reichel@collabora.com> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210312154357.1561730-1-sebastian.reichel@collabora.com> References: <20210312154357.1561730-1-sebastian.reichel@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Convert the binding to DT schema format. Signed-off-by: Sebastian Reichel --- .../bindings/power/supply/bq24257.txt | 62 --------- .../bindings/power/supply/bq24257.yaml | 124 ++++++++++++++++++ 2 files changed, 124 insertions(+), 62 deletions(-) delete mode 100644 Documentation/devicetree/bindings/power/supply/bq24257.txt create mode 100644 Documentation/devicetree/bindings/power/supply/bq24257.yaml diff --git a/Documentation/devicetree/bindings/power/supply/bq24257.txt b/Documentation/devicetree/bindings/power/supply/bq24257.txt deleted file mode 100644 index f8f5a1685bb9..000000000000 --- a/Documentation/devicetree/bindings/power/supply/bq24257.txt +++ /dev/null @@ -1,62 +0,0 @@ -Binding for TI bq24250/bq24251/bq24257 Li-Ion Charger - -Required properties: -- compatible: Should contain one of the following: - * "ti,bq24250" - * "ti,bq24251" - * "ti,bq24257" -- reg: integer, i2c address of the device. -- interrupts: Interrupt mapping for GPIO IRQ (configure for both edges). Use in - conjunction with "interrupt-parent". -- ti,battery-regulation-voltage: integer, maximum charging voltage in uV. -- ti,charge-current: integer, maximum charging current in uA. -- ti,termination-current: integer, charge will be terminated when current in - constant-voltage phase drops below this value (in uA). - -Optional properties: -- pg-gpios: GPIO used for connecting the bq2425x device PG (Power Good) pin. - This pin is not available on all devices however it should be used if - possible as this is the recommended way to obtain the charger's input PG - state. If this pin is not specified a software-based approach for PG - detection is used. -- ti,current-limit: The maximum current to be drawn from the charger's input - (in uA). If this property is not specified, the input limit current is - set automatically using USB D+/D- signal based charger type detection. - If the hardware does not support the D+/D- based detection, a default - of 500,000 is used (=500mA) instead. -- ti,ovp-voltage: Configures the over voltage protection voltage (in uV). If - not specified a default of 6,5000,000 (=6.5V) is used. -- ti,in-dpm-voltage: Configures the threshold input voltage for the dynamic - power path management (in uV). If not specified a default of 4,360,000 - (=4.36V) is used. - -Example: - -bq24257 { - compatible = "ti,bq24257"; - reg = <0x6a>; - interrupt-parent = <&gpio1>; - interrupts = <16 IRQ_TYPE_EDGE_BOTH>; - - pg-gpios = <&gpio1 28 GPIO_ACTIVE_HIGH>; - - ti,battery-regulation-voltage = <4200000>; - ti,charge-current = <1000000>; - ti,termination-current = <50000>; -}; - -Example: - -bq24250 { - compatible = "ti,bq24250"; - reg = <0x6a>; - interrupt-parent = <&gpio1>; - interrupts = <16 IRQ_TYPE_EDGE_BOTH>; - - ti,battery-regulation-voltage = <4200000>; - ti,charge-current = <500000>; - ti,termination-current = <50000>; - ti,current-limit = <900000>; - ti,ovp-voltage = <9500000>; - ti,in-dpm-voltage = <4440000>; -}; diff --git a/Documentation/devicetree/bindings/power/supply/bq24257.yaml b/Documentation/devicetree/bindings/power/supply/bq24257.yaml new file mode 100644 index 000000000000..3a0f6cd9015a --- /dev/null +++ b/Documentation/devicetree/bindings/power/supply/bq24257.yaml @@ -0,0 +1,124 @@ +# SPDX-License-Identifier: GPL-2.0 +# Copyright (C) 2021 Sebastian Reichel +%YAML 1.2 +--- +$id: "http://devicetree.org/schemas/power/supply/bq24257.yaml#" +$schema: "http://devicetree.org/meta-schemas/core.yaml#" + +title: Binding for bq24250, bq24251 and bq24257 Li-Ion Charger + +maintainers: + - Sebastian Reichel + +allOf: + - $ref: power-supply.yaml# + +properties: + compatible: + enum: + - ti,bq24250 + - ti,bq24251 + - ti,bq24257 + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + ti,battery-regulation-voltage: + $ref: /schemas/types.yaml#/definitions/uint32 + description: maximum charging voltage in uV + + ti,charge-current: + $ref: /schemas/types.yaml#/definitions/uint32 + description: maximum charging current in uA + + ti,termination-current: + $ref: /schemas/types.yaml#/definitions/uint32 + description: | + charge will be terminated when current in constant-voltage phase + drops below this value (in uA) + + pg-gpios: + description: | + GPIO used for connecting the bq2425x device PG (Power Good) pin. + This pin is not available on all devices however it should be used if + possible as this is the recommended way to obtain the charger's input PG + state. If this pin is not specified a software-based approach for PG + detection is used. + maxItems: 1 + + ti,current-limit: + $ref: /schemas/types.yaml#/definitions/uint32 + description: | + The maximum current to be drawn from the charger's input (in uA). + If this property is not specified, the input limit current is set + automatically using USB D+/D- signal based charger type detection. + If the hardware does not support the D+/D- based detection, a default + of 500,000 is used (=500mA) instead. + + ti,ovp-voltage: + $ref: /schemas/types.yaml#/definitions/uint32 + description: | + Configures the over voltage protection voltage (in uV). + If not specified a default of 6,5000,000 (=6.5V) is used. + + ti,in-dpm-voltage: + $ref: /schemas/types.yaml#/definitions/uint32 + description: | + Configures the threshold input voltage for the dynamic power path management (in uV). + If not specified a default of 4,360,000 (=4.36V) is used. + +required: + - compatible + - reg + - interrupts + - ti,battery-regulation-voltage + - ti,charge-current + - ti,termination-current + +additionalProperties: false + +examples: + - | + #include + #include + i2c0 { + #address-cells = <1>; + #size-cells = <0>; + + charger@6a { + compatible = "ti,bq24257"; + reg = <0x6a>; + interrupt-parent = <&gpio1>; + interrupts = <16 IRQ_TYPE_EDGE_BOTH>; + + pg-gpios = <&gpio1 28 GPIO_ACTIVE_HIGH>; + + ti,battery-regulation-voltage = <4200000>; + ti,charge-current = <1000000>; + ti,termination-current = <50000>; + }; + }; + - | + #include + #include + i2c0 { + #address-cells = <1>; + #size-cells = <0>; + + charger@6a { + compatible = "ti,bq24250"; + reg = <0x6a>; + interrupt-parent = <&gpio1>; + interrupts = <16 IRQ_TYPE_EDGE_BOTH>; + + ti,battery-regulation-voltage = <4200000>; + ti,charge-current = <500000>; + ti,termination-current = <50000>; + ti,current-limit = <900000>; + ti,ovp-voltage = <9500000>; + ti,in-dpm-voltage = <4440000>; + }; + }; -- 2.30.1