dt-bindings: power: supply: act8945a: Convert to DT schema format

Convert the binding to DT schema format.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: Rob Herring <robh@kernel.org>
This commit is contained in:
Sebastian Reichel 2021-03-17 14:48:53 +01:00 committed by Sebastian Reichel
parent 6c463222a2
commit ee123ad978
2 changed files with 76 additions and 44 deletions

View file

@ -1,44 +0,0 @@
Device-Tree bindings for charger of Active-semi ACT8945A Multi-Function Device
Required properties:
- compatible: "active-semi,act8945a-charger".
- active-semi,chglev-gpios: charge current level phandle with args
as described in ../gpio/gpio.txt.
- active-semi,lbo-gpios: specify the low battery voltage detect phandle
with args as as described in ../gpio/gpio.txt.
- interrupts: <a b> where a is the interrupt number and b is a
field that represents an encoding of the sense and level
information for the interrupt.
Optional properties:
- active-semi,input-voltage-threshold-microvolt: unit: mV;
Specifies the charger's input over-voltage threshold value;
The value can be: 6600, 7000, 7500, 8000; default: 6600
- active-semi,precondition-timeout: unit: minutes;
Specifies the charger's PRECONDITION safety timer setting value;
The value can be: 40, 60, 80, 0; If 0, it means to disable this timer;
default: 40.
- active-semi,total-timeout: unit: hours;
Specifies the charger's total safety timer setting value;
The value can be: 3, 4, 5, 0; If 0, it means to disable this timer;
default: 3.
Example:
pmic@5b {
compatible = "active-semi,act8945a";
reg = <0x5b>;
charger {
compatible = "active-semi,act8945a-charger";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_charger_chglev &pinctrl_charger_lbo &pinctrl_charger_irq>;
interrupt-parent = <&pioA>;
interrupts = <45 IRQ_TYPE_LEVEL_LOW>;
active-semi,chglev-gpios = <&pioA 12 GPIO_ACTIVE_HIGH>;
active-semi,lbo-gpios = <&pioA 72 GPIO_ACTIVE_LOW>;
active-semi,input-voltage-threshold-microvolt = <6600>;
active-semi,precondition-timeout = <40>;
active-semi,total-timeout = <3>;
};
};

View file

@ -0,0 +1,76 @@
# SPDX-License-Identifier: GPL-2.0
%YAML 1.2
---
$id: "http://devicetree.org/schemas/power/supply/active-semi,act8945a-charger.yaml#"
$schema: "http://devicetree.org/meta-schemas/core.yaml#"
title: Active-semi ACT8945A Charger Function
maintainers:
- Sebastian Reichel <sre@kernel.org>
allOf:
- $ref: power-supply.yaml#
properties:
compatible:
const: active-semi,act8945a-charger
interrupts:
maxItems: 1
active-semi,chglev-gpios:
maxItems: 1
description: charge current level GPIO
active-semi,lbo-gpios:
maxItems: 1
description: low battery voltage detect GPIO
active-semi,input-voltage-threshold-microvolt:
description: |
Specifies the charger's input over-voltage threshold value.
Despite the name, specified values are in millivolt (mV).
Defaults to 6.6 V
enum: [ 6600, 7000, 7500, 8000 ]
active-semi,precondition-timeout:
$ref: /schemas/types.yaml#/definitions/uint32
description: |
Specifies the charger's PRECONDITION safety timer setting value in minutes.
If 0, it means to disable this timer.
Defaults to 40 minutes.
enum: [ 0, 40, 60, 80 ]
active-semi,total-timeout:
$ref: /schemas/types.yaml#/definitions/uint32
description: |
Specifies the charger's total safety timer setting value in hours;
If 0, it means to disable this timer;
Defaults to 3 hours.
enum: [ 0, 3, 4, 5 ]
required:
- compatible
- interrupts
- active-semi,chglev-gpios
- active-semi,lbo-gpios
additionalProperties: false
examples:
- |
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/interrupt-controller/irq.h>
pmic {
charger {
compatible = "active-semi,act8945a-charger";
interrupt-parent = <&pioA>;
interrupts = <45 IRQ_TYPE_LEVEL_LOW>;
active-semi,chglev-gpios = <&pioA 12 GPIO_ACTIVE_HIGH>;
active-semi,lbo-gpios = <&pioA 72 GPIO_ACTIVE_LOW>;
active-semi,input-voltage-threshold-microvolt = <6600>;
active-semi,precondition-timeout = <40>;
active-semi,total-timeout = <3>;
};
};