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

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

Merge "power: bcl: Add IAVAIL BCL monitor mode support for non-bms targets"

parents 392b6538 c9d6972f
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -45,6 +45,9 @@ Optional parameters:
- qcom,bcl-hotplug-list = <hotplug-phandle-list>: List of phandles to the cores
		that are to be hotplugged, when battery current limit condition
		is reached.
- qcom,bcl-no-bms: This is an optional node for BCL IAVAIL monitor mode.
		If this property is defined, BCL IAVAIL monitor gets rbat value
		from power supply battery module instead of bms module.

Optional nodes:
- qcom,ibat-monitor: This optional node defines all the parameters for the
@@ -92,6 +95,7 @@ Example:
		compatible = "qcom,bcl";
		qcom,ibat-vadc = <&pma8084_vadc>;
		qcom,ibat-threshold-adc_tm = <&pma8084_adc_tm>;
		qcom,bcl-no-bms;
		qcom,ibat-monitor {
			qcom,high-threshold-uamp = <1500>;
			qcom,low-threshold-uamp = <500>;
+11 −2
Original line number Diff line number Diff line
@@ -142,6 +142,8 @@ struct bcl_context {
	int bcl_vbat_min;
	/* BCL period poll delay work structure  */
	struct delayed_work bcl_iavail_work;
	/* For non-bms target */
	bool bcl_no_bms;
	/* The max CPU frequency the BTM restricts during high load */
	uint32_t btm_freq_max;
	/* Indicates whether there is a high load */
@@ -337,9 +339,11 @@ static int bcl_get_resistance(int *rbatt_mohm)
	union power_supply_propval ret = {0,};

	if (psy == NULL) {
		psy = power_supply_get_by_name("bms");
		psy =
		power_supply_get_by_name(gbcl->bcl_no_bms ? "battery" : "bms");
		if (psy == NULL) {
			pr_err("failed to get ps bms\n");
			pr_err("failed to get ps %s\n",
				gbcl->bcl_no_bms ? "battery" : "bms");
			return -EINVAL;
		}
	}
@@ -1582,6 +1586,11 @@ static int bcl_probe(struct platform_device *pdev)
			bcl_type[BCL_IAVAIL_MONITOR_TYPE]);
	bcl->bcl_poll_interval_msec = BCL_POLL_INTERVAL;

	if (of_property_read_bool(pdev->dev.of_node, "qcom,bcl-no-bms"))
		bcl->bcl_no_bms = true;
	else
		bcl->bcl_no_bms = false;

	core_phandle = of_parse_phandle(pdev->dev.of_node,
			"qcom,bcl-hotplug-list", i++);
	while (core_phandle) {