mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/5] Add power monitor support on Microchip boards
@ 2024-09-23  6:49 Mihai Sain
  2024-09-23  6:49 ` [PATCH 1/5] ARM: dts: microchip: sam9x60ek: Add power monitor support Mihai Sain
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Mihai Sain @ 2024-09-23  6:49 UTC (permalink / raw)
  To: robh, krzk+dt, conor+dt, nicolas.ferre, alexandre.belloni,
	claudiu.beznea, linux, devicetree, linux-arm-kernel,
	linux-kernel
  Cc: Mihai Sain

This patch series adds power monitor support using PAC1934 on Microchip boards.

[root@sama7g5 ~]$ lsiio
Device 001: pac1934
Device 000: e1000000.adc

[root@sama7g5 ~]$ awk -f pac1934.awk
VDD3V3 current: 161.747 mA, voltage: 3300.29 mV
VDDIODDR current: 72.616 mA, voltage: 1346.68 mV
VDDCORE current: 249.84 mA, voltage: 1204.59 mV
VDDCPU current: 68.4628 mA, voltage: 1301.27 mV

Mihai Sain (5):
  ARM: dts: microchip: sam9x60ek: Add power monitor support
  ARM: dts: microchip: sama5d2_icp: Add power monitor support
  ARM: dts: microchip: sama7g54_curiosity: Add power monitor support
  ARM: dts: microchip: sama7g5ek: Add power monitor support
  ARM: configs: at91: enable PAC1934 driver as module

 .../arm/boot/dts/microchip/at91-sam9x60ek.dts | 31 +++++++++++++++++++
 .../boot/dts/microchip/at91-sama5d2_icp.dts   | 31 +++++++++++++++++++
 .../dts/microchip/at91-sama7g54_curiosity.dts | 31 +++++++++++++++++++
 .../arm/boot/dts/microchip/at91-sama7g5ek.dts | 31 +++++++++++++++++++
 arch/arm/configs/at91_dt_defconfig            |  1 +
 arch/arm/configs/sama5_defconfig              |  1 +
 arch/arm/configs/sama7_defconfig              |  1 +
 7 files changed, 127 insertions(+)


base-commit: de5cb0dcb74c294ec527eddfe5094acfdb21ff21
-- 
2.46.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/5] ARM: dts: microchip: sam9x60ek: Add power monitor support
  2024-09-23  6:49 [PATCH 0/5] Add power monitor support on Microchip boards Mihai Sain
@ 2024-09-23  6:49 ` Mihai Sain
  2024-09-23  6:49 ` [PATCH 2/5] ARM: dts: microchip: sama5d2_icp: " Mihai Sain
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Mihai Sain @ 2024-09-23  6:49 UTC (permalink / raw)
  To: robh, krzk+dt, conor+dt, nicolas.ferre, alexandre.belloni,
	claudiu.beznea, linux, devicetree, linux-arm-kernel,
	linux-kernel
  Cc: Mihai Sain

Add PAC1934 support in order to monitor the board power consumption.

Signed-off-by: Mihai Sain <mihai.sain@microchip.com>
---
 .../arm/boot/dts/microchip/at91-sam9x60ek.dts | 31 +++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/arch/arm/boot/dts/microchip/at91-sam9x60ek.dts b/arch/arm/boot/dts/microchip/at91-sam9x60ek.dts
index 3b38707d736e..6cf699d9b540 100644
--- a/arch/arm/boot/dts/microchip/at91-sam9x60ek.dts
+++ b/arch/arm/boot/dts/microchip/at91-sam9x60ek.dts
@@ -260,6 +260,37 @@ i2c6: i2c@600 {
 		i2c-digital-filter-width-ns = <35>;
 		status = "okay";
 
+		power-monitor@17 {
+			compatible = "microchip,pac1934";
+			reg = <0x17>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			channel@1 {
+				reg = <0x1>;
+				shunt-resistor-micro-ohms = <10000>;
+				label = "VDDIOM";
+			};
+
+			channel@2 {
+				reg = <0x2>;
+				shunt-resistor-micro-ohms = <10000>;
+				label = "VDDCORE";
+			};
+
+			channel@3 {
+				reg = <0x3>;
+				shunt-resistor-micro-ohms = <10000>;
+				label = "VDD3V3_MPU";
+			};
+
+			channel@4 {
+				reg = <0x4>;
+				shunt-resistor-micro-ohms = <10000>;
+				label = "VDD3V3";
+			};
+		};
+
 		gpio_exp: mcp23008@20 {
 			compatible = "microchip,mcp23008";
 			reg = <0x20>;
-- 
2.46.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 2/5] ARM: dts: microchip: sama5d2_icp: Add power monitor support
  2024-09-23  6:49 [PATCH 0/5] Add power monitor support on Microchip boards Mihai Sain
  2024-09-23  6:49 ` [PATCH 1/5] ARM: dts: microchip: sam9x60ek: Add power monitor support Mihai Sain
