Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
128 changes: 0 additions & 128 deletions Documentation/devicetree/bindings/hwmon/qcom,bcl-hwmon.yaml

This file was deleted.

64 changes: 64 additions & 0 deletions Documentation/devicetree/bindings/hwmon/qcom,pm7250b-bcl.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/hwmon/qcom,pm7250b-bcl.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Qualcomm SPMI PMIC Battery Current Limiting (BCL) Hardware Monitor

maintainers:
- Manaf Meethalavalappu Pallikunhi <manaf.pallikunhi@oss.qualcomm.com>

description:
SPMI PMIC Battery Current Limiting (BCL) hardware provides monitoring and
alarm functionality for battery overcurrent and battery or system under
voltage conditions. It monitors battery voltage and current, and
can trigger interrupts when configurable thresholds are exceeded.

properties:
compatible:
enum:
- qcom,pm7250b-bcl
- qcom,pm8350c-bcl
- qcom,pm8550-bcl
- qcom,pmh0101-bcl
- qcom,pmih0108-bcl
- qcom,smb2360-bcl
- qcom,smb2370-bcl

reg:
maxItems: 1

interrupts:
maxItems: 2

interrupt-names:
items:
- const: max-min
- const: critical

required:
- compatible
- reg
- interrupts
- interrupt-names

additionalProperties: false

examples:
- |
#include <dt-bindings/interrupt-controller/irq.h>

pmic {
#address-cells = <1>;
#size-cells = <0>;

sensor@1d00 {
compatible = "qcom,pm7250b-bcl";
reg = <0x1d00>;
interrupts = <0x2 0x1d 0x0 IRQ_TYPE_EDGE_RISING>,
<0x2 0x1d 0x1 IRQ_TYPE_EDGE_RISING>;
interrupt-names = "max-min",
"critical";
};
};
2 changes: 1 addition & 1 deletion Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ patternProperties:

"^sensor@[0-9a-f]+$":
type: object
$ref: /schemas/hwmon/qcom,bcl-hwmon.yaml#
$ref: /schemas/hwmon/qcom,pm7250b-bcl.yaml#

"^temp-alarm@[0-9a-f]+$":
type: object
Expand Down
5 changes: 2 additions & 3 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -21092,14 +21092,13 @@ S: Maintained
F: Documentation/devicetree/bindings/net/qcom,bam-dmux.yaml
F: drivers/net/wwan/qcom_bam_dmux.c


QUALCOMM BCL HARDWARE MONITOR DRIVER
M: Manaf Meethalavalappu Pallikunhi <manaf.pallikunhi@oss.qualcomm.com>
L: linux-hwmon@vger.kernel.org
L: linux-arm-msm@vger.kernel.org
S: Maintained
F: Documentation/devicetree/bindings/hwmon/qcom,bcl-hwmon.yaml
F: drivers/hwmon/qcom-bcl-hwmon.c
F: drivers/hwmon/qcom-bcl-hwmon.h
F: Documentation/devicetree/bindings/hwmon/qcom,pm7250b-bcl.yaml

QUALCOMM BLUETOOTH DRIVER
L: linux-arm-msm@vger.kernel.org
Expand Down
9 changes: 9 additions & 0 deletions arch/arm64/boot/dts/qcom/hamoa-pmics.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,15 @@

status = "disabled";

sensor@4700 {
compatible = "qcom,smb2360-bcl";
reg = <0x4700>;
interrupts = <0x7 0x47 0x0 IRQ_TYPE_EDGE_RISING>,
<0x7 0x47 0x1 IRQ_TYPE_EDGE_RISING>;
interrupt-names = "max-min",
"critical";
};

smb2360_0_eusb2_repeater: phy@fd00 {
compatible = "qcom,smb2360-eusb2-repeater";
reg = <0xfd00>;
Expand Down
19 changes: 9 additions & 10 deletions arch/arm64/boot/dts/qcom/pm7250b.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,15 @@
status = "disabled";
};

sensor@1d00 {
compatible = "qcom,pm7250b-bcl";
reg = <0x1d00>;
interrupts = <PM7250B_SID 0x1d 0x0 IRQ_TYPE_EDGE_RISING>,
<PM7250B_SID 0x1d 0x1 IRQ_TYPE_EDGE_RISING>;
interrupt-names = "max-min",
"critical";
};

pm7250b_temp: temp-alarm@2400 {
compatible = "qcom,spmi-temp-alarm";
reg = <0x2400>;
Expand Down Expand Up @@ -202,16 +211,6 @@
interrupt-controller;
#interrupt-cells = <2>;
};

