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

Commit cf8928d0 authored by Ashay Jaiswal's avatar Ashay Jaiswal
Browse files

power: step-chg-jeita: update jeita/step ranges to support signed threshold



Currently software JEITA uses unsigned variable to store threshold data
and thus fails to support negative temperature ranges, fix this by using
signed variable to store threshold data.

Change-Id: Ia888610e9e4ee4606333a07a3f338a494ec0392e
Signed-off-by: default avatarAshay Jaiswal <ashayj@codeaurora.org>
parent a6712ea7
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1113,7 +1113,7 @@ static int get_time_to_full_locked(struct ttf *ttf, int *val)

			/* Calculate OCV for each window */
			if (power_approx) {
				i_step = pbatt_avg / max((u32)MILLI_UNIT,
				i_step = pbatt_avg / max(MILLI_UNIT,
					(step_chg_cfg[i].high_threshold /
						MILLI_UNIT));
			} else {
+1 −1
Original line number Diff line number Diff line
@@ -152,7 +152,7 @@ static bool is_input_present(struct step_chg_info *chip)

int read_range_data_from_node(struct device_node *node,
		const char *prop_str, struct range_data *ranges,
		u32 max_threshold, u32 max_value)
		int max_threshold, u32 max_value)
{
	int rc = 0, i, length, per_tuple_length, tuples;

+3 −3
Original line number Diff line number Diff line
@@ -16,8 +16,8 @@ struct step_chg_jeita_param {
};

struct range_data {
	u32 low_threshold;
	u32 high_threshold;
	int low_threshold;
	int high_threshold;
	u32 value;
};

@@ -26,5 +26,5 @@ int qcom_step_chg_init(struct device *dev,
void qcom_step_chg_deinit(void);
int read_range_data_from_node(struct device_node *node,
		const char *prop_str, struct range_data *ranges,
		u32 max_threshold, u32 max_value);
		int max_threshold, u32 max_value);
#endif /* __STEP_CHG_H__ */