@@ -127,7 +127,7 @@ void process_cm2dm_message(struct bh_chip *chip)
127127 }
128128}
129129
130- void ina228_pwr_update (void )
130+ void ina228_power_update (void )
131131{
132132 struct sensor_value sensor_val ;
133133
@@ -137,11 +137,11 @@ void ina228_pwr_update(void)
137137 int32_t power = (sensor_val .val1 << 16 ) + (sensor_val .val2 * 65536ULL ) / 1000000ULL ;
138138
139139 ARRAY_FOR_EACH_PTR (BH_CHIPS , chip ) {
140- bh_chip_set_input_pwr (chip , & power );
140+ bh_chip_set_input_power (chip , & power );
141141 }
142142}
143143
144- uint16_t detect_max_pwr (void )
144+ uint16_t detect_max_power (void )
145145{
146146 static const struct gpio_dt_spec psu_sense0 =
147147 GPIO_DT_SPEC_GET_OR (DT_PATH (psu_sense0 ), gpios , {0 });
@@ -154,28 +154,28 @@ uint16_t detect_max_pwr(void)
154154 int sense0_val = gpio_pin_get_dt (& psu_sense0 );
155155 int sense1_val = gpio_pin_get_dt (& psu_sense1 );
156156
157- uint16_t psu_pwr ;
157+ uint16_t psu_power ;
158158
159159 if (!sense0_val && !sense1_val ) {
160- psu_pwr = 600 ;
160+ psu_power = 600 ;
161161 } else if (sense0_val && !sense1_val ) {
162- psu_pwr = 450 ;
162+ psu_power = 450 ;
163163 } else if (!sense0_val && sense1_val ) {
164- psu_pwr = 300 ;
164+ psu_power = 300 ;
165165 } else {
166166 /* Pins could either be open or shorted together */
167167 /* Pull down one and check the other */
168168 gpio_pin_configure_dt (& psu_sense0 , GPIO_OUTPUT_LOW );
169169 if (!gpio_pin_get_dt (& psu_sense1 )) {
170170 /* If shorted together then max power is 150W */
171- psu_pwr = 150 ;
171+ psu_power = 150 ;
172172 } else {
173- psu_pwr = 0 ;
173+ psu_power = 0 ;
174174 }
175175 gpio_pin_configure_dt (& psu_sense0 , GPIO_INPUT );
176176 }
177177
178- return psu_pwr ;
178+ return psu_power ;
179179}
180180
181181int main (void )
@@ -298,7 +298,7 @@ int main(void)
298298 dmStaticInfo static_info =
299299 (dmStaticInfo ){.version = 1 , .bl_version = 0 , .app_version = APPVERSION };
300300
301- uint16_t max_pwr = detect_max_pwr ();
301+ uint16_t max_power = detect_max_power ();
302302
303303 while (true) {
304304 tt_event_wait (TT_EVENT_WAKE , K_MSEC (20 ));
@@ -341,14 +341,14 @@ int main(void)
341341 ARRAY_FOR_EACH_PTR (BH_CHIPS , chip ) {
342342 if (chip -> data .arc_needs_init_msg ) {
343343 if (bh_chip_set_static_info (chip , & static_info ) == 0 &&
344- bh_chip_set_board_pwr_lim (chip , max_pwr ) == 0 ) {
344+ bh_chip_set_input_power_lim (chip , max_power ) == 0 ) {
345345 chip -> data .arc_needs_init_msg = false;
346346 }
347347 }
348348 }
349349
350350 if (IS_ENABLED (CONFIG_INA228 )) {
351- ina228_pwr_update ();
351+ ina228_power_update ();
352352 }
353353
354354 if (IS_ENABLED (CONFIG_TT_FAN_CTRL )) {
0 commit comments