sensor@1d00 {
compatible = "qcom,pm7250b-bcl", "qcom,bcl-v1";
reg = <0x1d00>;
interrupts = <PM7250B_SID 0x1d 0x0 IRQ_TYPE_EDGE_RISING>,
<PM7250B_SID 0x1d 0x1 IRQ_TYPE_EDGE_RISING>;
interrupt-names = "bcl-max-min",
"bcl-critical";
overcurrent-thresholds-milliamp = <5500 6000>;
};
};

pmic@PM7250B_SID1 {
Expand Down
17 changes: 9 additions & 8 deletions arch/arm64/boot/dts/qcom/pm8350c.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,15 @@
#thermal-sensor-cells = <0>;
};

sensor@4700 {
compatible = "qcom,pm8350c-bcl";
reg = <0x4700>;
interrupts = <0x2 0x47 0x0 IRQ_TYPE_EDGE_RISING>,
<0x2 0x47 0x1 IRQ_TYPE_EDGE_RISING>;
interrupt-names = "max-min",
"critical";
};

pm8350c_gpios: gpio@8800 {
compatible = "qcom,pm8350c-gpio", "qcom,spmi-gpio";
reg = <0x8800>;
Expand All @@ -42,14 +51,6 @@
status = "disabled";
};

sensor@4700 {
compatible = "qcom,pm8350c-bcl", "qcom,bcl-v2";
reg = <0x4700>;
interrupts = <0x2 0x47 0x0 IRQ_TYPE_EDGE_RISING>,
<0x2 0x47 0x1 IRQ_TYPE_EDGE_RISING>;
interrupt-names = "bcl-max-min",
"bcl-critical";
};
};
};

Expand Down
9 changes: 9 additions & 0 deletions arch/arm64/boot/dts/qcom/pm8550.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,15 @@
#thermal-sensor-cells = <0>;
};

sensor@4700 {
compatible = "qcom,pm8550-bcl";
reg = <0x4700>;
interrupts = <0x1 0x47 0x0 IRQ_TYPE_EDGE_RISING>,
<0x1 0x47 0x1 IRQ_TYPE_EDGE_RISING>;
interrupt-names = "max-min",
"critical";
};

pm8550_gpios: gpio@8800 {
compatible = "qcom,pm8550-gpio", "qcom,spmi-gpio";
reg = <0x8800>;
Expand Down
2 changes: 1 addition & 1 deletion arch/arm64/configs/qcom.config
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ CONFIG_STM_SOURCE_FTRACE=m
CONFIG_STM_SOURCE_HEARTBEAT=m
CONFIG_SENSORS_AMC6821=y
CONFIG_SENSORS_EMC2305=y
CONFIG_SENSORS_QCOM_BCL=y
CONFIG_SENSORS_QCOM_SPMI_BCL=y

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this need to be =y ? or can be module as well ?

CONFIG_SWIOTLB_DYNAMIC=y
CONFIG_TRACE_MMIO_ACCESS=y
CONFIG_UCLAMP_TASK_GROUP=y
Expand Down
6 changes: 4 additions & 2 deletions drivers/hwmon/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1893,8 +1893,10 @@ config SENSORS_PWM_FAN
This driver can also be built as a module. If so, the module
will be called pwm-fan.

config SENSORS_QCOM_BCL
tristate "Qualcomm BCL hardware monitoring"
config SENSORS_QCOM_SPMI_BCL
tristate "Qualcomm SPMI BCL hardware monitoring"
depends on SPMI
select REGMAP_SPMI
help
Say yes here to enable support for Qualcomm battery over current
and under voltage alarms monitor.
Expand Down
2 changes: 1 addition & 1 deletion drivers/hwmon/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ obj-$(CONFIG_SENSORS_POWERZ) += powerz.o
obj-$(CONFIG_SENSORS_POWR1220) += powr1220.o
obj-$(CONFIG_SENSORS_PT5161L) += pt5161l.o
obj-$(CONFIG_SENSORS_PWM_FAN) += pwm-fan.o
obj-$(CONFIG_SENSORS_QCOM_BCL) += qcom-bcl-hwmon.o
obj-$(CONFIG_SENSORS_QCOM_SPMI_BCL) += qcom-bcl-hwmon.o
obj-$(CONFIG_SENSORS_QNAP_MCU_HWMON) += qnap-mcu-hwmon.o
obj-$(CONFIG_SENSORS_RASPBERRYPI_HWMON) += raspberrypi-hwmon.o
obj-$(CONFIG_SENSORS_SA67MCU) += sa67mcu-hwmon.o
Expand Down
Loading