1. GPU相关,
以8998为例, /sys/class/kgsl/kgsl-3d0,目录即为GPU相关,里面包括频点,cur_freq, gpu_busy_percentage
2. chage_full_design节点值的如何定义的,以pm630
首先,power_supply 下的节点值都是通过fg_psy_get_property和fg_psy_set_property得到
static int fg_psy_get_property(struct power_supply *psy,
enum power_supply_property psp,
union power_supply_propval *pval)
{
...
case POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN:
pval->intval = chip->cl.nom_cap_uah;
break;
...
}
cl.nom_cap_uah是通过如下函数获得,
static void profile_load_work(struct work_struct *work)
{
...
rc = fg_sram_read(chip, NOM_CAP_WORD, NOM_CAP_OFFSET, buf, 2,
FG_IMA_DEFAULT);
if (rc < 0) {
pr_err("Error in reading %04x[%d] rc=%d
", NOM_CAP_WORD,
NOM_CAP_OFFSET, rc);
} else {
pr_err("fg read nominal capacity from battery profile, buf[0] is %04x, buf[1] is %04x", buf[0], buf[1]);
chip->cl.nom_cap_uah = (int)(buf[0] | buf[1] << 8) * 1000;
rc = fg_load_learned_cap_from_sram(chip);
if (rc < 0)
pr_err("Error in loading capacity learning data, rc:%d
",
rc);
}
...
}
由上可以得知,是通过battery profile获取该值,那么battery profile 在哪里定义呢?
static void profile_load_work(struct work_struct *work)
{
...
rc = fg_get_batt_id(chip);
if (rc < 0) {
pr_err("Error in getting battery id, rc:%d
", rc);
goto out;
}
rc = fg_get_batt_profile(chip);
if (rc < 0) {
pr_warn("profile for batt_id=%dKOhms not found..using OTP, rc:%d
",
chip->batt_id_ohms / 1000, rc);
goto out;
}
...
}
由如上代码可以得知,是从qcom 的batterydata-***-id1.dtsi获得
,具体内容如下
qcom,fg-profile-data = [
66 1F B3 05
78 0A 8B FC
73 1D 57 07
32 12 45 14
38 18 1C 23
7F 45 BD 52
56 00 00 00
0F 00 00 00
00 00 16 C4
78 C5 41 C3
1B 00 08 00
55 E2 B4 E4
B1 FD 84 00
D5 00 3E 12
2D 05 19 3B
16 06 09 20
27 00 14 00
EA 1F 44 05
CC 0A F4 05
51 1D A0 00
C3 03 AC 15
80 19 9F 22
BE 45 9E 52
56 00 00 00
0E 00 00 00
00 00 FB 07
19 C3 B3 C4
17 00 00 00
23 EA B4 E4
DF FD EC EB
C6 C5 60 0A
06 01 B2 12
99 33 CC FF
07 10 00 00
9B 0A 66 46 //9B 0A 即为2715mah
17 00 40 00
1E 02 0A FA
FF 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
];
66 1F B3 05
78 0A 8B FC
73 1D 57 07
32 12 45 14
38 18 1C 23
7F 45 BD 52
56 00 00 00
0F 00 00 00
00 00 16 C4
78 C5 41 C3
1B 00 08 00
55 E2 B4 E4
B1 FD 84 00
D5 00 3E 12
2D 05 19 3B
16 06 09 20
27 00 14 00
EA 1F 44 05
CC 0A F4 05
51 1D A0 00
C3 03 AC 15
80 19 9F 22
BE 45 9E 52
56 00 00 00
0E 00 00 00
00 00 FB 07
19 C3 B3 C4
17 00 00 00
23 EA B4 E4
DF FD EC EB
C6 C5 60 0A
06 01 B2 12
99 33 CC FF
07 10 00 00
9B 0A 66 46 //9B 0A 即为2715mah
17 00 40 00
1E 02 0A FA
FF 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
];