The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Claudiu Beznea <claudiu.beznea@tuxon.dev>
To: Mihai Sain <mihai.sain@microchip.com>,
	robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org,
	nicolas.ferre@microchip.com, alexandre.belloni@bootlin.com,
	devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] ARM: dts: microchip: sam9x75_curiosity: Add power monitor support
Date: Mon, 2 Dec 2024 10:14:25 +0200	[thread overview]
Message-ID: <2d8dd1c8-fd4b-4dc1-ba62-312ac86335a6@tuxon.dev> (raw)
In-Reply-To: <20241122080523.3941-3-mihai.sain@microchip.com>

Hi, Mihai,

On 22.11.2024 10:05, Mihai Sain wrote:
> Add PAC1934 support in order to monitor the board power consumption.
> Device is connected on flexcom7 in twi mode.
> 
> [root@SAM9X75 ~]$ awk -f pac1934.awk
> VDD3V3 current:   10.675 mA, voltage: 3295.41 mV
> VDDOUT4 current:  5.7625 mA, voltage: 1196.78 mV
> VDDCORE current: 115.442 mA, voltage: 1243.65 mV
> VDDIODDR current: 29.585 mA, voltage: 1345.21 mV
> 
> Signed-off-by: Mihai Sain <mihai.sain@microchip.com>
> ---
>  .../dts/microchip/at91-sam9x75_curiosity.dts  | 52 +++++++++++++++++++
>  1 file changed, 52 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/microchip/at91-sam9x75_curiosity.dts b/arch/arm/boot/dts/microchip/at91-sam9x75_curiosity.dts
> index d453800f8e35..76d7a756e08c 100644
> --- a/arch/arm/boot/dts/microchip/at91-sam9x75_curiosity.dts
> +++ b/arch/arm/boot/dts/microchip/at91-sam9x75_curiosity.dts
> @@ -198,6 +198,52 @@ regulator-state-standby {
>  	};
>  };
>  
> +&flx7 {
> +	atmel,flexcom-mode = <ATMEL_FLEXCOM_MODE_TWI>;
> +	status = "okay";
> +};
> +
> +&i2c7 {
> +	dmas = <0>, <0>;
> +	i2c-analog-filter;
> +	i2c-digital-filter;
> +	i2c-digital-filter-width-ns = <35>;
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&pinctrl_flx7_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 = <10000>;
> +			label = "VDD3V3";
> +		};
> +
> +		channel@2 {
> +			reg = <0x2>;
> +			shunt-resistor-micro-ohms = <10000>;
> +			label = "VDDOUT4";

On the schematics at [1] this seems to be named DCDC4. Is there a mistake
on [1] or this patch needs adjustments? If so, I can do it while applying.

Thank you,
Claudiu

[1]
https://ww1.microchip.com/downloads/aemDocuments/documents/MPU32/ProductDocuments/UserGuides/SAM9X75-Curiosity-User-Guide-DS60001859.pdf

> +		};
> +
> +		channel@3 {
> +			reg = <0x3>;
> +			shunt-resistor-micro-ohms = <10000>;
> +			label = "VDDCORE";
> +		};
> +
> +		channel@4 {
> +			reg = <0x4>;
> +			shunt-resistor-micro-ohms = <10000>;
> +			label = "VDDIODDR";
> +		};
> +	};
> +};
> +
>  &i2s {
>  	pinctrl-names = "default";
>  	pinctrl-0 = <&pinctrl_i2s_default>;
> @@ -231,6 +277,12 @@ pinctrl_flx6_default: flx6-default {
>  				<AT91_PIOA 24 AT91_PERIPH_A AT91_PINCTRL_PULL_UP>,
>  				<AT91_PIOA 25 AT91_PERIPH_A AT91_PINCTRL_PULL_UP>;
>  		};
> +
> +		pinctrl_flx7_default: flx7-default {
> +			atmel,pins =
> +				<AT91_PIOC 0 AT91_PERIPH_C AT91_PINCTRL_PULL_UP>,
> +				<AT91_PIOC 1 AT91_PERIPH_C AT91_PINCTRL_PULL_UP>;
> +		};
>  	};
>  
>  	gpio-keys {

  reply	other threads:[~2024-12-02  8:14 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-22  8:05 [PATCH 0/2] Add power monitor support on sam9x75-curiosity board Mihai Sain
2024-11-22  8:05 ` [PATCH 1/2] ARM: dts: microchip: sam9x7: Move i2c address/size to dtsi Mihai Sain
2024-12-02  8:08   ` Claudiu Beznea
2024-11-22  8:05 ` [PATCH 2/2] ARM: dts: microchip: sam9x75_curiosity: Add power monitor support Mihai Sain
2024-12-02  8:14   ` Claudiu Beznea [this message]
2024-12-02  8:32     ` Mihai.Sain
2024-12-03  8:37       ` Claudiu Beznea
2024-12-03  8:47         ` Mihai.Sain
2024-12-08 15:49 ` [PATCH 0/2] Add power monitor support on sam9x75-curiosity board Claudiu Beznea

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2d8dd1c8-fd4b-4dc1-ba62-312ac86335a6@tuxon.dev \
    --to=claudiu.beznea@tuxon.dev \
    --cc=alexandre.belloni@bootlin.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mihai.sain@microchip.com \
    --cc=nicolas.ferre@microchip.com \
    --cc=robh@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox