Skip to contentSkip to conversation

ARM: dts: sun7i: olimex-lime2: Enable ac and power supplies

PATCH RESEND Applied Priit Laes 3 participants 4 messages May 28, 2019 – May 29, 2019

Subsystems (2)
lore
Share & tools
lore

Priit Laes

author
#0 lore raw

PATCH RESEND 1/1 ARM: dts: sun7i: olimex-lime2: Enable ac and power supplies

Lime2 has battery connector so enable these supplies.

---
 arch/arm/boot/dts/sun7i-a20-olinuxino-lime2.dts | 8 ++++++++
 1 file changed, 8 insertions(+)
arch/arm/boot/dts/sun7i-a20-olinuxino-lime2.dts +8 -0
index 9c8eecf4337a..9001b5527615 100644
@@ -206,6 +206,14 @@
 
 #include "axp209.dtsi"
 
+&ac_power_supply {
+	status = "okay";
+};
+
+&battery_power_supply {
+	status = "okay";
+};
+
 &reg_dcdc2 {
 	regulator-always-on;
 	regulator-min-microvolt = <1000000>;
Signature · 1 line
2.11.0
Reviewed-by on v1 1/1
#1 lore raw

Hi,

Quoted 1 line · Priit Laes

Lime2 has battery connector so enable these supplies.

Out of curiosity, what is reported to userspace when no battery is attached?

Looks good otherwise:

Cheers,

Paul

Quoted 27 lines
---
 arch/arm/boot/dts/sun7i-a20-olinuxino-lime2.dts | 8 ++++++++
 1 file changed, 8 insertions(+)
arch/arm/boot/dts/sun7i-a20-olinuxino-lime2.dts +8 -0
index 9c8eecf4337a..9001b5527615 100644
@@ -206,6 +206,14 @@
 
 #include "axp209.dtsi"
 
+&ac_power_supply {
+	status = "okay";
+};
+
+&battery_power_supply {
+	status = "okay";
+};
+
 &reg_dcdc2 {
 	regulator-always-on;
 	regulator-min-microvolt = <1000000>;
Signature · 1 line
2.11.0
Signature · 3 lines
Paul Kocialkowski, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com
author
#2 lore raw
Quoted 7 lines · Paul Kocialkowski

Hi,

Quoted 1 line · Priit Laes

Lime2 has battery connector so enable these supplies.

Out of curiosity, what is reported to userspace when no battery is attached?

Data from /sys/class/power_supply/axp20x-battery:

[snip]

$ for i in $(ls -1); do echo "cat $i"; cat $i; done

cat capacity
100
cat constant_charge_current
1200000
cat constant_charge_current_max
1200000
cat current_now
0
cat health
Good
cat online
0
cat present
0
cat status
Not charging
cat type
Battery
cat uevent
POWER_SUPPLY_NAME=axp20x-battery
POWER_SUPPLY_PRESENT=0
POWER_SUPPLY_ONLINE=0
POWER_SUPPLY_STATUS=Not charging
POWEROSUPPLY_VOLTAGE_NOW=0
POWER_SUPPLY_CURRENT_NOW=0
POWER_SUPPLY_CON/TANT_CHARGE_CURRENT=1200000
POWER_SUPPLY_CONSTANT_CHARGE_CURRENT_MAX=1200000
POWER_SUPPLY_HEALTH=Good
POWER_SUPPLY_VOLTAGE_MAXODESIGN=4200000
POWEROSUPPLY_VOLTAGE_MIN_DESIGN=2900000
POWER_SUPPLY_CAPACITY=100
cat voltage_max_design
4200000
cat voltage_min_design
2900000
cat voltage_now
0
[/snip]

Quoted 39 lines

Looks good otherwise:

Cheers,

Paul

Quoted 27 lines
---
 arch/arm/boot/dts/sun7i-a20-olinuxino-lime2.dts | 8 ++++++++
 1 file changed, 8 insertions(+)
arch/arm/boot/dts/sun7i-a20-olinuxino-lime2.dts +8 -0
index 9c8eecf4337a..9001b5527615 100644
@@ -206,6 +206,14 @@
 
 #include "axp209.dtsi"
 
+&ac_power_supply {
+	status = "okay";
+};
+
+&battery_power_supply {
+	status = "okay";
+};
+
 &reg_dcdc2 {
 	regulator-always-on;
 	regulator-min-microvolt = <1000000>;
Signature · 1 line
2.11.0
Signature · 3 lines
Paul Kocialkowski, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com