diff mbox series

[9/9] arm64: dts: rockchip: add Photonicat PMU support for Ariaboard Photonicat

Message ID 20240906093630.2428329-10-bigfoot@classfun.cn (mailing list archive)
State Handled Elsewhere, archived
Headers show
Series Introduce Photonicat power management MCU driver | expand

Commit Message

Junhao Xie Sept. 6, 2024, 9:36 a.m. UTC
This commit adds support for Photonicat power management MCU on
Ariaboard Photonicat.

Signed-off-by: Junhao Xie <bigfoot@classfun.cn>
---
 .../boot/dts/rockchip/rk3568-photonicat.dts   | 43 +++++++++++++++++++
 1 file changed, 43 insertions(+)

Comments

Krzysztof Kozlowski Sept. 6, 2024, 9:53 a.m. UTC | #1
On 06/09/2024 11:36, Junhao Xie wrote:
> This commit adds support for Photonicat power management MCU on
> Ariaboard Photonicat.
> 
> Signed-off-by: Junhao Xie <bigfoot@classfun.cn>
> ---
>  .../boot/dts/rockchip/rk3568-photonicat.dts   | 43 +++++++++++++++++++
>  1 file changed, 43 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/rockchip/rk3568-photonicat.dts b/arch/arm64/boot/dts/rockchip/rk3568-photonicat.dts
> index 2fe403cd61cb..597275702408 100644
> --- a/arch/arm64/boot/dts/rockchip/rk3568-photonicat.dts
> +++ b/arch/arm64/boot/dts/rockchip/rk3568-photonicat.dts
> @@ -513,6 +513,49 @@ &uart4 {
>  	dma-names = "tx", "rx";
>  	status = "okay";
>  	/* Onboard power management MCU */
> +
> +	pcat_pmu: mcu {
> +		compatible = "ariaboard,photonicat-pmu";
> +		current-speed = <115200>;
> +		local-address = <1>;
> +		remote-address = <1>;
> +
> +		pcat_pmu_battery: supply-battery {

Drop unused labels. Everywhere. You are not making the code more readable.


> +			compatible = "ariaboard,photonicat-pmu-supply";
> +			label = "battery";
> +			monitored-battery = <&battery>;
> +			power-supplies = <&pcat_pmu_charger>;

Why do you reference internal design of the device as DTS? You cannot
have here other power supply, can you?

Best regards,
Krzysztof
Junhao Xie Sept. 6, 2024, 1:56 p.m. UTC | #2
On 2024/9/6 17:53, Krzysztof Kozlowski wrote:
> On 06/09/2024 11:36, Junhao Xie wrote:
>> This commit adds support for Photonicat power management MCU on
>> Ariaboard Photonicat.
>>
[...]
>> +
>> +		pcat_pmu_battery: supply-battery {
> 
> Drop unused labels. Everywhere. You are not making the code more readable.

I will remove them.

> 
>> +			compatible = "ariaboard,photonicat-pmu-supply";
>> +			label = "battery";
>> +			monitored-battery = <&battery>;
>> +			power-supplies = <&pcat_pmu_charger>;
> 
> Why do you reference internal design of the device as DTS? You cannot
> have here other power supply, can you?

I mistakenly thought power_supply_am_i_supplied() required power-supplies
property, it actually does not, I will remove it.

> 
> Best regards,
> Krzysztof
> 

Thanks for your review, I will fix all problems in next version!

Best regards,
Junhao
diff mbox series

Patch

diff --git a/arch/arm64/boot/dts/rockchip/rk3568-photonicat.dts b/arch/arm64/boot/dts/rockchip/rk3568-photonicat.dts
index 2fe403cd61cb..597275702408 100644
--- a/arch/arm64/boot/dts/rockchip/rk3568-photonicat.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3568-photonicat.dts
@@ -513,6 +513,49 @@  &uart4 {
 	dma-names = "tx", "rx";
 	status = "okay";
 	/* Onboard power management MCU */
+
+	pcat_pmu: mcu {
+		compatible = "ariaboard,photonicat-pmu";
+		current-speed = <115200>;
+		local-address = <1>;
+		remote-address = <1>;
+
+		pcat_pmu_battery: supply-battery {
+			compatible = "ariaboard,photonicat-pmu-supply";
+			label = "battery";
+			monitored-battery = <&battery>;
+			power-supplies = <&pcat_pmu_charger>;
+			type = "battery";
+		};
+
+		pcat_pmu_charger: supply-charger {
+			compatible = "ariaboard,photonicat-pmu-supply";
+			label = "charger";
+			type = "charger";
+		};
+
+		pcat_pmu_hwmon: hwmon {
+			compatible = "ariaboard,photonicat-pmu-hwmon";
+			label = "pcat_board";
+		};
+
+		pcat_pmu_leds_status: leds-status {
+			compatible = "ariaboard,photonicat-pmu-leds";
+			label = "net-status";
+		};
+
+		pcat_pmu_poweroff: poweroff {
+			compatible = "ariaboard,photonicat-pmu-poweroff";
+		};
+
+		pcat_pmu_rtc: rtc {
+			compatible = "ariaboard,photonicat-pmu-rtc";
+		};
+
+		pcat_pmu_watchdog: watchdog {
+			compatible = "ariaboard,photonicat-pmu-watchdog";
+		};
+	};
 };
 
 &usb_host0_xhci {