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

Commit 83b80e73 authored by David Collins's avatar David Collins Committed by Gerrit - the friendly Code Review server
Browse files

regulator: qcom_pm8008: allow multiple PM8008 instances with unique names



Change the qcom_pm8008-regulator "regulator-name" device tree
property parsing procedure from an exact match to a substring
match.  This allows multiple PM8008 chips to be used on a given
board which have unique names specified for their respective
regulators.

Change-Id: I519107431148cdf1882d8e50056f2d2e20ce018f
Signed-off-by: default avatarDavid Collins <collinsd@codeaurora.org>
parent 3686a15a
Loading
Loading
Loading
Loading
+10 −10
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/* Copyright (c) 2019-2020, The Linux Foundation. All rights reserved. */
/* Copyright (c) 2019-2021, The Linux Foundation. All rights reserved. */

#define pr_fmt(fmt) "PM8008: %s: " fmt, __func__

@@ -98,15 +98,15 @@ struct pm8008_regulator {
	bool			enable_ocp_broadcast;
};

static struct regulator_data reg_data[] = {
static struct regulator_data reg_data[PM8008_MAX_LDO] = {
			/* name,        parent,  min load, headroom */
			{"pm8008_l1", "vdd_l1_l2", 10000, 225000},
			{"pm8008_l2", "vdd_l1_l2", 10000, 225000},
			{"pm8008_l3", "vdd_l3_l4", 10000, 200000},
			{"pm8008_l4", "vdd_l3_l4", 10000, 200000},
			{"pm8008_l5", "vdd_l5", 10000, 300000},
			{"pm8008_l6", "vdd_l6", 10000, 300000},
			{"pm8008_l7", "vdd_l7", 10000, 300000},
			{"l1", "vdd_l1_l2", 10000, 225000},
			{"l2", "vdd_l1_l2", 10000, 225000},
			{"l3", "vdd_l3_l4", 10000, 200000},
			{"l4", "vdd_l3_l4", 10000, 200000},
			{"l5", "vdd_l5", 10000, 300000},
			{"l6", "vdd_l6", 10000, 300000},
			{"l7", "vdd_l7", 10000, 300000},
};

/* common functions */
@@ -573,7 +573,7 @@ static int pm8008_register_ldo(struct pm8008_regulator *pm8008_reg,

	/* get regulator data */
	for (i = 0; i < PM8008_MAX_LDO; i++)
		if (!strcmp(reg_data[i].name, name))
		if (strstr(name, reg_data[i].name))
			break;

	if (i == PM8008_MAX_LDO) {