* [PATCH v5 0/2] power: supply: introduce support for the Qualcomm smb2 charger
@ 2022-10-07 22:22 Caleb Connolly
2022-10-07 22:22 ` [PATCH v5 2/2] dt-bindings: power: supply: qcom,pmi8998-charger: add bindings for smb2 driver Caleb Connolly
0 siblings, 1 reply; 2+ messages in thread
From: Caleb Connolly @ 2022-10-07 22:22 UTC (permalink / raw)
To: linux-arm-msm, linux-pm, Sebastian Reichel
Cc: Bjorn Andersson, phone-devel, Caleb Connolly, devicetree,
Konrad Dybcio, linux-kernel, llvm, Tom Rix
Add a driver for the Qualcomm PMI8998/PM660 Switch-Mode Battery Charger.
This is the second generation SMB charger, and replaces the previous
SMBB hardware found in older PMICs.
This driver provides basic support for initialising the hardware,
configuring the USB input current limit and reporting information about
the state of the charger. Features like type-c dual role support and OTG
switching will be added in future patches.
This patch series depends on my previous series adding support for
the Round Robin ADC which is used for reading the USB voltage and
current, it is currently queued in linux-next, and can be found here:
https://lore.kernel.org/linux-arm-msm/20220429220904.137297-1-caleb.connolly@linaro.org/
This has now been merged
Changes since v4:
* Fix typo when setting FAST_CHARGE_CURRENT_CFG - the OnePlus 6 now charges
properly!
* Limited charge current to 1A until we better understand the thermal
protection features and how to use them.
* Address Sebastian's comments (thanks for your patience with this)
* re-run clang-format
Changes since v3:
* Drop DTS patches, to be sent in a future series
* Add POWER_SUPPLY_PROP_CHARGE_CONTROL_LIMIT so that the charger will
be exposed as a cooling device,
see https://lore.kernel.org/linux-pm/164f2458-fb66-f238-7143-bdbe1e200870@linaro.org
* Run clang-format and prevent it from breaking the formatting of the
defines
* Apply Sebastian's suggested fixes
Changes since v2:
* Use devm_delayed_work_autocancel
* Minor driver fixes
* Pick up Krzysztof's R-b on the DT patch
Changes since v1:
* Rename the driver to pmi8998_charger
* Drop unnecessary (and very broken) mutex
* Rework the driver based on feedback to v1
* Fix some minor bugs and improve Automatic Input Current Limit support
Caleb Connolly (2):
power: supply: add Qualcomm PMI8998 SMB2 Charger driver
dt-bindings: power: supply: qcom,pmi8998-charger: add bindings for
smb2 driver
.../power/supply/qcom,pmi8998-charger.yaml | 82 ++
drivers/power/supply/Kconfig | 16 +
drivers/power/supply/Makefile | 1 +
drivers/power/supply/qcom_pmi8998_charger.c | 1040 +++++++++++++++++
4 files changed, 1139 insertions(+)
create mode 100644 Documentation/devicetree/bindings/power/supply/qcom,pmi8998-charger.yaml
create mode 100644 drivers/power/supply/qcom_pmi8998_charger.c
--
2.38.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH v5 2/2] dt-bindings: power: supply: qcom,pmi8998-charger: add bindings for smb2 driver
2022-10-07 22:22 [PATCH v5 0/2] power: supply: introduce support for the Qualcomm smb2 charger Caleb Connolly
@ 2022-10-07 22:22 ` Caleb Connolly
0 siblings, 0 replies; 2+ messages in thread
From: Caleb Connolly @ 2022-10-07 22:22 UTC (permalink / raw)
To: linux-arm-msm, linux-pm, Sebastian Reichel
Cc: Bjorn Andersson, phone-devel, Caleb Connolly, Krzysztof Kozlowski,
Rob Herring, Krzysztof Kozlowski, devicetree, linux-kernel
Add devicetree bindings for the Qualcomm PMI8998/PM660 SMB2 charger
driver.
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
.../power/supply/qcom,pmi8998-charger.yaml | 82 +++++++++++++++++++
1 file changed, 82 insertions(+)
create mode 100644 Documentation/devicetree/bindings/power/supply/qcom,pmi8998-charger.yaml
diff --git a/Documentation/devicetree/bindings/power/supply/qcom,pmi8998-charger.yaml b/Documentation/devicetree/bindings/power/supply/qcom,pmi8998-charger.yaml
new file mode 100644
index 000000000000..277c47e048b6
--- /dev/null
+++ b/Documentation/devicetree/bindings/power/supply/qcom,pmi8998-charger.yaml
@@ -0,0 +1,82 @@
+# SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/power/supply/qcom,pmi8998-charger.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Qualcomm PMI8998/PM660 Switch-Mode Battery Charger "2"
+
+maintainers:
+ - Caleb Connolly <caleb.connolly@linaro.org>
+
+properties:
+ compatible:
+ enum:
+ - qcom,pmi8998-charger
+ - qcom,pm660-charger
+
+ reg:
+ maxItems: 1
+
+ interrupts:
+ maxItems: 4
+
+ interrupt-names:
+ items:
+ - const: usb-plugin
+ - const: bat-ov
+ - const: wdog-bark
+ - const: usbin-icl-change
+
+ io-channels:
+ items:
+ - description: USB in current in uA
+ - description: USB in voltage in uV
+
+ io-channel-names:
+ items:
+ - const: usbin_i
+ - const: usbin_v
+
+ monitored-battery:
+ description: phandle to the simple-battery node
+ $ref: /schemas/types.yaml#/definitions/phandle
+
+required:
+ - compatible
+ - reg
+ - interrupts
+ - interrupt-names
+ - io-channels
+ - io-channel-names
+ - monitored-battery
+
+additionalProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/interrupt-controller/irq.h>
+
+ pmic {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ #interrupt-cells = <4>;
+
+ charger@1000 {
+ compatible = "qcom,pmi8998-charger";
+ reg = <0x1000>;
+
+ interrupts = <0x2 0x12 0x2 IRQ_TYPE_EDGE_BOTH>,
+ <0x2 0x13 0x4 IRQ_TYPE_EDGE_BOTH>,
+ <0x2 0x13 0x6 IRQ_TYPE_EDGE_RISING>,
+ <0x2 0x16 0x1 IRQ_TYPE_EDGE_RISING>;
+ interrupt-names = "usb-plugin", "bat-ov", "wdog-bark", "usbin-icl-change";
+
+ io-channels = <&pmi8998_rradc 3>,
+ <&pmi8998_rradc 4>;
+ io-channel-names = "usbin_i",
+ "usbin_v";
+
+ monitored-battery = <&battery>;
+ };
+ };
--
2.38.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-10-07 22:23 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-07 22:22 [PATCH v5 0/2] power: supply: introduce support for the Qualcomm smb2 charger Caleb Connolly
2022-10-07 22:22 ` [PATCH v5 2/2] dt-bindings: power: supply: qcom,pmi8998-charger: add bindings for smb2 driver Caleb Connolly
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).