dt-bindings: power: supply: n900-battery: Convert to DT schema format

Convert the binding to DT schema format.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Rejected-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Rob Herring <robh@kernel.org>
This commit is contained in:
Sebastian Reichel 2021-03-17 14:48:44 +01:00 committed by Sebastian Reichel
parent bb56712aba
commit df89b2850a
2 changed files with 49 additions and 25 deletions

View File

@ -0,0 +1,49 @@
# SPDX-License-Identifier: GPL-2.0
%YAML 1.2
---
$id: "http://devicetree.org/schemas/power/supply/nokia,n900-battery.yaml#"
$schema: "http://devicetree.org/meta-schemas/core.yaml#"
title: Nokia N900 battery
maintainers:
- Pali Rohár <pali@kernel.org>
- Sebastian Reichel <sre@kernel.org>
allOf:
- $ref: power-supply.yaml#
properties:
compatible:
const: nokia,n900-battery
io-channels:
items:
- description: ADC channel for temperature reading
- description: ADC channel for battery size identification
- description: ADC channel to measure the battery voltage
io-channel-names:
items:
- const: temp
- const: bsi
- const: vbat
required:
- compatible
- io-channels
- io-channel-names
additionalProperties: false
examples:
- |
battery {
compatible = "nokia,n900-battery";
io-channels = <&twl4030_madc 0>,
<&twl4030_madc 4>,
<&twl4030_madc 12>;
io-channel-names = "temp",
"bsi",
"vbat";
};

View File

@ -1,25 +0,0 @@
Binding for Nokia N900 battery
The Nokia N900 battery status can be read via the TWL4030's A/D converter.
Required properties:
- compatible: Should contain one of the following:
* "nokia,n900-battery"
- io-channels: Should contain IIO channel specifiers
for each element in io-channel-names.
- io-channel-names: Should contain the following values:
* "temp" - The ADC channel for temperature reading
* "bsi" - The ADC channel for battery size identification
* "vbat" - The ADC channel to measure the battery voltage
Example from Nokia N900:
battery: n900-battery {
compatible = "nokia,n900-battery";
io-channels = <&twl4030_madc 0>,
<&twl4030_madc 4>,
<&twl4030_madc 12>;
io-channel-names = "temp",
"bsi",
"vbat";
};