summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOwen_Ou <Owen_Ou@compal.corp-partner.google.com>2022-02-15 17:01:55 +0800
committerCommit Bot <commit-bot@chromium.org>2022-02-16 21:59:16 +0000
commitb0a42e9ac9c4568806a07baa71b8b86444f084ea (patch)
tree7695d9f6619f1c88bd6fdc0c0001a3181d361ef4
parent73c21f76e44649f7f992f1fa686d62801e09e0c2 (diff)
downloadchrome-ec-b0a42e9ac9c4568806a07baa71b8b86444f084ea.tar.gz
Skyrim: implement battery parameter
Setup battery parameter for skyrim. BUG=b:219670453 BRANCH=none TEST=1. zmake configure -b skyrim 2. ec can read battery info(ec log) 3. battery can charge & discharge 4. battery can cutoff Signed-off-by: Owen_Ou <Owen_Ou@compal.corp-partner.google.com> Change-Id: I94d522e75b464c55cd7b71a5e7e68493513822c0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3463105 Tested-by: Owen Ou <owen_ou@compal.corp-partner.google.com> Reviewed-by: Elthan Huang <elthan_huang@compal.corp-partner.google.com> Reviewed-by: Diana Z <dzigterman@chromium.org> Commit-Queue: Diana Z <dzigterman@chromium.org>
-rw-r--r--zephyr/dts/bindings/battery/battery-smart.yaml1
-rw-r--r--zephyr/dts/bindings/battery/named-batteries.yaml1
-rw-r--r--zephyr/dts/bindings/battery/smp,l20m3pg1.yaml57
-rw-r--r--zephyr/projects/skyrim/battery.dts3
4 files changed, 62 insertions, 0 deletions
diff --git a/zephyr/dts/bindings/battery/battery-smart.yaml b/zephyr/dts/bindings/battery/battery-smart.yaml
index d3fff1f4c1..11a6119f36 100644
--- a/zephyr/dts/bindings/battery/battery-smart.yaml
+++ b/zephyr/dts/bindings/battery/battery-smart.yaml
@@ -24,4 +24,5 @@ properties:
- "panasonic,ap16l5j-009"
- "powertech,batgqa05l22"
- "smp,l20m3pg0"
+ - "smp,l20m3pg1"
- "smp,l20m3pg2"
diff --git a/zephyr/dts/bindings/battery/named-batteries.yaml b/zephyr/dts/bindings/battery/named-batteries.yaml
index dbe2362646..7bff38ec75 100644
--- a/zephyr/dts/bindings/battery/named-batteries.yaml
+++ b/zephyr/dts/bindings/battery/named-batteries.yaml
@@ -25,4 +25,5 @@ child-binding:
- "lgc_l20l3pg2"
- "murata_ap18c4k"
- "smp_l20m3pg0"
+ - "smp,l20m3pg1"
- "smp_l20m3pg2"
diff --git a/zephyr/dts/bindings/battery/smp,l20m3pg1.yaml b/zephyr/dts/bindings/battery/smp,l20m3pg1.yaml
new file mode 100644
index 0000000000..f462f8b388
--- /dev/null
+++ b/zephyr/dts/bindings/battery/smp,l20m3pg1.yaml
@@ -0,0 +1,57 @@
+# Copyright 2022 The Chromium OS Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+description: "SMP L20M30PG1"
+compatible: "smp,l20m3pg1"
+
+include: battery-smart.yaml
+
+properties:
+ enum-name:
+ type: string
+ default: "smp,l20m3pg1"
+
+ # TI L20M3PG1 Fuel Gauge
+ manuf_name:
+ default: "SMP"
+ device_name:
+ default: "L20M3PG1"
+ ship_mode_reg_addr:
+ default: 0x00
+ ship_mode_reg_data:
+ default: [ 0x0010, 0x0010 ]
+ fet_mfgacc_support:
+ default: 1
+ fet_reg_addr:
+ default: 0x0054
+ fet_reg_mask:
+ default: 0x2000
+ fet_disconnect_val:
+ default: 0x2000
+ fet_cfet_mask:
+ default: 0x6000
+ fet_cfet_off_val:
+ default: 0x6000
+
+ # Battery info
+ voltage_max:
+ default: 13200
+ voltage_normal:
+ default: 11520
+ voltage_min:
+ default: 9000
+ precharge_current:
+ default: 247
+ start_charging_min_c:
+ default: 0
+ start_charging_max_c:
+ default: 50
+ charging_min_c:
+ default: 0
+ charging_max_c:
+ default: 60
+ discharging_min_c:
+ default: -40
+ discharging_max_c:
+ default: 73
diff --git a/zephyr/projects/skyrim/battery.dts b/zephyr/projects/skyrim/battery.dts
index 02a6d0d3b9..9b9ccabadb 100644
--- a/zephyr/projects/skyrim/battery.dts
+++ b/zephyr/projects/skyrim/battery.dts
@@ -8,5 +8,8 @@
default_battery: aec_5477109 {
compatible = "aec,5477109";
};
+ smp_l20m3pg1 {
+ compatible = "smp,l20m3pg1";
+ };
};
};