@ 2024-09-23  6:49 ` Mihai Sain
  2024-09-23  6:49 ` [PATCH 3/5] ARM: dts: microchip: sama7g54_curiosity: " Mihai Sain
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Mihai Sain @ 2024-09-23  6:49 UTC (permalink / raw)
  To: robh, krzk+dt, conor+dt, nicolas.ferre, alexandre.belloni,
	claudiu.beznea, linux, devicetree, linux-arm-kernel,
	linux-kernel
  Cc: Mihai Sain

Add PAC1934 support in order to monitor the board power consumption.

Signed-off-by: Mihai Sain <mihai.sain@microchip.com>
---
 .../boot/dts/microchip/at91-sama5d2_icp.dts   | 31 +++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/arch/arm/boot/dts/microchip/at91-sama5d2_icp.dts b/arch/arm/boot/dts/microchip/at91-sama5d2_icp.dts
index 5e2bb517a480..8f617cb29d36 100644
--- a/arch/arm/boot/dts/microchip/at91-sama5d2_icp.dts
+++ b/arch/arm/boot/dts/microchip/at91-sama5d2_icp.dts
@@ -195,6 +195,37 @@ i2c6: i2c@600 {
 		i2c-digital-filter-width-ns = <35>;
 		status = "okay";
 
+		power-monitor@10 {
+			compatible = "microchip,pac1934";
+			reg = <0x10>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			channel@1 {
+				reg = <0x1>;
+				shunt-resistor-micro-ohms = <10000>;
+				label = "VDD3V3_1";
+			};
+
+			channel@2 {
+				reg = <0x2>;
+				shunt-resistor-micro-ohms = <10000>;
+				label = "VDD3V3_2";
+			};
+
+			channel@3 {
+				reg = <0x3>;
+				shunt-resistor-micro-ohms = <10000>;
+				label = "VDDCORE";
+			};
+
+			channel@4 {
+				reg = <0x4>;
+				shunt-resistor-micro-ohms = <10000>;
+				label = "VDDIODDR";
+			};
+		};
+
 		mcp16502@5b {
 			compatible = "microchip,mcp16502";
 			reg = <0x5b>;
-- 
2.46.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 3/5] ARM: dts: microchip: sama7g54_curiosity: Add power monitor support
  2024-09-23  6:49 [PATCH 0/5] Add power monitor support on Microchip boards Mihai Sain
  2024-09-23  6:49 ` [PATCH 1/5] ARM: dts: microchip: sam9x60ek: Add power monitor support Mihai Sain
  2024-09-23  6:49 ` [PATCH 2/5] ARM: dts: microchip: sama5d2_icp: " Mihai Sain
@ 2024-09-23  6:49 ` Mihai Sain
  2024-09-23  6:49 ` [PATCH 4/5] ARM: dts: microchip: sama7g5ek: " Mihai Sain
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Mihai Sain @ 2024-09-23  6:49 UTC (permalink / raw)
  To: robh, krzk+dt, conor+dt, nicolas.ferre, alexandre.belloni,
	claudiu.beznea, linux, devicetree, linux-arm-kernel,
	linux-kernel
  Cc: Mihai Sain

Add PAC1934 support in order to monitor the board power consumption.

Signed-off-by: Mihai Sain <mihai.sain@microchip.com>
---
 .../dts/microchip/at91-sama7g54_curiosity.dts | 31 +++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/arch/arm/boot/dts/microchip/at91-sama7g54_curiosity.dts b/arch/arm/boot/dts/microchip/at91-sama7g54_curiosity.dts
index 645e49fdb7fe..2dec2218f32c 100644
--- a/arch/arm/boot/dts/microchip/at91-sama7g54_curiosity.dts
+++ b/arch/arm/boot/dts/microchip/at91-sama7g54_curiosity.dts
@@ -186,6 +186,37 @@ i2c10: i2c@600 {
 		i2c-digital-filter-width-ns = <35>;
 		status = "okay";
 
+		power-monitor@1f {
+			compatible = "microchip,pac1934";
+			reg = <0x1f>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			channel@1 {
+				reg = <0x1>;
+				shunt-resistor-micro-ohms = <47000>;
+				label = "VDD3V3";
+			};
+
+			channel@2 {
+				reg = <0x2>;
+				shunt-resistor-micro-ohms = <47000>;
+				label = "VDDIODDR";
+			};
+
+			channel@3 {
+				reg = <0x3>;
+				shunt-resistor-micro-ohms = <47000>;
+				label = "VDDCORE";
+			};
+
+			channel@4 {
+				reg = <0x4>;
+				shunt-resistor-micro-ohms = <47000>;
+				label = "VDDCPU";
+			};
+		};
+
 		eeprom@51 {
 			compatible = "atmel,24c02";
 			reg = <0x51>;
-- 
2.46.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 4/5] ARM: dts: microchip: sama7g5ek: Add power monitor support
  2024-09-23  6:49 [PATCH 0/5] Add power monitor support on Microchip boards Mihai Sain
                   ` (2 preceding siblings ...)
  2024-09-23  6:49 ` [PATCH 3/5] ARM: dts: microchip: sama7g54_curiosity: " Mihai Sain
@ 2024-09-23  6:49 ` Mihai Sain
  2024-09-23  6:49 ` [PATCH 5/5] ARM: configs: at91: enable PAC1934 driver as module Mihai Sain
  2024-10-20 15:35 ` [PATCH 0/5] Add power monitor support on Microchip boards Claudiu Beznea
  5 siblings, 0 replies; 7+ messages in thread
From: Mihai Sain @ 2024-09-23  6:49 UTC (permalink / raw)
  To: robh, krzk+dt, conor+dt, nicolas.ferre, alexandre.belloni,
	claudiu.beznea, linux, devicetree, linux-arm-kernel,
	linux-kernel
  Cc: Mihai Sain

Add PAC1934 support in order to monitor the board power consumption.

Signed-off-by: Mihai Sain <mihai.sain@microchip.com>
---
 .../arm/boot/dts/microchip/at91-sama7g5ek.dts | 31 +++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/arch/arm/boot/dts/microchip/at91-sama7g5ek.dts b/arch/arm/boot/dts/microchip/at91-sama7g5ek.dts
index ed75d491a246..5fd77abd4201 100644
--- a/arch/arm/boot/dts/microchip/at91-sama7g5ek.dts
+++ b/arch/arm/boot/dts/microchip/at91-sama7g5ek.dts
@@ -244,6 +244,37 @@ i2c1: i2c@600 {
 		i2c-digital-filter-width-ns = <35>;
 		status = "okay";
 
+		power-monitor@10 {
+			compatible = "microchip,pac1934";
+			reg = <0x10>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			channel@1 {
+				reg = <0x1>;
+				shunt-resistor-micro-ohms = <10000>;
+				label = "VDD3V3";
+			};
+
+			channel@2 {
+				reg = <0x2>;
+				shunt-resistor-micro-ohms = <10000>;
+				label = "VDDIODDR";
+			};
+
+			channel@3 {
+				reg = <0x3>;
+				shunt-resistor-micro-ohms = <10000>;
+				label = "VDDCORE";
+			};
+
+			channel@4 {
+				reg = <0x4>;
+				shunt-resistor-micro-ohms = <10000>;
+				label = "VDDCPU";
+			};
+		};
+
 		mcp16502@5b {
 			compatible = "microchip,mcp16502";
 			reg = <0x5b>;
-- 
2.46.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 5/5] ARM: configs: at91: enable PAC1934 driver as module
  2024-09-23  6:49 [PATCH 0/5] Add power monitor support on Microchip boards Mihai Sain
                   ` (3 preceding siblings ...)
  2024-09-23  6:49 ` [PATCH 4/5] ARM: dts: microchip: sama7g5ek: " Mihai Sain
@ 2024-09-23  6:49 ` Mihai Sain
  2024-10-20 15:35 ` [PATCH 0/5] Add power monitor support on Microchip boards Claudiu Beznea
  5 siblings, 0 replies; 7+ messages in thread
From: Mihai Sain @ 2024-09-23  6:49 UTC (permalink / raw)
  To: robh, krzk+dt, conor+dt, nicolas.ferre, alexandre.belloni,
	claudiu.beznea, linux, devicetree, linux-arm-kernel,
	linux-kernel
  Cc: Mihai Sain

Enable PAC1934 driver and build as module.

Signed-off-by: Mihai Sain <mihai.sain@microchip.com>
---
 arch/arm/configs/at91_dt_defconfig | 1 +
 arch/arm/configs/sama5_defconfig   | 1 +
 arch/arm/configs/sama7_defconfig   | 1 +
 3 files changed, 3 insertions(+)

diff --git a/arch/arm/configs/at91_dt_defconfig b/arch/arm/configs/at91_dt_defconfig
index 2022a7fca0f9..f2596a1b2f7d 100644
--- a/arch/arm/configs/at91_dt_defconfig
+++ b/arch/arm/configs/at91_dt_defconfig
@@ -201,6 +201,7 @@ CONFIG_AT_XDMAC=y
 CONFIG_IIO=y
 CONFIG_AT91_ADC=y
 CONFIG_AT91_SAMA5D2_ADC=y
+CONFIG_PAC1934=m
 CONFIG_PWM=y
 CONFIG_PWM_ATMEL=y
 CONFIG_PWM_ATMEL_HLCDC_PWM=y
diff --git a/arch/arm/configs/sama5_defconfig b/arch/arm/configs/sama5_defconfig
index 9096a99b5abd..e447329398d5 100644
--- a/arch/arm/configs/sama5_defconfig
+++ b/arch/arm/configs/sama5_defconfig
@@ -212,6 +212,7 @@ CONFIG_VIDEO_HANTRO=m
 CONFIG_IIO=y
 CONFIG_AT91_ADC=y
 CONFIG_AT91_SAMA5D2_ADC=y
+CONFIG_PAC1934=m
 CONFIG_ENVELOPE_DETECTOR=m
 CONFIG_DPOT_DAC=m
 CONFIG_MCP4531=m
diff --git a/arch/arm/configs/sama7_defconfig b/arch/arm/configs/sama7_defconfig
index 7fa5d251ced2..1a2e93c8ee71 100644
--- a/arch/arm/configs/sama7_defconfig
+++ b/arch/arm/configs/sama7_defconfig
@@ -193,6 +193,7 @@ CONFIG_STAGING=y
 CONFIG_IIO=y
 CONFIG_IIO_SW_TRIGGER=y
 CONFIG_AT91_SAMA5D2_ADC=y
+CONFIG_PAC1934=m
 CONFIG_PWM=y
 CONFIG_PWM_ATMEL=y
 CONFIG_MCHP_EIC=y
-- 
2.46.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 0/5] Add power monitor support on Microchip boards
  2024-09-23  6:49 [PATCH 0/5] Add power monitor support on Microchip boards Mihai Sain
                   ` (4 preceding siblings ...)
  2024-09-23  6:49 ` [PATCH 5/5] ARM: configs: at91: enable PAC1934 driver as module Mihai Sain
@ 2024-10-20 15:35 ` Claudiu Beznea
  5 siblings, 0 replies; 7+ messages in thread
From: Claudiu Beznea @ 2024-10-20 15:35 UTC (permalink / raw)
  To: Mihai Sain, robh, krzk+dt, conor+dt, nicolas.ferre,
	alexandre.belloni, linux, devicetree, linux-arm-kernel,
	linux-kernel



On 23.09.2024 09:49, Mihai Sain wrote:
> Mihai Sain (5):
>   ARM: dts: microchip: sam9x60ek: Add power monitor support
>   ARM: dts: microchip: sama5d2_icp: Add power monitor support
>   ARM: dts: microchip: sama7g54_curiosity: Add power monitor support
>   ARM: dts: microchip: sama7g5ek: Add power monitor support
>   ARM: configs: at91: enable PAC1934 driver as module

Applied to at91-dt, thanks!

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-10-20 15:35 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-09-23  6:49 [PATCH 0/5] Add power monitor support on Microchip boards Mihai Sain
2024-09-23  6:49 ` [PATCH 1/5] ARM: dts: microchip: sam9x60ek: Add power monitor support Mihai Sain
2024-09-23  6:49 ` [PATCH 2/5] ARM: dts: microchip: sama5d2_icp: " Mihai Sain
2024-09-23  6:49 ` [PATCH 3/5] ARM: dts: microchip: sama7g54_curiosity: " Mihai Sain
2024-09-23  6:49 ` [PATCH 4/5] ARM: dts: microchip: sama7g5ek: " Mihai Sain
2024-09-23  6:49 ` [PATCH 5/5] ARM: configs: at91: enable PAC1934 driver as module Mihai Sain
2024-10-20 15:35 ` [PATCH 0/5] Add power monitor support on Microchip boards Claudiu Beznea

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®