]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ARM: dts: microchip: sama7d65_curiosity: Add power monitor support
authorMihai Sain <mihai.sain@microchip.com>
Tue, 11 Feb 2025 14:33:02 +0000 (16:33 +0200)
committerClaudiu Beznea <claudiu.beznea@tuxon.dev>
Mon, 17 Feb 2025 09:13:47 +0000 (11:13 +0200)
Add PAC1934 support in order to monitor the board power consumption.
Device is connected on flexcom10 in twi mode.

[root@SAMA7D65 ~]$ awk -f pac1934.awk
VDD3V3   current: 146.173 mA, voltage: 3302.73 mV
VDDIODDR current: 62.1356 mA, voltage: 1353.96 mV
VDDCORE  current: 242.248 mA, voltage: 1204.36 mV
VDDCPU   current: 213.565 mA, voltage: 1303.05 mV

Signed-off-by: Mihai Sain <mihai.sain@microchip.com>
Link: https://lore.kernel.org/r/20250211143302.4102-3-mihai.sain@microchip.com
[claudiu.beznea: kept pinctrl nodes alphanumerically sorted in the
 pinctrl container]
Signed-off-by: Claudiu Beznea <claudiu.beznea@tuxon.dev>
arch/arm/boot/dts/microchip/at91-sama7d65_curiosity.dts

index 0f86360fb733ad1e11e22936be08055de5a19bcd..545cfcc57e300a35aff95100eb56be180655ebcd 100644 (file)
        status = "okay";
 };
 
+&flx10 {
+       atmel,flexcom-mode = <ATMEL_FLEXCOM_MODE_TWI>;
+       status = "okay";
+};
+
+&i2c10 {
+       dmas = <0>, <0>;
+       i2c-analog-filter;
+       i2c-digital-filter;
+       i2c-digital-filter-width-ns = <35>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_i2c10_default>;
+       status = "okay";
+
+       power-monitor@10 {
+               compatible = "microchip,pac1934";
+               reg = <0x10>;
+               #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";
+               };
+       };
+};
+
 &main_xtal {
        clock-frequency = <24000000>;
 };
 
 &pioa {
+       pinctrl_i2c10_default: i2c10-default{
+               pinmux = <PIN_PB19__FLEXCOM10_IO1>,
+                        <PIN_PB20__FLEXCOM10_IO0>;
+               bias-pull-up;
+       };
+
        pinctrl_sdmmc1_default: sdmmc1-default {
                cmd-data {
                        pinmux = <PIN_PB22__SDMMC1_CMD>,