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

Commit fe5ce2a6 authored by Linux Build Service Account's avatar Linux Build Service Account
Browse files

Promotion of kernel.lnx.4.4-161129.2.

CRs      Change ID                                   Subject
--------------------------------------------------------------------------------------------------------------
1091566   I0cd6ca6679c19bbdf4ad980a22d9976396028316   qpnp-fg-gen3: Add support to configure auto recharge vol
1085699   I545771f9a84ecc9c2f641c17e057673a32b1f305   usb: gadget: Notify QTI upon cable connect for DPL
1094456   Ifefcbe4741ddd046755ecc24c3f2d619566c2823   clk: fix critical clock locking
1094461   I6f0f8f742d6e1b3ff735dcbeabd54ef101329cdf   sched: Disable interrupts while holding related_thread_g
1094434   I69ae0d8589a0878b9758619893848afc272179c5   Crash due to mutex genl_lock called from RCU context
1094456   I2bf824bd2446ca87baabd31c166119d6c5c90643   clk: Provide OF helper to mark clocks as CRITICAL

Change-Id: If9a65e4592e6051e11e3501ecefc79a792097a3f
CRs-Fixed: 1085699, 1094434, 1094461, 1091566, 1094456
parents 277e2eec bde539ed
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -63,6 +63,14 @@ First Level Node - FG Gen3 device
	Definition: The voltage threshold (in mV) which upon set will be used
		    for configuring the low battery voltage threshold.

- qcom,fg-recharge-voltage
	Usage:      optional
	Value type: <u32>
	Definition: The voltage threshold (in mV) based on which the charging
		    will be resumed once the charging is complete. If this
		    property is not specified, then the default value will be
		    4250mV.

- qcom,fg-chg-term-current
	Usage:      optional
	Value type: <u32>
+40 −0
Original line number Diff line number Diff line
@@ -3128,8 +3128,13 @@ static int __clk_init(struct device *dev, struct clk *clk_user)
		core->ops->init(core->hw);

	if (core->flags & CLK_IS_CRITICAL) {
		unsigned long flags;

		clk_core_prepare(core);

		flags = clk_enable_lock();
		clk_core_enable(core);
		clk_enable_unlock(flags);
	}

	kref_init(&core->ref);
@@ -3863,6 +3868,41 @@ static int parent_ready(struct device_node *np)
	}
}

/**
 * of_clk_detect_critical() - set CLK_IS_CRITICAL flag from Device Tree
 * @np: Device node pointer associated with clock provider
 * @index: clock index
 * @flags: pointer to clk_core->flags
 *
 * Detects if the clock-critical property exists and, if so, sets the
 * corresponding CLK_IS_CRITICAL flag.
 *
 * Do not use this function. It exists only for legacy Device Tree
 * bindings, such as the one-clock-per-node style that are outdated.
 * Those bindings typically put all clock data into .dts and the Linux
 * driver has no clock data, thus making it impossible to set this flag
 * correctly from the driver. Only those drivers may call
 * of_clk_detect_critical from their setup functions.
 *
 * Return: error code or zero on success
 */
int of_clk_detect_critical(struct device_node *np,
					  int index, unsigned long *flags)
{
	struct property *prop;
	const __be32 *cur;
	uint32_t idx;

	if (!np || !flags)
		return -EINVAL;

	of_property_for_each_u32(np, "clock-critical", prop, cur, idx)
		if (index == idx)
			*flags |= CLK_IS_CRITICAL;

	return 0;
}

