Skip to content

Commit 371f778

Browse files
mattmart3jic23
authored andcommitted
iio: adc: add support for pac1921
Add support for Microchip PAC1921 Power/Current monitor. Implemented features: * capture of bus voltage, sense voltage, current and power measurements in free-run integration mode * support for both raw and triggered buffer reading * support for overflow events * scale attributes to control voltage and current gains * oversampling ratio attribute to control the number of integration samples * sampling rate attribute that reflects the integration period * userspace attribute and DT parameter to control shunt resistor * simple power management support Limitations: * operation mode fixed to free-run integration * READ/INT pin and OUT pin not supported * no controls for measurement resolutions and filters Signed-off-by: Matteo Martelli <matteomartelli3@gmail.com> Link: https://patch.msgid.link/20240724-iio-pac1921-v4-3-723698e903a3@gmail.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
1 parent e5535cc commit 371f778

File tree

4 files changed

+1282
-0
lines changed

4 files changed

+1282
-0
lines changed

MAINTAINERS

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15054,6 +15054,13 @@ F: Documentation/devicetree/bindings/nvmem/microchip,sama7g5-otpc.yaml
1505415054
F: drivers/nvmem/microchip-otpc.c
1505515055
F: include/dt-bindings/nvmem/microchip,sama7g5-otpc.h
1505615056

15057+
MICROCHIP PAC1921 POWER/CURRENT MONITOR DRIVER
15058+
M: Matteo Martelli <matteomartelli3@gmail.com>
15059+
L: linux-iio@vger.kernel.org
15060+
S: Supported
15061+
F: Documentation/devicetree/bindings/iio/adc/microchip,pac1921.yaml
15062+
F: drivers/iio/adc/pac1921.c
15063+
1505715064
MICROCHIP PAC1934 POWER/ENERGY MONITOR DRIVER
1505815065
M: Marius Cristea <marius.cristea@microchip.com>
1505915066
L: linux-iio@vger.kernel.org

drivers/iio/adc/Kconfig

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1002,6 +1002,19 @@ config NPCM_ADC
10021002
This driver can also be built as a module. If so, the module
10031003
will be called npcm_adc.
10041004

1005+
config PAC1921
1006+
tristate "Microchip Technology PAC1921 driver"
1007+
depends on I2C
1008+
select REGMAP_I2C
1009+
select IIO_BUFFER
1010+
select IIO_TRIGGERED_BUFFER
1011+
help
1012+
Say yes here to build support for Microchip Technology's PAC1921
1013+
High-Side Power/Current Monitor with Analog Output.
1014+
1015+
This driver can also be built as a module. If so, the module
1016+
will be called pac1921.
1017+
10051018
config PAC1934
10061019
tristate "Microchip Technology PAC1934 driver"
10071020
depends on I2C

drivers/iio/adc/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ obj-$(CONFIG_MP2629_ADC) += mp2629_adc.o
9191
obj-$(CONFIG_MXS_LRADC_ADC) += mxs-lradc-adc.o
9292
obj-$(CONFIG_NAU7802) += nau7802.o
9393
obj-$(CONFIG_NPCM_ADC) += npcm_adc.o
94+
obj-$(CONFIG_PAC1921) += pac1921.o
9495
obj-$(CONFIG_PAC1934) += pac1934.o
9596
obj-$(CONFIG_PALMAS_GPADC) += palmas_gpadc.o
9697
obj-$(CONFIG_QCOM_PM8XXX_XOADC) += qcom-pm8xxx-xoadc.o

0 commit comments

Comments
 (0)