1. GPU相關,函數
以8998爲例, /sys/class/kgsl/kgsl-3d0,目錄即爲GPU相關,裏面包括頻點,cur_freq, gpu_busy_percentage3d
2. chage_full_design節點值的如何定義的,以pm630ip
首先,power_supply 下的節點值都是經過fg_psy_get_property和fg_psy_set_property獲得ci
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\n", 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\n",
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\n", 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\n",
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 ];