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

Commit 83d48c5b authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "ARM: dts: msm: Config charging termination source for PM8150B"

parents 2d7e4341 fc6a9f32
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
/*
 * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
 * Copyright (c) 2017-2019, 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
@@ -175,6 +175,7 @@
			qcom,thermal-mitigation
					= <3000000 1500000 1000000 500000>;

			qcom,chg-term-src = <1>;
			qcom,charger-temp-max = <800>;
			qcom,smb-temp-max = <800>;

+9 −0
Original line number Diff line number Diff line
@@ -2232,9 +2232,18 @@ static int smb5_configure_iterm_thresholds_adc(struct smb5 *chip)
static int smb5_configure_iterm_thresholds(struct smb5 *chip)
{
	int rc = 0;
	struct smb_charger *chg = &chip->chg;

	switch (chip->dt.term_current_src) {
	case ITERM_SRC_ADC:
		rc = smblib_masked_write(chg, CHGR_ADC_TERM_CFG_REG,
				TERM_BASED_ON_SYNC_CONV_OR_SAMPLE_CNT,
				TERM_BASED_ON_SAMPLE_CNT);
		if (rc < 0) {
			dev_err(chg->dev, "Couldn't configure ADC_ITERM_CFG rc=%d\n",
					rc);
			return rc;
		}
		rc = smb5_configure_iterm_thresholds_adc(chip);
		break;
	default:
+5 −0
Original line number Diff line number Diff line
@@ -86,6 +86,11 @@ enum {
#define NO_OF_SAMPLE_FOR_RCHG_SHIFT		2
#define NO_OF_SAMPLE_FOR_RCHG			GENMASK(3, 2)

#define CHGR_ADC_TERM_CFG_REG			(CHGR_BASE + 0x6C)
#define TERM_BASED_ON_SYNC_CONV_OR_SAMPLE_CNT	BIT(0)
#define TERM_BASED_ON_SYNC_CONV			0
#define TERM_BASED_ON_SAMPLE_CNT		1

#define CHGR_FLOAT_VOLTAGE_CFG_REG		(CHGR_BASE + 0x70)

#define CHARGE_INHIBIT_THRESHOLD_CFG_REG	(CHGR_BASE + 0x72)