Documentation/devicetree/bindings/power/supply/gpio-charger.yaml

Source file repositories/reference/linux-study-clean/Documentation/devicetree/bindings/power/supply/gpio-charger.yaml

File Facts

System
Linux kernel
Corpus path
Documentation/devicetree/bindings/power/supply/gpio-charger.yaml
Extension
.yaml
Size
2979 bytes
Lines
101
Domain
Support Tooling And Documentation
Bucket
Documentation
Inferred role
Support Tooling And Documentation: configuration, schema, or hardware description
Status
atlas-only

Why This File Exists

Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.

Dependency Surface

Detected Declarations

Annotated Snippet

# SPDX-License-Identifier: GPL-2.0
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/supply/gpio-charger.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: simple battery chargers only communicating through GPIOs

maintainers:
  - Sebastian Reichel <sre@kernel.org>

description:
  This binding is for all chargers, which are working more or less
  autonomously, only providing some status GPIOs and possibly some
  GPIOs for limited control over the charging process.

properties:
  compatible:
    const: gpio-charger

  charger-type:
    enum:
      - unknown
      - battery
      - ups
      - mains
      - usb-sdp                   # USB standard downstream port
      - usb-dcp                   # USB dedicated charging port
      - usb-cdp                   # USB charging downstream port
      - usb-aca                   # USB accessory charger adapter
    description:
      Type of the charger, e.g. "mains" for a wall charger.

  gpios:
    maxItems: 1
    description: GPIO indicating the charger presence

  charge-status-gpios:
    maxItems: 1
    description: GPIO indicating the charging status

  charge-current-limit-gpios:
    minItems: 1
    maxItems: 32
    description: GPIOs used for current limiting

  charge-current-limit-mapping:
    description: List of tuples with current in uA and a GPIO bitmap (in
      this order). The tuples must be provided in descending order of the
      current limit.
    $ref: /schemas/types.yaml#/definitions/uint32-matrix
    items:
      items:
        - description:
            Current limit in uA
        - description:
            Encoded GPIO setting. Bit 0 represents last GPIO from the
            charge-current-limit-gpios property. Bit 1 second to last
            GPIO and so on.

  charge-current-limit-default-microamp:
    description: Default charge current limit. Must be listed in
      charge-current-limit-mapping.

required:
  - compatible

anyOf:
  - required:
      - gpios

Annotation

Implementation Notes