Lines Matching refs:index
60 static void clear_supply_loss_counter(uint16_t obj_inst_id, int index) in clear_supply_loss_counter() argument
62 supply_loss_counter[index] = 0; in clear_supply_loss_counter()
84 int index, i = 0, j = 0; in battery_create() local
87 for (index = 0; index < MAX_INSTANCE_COUNT; index++) { in battery_create()
88 if (inst[index].obj && inst[index].obj_inst_id == obj_inst_id) { in battery_create()
96 for (index = 0; index < MAX_INSTANCE_COUNT; index++) { in battery_create()
97 if (!inst[index].obj) { in battery_create()
102 if (index >= MAX_INSTANCE_COUNT) { in battery_create()
108 battery_level[index] = 0; in battery_create()
109 supply_loss_counter[index] = 0; in battery_create()
111 (void)memset(res[index], 0, sizeof(res[index][0]) * ARRAY_SIZE(res[index])); in battery_create()
112 init_res_instance(res_inst[index], ARRAY_SIZE(res_inst[index])); in battery_create()
115 INIT_OBJ_RES_DATA(UCIFI_BATTERY_LEVEL_RID, res[index], i, res_inst[index], j, in battery_create()
116 &battery_level[index], sizeof(*battery_level)); in battery_create()
117 INIT_OBJ_RES_OPTDATA(UCIFI_BATTERY_CAPACITY_RID, res[index], i, res_inst[index], j); in battery_create()
118 INIT_OBJ_RES_OPTDATA(UCIFI_BATTERY_VOLTAGE_RID, res[index], i, res_inst[index], j); in battery_create()
119 INIT_OBJ_RES_OPTDATA(UCIFI_BATTERY_TYPE_RID, res[index], i, res_inst[index], j); in battery_create()
120 INIT_OBJ_RES_OPTDATA(UCIFI_BATTERY_LOW_THESHOLD_RID, res[index], i, res_inst[index], j); in battery_create()
121 INIT_OBJ_RES_OPTDATA(UCIFI_BATTERY_LEVEL_TOO_LOW_RID, res[index], i, res_inst[index], j); in battery_create()
122 INIT_OBJ_RES_OPTDATA(UCIFI_BATTERY_SHUTDOWN_RID, res[index], i, res_inst[index], j); in battery_create()
123 INIT_OBJ_RES_OPTDATA(UCIFI_BATTERY_NUM_CYCLES_RID, res[index], i, res_inst[index], j); in battery_create()
124 INIT_OBJ_RES_OPTDATA(UCIFI_BATTERY_SUPPLY_LOSS_RID, res[index], i, res_inst[index], j); in battery_create()
125 INIT_OBJ_RES_DATA(UCIFI_BATTERY_SUPPLY_LOSS_COUNTER_RID, res[index], i, res_inst[index], j, in battery_create()
126 &supply_loss_counter[index], sizeof(*supply_loss_counter)); in battery_create()
127 INIT_OBJ_RES_EXECUTE(UCIFI_BATTERY_SUPPLY_LOSS_COUNTER_RESET_RID, res[index], i, in battery_create()
129 INIT_OBJ_RES_OPTDATA(UCIFI_BATTERY_SUPPLY_LOSS_REASON_RID, res[index], i, res_inst[index], in battery_create()
132 inst[index].resources = res[index]; in battery_create()
133 inst[index].resource_count = i; in battery_create()
135 return &inst[index]; in battery_create()