| 1 |
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) |
| 2 |
%YAML 1.2 |
| 3 |
--- |
| 4 |
$id: http://devicetree.org/schemas/power/supply/summit,smb347-charger.yaml# |
| 5 |
$schema: http://devicetree.org/meta-schemas/core.yaml# |
| 6 |
|
| 7 |
title: Battery charger driver for SMB345, SMB347 and SMB358 |
| 8 |
|
| 9 |
maintainers: |
| 10 |
- David Heidelberg <[email protected]> |
| 11 |
- Dmitry Osipenko <[email protected]> |
| 12 |
|
| 13 |
properties: |
| 14 |
compatible: |
| 15 |
enum: |
| 16 |
- summit,smb345 |
| 17 |
- summit,smb347 |
| 18 |
- summit,smb358 |
| 19 |
|
| 20 |
reg: |
| 21 |
maxItems: 1 |
| 22 |
|
| 23 |
interrupts: |
| 24 |
maxItems: 1 |
| 25 |
|
| 26 |
monitored-battery: true |
| 27 |
|
| 28 |
summit,enable-usb-charging: |
| 29 |
type: boolean |
| 30 |
description: Enable charging through USB. |
| 31 |
|
| 32 |
summit,enable-otg-charging: |
| 33 |
type: boolean |
| 34 |
description: Provide power for USB OTG |
| 35 |
|
| 36 |
summit,enable-mains-charging: |
| 37 |
type: boolean |
| 38 |
description: Enable charging through mains |
| 39 |
|
| 40 |
summit,enable-charge-control: |
| 41 |
description: Enable charging control |
| 42 |
$ref: /schemas/types.yaml#/definitions/uint32 |
| 43 |
enum: |
| 44 |
- 0 # SMB3XX_CHG_ENABLE_SW SW (I2C interface) |
| 45 |
- 1 # SMB3XX_CHG_ENABLE_PIN_ACTIVE_LOW Pin control (Active Low) |
| 46 |
- 2 # SMB3XX_CHG_ENABLE_PIN_ACTIVE_HIGH Pin control (Active High) |
| 47 |
|
| 48 |
summit,fast-voltage-threshold-microvolt: |
| 49 |
description: Voltage threshold to transit to fast charge mode (in uV) |
| 50 |
minimum: 2400000 |
| 51 |
maximum: 3000000 |
| 52 |
|
| 53 |
summit,mains-current-limit-microamp: |
| 54 |
description: Maximum input current from AC/DC input (in uA) |
| 55 |
|
| 56 |
summit,usb-current-limit-microamp: |
| 57 |
description: Maximum input current from USB input (in uA) |
| 58 |
|
| 59 |
summit,charge-current-compensation-microamp: |
| 60 |
description: Charge current compensation (in uA) |
| 61 |
|
| 62 |
summit,chip-temperature-threshold-celsius: |
| 63 |
description: Chip temperature for thermal regulation in °C. |
| 64 |
enum: [100, 110, 120, 130] |
| 65 |
|
| 66 |
summit,soft-compensation-method: |
| 67 |
description: Soft temperature limit compensation method |
| 68 |
$ref: /schemas/types.yaml#/definitions/uint32 |
| 69 |
enum: |
| 70 |
- 0 # SMB3XX_SOFT_TEMP_COMPENSATE_NONE Compensation none |
| 71 |
- 1 # SMB3XX_SOFT_TEMP_COMPENSATE_CURRENT Current compensation |
| 72 |
- 2 # SMB3XX_SOFT_TEMP_COMPENSATE_VOLTAGE Voltage compensation |
| 73 |
|
| 74 |
summit,inok-polarity: |
| 75 |
description: | |
| 76 |
Polarity of INOK signal indicating presence of external power supply. |
| 77 |
$ref: /schemas/types.yaml#/definitions/uint32 |
| 78 |
enum: |
| 79 |
- 0 # SMB3XX_SYSOK_INOK_ACTIVE_LOW |
| 80 |
- 1 # SMB3XX_SYSOK_INOK_ACTIVE_HIGH |
| 81 |
|
| 82 |
usb-vbus: |
| 83 |
$ref: /schemas/regulator/regulator.yaml# |
| 84 |
type: object |
| 85 |
|
| 86 |
properties: |
| 87 |
summit,needs-inok-toggle: |
| 88 |
type: boolean |
| 89 |
description: INOK signal is fixed and polarity needs to be toggled |
| 90 |
in order to enable/disable output mode. |
| 91 |
|
| 92 |
unevaluatedProperties: false |
| 93 |
|
| 94 |
allOf: |
| 95 |
- $ref: power-supply.yaml# |
| 96 |
- if: |
| 97 |
properties: |
| 98 |
compatible: |
| 99 |
enum: |
| 100 |
- summit,smb345 |
| 101 |
- summit,smb358 |
| 102 |
|
| 103 |
then: |
| 104 |
properties: |
| 105 |
summit,mains-current-limit-microamp: |
| 106 |
enum: [ 300000, 500000, 700000, 1000000, |
| 107 |
1500000, 1800000, 2000000] |
| 108 |
|
| 109 |
summit,usb-current-limit-microamp: |
| 110 |
enum: [ 300000, 500000, 700000, 1000000, |
| 111 |
1500000, 1800000, 2000000] |
| 112 |
|
| 113 |
summit,charge-current-compensation-microamp: |
| 114 |
enum: [200000, 450000, 600000, 900000] |
| 115 |
|
| 116 |
else: |
| 117 |
properties: |
| 118 |
summit,mains-current-limit-microamp: |
| 119 |
enum: [ 300000, 500000, 700000, 900000, 1200000, |
| 120 |
1500000, 1800000, 2000000, 2200000, 2500000] |
| 121 |
|
| 122 |
summit,usb-current-limit-microamp: |
| 123 |
enum: [ 300000, 500000, 700000, 900000, 1200000, |
| 124 |
1500000, 1800000, 2000000, 2200000, 2500000] |
| 125 |
|
| 126 |
summit,charge-current-compensation-microamp: |
| 127 |
enum: [250000, 700000, 900000, 1200000] |
| 128 |
|
| 129 |
required: |
| 130 |
- compatible |
| 131 |
- reg |
| 132 |
|
| 133 |
anyOf: |
| 134 |
- required: |
| 135 |
- summit,enable-usb-charging |
| 136 |
- required: |
| 137 |
- summit,enable-otg-charging |
| 138 |
- required: |
| 139 |
- summit,enable-mains-charging |
| 140 |
|
| 141 |
additionalProperties: false |
| 142 |
|
| 143 |
examples: |
| 144 |
- | |
| 145 |
#include <dt-bindings/power/summit,smb347-charger.h> |
| 146 |
|
| 147 |
i2c { |
| 148 |
#address-cells = <1>; |
| 149 |
#size-cells = <0>; |
| 150 |
|
| 151 |
charger@7f { |
| 152 |
compatible = "summit,smb347"; |
| 153 |
reg = <0x7f>; |
| 154 |
|
| 155 |
summit,enable-charge-control = <SMB3XX_CHG_ENABLE_PIN_ACTIVE_HIGH>; |
| 156 |
summit,inok-polarity = <SMB3XX_SYSOK_INOK_ACTIVE_LOW>; |
| 157 |
summit,chip-temperature-threshold-celsius = <110>; |
| 158 |
summit,mains-current-limit-microamp = <2000000>; |
| 159 |
summit,usb-current-limit-microamp = <500000>; |
| 160 |
summit,enable-usb-charging; |
| 161 |
summit,enable-mains-charging; |
| 162 |
|
| 163 |
monitored-battery = <&battery>; |
| 164 |
|
| 165 |
usb-vbus { |
| 166 |
regulator-name = "usb_vbus"; |
| 167 |
regulator-min-microvolt = <5000000>; |
| 168 |
regulator-max-microvolt = <5000000>; |
| 169 |
regulator-min-microamp = <750000>; |
| 170 |
regulator-max-microamp = <750000>; |
| 171 |
summit,needs-inok-toggle; |
| 172 |
}; |
| 173 |
}; |
| 174 |
}; |
| 175 |
|
| 176 |
battery: battery-cell { |
| 177 |
compatible = "simple-battery"; |
| 178 |
constant-charge-current-max-microamp = <1800000>; |
| 179 |
operating-range-celsius = <0 45>; |
| 180 |
alert-celsius = <3 42>; |
| 181 |
}; |