/**
 * of_clk_init() - Scan and init clock providers from the DT
 * @matches: array of compatible values and init functions for providers.
+2 −0
Original line number Diff line number Diff line
@@ -151,6 +151,7 @@ enum fg_sram_param_id {
	FG_SRAM_CHG_TERM_CURR,
	FG_SRAM_DELTA_SOC_THR,
	FG_SRAM_RECHARGE_SOC_THR,
	FG_SRAM_RECHARGE_VBATT_THR,
	FG_SRAM_KI_COEFF_MED_DISCHG,
	FG_SRAM_KI_COEFF_HI_DISCHG,
	FG_SRAM_MAX,
@@ -198,6 +199,7 @@ struct fg_dt_props {
	int	sys_term_curr_ma;
	int	delta_soc_thr;
	int	recharge_soc_thr;
	int	recharge_volt_thr_mv;
	int	rsense_sel;
	int	jeita_thresholds[NUM_JEITA_LEVELS];
	int	esr_timer_charging;
+31 −2
Original line number Diff line number Diff line
@@ -112,6 +112,8 @@
#define EMPTY_VOLT_v2_OFFSET		3
#define VBATT_LOW_v2_WORD		16
#define VBATT_LOW_v2_OFFSET		0
#define RECHARGE_VBATT_THR_v2_WORD	16
#define RECHARGE_VBATT_THR_v2_OFFSET	1
#define FLOAT_VOLT_v2_WORD		16
#define FLOAT_VOLT_v2_OFFSET		2

@@ -236,6 +238,9 @@ static struct fg_sram_param pmi8998_v2_sram_params[] = {
	PARAM(RECHARGE_SOC_THR, RECHARGE_SOC_THR_v2_WORD,
		RECHARGE_SOC_THR_v2_OFFSET, 1, 256, 100, 0, fg_encode_default,
		NULL),
	PARAM(RECHARGE_VBATT_THR, RECHARGE_VBATT_THR_v2_WORD,
		RECHARGE_VBATT_THR_v2_OFFSET, 1, 1000, 15625, -2000,
		fg_encode_voltage, NULL),
	PARAM(ESR_TIMER_DISCHG_MAX, ESR_TIMER_DISCHG_MAX_WORD,
		ESR_TIMER_DISCHG_MAX_OFFSET, 2, 1, 1, 0, fg_encode_default,
		NULL),
@@ -2395,8 +2400,8 @@ static int fg_hw_init(struct fg_chip *chip)
		return rc;
	}

	/* This SRAM register is only present in v2.0 */
	if (chip->pmic_rev_id->rev4 == PMI8998_V2P0_REV4 &&
	/* This SRAM register is only present in v2.0 and above */
	if (chip->pmic_rev_id->rev4 >= PMI8998_V2P0_REV4 &&
		chip->bp.float_volt_uv > 0) {
		fg_encode(chip->sp, FG_SRAM_FLOAT_VOLT,
			chip->bp.float_volt_uv / 1000, buf);
@@ -2476,6 +2481,23 @@ static int fg_hw_init(struct fg_chip *chip)
		}
	}

	/* This configuration is available only for pmicobalt v2.0 and above */
	if (chip->pmic_rev_id->rev4 >= PMI8998_V2P0_REV4 &&
		chip->dt.recharge_volt_thr_mv > 0) {
		fg_encode(chip->sp, FG_SRAM_RECHARGE_VBATT_THR,
			chip->dt.recharge_volt_thr_mv, buf);
		rc = fg_sram_write(chip,
				chip->sp[FG_SRAM_RECHARGE_VBATT_THR].addr_word,
				chip->sp[FG_SRAM_RECHARGE_VBATT_THR].addr_byte,
				buf, chip->sp[FG_SRAM_RECHARGE_VBATT_THR].len,
				FG_IMA_DEFAULT);
		if (rc < 0) {
			pr_err("Error in writing recharge_vbatt_thr, rc=%d\n",
				rc);
			return rc;
		}
	}

	if (chip->dt.rsense_sel >= SRC_SEL_BATFET &&
			chip->dt.rsense_sel < SRC_SEL_RESERVED) {
		rc = fg_masked_write(chip, BATT_INFO_IBATT_SENSING_CFG(chip),
@@ -2935,6 +2957,7 @@ static int fg_parse_ki_coefficients(struct fg_chip *chip)

#define DEFAULT_CUTOFF_VOLT_MV		3200
#define DEFAULT_EMPTY_VOLT_MV		2800
#define DEFAULT_RECHARGE_VOLT_MV	4250
#define DEFAULT_CHG_TERM_CURR_MA	100
#define DEFAULT_SYS_TERM_CURR_MA	-125
#define DEFAULT_DELTA_SOC_THR		1
@@ -3096,6 +3119,12 @@ static int fg_parse_dt(struct fg_chip *chip)
	else
		chip->dt.recharge_soc_thr = temp;

	rc = of_property_read_u32(node, "qcom,fg-recharge-voltage", &temp);
	if (rc < 0)
		chip->dt.recharge_volt_thr_mv = DEFAULT_RECHARGE_VOLT_MV;
	else
		chip->dt.recharge_volt_thr_mv = temp;

	rc = of_property_read_u32(node, "qcom,fg-rsense-sel", &temp);
	if (rc < 0)
		chip->dt.rsense_sel = SRC_SEL_BATFET_SMB;
+4 −0
Original line number Diff line number Diff line
@@ -1984,6 +1984,10 @@ static int gsi_set_alt(struct usb_function *f, unsigned intf, unsigned alt)

	atomic_set(&gsi->connected, 1);

	/* send 0 len pkt to qti to notify state change */
	if (gsi->prot_id == IPA_USB_DIAG)
		gsi_ctrl_send_cpkt_tomodem(gsi, NULL, 0);

	return 0;

notify_ep_disable:
Loading