Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 01a84b70 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "drivers: fix 32bit compilation for QPNP drivers"

parents 583cff4f 8f0b4197
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
/* Copyright (c) 2014-2015, 2017, The Linux Foundation. All rights reserved.
/* Copyright (c) 2014-2015, 2017-2018, The Linux Foundation.
 * All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -1434,8 +1435,7 @@ static ssize_t qpnp_haptics_show_duration(struct device *dev,
		time_us = ktime_to_us(time_rem);
	}

	return snprintf(buf, PAGE_SIZE, "%lld\n", time_us / 1000);
	return 0;
	return snprintf(buf, PAGE_SIZE, "%lld\n", div_s64(time_us, 1000));
}

static ssize_t qpnp_haptics_store_duration(struct device *dev,
+5 −5
Original line number Diff line number Diff line
/* Copyright (c) 2014-2017, The Linux Foundation. All rights reserved.
/* Copyright (c) 2014-2018, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -2548,13 +2548,13 @@ static int estimate_battery_age(struct fg_chip *chip, int *actual_capacity)

	/* calculate soc_cutoff_new */
	val = (1000000LL + temp_rs_to_rslow) * battery_esr;
	do_div(val, 1000000);
	val = div64_s64(val, 1000000);
	ocv_cutoff_new = div64_s64(chip->evaluation_current * val, 1000)
		+ chip->cutoff_voltage;

	/* calculate soc_cutoff_aged */
	val = (1000000LL + temp_rs_to_rslow) * esr_actual;
	do_div(val, 1000000);
	val = div64_s64(val, 1000000);
	ocv_cutoff_aged = div64_s64(chip->evaluation_current * val, 1000)
		+ chip->cutoff_voltage;

@@ -3068,11 +3068,11 @@ static void fg_cap_learning_post_process(struct fg_chip *chip)

	max_inc_val = chip->learning_data.learned_cc_uah
			* (1000 + chip->learning_data.max_increment);
	do_div(max_inc_val, 1000);
	max_inc_val = div_s64(max_inc_val, 1000);

	min_dec_val = chip->learning_data.learned_cc_uah
			* (1000 - chip->learning_data.max_decrement);
	do_div(min_dec_val, 1000);
	min_dec_val = div_s64(min_dec_val, 1000);

	old_cap = chip->learning_data.learned_cc_uah;
	if (chip->learning_data.cc_uah > max_inc_val)