xref: /freebsd/sys/contrib/device-tree/Bindings/power/supply/cpcap-charger.yaml (revision b97ee269eae3cbaf35c18f51a459aea581c2a7dc)
12eb4d8dcSEmmanuel Vadot# SPDX-License-Identifier: GPL-2.0
22eb4d8dcSEmmanuel Vadot# Copyright (C) 2021 Sebastian Reichel
32eb4d8dcSEmmanuel Vadot%YAML 1.2
42eb4d8dcSEmmanuel Vadot---
5*b97ee269SEmmanuel Vadot$id: http://devicetree.org/schemas/power/supply/cpcap-charger.yaml#
6*b97ee269SEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
72eb4d8dcSEmmanuel Vadot
82eb4d8dcSEmmanuel Vadottitle: Motorola CPCAP PMIC charger
92eb4d8dcSEmmanuel Vadot
102eb4d8dcSEmmanuel Vadotmaintainers:
112eb4d8dcSEmmanuel Vadot  - Tony Lindgren <tony@atomide.com>
122eb4d8dcSEmmanuel Vadot  - Sebastian Reichel <sre@kernel.org>
132eb4d8dcSEmmanuel Vadot
142eb4d8dcSEmmanuel Vadotdescription: |
152eb4d8dcSEmmanuel Vadot  Motorola CPCAP is a PMIC found in some mobile phones, e.g.
162eb4d8dcSEmmanuel Vadot  the Droid 4. This binding describes its battery charger
172eb4d8dcSEmmanuel Vadot  sub-function.
182eb4d8dcSEmmanuel Vadot
192eb4d8dcSEmmanuel VadotallOf:
202eb4d8dcSEmmanuel Vadot  - $ref: power-supply.yaml#
212eb4d8dcSEmmanuel Vadot
222eb4d8dcSEmmanuel Vadotproperties:
232eb4d8dcSEmmanuel Vadot  compatible:
242eb4d8dcSEmmanuel Vadot    const: motorola,mapphone-cpcap-charger
252eb4d8dcSEmmanuel Vadot
262eb4d8dcSEmmanuel Vadot  interrupts:
272eb4d8dcSEmmanuel Vadot    items:
282eb4d8dcSEmmanuel Vadot      - description: charger detection interrupt
292eb4d8dcSEmmanuel Vadot      - description: reverse charge interrupt
302eb4d8dcSEmmanuel Vadot      - description: SE1 charger detection interrupt
312eb4d8dcSEmmanuel Vadot      - description: SE0 charger detection interrupt
322eb4d8dcSEmmanuel Vadot      - description: reverse mode interrupt
332eb4d8dcSEmmanuel Vadot      - description: charge current 2 interrupt
342eb4d8dcSEmmanuel Vadot      - description: charge current 1 interrupt
352eb4d8dcSEmmanuel Vadot      - description: VBUS valid interrupt
362eb4d8dcSEmmanuel Vadot      - description: battery detect interrupt
372eb4d8dcSEmmanuel Vadot
382eb4d8dcSEmmanuel Vadot  interrupt-names:
392eb4d8dcSEmmanuel Vadot    items:
402eb4d8dcSEmmanuel Vadot      - const: chrg_det
412eb4d8dcSEmmanuel Vadot      - const: rvrs_chrg
422eb4d8dcSEmmanuel Vadot      - const: chrg_se1b
432eb4d8dcSEmmanuel Vadot      - const: se0conn
442eb4d8dcSEmmanuel Vadot      - const: rvrs_mode
452eb4d8dcSEmmanuel Vadot      - const: chrgcurr2
462eb4d8dcSEmmanuel Vadot      - const: chrgcurr1
472eb4d8dcSEmmanuel Vadot      - const: vbusvld
482eb4d8dcSEmmanuel Vadot      - const: battdetb
492eb4d8dcSEmmanuel Vadot
502eb4d8dcSEmmanuel Vadot  io-channels:
512eb4d8dcSEmmanuel Vadot    items:
522eb4d8dcSEmmanuel Vadot      - description: battery temperature
532eb4d8dcSEmmanuel Vadot      - description: battery voltage
542eb4d8dcSEmmanuel Vadot      - description: VBUS voltage
552eb4d8dcSEmmanuel Vadot      - description: battery charge current
562eb4d8dcSEmmanuel Vadot      - description: battery current
572eb4d8dcSEmmanuel Vadot
582eb4d8dcSEmmanuel Vadot  io-channel-names:
592eb4d8dcSEmmanuel Vadot    items:
602eb4d8dcSEmmanuel Vadot      - const: battdetb
612eb4d8dcSEmmanuel Vadot      - const: battp
622eb4d8dcSEmmanuel Vadot      - const: vbus
632eb4d8dcSEmmanuel Vadot      - const: chg_isense
642eb4d8dcSEmmanuel Vadot      - const: batti
652eb4d8dcSEmmanuel Vadot
662eb4d8dcSEmmanuel Vadot  mode-gpios:
672eb4d8dcSEmmanuel Vadot    description: |
682eb4d8dcSEmmanuel Vadot      Optionally CPCAP charger can have a companion wireless
692eb4d8dcSEmmanuel Vadot      charge controller that is controlled with two GPIOs
702eb4d8dcSEmmanuel Vadot      that are active low.
712eb4d8dcSEmmanuel Vadot    minItems: 2
722eb4d8dcSEmmanuel Vadot    maxItems: 2
732eb4d8dcSEmmanuel Vadot
742eb4d8dcSEmmanuel Vadotrequired:
752eb4d8dcSEmmanuel Vadot  - compatible
762eb4d8dcSEmmanuel Vadot  - interrupts
772eb4d8dcSEmmanuel Vadot  - interrupt-names
782eb4d8dcSEmmanuel Vadot  - io-channels
792eb4d8dcSEmmanuel Vadot  - io-channel-names
802eb4d8dcSEmmanuel Vadot
812eb4d8dcSEmmanuel VadotadditionalProperties: false
822eb4d8dcSEmmanuel Vadot
832eb4d8dcSEmmanuel Vadotexamples:
842eb4d8dcSEmmanuel Vadot  - |
852eb4d8dcSEmmanuel Vadot    #include <dt-bindings/gpio/gpio.h>
862eb4d8dcSEmmanuel Vadot    cpcap {
872eb4d8dcSEmmanuel Vadot      charger {
882eb4d8dcSEmmanuel Vadot        compatible = "motorola,mapphone-cpcap-charger";
892eb4d8dcSEmmanuel Vadot        interrupts-extended =
902eb4d8dcSEmmanuel Vadot                <&cpcap 13 0>, <&cpcap 12 0>, <&cpcap 29 0>, <&cpcap 28 0>,
912eb4d8dcSEmmanuel Vadot                <&cpcap 22 0>, <&cpcap 21 0>, <&cpcap 20 0>, <&cpcap 19 0>,
922eb4d8dcSEmmanuel Vadot                <&cpcap 54 0>;
932eb4d8dcSEmmanuel Vadot        interrupt-names =
942eb4d8dcSEmmanuel Vadot                "chrg_det", "rvrs_chrg", "chrg_se1b", "se0conn",
952eb4d8dcSEmmanuel Vadot                "rvrs_mode", "chrgcurr2", "chrgcurr1", "vbusvld",
962eb4d8dcSEmmanuel Vadot                "battdetb";
972eb4d8dcSEmmanuel Vadot        mode-gpios = <&gpio3 29 GPIO_ACTIVE_LOW>,
982eb4d8dcSEmmanuel Vadot                     <&gpio3 23 GPIO_ACTIVE_LOW>;
992eb4d8dcSEmmanuel Vadot        io-channels = <&cpcap_adc 0>, <&cpcap_adc 1>,
1002eb4d8dcSEmmanuel Vadot                      <&cpcap_adc 2>, <&cpcap_adc 5>,
1012eb4d8dcSEmmanuel Vadot                      <&cpcap_adc 6>;
1022eb4d8dcSEmmanuel Vadot        io-channel-names = "battdetb", "battp",
1032eb4d8dcSEmmanuel Vadot                           "vbus", "chg_isense",
1042eb4d8dcSEmmanuel Vadot                           "batti";
1052eb4d8dcSEmmanuel Vadot      };
1062eb4d8dcSEmmanuel Vadot    };
107