Power: ab8500: Fixed coding style issues
PATCH 1/1 Power: ab8500: Fixed coding style issues
Fixed coding style.
Signed-off-by Jesper Falk <[email protected]>
--- drivers/power/ab8500_bmdata.c | 114 ++++++++++++++++++++--------------------- drivers/power/ab8500_btemp.c | 8 ++- drivers/power/ab8500_charger.c | 10 ++-- drivers/power/ab8500_fg.c | 38 +++++++++----- 4 files changed, 88 insertions(+), 82 deletions(-)
drivers/power/ab8500_bmdata.c +57 -57
@@ -430,10 +430,10 @@ static const struct abx500_maxim_parameters ab8500_maxi_params = { };static const struct abx500_maxim_parameters abx540_maxi_params = { - .ena_maxi = true, - .chg_curr =3000 , - .wait_cycles =10 , - .charger_curr_step =200 , + .ena_maxi = true, + .chg_curr =3000 , + .wait_cycles =10 , + .charger_curr_step =200 , };static const struct abx500_bm_charger_parameters chg = {
@@ -448,19 +448,19 @@ static const struct abx500_bm_charger_parameters chg = {* AB8500 values */ static int ab8500_charge_output_curr_map[] = { -100 ,200 ,300 ,400 ,500 ,600 ,700 ,800 , -900 ,1000 ,1100 ,1200 ,1300 ,1400 ,1500 ,1500 , +100 ,200 ,300 ,400 ,500 ,600 ,700 ,800 , +900 ,1000 ,1100 ,1200 ,1300 ,1400 ,1500 ,1500 , };static int ab8540_charge_output_curr_map[] = { -0 ,0 ,0 ,75 ,100 ,125 ,150 ,175 , -200 ,225 ,250 ,275 ,300 ,325 ,350 ,375 , -400 ,425 ,450 ,475 ,500 ,525 ,550 ,575 , -600 ,625 ,650 ,675 ,700 ,725 ,750 ,775 , -800 ,825 ,850 ,875 ,900 ,925 ,950 ,975 , -1000 ,1025 ,1050 ,1075 ,1100 ,1125 ,1150 ,1175 , -1200 ,1225 ,1250 ,1275 ,1300 ,1325 ,1350 ,1375 , -1400 ,1425 ,1450 ,1500 ,1600 ,1700 ,1900 ,2000 , +0 ,0 ,0 ,75 ,100 ,125 ,150 ,175 , +200 ,225 ,250 ,275 ,300 ,325 ,350 ,375 , +400 ,425 ,450 ,475 ,500 ,525 ,550 ,575 , +600 ,625 ,650 ,675 ,700 ,725 ,750 ,775 , +800 ,825 ,850 ,875 ,900 ,925 ,950 ,975 , +1000 ,1025 ,1050 ,1075 ,1100 ,1125 ,1150 ,1175 , +1200 ,1225 ,1250 ,1275 ,1300 ,1325 ,1350 ,1375 , +1400 ,1425 ,1450 ,1500 ,1600 ,1700 ,1900 ,2000 , };/*
@@ -468,19 +468,19 @@ static int ab8540_charge_output_curr_map[] = {* AB8500 values */ static int ab8500_charge_input_curr_map[] = { -50 ,98 ,193 ,290 ,380 ,450 ,500 ,600 , -700 ,800 ,900 ,1000 ,1100 ,1300 ,1400 ,1500 , +50 ,98 ,193 ,290 ,380 ,450 ,500 ,600 , +700 ,800 ,900 ,1000 ,1100 ,1300 ,1400 ,1500 , };static int ab8540_charge_input_curr_map[] = { -25 ,50 ,75 ,100 ,125 ,150 ,175 ,200 , -225 ,250 ,275 ,300 ,325 ,350 ,375 ,400 , -425 ,450 ,475 ,500 ,525 ,550 ,575 ,600 , -625 ,650 ,675 ,700 ,725 ,750 ,775 ,800 , -825 ,850 ,875 ,900 ,925 ,950 ,975 ,1000 , -1025 ,1050 ,1075 ,1100 ,1125 ,1150 ,1175 ,1200 , -1225 ,1250 ,1275 ,1300 ,1325 ,1350 ,1375 ,1400 , -1425 ,1450 ,1475 ,1500 ,1500 ,1500 ,1500 ,1500 , +25 ,50 ,75 ,100 ,125 ,150 ,175 ,200 , +225 ,250 ,275 ,300 ,325 ,350 ,375 ,400 , +425 ,450 ,475 ,500 ,525 ,550 ,575 ,600 , +625 ,650 ,675 ,700 ,725 ,750 ,775 ,800 , +825 ,850 ,875 ,900 ,925 ,950 ,975 ,1000 , +1025 ,1050 ,1075 ,1100 ,1125 ,1150 ,1175 ,1200 , +1225 ,1250 ,1275 ,1300 ,1325 ,1350 ,1375 ,1400 , +1425 ,1450 ,1475 ,1500 ,1500 ,1500 ,1500 ,1500 , };struct abx500_bm_data ab8500_bm_data = {
@@ -513,42 +513,42 @@ struct abx500_bm_data ab8500_bm_data = { .maxi = &ab8500_maxi_params, .chg_params = &chg, .fg_params = &fg, - .chg_input_curr = ab8500_charge_input_curr_map, - .n_chg_in_curr = ARRAY_SIZE(ab8500_charge_input_curr_map), + .chg_input_curr = ab8500_charge_input_curr_map, + .n_chg_in_curr = ARRAY_SIZE(ab8500_charge_input_curr_map), };struct abx500_bm_data ab8540_bm_data = { - .temp_under =3 , - .temp_low =8 , - .temp_high =43 , - .temp_over =48 , - .main_safety_tmr_h =4 , - .temp_interval_chg =20 , - .temp_interval_nochg =120 , - .usb_safety_tmr_h =4 , - .bkup_bat_v =BUP_VCH_SEL_2P6V , - .bkup_bat_i =BUP_ICH_SEL_150UA , - .no_maintenance = false, - .capacity_scaling = false, - .adc_therm = ABx500_ADC_THERM_BATCTRL, - .chg_unknown_bat = false, - .enable_overshoot = false, - .fg_res =100 , - .cap_levels = &cap_levels, - .bat_type = bat_type_thermistor, - .n_btypes =ARRAY_SIZE (bat_type_thermistor), - .batt_id =0 , - .interval_charging =5 , - .interval_not_charging =120 , - .temp_hysteresis =3 , - .gnd_lift_resistance =0 , - .maxi = &abx540_maxi_params, - .chg_params = &chg, - .fg_params = &fg, - .chg_output_curr = ab8540_charge_output_curr_map, - .n_chg_out_curr =ARRAY_SIZE (ab8540_charge_output_curr_map), - .chg_input_curr = ab8540_charge_input_curr_map, - .n_chg_in_curr =ARRAY_SIZE (ab8540_charge_input_curr_map), + .temp_under =3 , + .temp_low =8 , + .temp_high =43 , + .temp_over =48 , + .main_safety_tmr_h =4 , + .temp_interval_chg =20 , + .temp_interval_nochg =120 , + .usb_safety_tmr_h =4 , + .bkup_bat_v =BUP_VCH_SEL_2P6V , + .bkup_bat_i =BUP_ICH_SEL_150UA , + .no_maintenance = false, + .capacity_scaling = false, + .adc_therm = ABx500_ADC_THERM_BATCTRL, + .chg_unknown_bat = false, + .enable_overshoot = false, + .fg_res =100 , + .cap_levels = &cap_levels, + .bat_type = bat_type_thermistor, + .n_btypes =ARRAY_SIZE (bat_type_thermistor), + .batt_id =0 , + .interval_charging =5 , + .interval_not_charging =120 , + .temp_hysteresis =3 , + .gnd_lift_resistance =0 , + .maxi = &abx540_maxi_params, + .chg_params = &chg, + .fg_params = &fg, + .chg_output_curr = ab8540_charge_output_curr_map, + .n_chg_out_curr =ARRAY_SIZE (ab8540_charge_output_curr_map), + .chg_input_curr = ab8540_charge_input_curr_map, + .n_chg_in_curr =ARRAY_SIZE (ab8540_charge_input_curr_map), }; int ab8500_bm_of_probe(struct device *dev,
drivers/power/ab8500_btemp.c +3 -5
@@ -84,7 +84,7 @@ struct ab8500_btemp_ranges {* @parent: Pointer to the struct ab8500 * @gpadc: Pointer to the struct gpadc * @fg: Pointer to the struct fg -* @bm: Platform specific battery management information +* @bm: Platform specific battery management information * @btemp_psy: Structure for BTEMP specific battery properties * @events: Structure for information about events triggered * @btemp_ranges: Battery temperature range structure
@@ -946,9 +946,8 @@ static int ab8500_btemp_get_ext_psy_data(struct device *dev, void *data)switch (ext->type) {case POWER_SUPPLY_TYPE_MAINS :/* AC disconnected */ -if (!ret.intval && di->events.ac_conn) { +if (!ret.intval && di->events.ac_conn) di->events.ac_conn = false; - }/* AC connected */ else if (ret.intval && !di->events.ac_conn) { di->events.ac_conn = true;
@@ -958,9 +957,8 @@ static int ab8500_btemp_get_ext_psy_data(struct device *dev, void *data)break ;case POWER_SUPPLY_TYPE_USB :/* USB disconnected */ -if (!ret.intval && di->events.usb_conn) { +if (!ret.intval && di->events.usb_conn) di->events.usb_conn = false; - }/* USB connected */ else if (ret.intval && !di->events.usb_conn) { di->events.usb_conn = true;
drivers/power/ab8500_charger.c +4 -6
@@ -236,7 +236,7 @@ struct ab8500_charger_max_usb_in_curr {* Counter for current stepping sessions * @parent: Pointer to the struct ab8500 * @gpadc: Pointer to the struct gpadc -* @bm: Platform specific battery management information +* @bm: Platform specific battery management information * @flags: Structure for information about events triggered * @usb_state: Structure for usb stack information * @max_usb_in_curr: Max USB charger input current
@@ -385,17 +385,15 @@ static void ab8500_enable_disable_sw_fallback(struct ab8500_charger *di,/* write back the changed fallback bit value to register */ ret =abx500_set_register_interruptible (di->dev, bank, reg, val); -if (ret) { +if (ret)dev_err (di->dev,"%d write failed\n" , __LINE__); - } disable_otp:if (is_ab8500 (di->parent)) {/* disable the set OTP registers again */ ret =abx500_set_register_interruptible (di->dev,0x11 ,0x00 ,0x0 ); -if (ret) { +if (ret)dev_err (di->dev,"%d write failed\n" , __LINE__); - } } }
@@ -2397,7 +2395,7 @@ static void ab8500_charger_usb_link_status_work(struct work_struct *work)return ; } -dev_dbg (di->dev,"%s di->vbus_detected = true\n" ,__func__); +dev_dbg (di->dev,"%s di->vbus_detected = true\n" , __func__); di->vbus_detected = true; ret =ab8500_charger_read_usb_type (di);if (ret) {
drivers/power/ab8500_fg.c +24 -14
@@ -185,7 +185,7 @@ struct inst_curr_result_list {* @avg_cap: Average capacity filter * @parent: Pointer to the struct ab8500 * @gpadc: Pointer to the struct gpadc -* @bm: Platform specific battery management information +* @bm: Platform specific battery management information * @fg_psy: Structure that holds the FG specific battery properties * @fg_wq: Work queue for running the FG algorithm * @fg_periodic_work: Work to run the FG algorithm periodically
@@ -821,7 +821,8 @@ static void ab8500_fg_acc_cur_work(struct work_struct *work)queue_work (di->fg_wq, &di->fg_work);dev_dbg (di->dev,"fg_res: %d, fg_samples: %d, gasg: %d, accu_charge: %d\n" , - di->bm->fg_res, di->fg_samples, val, di->accu_charge); + di->bm->fg_res, di->fg_samples, val, + di->accu_charge);return ; exit: dev_err(di->dev,
@@ -1884,9 +1885,9 @@ static void ab8500_fg_low_bat_work(struct work_struct *work)dev_warn (di->dev,"Shut down pending...\n" ); }else {/* -* Else we need to re-schedule this check to be able to detect -* if the voltage increases again during charging or -* due to decreasing load. +* Else we need to re-schedule this check to be able to +* detect if the voltage increases again during charging +* or due to decreasing load. */ di->low_bat_cnt--;dev_warn (di->dev,"Battery voltage still LOW\n" );
@@ -2735,7 +2736,8 @@ static ssize_t ab8505_powercut_restart_write(struct device *dev, } ret =abx500_set_register_interruptible (di->dev,AB8500_RTC , -AB8505_RTC_PCUT_RESTART_REG , (u8 )reg_value); +AB8505_RTC_PCUT_RESTART_REG , + (u8 )reg_value);if (ret <0 )dev_err (dev,"Failed to set AB8505_RTC_PCUT_RESTART_REG\n" );
@@ -2757,7 +2759,8 @@ static ssize_t ab8505_powercut_timer_read(struct device *dev, di =to_ab8500_fg_device_info (psy); ret =abx500_get_register_interruptible (di->dev,AB8500_RTC , -AB8505_RTC_PCUT_TIME_REG , ®_value); +AB8505_RTC_PCUT_TIME_REG , + ®_value);if (ret <0 ) {dev_err (dev,"Failed to read AB8505_RTC_PCUT_TIME_REG\n" );
@@ -2782,7 +2785,8 @@ static ssize_t ab8505_powercut_restart_counter_read(struct device *dev, di =to_ab8500_fg_device_info (psy); ret =abx500_get_register_interruptible (di->dev,AB8500_RTC , -AB8505_RTC_PCUT_RESTART_REG , ®_value); +AB8505_RTC_PCUT_RESTART_REG , + ®_value);if (ret <0 ) {dev_err (dev,"Failed to read AB8505_RTC_PCUT_RESTART_REG\n" );
@@ -2807,7 +2811,8 @@ static ssize_t ab8505_powercut_read(struct device *dev, di =to_ab8500_fg_device_info (psy); ret =abx500_get_register_interruptible (di->dev,AB8500_RTC , -AB8505_RTC_PCUT_CTL_STATUS_REG , ®_value); +AB8505_RTC_PCUT_CTL_STATUS_REG , + ®_value);if (ret <0 ) goto fail;
@@ -2836,7 +2841,8 @@ static ssize_t ab8505_powercut_write(struct device *dev, } ret =abx500_set_register_interruptible (di->dev,AB8500_RTC , -AB8505_RTC_PCUT_CTL_STATUS_REG , (u8 )reg_value); +AB8505_RTC_PCUT_CTL_STATUS_REG , + (u8 )reg_value);if (ret <0 )dev_err (dev,"Failed to set AB8505_RTC_PCUT_CTL_STATUS_REG\n" );
@@ -2858,7 +2864,8 @@ static ssize_t ab8505_powercut_flag_read(struct device *dev, di =to_ab8500_fg_device_info (psy); ret =abx500_get_register_interruptible (di->dev,AB8500_RTC , -AB8505_RTC_PCUT_CTL_STATUS_REG , ®_value); +AB8505_RTC_PCUT_CTL_STATUS_REG , + ®_value);if (ret <0 ) {dev_err (dev,"Failed to read AB8505_RTC_PCUT_CTL_STATUS_REG\n" );
@@ -2883,7 +2890,8 @@ static ssize_t ab8505_powercut_debounce_read(struct device *dev, di =to_ab8500_fg_device_info (psy); ret =abx500_get_register_interruptible (di->dev,AB8500_RTC , -AB8505_RTC_PCUT_DEBOUNCE_REG , ®_value); +AB8505_RTC_PCUT_DEBOUNCE_REG , + ®_value);if (ret <0 ) {dev_err (dev,"Failed to read AB8505_RTC_PCUT_DEBOUNCE_REG\n" );
@@ -2914,7 +2922,8 @@ static ssize_t ab8505_powercut_debounce_write(struct device *dev, } ret =abx500_set_register_interruptible (di->dev,AB8500_RTC , -AB8505_RTC_PCUT_DEBOUNCE_REG , (u8 )reg_value); +AB8505_RTC_PCUT_DEBOUNCE_REG , + (u8 )reg_value);if (ret <0 )dev_err (dev,"Failed to set AB8505_RTC_PCUT_DEBOUNCE_REG\n" );
@@ -2935,7 +2944,8 @@ static ssize_t ab8505_powercut_enable_status_read(struct device *dev, di =to_ab8500_fg_device_info (psy); ret =abx500_get_register_interruptible (di->dev,AB8500_RTC , -AB8505_RTC_PCUT_CTL_STATUS_REG , ®_value); +AB8505_RTC_PCUT_CTL_STATUS_REG , + ®_value);if (ret <0 ) {dev_err (dev,"Failed to read AB8505_RTC_PCUT_CTL_STATUS_REG\n" );
Signature · 1 line
1.8.5.2
Quoted 1 line · Jesper Falk
Fixed coding style.
It'd be nice to change some of these arrays to const too like:
include/linux/mfd/abx500.h +2 -2
@@ -287,8 +287,8 @@ struct abx500_bm_data {int gnd_lift_resistance;int n_chg_out_curr;int n_chg_in_curr; -int *chg_output_curr; -int *chg_input_curr; +const int *chg_output_curr; +const int *chg_input_curr;const struct abx500_maxim_parameters *maxi;const struct abx500_bm_capacity_levels *cap_levels;struct abx500_battery_type *bat_type;
drivers/power/ab8500_bmdata.c
Quoted 1 line
drivers/power/ab8500_bmdata.c +0
-0
[]
drivers/power/ab8500_bmdata.c static const struct abx500_bm_charger_parameters chg = { · line 450
Quoted 4 lines
drivers/power/ab8500_bmdata.c +0
-0@@ -448,19 +448,19 @@ static const struct abx500_bm_charger_parameters chg = {* AB8500 values */ static int ab8500_charge_output_curr_map[] = {
static const int
drivers/power/ab8500_bmdata.c static const struct abx500_bm_charger_parameters chg = { · line 455
Quoted 7 lines
drivers/power/ab8500_bmdata.c +2
-2-100 ,200 ,300 ,400 ,500 ,600 ,700 ,800 , - 900, 1000, 1100, 1200, 1300, 1400, 1500, 1500, +100 ,200 ,300 ,400 ,500 ,600 ,700 ,800 , + 900, 1000, 1100, 1200, 1300, 1400, 1500, 1500, }; static int ab8540_charge_output_curr_map[] = {
here too
Quoted 20 lines
drivers/power/ab8500_bmdata.c +8
-8-0 ,0 ,0 ,75 ,100 ,125 ,150 ,175 , -200 ,225 ,250 ,275 ,300 ,325 ,350 ,375 , -400 ,425 ,450 ,475 ,500 ,525 ,550 ,575 , -600 ,625 ,650 ,675 ,700 ,725 ,750 ,775 , -800 ,825 ,850 ,875 ,900 ,925 ,950 ,975 , -1000 ,1025 ,1050 ,1075 ,1100 ,1125 ,1150 ,1175 , -1200 ,1225 ,1250 ,1275 ,1300 ,1325 ,1350 ,1375 , - 1400, 1425, 1450, 1500, 1600, 1700, 1900, 2000, +0 ,0 ,0 ,75 ,100 ,125 ,150 ,175 , +200 ,225 ,250 ,275 ,300 ,325 ,350 ,375 , +400 ,425 ,450 ,475 ,500 ,525 ,550 ,575 , +600 ,625 ,650 ,675 ,700 ,725 ,750 ,775 , +800 ,825 ,850 ,875 ,900 ,925 ,950 ,975 , +1000 ,1025 ,1050 ,1075 ,1100 ,1125 ,1150 ,1175 , +1200 ,1225 ,1250 ,1275 ,1300 ,1325 ,1350 ,1375 , + 1400, 1425, 1450, 1500, 1600, 1700, 1900, 2000, };/*
drivers/power/ab8500_bmdata.c static int ab8540_charge_output_curr_map[] = { · line 473
Quoted 8 lines
drivers/power/ab8500_bmdata.c +2
-2@@ -468,19 +468,19 @@ static int ab8540_charge_output_curr_map[] = {* AB8500 values */ static int ab8500_charge_input_curr_map[] = { -50 ,98 ,193 ,290 ,380 ,450 ,500 ,600 , -700 ,800 ,900 ,1000 ,1100 ,1300 ,1400 ,1500 , +50 ,98 ,193 ,290 ,380 ,450 ,500 ,600 , +700 ,800 ,900 ,1000 ,1100 ,1300 ,1400 ,1500 , };
here 3
Quoted 8 lines
drivers/power/ab8500_bmdata.c +0
-7static int ab8540_charge_input_curr_map[] = { -25 ,50 ,75 ,100 ,125 ,150 ,175 ,200 , -225 ,250 ,275 ,300 ,325 ,350 ,375 ,400 , -425 ,450 ,475 ,500 ,525 ,550 ,575 ,600 , -625 ,650 ,675 ,700 ,725 ,750 ,775 ,800 , -825 ,850 ,875 ,900 ,925 ,950 ,975 ,1000 , -1025 ,1050 ,1075 ,1100 ,1125 ,1150 ,1175 ,1200 , -1225 ,1250 ,1275 ,1300 ,1325 ,1350 ,1375 ,1400 ,
drivers/power/ab8500_bmdata.c static int ab8540_charge_output_curr_map[] = { · line 483
Quoted 10 lines
drivers/power/ab8500_bmdata.c +8
-1- 1425, 1450, 1475, 1500, 1500, 1500, 1500, 1500, +25 ,50 ,75 ,100 ,125 ,150 ,175 ,200 , +225 ,250 ,275 ,300 ,325 ,350 ,375 ,400 , +425 ,450 ,475 ,500 ,525 ,550 ,575 ,600 , +625 ,650 ,675 ,700 ,725 ,750 ,775 ,800 , +825 ,850 ,875 ,900 ,925 ,950 ,975 ,1000 , +1025 ,1050 ,1075 ,1100 ,1125 ,1150 ,1175 ,1200 , +1225 ,1250 ,1275 ,1300 ,1325 ,1350 ,1375 ,1400 , + 1425, 1450, 1475, 1500, 1500, 1500, 1500, 1500, };
and here.