Skip to contentSkip to conversation

regulator: mt6358: Remove bogus regulators and improvements

PATCH RESEND Superseded Chen-Yu Tsai 4 participants 16 messages Jul 21, 2023 – Jul 24, 2023

Subsystems (4)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

v2 cover regulator: mt6358: Remove bogus regulators and improvements

(Resending with Lee added to recipients)

Hi,

This is v2 of the remainder of the MT6358 regulator driver cleanup and improvement series. v1 can be found here [1].

Changes since v1:
- Merged patches dropped
- Added patch to move VCN33 regulator status sync after ID check
- Added patch to fix VCN33 sync fail error message
- Added patch to add missing register definitions

Various discrepancies were found while preparing to upstream MT8186 device trees, which utilize the MT6366 PMIC, that is also covered by this driver.

Patch 1 should either go through the mfd tree and an immutable branch created for the regulator tree to consume, or given an Ack, merged directly through the regulator tree.

Spoiler: a follow-up series dealing with the MT6366 PMIC, which is covered by the same driver, also has an mfd header patch that would need the same treatment.

Patches 2~6 should go through the regulator tree, and patch 7 through the soc tree. Patches 2 and 3 should be merged as fixes for v6.5, as the commit they fix was just introduced in -rc1.

Patches 5 and 6 depends on "[v3] regulator: Use bitfield values for range selectors" [2] I sent out earlier.

This v2 series can be seen as three parts. v1 also had three parts, but one part was fully merged, and then v2 gained another cleanup.

Part 1 - Fixing bogus regulators (patches 2, 3, and 7)

There are some regulators listed in the bindings and driver that have no corresponding pin on the actual hardware. MediaTek says these are a hardware construct for shared control of the same regulator in the VCN33 case and an alternative control scheme for low power suspend.

In the VCN33 case, there's only one actual regulator, so we merge the two and rename them to match the hardware pin. No existing devices use these AFAICT, so this should be safe to change.

The driver changes for this part have been merged, but two review comments were not accounted for. They are addressed here with two new patches

Part 2 - Robust chip ID checking (patch 4)

Angelo suggested making the driver fail to probe if an unexpected chip ID was found. Patch 4 implements this.

Part 3 - Output voltage fine tuning support (patches 1, 5, and 6)

Many of the LDOs on these PMIC support an extra level of output voltage fine tuning. Most default to no offset, but a couple have a non-zero offset by default. Previously this was unaccounted for in the driver and device tree constraints. On the outputs with non-zero offset, this ends up becoming a discrepancy between the device tree and actual hardware. These two patches adds support for this second level of tuning, modeled as bunch of linear ranges. While it's unlikely we need this level of control, it's nice to be able to read back the accurate hardware settings.

Please have a look. After this series is done I'll send out patches for the MT6366 PMIC, which is what started this. That will also include updated YAML bindings for MT6366. I think we can merge MT6358 bindings into them afterwards.

Thanks
ChenYu

[1] https://lore.kernel.org/linux-arm-kernel/[email protected]/
[2] https://lore.kernel.org/linux-arm-kernel/[email protected]/

Chen-Yu Tsai (7):
mfd: mt6358: Add missing registers for LDO voltage calibration
regulator: mt6358: Sync VCN33_* enable status after checking ID
regulator: mt6358: Fix incorrect VCN33 sync error message
regulator: mt6358: Fail probe on unknown chip ID
regulator: mt6358: Add output voltage fine tuning to fixed regulators
regulator: mt6358: Add output voltage fine tuning to variable LDOs
arm64: dts: mediatek: mt6358: Merge ldo_vcn33_* regulators

 arch/arm64/boot/dts/mediatek/mt6358.dtsi |  11 +-
 drivers/regulator/mt6358-regulator.c     | 314 +++++++++++------------
 include/linux/mfd/mt6358/registers.h     |   6 +
 3 files changed, 151 insertions(+), 180 deletions(-)
Signature · 1 line
2.41.0.487.g6d72f3e995-goog
#1 lore raw

PATCH RESEND v2 1/7 mfd: mt6358: Add missing registers for LDO voltage calibration

Most of the LDOs, except the "VSRAM_*" ones, on the MT6358 and MT6366 PMICs support a finer output voltage calibration within the range of +0 mV to +100 mV with 10 mV step. Some of the registers for this function are missing from the register table.

Add the missing ones for MT6358.

---
 include/linux/mfd/mt6358/registers.h | 6 ++++++
 1 file changed, 6 insertions(+)
include/linux/mfd/mt6358/registers.h +6 -0
index 3d33517f178c..5ea2590be710 100644
@@ -262,6 +262,12 @@
 #define MT6358_LDO_VBIF28_CON3                0x1db0
 #define MT6358_VCAMA1_ANA_CON0                0x1e08
 #define MT6358_VCAMA2_ANA_CON0                0x1e0c
+#define MT6358_VFE28_ANA_CON0                 0x1e10
+#define MT6358_VCN28_ANA_CON0                 0x1e14
+#define MT6358_VBIF28_ANA_CON0                0x1e18
+#define MT6358_VAUD28_ANA_CON0                0x1e1c
+#define MT6358_VAUX18_ANA_CON0                0x1e20
+#define MT6358_VXO22_ANA_CON0                 0x1e24
 #define MT6358_VCN33_ANA_CON0                 0x1e28
 #define MT6358_VSIM1_ANA_CON0                 0x1e2c
 #define MT6358_VSIM2_ANA_CON0                 0x1e30
Signature · 1 line
2.41.0.487.g6d72f3e995-goog
maintainer Reviewed-by on v2 1/7
#2 lore raw

Re: [PATCH RESEND v2 1/7] mfd: mt6358: Add missing registers for LDO voltage calibration

Il 21/07/23 10:28, Chen-Yu Tsai ha scritto:

Quoted 5 lines

Most of the LDOs, except the "VSRAM_*" ones, on the MT6358 and MT6366 PMICs support a finer output voltage calibration within the range of +0 mV to +100 mV with 10 mV step. Some of the registers for this function are missing from the register table.

Please mention that you're doing this addition *because* you're using those new definitions right after, and in the regulator driver:

[...]
In preparation for adding support for improved output voltage selection in mt6358-regulator, add the relevant missing registers for the same. [...]

After which,

Quoted 24 lines

Add the missing ones for MT6358.

---
  include/linux/mfd/mt6358/registers.h | 6 ++++++
  1 file changed, 6 insertions(+)
include/linux/mfd/mt6358/registers.h +6 -0
index 3d33517f178c..5ea2590be710 100644
@@ -262,6 +262,12 @@
  #define MT6358_LDO_VBIF28_CON3                0x1db0
  #define MT6358_VCAMA1_ANA_CON0                0x1e08
  #define MT6358_VCAMA2_ANA_CON0                0x1e0c
+#define MT6358_VFE28_ANA_CON0                 0x1e10
+#define MT6358_VCN28_ANA_CON0                 0x1e14
+#define MT6358_VBIF28_ANA_CON0                0x1e18
+#define MT6358_VAUD28_ANA_CON0                0x1e1c
+#define MT6358_VAUX18_ANA_CON0                0x1e20
+#define MT6358_VXO22_ANA_CON0                 0x1e24
  #define MT6358_VCN33_ANA_CON0                 0x1e28
  #define MT6358_VSIM1_ANA_CON0                 0x1e2c
  #define MT6358_VSIM2_ANA_CON0                 0x1e30
#3 lore raw

PATCH RESEND v2 2/7 regulator: mt6358: Sync VCN33_* enable status after checking ID

In reply to Chen-Yu Tsai

Syncing VCN33_* enable status should be done after checking the PMIC's ID, to avoid setting random bits on other PMICs.

Fixes 65bae54e08c1 ("regulator: mt6358: Merge VCN33_* regulators")
---
 drivers/regulator/mt6358-regulator.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/regulator/mt6358-regulator.c +4 -4
index 31a16fb28ecd..da6b40f947c4 100644
@@ -676,10 +676,6 @@ static int mt6358_regulator_probe(struct platform_device *pdev)
 	const struct mt6358_regulator_info *mt6358_info;
 	int i, max_regulator, ret;
 
-	ret = mt6358_sync_vcn33_setting(&pdev->dev);
-	if (ret)
-		return ret;
-
 	if (mt6397->chip_id == MT6366_CHIP_ID) {
 		max_regulator = MT6366_MAX_REGULATOR;
 		mt6358_info = mt6366_regulators;
@@ -688,6 +684,10 @@ static int mt6358_regulator_probe(struct platform_device *pdev)
 		mt6358_info = mt6358_regulators;
 	}
 
+	ret = mt6358_sync_vcn33_setting(&pdev->dev);
+	if (ret)
+		return ret;
+
 	for (i = 0; i < max_regulator; i++) {
 		config.dev = &pdev->dev;
 		config.regmap = mt6397->regmap;
Signature · 1 line
2.41.0.487.g6d72f3e995-goog
maintainer Reviewed-by on v2 2/7
#4 lore raw

Re: [PATCH RESEND v2 2/7] regulator: mt6358: Sync VCN33_* enable status after checking ID

Il 21/07/23 10:28, Chen-Yu Tsai ha scritto:

Quoted 6 lines

Syncing VCN33_* enable status should be done after checking the PMIC's ID, to avoid setting random bits on other PMICs.

Fixes 65bae54e08c1 ("regulator: mt6358: Merge VCN33_* regulators")
#5 lore raw

PATCH RESEND v2 3/7 regulator: mt6358: Fix incorrect VCN33 sync error message

In reply to Chen-Yu Tsai

After syncing the enable status of VCN33_WIFI to VCN33_BT, the driver will disable VCN33_WIFI. If it fails it will error out with a message. However the error message incorrectly refers to VCN33_BT.

Fix the error message so that it correctly refers to VCN33_WIFI.

Fixes 65bae54e08c1 ("regulator: mt6358: Merge VCN33_* regulators")
---
 drivers/regulator/mt6358-regulator.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/regulator/mt6358-regulator.c +1 -1
index da6b40f947c4..b9cda2210c33 100644
@@ -661,7 +661,7 @@ static int mt6358_sync_vcn33_setting(struct device *dev)
 	/* Disable VCN33_WIFI */
 	ret = regmap_update_bits(mt6397->regmap, MT6358_LDO_VCN33_CON0_1, BIT(0), 0);
 	if (ret) {
-		dev_err(dev, "Failed to disable VCN33_BT\n");
+		dev_err(dev, "Failed to disable VCN33_WIFI\n");
 		return ret;
 	}
 
Signature · 1 line
2.41.0.487.g6d72f3e995-goog
maintainer Reviewed-by on v2 3/7
#6 lore raw

Re: [PATCH RESEND v2 3/7] regulator: mt6358: Fix incorrect VCN33 sync error message

Il 21/07/23 10:28, Chen-Yu Tsai ha scritto:

Quoted 9 lines

After syncing the enable status of VCN33_WIFI to VCN33_BT, the driver will disable VCN33_WIFI. If it fails it will error out with a message. However the error message incorrectly refers to VCN33_BT.

Fix the error message so that it correctly refers to VCN33_WIFI.

Fixes 65bae54e08c1 ("regulator: mt6358: Merge VCN33_* regulators")
#7 lore raw

PATCH RESEND v2 4/7 regulator: mt6358: Fail probe on unknown chip ID

In reply to Chen-Yu Tsai

The MT6358 and MT6366 PMICs, and likely many others from MediaTek, have a chip ID register, making the chip semi-discoverable.

The driver currently supports two PMICs and expects to be probed on one or the other. It does not account for incorrect mfd driver entries or device trees. While these should not happen, if they do, it could be catastrophic for the device. The driver should be sure the hardware is what it expects.

Make the driver fail to probe if the chip ID presented is not a known one.

Fixes f0e3c6261af1 ("regulator: mt6366: Add support for MT6366 regulator")
---
 drivers/regulator/mt6358-regulator.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)
drivers/regulator/mt6358-regulator.c +10 -4
index b9cda2210c33..a1eae45f5fee 100644
@@ -676,12 +676,18 @@ static int mt6358_regulator_probe(struct platform_device *pdev)
 	const struct mt6358_regulator_info *mt6358_info;
 	int i, max_regulator, ret;
 
-	if (mt6397->chip_id == MT6366_CHIP_ID) {
-		max_regulator = MT6366_MAX_REGULATOR;
-		mt6358_info = mt6366_regulators;
-	} else {
+	switch (mt6397->chip_id) {
+	case MT6358_CHIP_ID:
 		max_regulator = MT6358_MAX_REGULATOR;
 		mt6358_info = mt6358_regulators;
+		break;
+	case MT6366_CHIP_ID:
+		max_regulator = MT6366_MAX_REGULATOR;
+		mt6358_info = mt6366_regulators;
+		break;
+	default:
+		dev_err(&pdev->dev, "unsupported chip ID: %d\n", mt6397->chip_id);
+		return -EINVAL;
 	}
 
 	ret = mt6358_sync_vcn33_setting(&pdev->dev);
Signature · 1 line
2.41.0.487.g6d72f3e995-goog
maintainer Reviewed-by on v2 4/7
#8 lore raw

Re: [PATCH RESEND v2 4/7] regulator: mt6358: Fail probe on unknown chip ID

Il 21/07/23 10:28, Chen-Yu Tsai ha scritto:

Quoted 9 lines

The MT6358 and MT6366 PMICs, and likely many others from MediaTek, have a chip ID register, making the chip semi-discoverable.

The driver currently supports two PMICs and expects to be probed on one or the other. It does not account for incorrect mfd driver entries or device trees. While these should not happen, if they do, it could be catastrophic for the device. The driver should be sure the hardware is what it expects.

Quoted 6 lines

Make the driver fail to probe if the chip ID presented is not a known one.

Fixes f0e3c6261af1 ("regulator: mt6366: Add support for MT6366 regulator")
#9 lore raw

PATCH RESEND v2 5/7 regulator: mt6358: Add output voltage fine tuning to fixed regulators

In reply to Chen-Yu Tsai

The "fixed" LDO regulators found on the MT6358 and MT6366 PMICs have either no voltage selection register, or only one valid setting. However these do have a fine voltage calibration setting that can slightly boost the output voltage from 0 mV to 100 mV, in 10 mV increments.

Add support for this by changing these into linear range regulators.

---
 drivers/regulator/mt6358-regulator.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)
drivers/regulator/mt6358-regulator.c +13 -2
index a1eae45f5fee..b34ad85db771 100644
@@ -123,10 +123,13 @@ struct mt6358_regulator_info {
 		.type = REGULATOR_VOLTAGE,	\
 		.id = MT6358_ID_##vreg,	\
 		.owner = THIS_MODULE,	\
-		.n_voltages = 1,	\
+		.n_voltages = 11,	\
+		.vsel_reg = MT6358_##vreg##_ANA_CON0,	\
+		.vsel_mask = GENMASK(3, 0),	\
 		.enable_reg = enreg,	\
 		.enable_mask = BIT(enbit),	\
 		.min_uV = volt,	\
+		.uV_step = 10000, \
 	},	\
 	.status_reg = MT6358_LDO_##vreg##_CON1,	\
 	.qi = BIT(15),							\
@@ -219,10 +222,13 @@ struct mt6358_regulator_info {
 		.type = REGULATOR_VOLTAGE,	\
 		.id = MT6366_ID_##vreg,	\
 		.owner = THIS_MODULE,	\
-		.n_voltages = 1,	\
+		.n_voltages = 11,	\
+		.vsel_reg = MT6358_##vreg##_ANA_CON0,	\
+		.vsel_mask = GENMASK(3, 0),	\
 		.enable_reg = enreg,	\
 		.enable_mask = BIT(enbit),	\
 		.min_uV = volt,	\
+		.uV_step = 10000, \
 	},	\
 	.status_reg = MT6358_LDO_##vreg##_CON1,	\
 	.qi = BIT(15),							\
@@ -476,8 +482,13 @@ static const struct regulator_ops mt6358_volt_table_ops = {
 	.get_status = mt6358_get_status,
 };
 
+/* "Fixed" LDOs with output voltage calibration +0 ~ +10 mV */
 static const struct regulator_ops mt6358_volt_fixed_ops = {
 	.list_voltage = regulator_list_voltage_linear,
+	.map_voltage = regulator_map_voltage_linear,
+	.set_voltage_sel = regulator_set_voltage_sel_regmap,
+	.get_voltage_sel = mt6358_get_buck_voltage_sel,
+	.set_voltage_time_sel = regulator_set_voltage_time_sel,
 	.enable = regulator_enable_regmap,
 	.disable = regulator_disable_regmap,
 	.is_enabled = regulator_is_enabled_regmap,
Signature · 1 line
2.41.0.487.g6d72f3e995-goog
#10 lore raw

PATCH RESEND v2 6/7 regulator: mt6358: Add output voltage fine tuning to variable LDOs

In reply to Chen-Yu Tsai

Some of the LDO regulators in the MT6358/MT6366 have sparsely populated voltage tables, supported by custom get/set operators. While it works, it requires more code and an extra field to store the lookup table. These LDOs also have fine voltage calibration settings that can slightly boost the output voltage from 0 mV to 100 mV, in 10 mV increments.

These combined could be modeled as a pickable set of linear ranges. The coarse voltage setting is modeled as the range selector, while each range has 11 selectors, starting from the range's base voltage, up to +100 mV, in 10mV increments.

---
 drivers/regulator/mt6358-regulator.c | 275 +++++++++++----------------
 1 file changed, 115 insertions(+), 160 deletions(-)
drivers/regulator/mt6358-regulator.c +115 -160
index b34ad85db771..43cb837a6203 100644
@@ -26,8 +26,6 @@ struct mt6358_regulator_info {
 	struct regulator_desc desc;
 	u32 status_reg;
 	u32 qi;
-	const u32 *index_table;
-	unsigned int n_table;
 	u32 da_vsel_reg;
 	u32 da_vsel_mask;
 	u32 modeset_reg;
@@ -64,9 +62,7 @@ struct mt6358_regulator_info {
 	.modeset_mask = BIT(_modeset_shift),	\
 }
 
-#define MT6358_LDO(match, vreg, ldo_volt_table,	\
-	ldo_index_table, enreg, enbit, vosel,	\
-	vosel_mask)	\
+#define MT6358_LDO(match, vreg, volt_ranges, enreg, enbit, vosel, vosel_mask) \
 [MT6358_ID_##vreg] = {	\
 	.desc = {	\
 		.name = #vreg,	\
@@ -75,17 +71,19 @@ struct mt6358_regulator_info {
 		.type = REGULATOR_VOLTAGE,	\
 		.id = MT6358_ID_##vreg,	\
 		.owner = THIS_MODULE,	\
-		.n_voltages = ARRAY_SIZE(ldo_volt_table),	\
-		.volt_table = ldo_volt_table,	\
-		.vsel_reg = vosel,	\
-		.vsel_mask = vosel_mask,	\
+		.n_voltages = ARRAY_SIZE(volt_ranges##_ranges) * 11,	\
+		.linear_ranges = volt_ranges##_ranges,		\
+		.linear_range_selectors_bitfield = volt_ranges##_selectors,	\
+		.n_linear_ranges = ARRAY_SIZE(volt_ranges##_ranges),	\
+		.vsel_range_reg = vosel,	\
+		.vsel_range_mask = vosel_mask,	\
+		.vsel_reg = MT6358_##vreg##_ANA_CON0,	\
+		.vsel_mask = GENMASK(3, 0),	\
 		.enable_reg = enreg,	\
 		.enable_mask = BIT(enbit),	\
 	},	\
 	.status_reg = MT6358_LDO_##vreg##_CON1,	\
 	.qi = BIT(15),	\
-	.index_table = ldo_index_table,	\
-	.n_table = ARRAY_SIZE(ldo_index_table),	\
 }
 
 #define MT6358_LDO1(match, vreg, min, max, step,	\
@@ -163,9 +161,7 @@ struct mt6358_regulator_info {
 	.modeset_mask = BIT(_modeset_shift),	\
 }
 
-#define MT6366_LDO(match, vreg, ldo_volt_table,	\
-	ldo_index_table, enreg, enbit, vosel,	\
-	vosel_mask)	\
+#define MT6366_LDO(match, vreg, volt_ranges, enreg, enbit, vosel, vosel_mask) \
 [MT6366_ID_##vreg] = {	\
 	.desc = {	\
 		.name = #vreg,	\
@@ -174,17 +170,19 @@ struct mt6358_regulator_info {
 		.type = REGULATOR_VOLTAGE,	\
 		.id = MT6366_ID_##vreg,	\
 		.owner = THIS_MODULE,	\
-		.n_voltages = ARRAY_SIZE(ldo_volt_table),	\
-		.volt_table = ldo_volt_table,	\
-		.vsel_reg = vosel,	\
-		.vsel_mask = vosel_mask,	\
+		.n_voltages = ARRAY_SIZE(volt_ranges##_ranges) * 11,	\
+		.linear_ranges = volt_ranges##_ranges,		\
+		.linear_range_selectors_bitfield = volt_ranges##_selectors,	\
+		.n_linear_ranges = ARRAY_SIZE(volt_ranges##_ranges),	\
+		.vsel_range_reg = vosel,	\
+		.vsel_range_mask = vosel_mask,	\
+		.vsel_reg = MT6358_##vreg##_ANA_CON0,	\
+		.vsel_mask = GENMASK(3, 0),	\
 		.enable_reg = enreg,	\
 		.enable_mask = BIT(enbit),	\
 	},	\
 	.status_reg = MT6358_LDO_##vreg##_CON1,	\
 	.qi = BIT(15),	\
-	.index_table = ldo_index_table,	\
-	.n_table = ARRAY_SIZE(ldo_index_table),	\
 }
 
 #define MT6366_LDO1(match, vreg, min, max, step,	\
@@ -235,95 +233,95 @@ struct mt6358_regulator_info {
 }
 
 
-static const unsigned int vdram2_voltages[] = {
-	600000, 1800000,
-};
-
-static const unsigned int vsim_voltages[] = {
-	1700000, 1800000, 2700000, 3000000, 3100000,
-};
-
-static const unsigned int vibr_voltages[] = {
-	1200000, 1300000, 1500000, 1800000,
-	2000000, 2800000, 3000000, 3300000,
+/* VDRAM2 voltage selector not shown in datasheet */
+static const unsigned int vdram2_selectors[] = { 0, 12 };
+static const struct linear_range vdram2_ranges[] = {
+	REGULATOR_LINEAR_RANGE(600000, 0, 10, 10000),
+	REGULATOR_LINEAR_RANGE(1800000, 11, 21, 10000),
 };
 
-static const unsigned int vusb_voltages[] = {
-	3000000, 3100000,
+static const unsigned int vsim_selectors[] = { 3, 4, 8, 11, 12 };
+static const struct linear_range vsim_ranges[] = {
+	REGULATOR_LINEAR_RANGE(1700000, 0, 10, 10000),
+	REGULATOR_LINEAR_RANGE(1800000, 11, 21, 10000),
+	REGULATOR_LINEAR_RANGE(2700000, 22, 32, 10000),
+	REGULATOR_LINEAR_RANGE(3000000, 33, 43, 10000),
+	REGULATOR_LINEAR_RANGE(3100000, 44, 54, 10000),
 };
 
-static const unsigned int vcamd_voltages[] = {
-	900000, 1000000, 1100000, 1200000,
-	1300000, 1500000, 1800000,
+static const unsigned int vibr_selectors[] = { 0, 1, 2, 4, 5, 9, 11, 13 };
+static const struct linear_range vibr_ranges[] = {
+	REGULATOR_LINEAR_RANGE(1200000, 0, 10, 10000),
+	REGULATOR_LINEAR_RANGE(1300000, 11, 21, 10000),
+	REGULATOR_LINEAR_RANGE(1500000, 22, 32, 10000),
+	REGULATOR_LINEAR_RANGE(1800000, 33, 43, 10000),
+	REGULATOR_LINEAR_RANGE(2000000, 44, 54, 10000),
+	REGULATOR_LINEAR_RANGE(2800000, 55, 65, 10000),
+	REGULATOR_LINEAR_RANGE(3000000, 66, 76, 10000),
+	REGULATOR_LINEAR_RANGE(3300000, 77, 87, 10000),
 };
 
-static const unsigned int vefuse_voltages[] = {
-	1700000, 1800000, 1900000,
+/* VUSB voltage selector not shown in datasheet */
+static const unsigned int vusb_selectors[] = { 3, 4 };
+static const struct linear_range vusb_ranges[] = {
+	REGULATOR_LINEAR_RANGE(3000000, 0, 10, 10000),
+	REGULATOR_LINEAR_RANGE(3100000, 11, 21, 10000),
 };
 
-static const unsigned int vmch_vemc_voltages[] = {
-	2900000, 3000000, 3300000,
+static const unsigned int vcamd_selectors[] = { 3, 4, 5, 6, 7, 9, 12 };
+static const struct linear_range vcamd_ranges[] = {
+	REGULATOR_LINEAR_RANGE(900000, 0, 10, 10000),
+	REGULATOR_LINEAR_RANGE(1000000, 11, 21, 10000),
+	REGULATOR_LINEAR_RANGE(1100000, 22, 32, 10000),
+	REGULATOR_LINEAR_RANGE(1200000, 33, 43, 10000),
+	REGULATOR_LINEAR_RANGE(1300000, 44, 54, 10000),
+	REGULATOR_LINEAR_RANGE(1500000, 55, 65, 10000),
+	REGULATOR_LINEAR_RANGE(1800000, 66, 76, 10000),
 };
 
-static const unsigned int vcama_voltages[] = {
-	1800000, 2500000, 2700000,
-	2800000, 2900000, 3000000,
+static const unsigned int vefuse_selectors[] = { 11, 12, 13 };
+static const struct linear_range vefuse_ranges[] = {
+	REGULATOR_LINEAR_RANGE(1700000, 0, 10, 10000),
+	REGULATOR_LINEAR_RANGE(1800000, 11, 21, 10000),
+	REGULATOR_LINEAR_RANGE(1900000, 22, 32, 10000),
 };
 
-static const unsigned int vcn33_voltages[] = {
-	3300000, 3400000, 3500000,
+static const unsigned int vmch_vemc_selectors[] = { 2, 3, 5 };
+static const struct linear_range vmch_vemc_ranges[] = {
+	REGULATOR_LINEAR_RANGE(2900000, 0, 10, 10000),
+	REGULATOR_LINEAR_RANGE(3000000, 11, 21, 10000),
+	REGULATOR_LINEAR_RANGE(3300000, 22, 32, 10000),
 };
 
-static const unsigned int vmc_voltages[] = {
-	1800000, 2900000, 3000000, 3300000,
+static const unsigned int vcama_selectors[] = { 0, 7, 9, 10, 11, 12 };
+static const struct linear_range vcama_ranges[] = {
+	REGULATOR_LINEAR_RANGE(1800000, 0, 10, 10000),
+	REGULATOR_LINEAR_RANGE(2500000, 11, 21, 10000),
+	REGULATOR_LINEAR_RANGE(2700000, 22, 32, 10000),
+	REGULATOR_LINEAR_RANGE(2800000, 33, 43, 10000),
+	REGULATOR_LINEAR_RANGE(2900000, 44, 54, 10000),
+	REGULATOR_LINEAR_RANGE(3000000, 55, 65, 10000),
 };
 
-static const unsigned int vldo28_voltages[] = {
-	2800000, 3000000,
+static const unsigned int vcn33_selectors[] = { 1, 2, 3 };
+static const struct linear_range vcn33_ranges[] = {
+	REGULATOR_LINEAR_RANGE(3300000, 0, 10, 10000),
+	REGULATOR_LINEAR_RANGE(3400000, 11, 21, 10000),
+	REGULATOR_LINEAR_RANGE(3500000, 22, 32, 10000),
 };
 
-static const u32 vdram2_idx[] = {
-	0, 12,
+static const unsigned int vmc_selectors[] = { 4, 10, 11, 13 };
+static const struct linear_range vmc_ranges[] = {
+	REGULATOR_LINEAR_RANGE(1800000, 0, 10, 10000),
+	REGULATOR_LINEAR_RANGE(2900000, 11, 21, 10000),
+	REGULATOR_LINEAR_RANGE(3000000, 22, 32, 10000),
+	REGULATOR_LINEAR_RANGE(3300000, 33, 43, 10000),
 };
 
-static const u32 vsim_idx[] = {
-	3, 4, 8, 11, 12,
-};
-
-static const u32 vibr_idx[] = {
-	0, 1, 2, 4, 5, 9, 11, 13,
-};
-
-static const u32 vusb_idx[] = {
-	3, 4,
-};
-
-static const u32 vcamd_idx[] = {
-	3, 4, 5, 6, 7, 9, 12,
-};
-
-static const u32 vefuse_idx[] = {
-	11, 12, 13,
-};
-
-static const u32 vmch_vemc_idx[] = {
-	2, 3, 5,
-};
-
-static const u32 vcama_idx[] = {
-	0, 7, 9, 10, 11, 12,
-};
-
-static const u32 vcn33_idx[] = {
-	1, 2, 3,
-};
-
-static const u32 vmc_idx[] = {
-	4, 10, 11, 13,
-};
-
-static const u32 vldo28_idx[] = {
-	1, 3,
+static const unsigned int vldo28_selectors[] = { 1, 3 };
+static const struct linear_range vldo28_ranges[] = {
+	REGULATOR_LINEAR_RANGE(2800000, 0, 10, 10000),
+	REGULATOR_LINEAR_RANGE(3000000, 11, 21, 10000),
 };
 
 static unsigned int mt6358_map_mode(unsigned int mode)
@@ -332,49 +330,6 @@ static unsigned int mt6358_map_mode(unsigned int mode)
 		REGULATOR_MODE_NORMAL : REGULATOR_MODE_FAST;
 }
 
-static int mt6358_set_voltage_sel(struct regulator_dev *rdev,
-				  unsigned int selector)
-{
-	const struct mt6358_regulator_info *info = to_regulator_info(rdev->desc);
-	int idx, ret;
-	const u32 *pvol;
-
-	pvol = info->index_table;
-
-	idx = pvol[selector];
-	idx <<= ffs(info->desc.vsel_mask) - 1;
-	ret = regmap_update_bits(rdev->regmap, info->desc.vsel_reg,
-				 info->desc.vsel_mask, idx);
-
-	return ret;
-}
-
-static int mt6358_get_voltage_sel(struct regulator_dev *rdev)
-{
-	const struct mt6358_regulator_info *info = to_regulator_info(rdev->desc);
-	int idx, ret;
-	u32 selector;
-	const u32 *pvol;
-
-	ret = regmap_read(rdev->regmap, info->desc.vsel_reg, &selector);
-	if (ret != 0) {
-		dev_info(&rdev->dev,
-			 "Failed to get mt6358 %s vsel reg: %d\n",
-			 info->desc.name, ret);
-		return ret;
-	}
-
-	selector = (selector & info->desc.vsel_mask) >>
-			(ffs(info->desc.vsel_mask) - 1);
-	pvol = info->index_table;
-	for (idx = 0; idx < info->desc.n_voltages; idx++) {
-		if (pvol[idx] == selector)
-			return idx;
-	}
-
-	return -EINVAL;
-}
-
 static int mt6358_get_buck_voltage_sel(struct regulator_dev *rdev)
 {
 	const struct mt6358_regulator_info *info = to_regulator_info(rdev->desc);
@@ -471,10 +426,10 @@ static const struct regulator_ops mt6358_volt_range_ops = {
 };
 
 static const struct regulator_ops mt6358_volt_table_ops = {
-	.list_voltage = regulator_list_voltage_table,
-	.map_voltage = regulator_map_voltage_iterate,
-	.set_voltage_sel = mt6358_set_voltage_sel,
-	.get_voltage_sel = mt6358_get_voltage_sel,
+	.list_voltage = regulator_list_voltage_pickable_linear_range,
+	.map_voltage = regulator_map_voltage_pickable_linear_range,
+	.set_voltage_sel = regulator_set_voltage_sel_pickable_regmap,
+	.get_voltage_sel = regulator_get_voltage_sel_pickable_regmap,
 	.set_voltage_time_sel = regulator_set_voltage_time_sel,
 	.enable = regulator_enable_regmap,
 	.disable = regulator_disable_regmap,
@@ -534,34 +489,34 @@ static const struct mt6358_regulator_info mt6358_regulators[] = {
 	MT6358_REG_FIXED("ldo_vrf18", VRF18, MT6358_LDO_VRF18_CON0, 0, 1800000),
 	MT6358_REG_FIXED("ldo_vaud28", VAUD28,
 			 MT6358_LDO_VAUD28_CON0, 0, 2800000),
-	MT6358_LDO("ldo_vdram2", VDRAM2, vdram2_voltages, vdram2_idx,
+	MT6358_LDO("ldo_vdram2", VDRAM2, vdram2,
 		   MT6358_LDO_VDRAM2_CON0, 0, MT6358_LDO_VDRAM2_ELR0, 0xf),
-	MT6358_LDO("ldo_vsim1", VSIM1, vsim_voltages, vsim_idx,
+	MT6358_LDO("ldo_vsim1", VSIM1, vsim,
 		   MT6358_LDO_VSIM1_CON0, 0, MT6358_VSIM1_ANA_CON0, 0xf00),
-	MT6358_LDO("ldo_vibr", VIBR, vibr_voltages, vibr_idx,
+	MT6358_LDO("ldo_vibr", VIBR, vibr,
 		   MT6358_LDO_VIBR_CON0, 0, MT6358_VIBR_ANA_CON0, 0xf00),
-	MT6358_LDO("ldo_vusb", VUSB, vusb_voltages, vusb_idx,
+	MT6358_LDO("ldo_vusb", VUSB, vusb,
 		   MT6358_LDO_VUSB_CON0_0, 0, MT6358_VUSB_ANA_CON0, 0x700),
-	MT6358_LDO("ldo_vcamd", VCAMD, vcamd_voltages, vcamd_idx,
+	MT6358_LDO("ldo_vcamd", VCAMD, vcamd,
 		   MT6358_LDO_VCAMD_CON0, 0, MT6358_VCAMD_ANA_CON0, 0xf00),
-	MT6358_LDO("ldo_vefuse", VEFUSE, vefuse_voltages, vefuse_idx,
+	MT6358_LDO("ldo_vefuse", VEFUSE, vefuse,
 		   MT6358_LDO_VEFUSE_CON0, 0, MT6358_VEFUSE_ANA_CON0, 0xf00),
-	MT6358_LDO("ldo_vmch", VMCH, vmch_vemc_voltages, vmch_vemc_idx,
+	MT6358_LDO("ldo_vmch", VMCH, vmch_vemc,
 		   MT6358_LDO_VMCH_CON0, 0, MT6358_VMCH_ANA_CON0, 0x700),
-	MT6358_LDO("ldo_vcama1", VCAMA1, vcama_voltages, vcama_idx,
+	MT6358_LDO("ldo_vcama1", VCAMA1, vcama,
 		   MT6358_LDO_VCAMA1_CON0, 0, MT6358_VCAMA1_ANA_CON0, 0xf00),
-	MT6358_LDO("ldo_vemc", VEMC, vmch_vemc_voltages, vmch_vemc_idx,
+	MT6358_LDO("ldo_vemc", VEMC, vmch_vemc,
 		   MT6358_LDO_VEMC_CON0, 0, MT6358_VEMC_ANA_CON0, 0x700),
-	MT6358_LDO("ldo_vcn33", VCN33, vcn33_voltages, vcn33_idx,
+	MT6358_LDO("ldo_vcn33", VCN33, vcn33,
 		   MT6358_LDO_VCN33_CON0_0, 0, MT6358_VCN33_ANA_CON0, 0x300),
-	MT6358_LDO("ldo_vcama2", VCAMA2, vcama_voltages, vcama_idx,
+	MT6358_LDO("ldo_vcama2", VCAMA2, vcama,
 		   MT6358_LDO_VCAMA2_CON0, 0, MT6358_VCAMA2_ANA_CON0, 0xf00),
-	MT6358_LDO("ldo_vmc", VMC, vmc_voltages, vmc_idx,
+	MT6358_LDO("ldo_vmc", VMC, vmc,
 		   MT6358_LDO_VMC_CON0, 0, MT6358_VMC_ANA_CON0, 0xf00),
-	MT6358_LDO("ldo_vldo28", VLDO28, vldo28_voltages, vldo28_idx,
+	MT6358_LDO("ldo_vldo28", VLDO28, vldo28,
 		   MT6358_LDO_VLDO28_CON0_0, 0,
 		   MT6358_VLDO28_ANA_CON0, 0x300),
-	MT6358_LDO("ldo_vsim2", VSIM2, vsim_voltages, vsim_idx,
+	MT6358_LDO("ldo_vsim2", VSIM2, vsim,
 		   MT6358_LDO_VSIM2_CON0, 0, MT6358_VSIM2_ANA_CON0, 0xf00),
 	MT6358_LDO1("ldo_vsram_proc11", VSRAM_PROC11, 500000, 1293750, 6250,
 		    MT6358_LDO_VSRAM_PROC11_DBG0, 0x7f00, MT6358_LDO_VSRAM_CON0, 0x7f),
@@ -610,25 +565,25 @@ static const struct mt6358_regulator_info mt6366_regulators[] = {
 	MT6366_REG_FIXED("ldo_vrf18", VRF18, MT6358_LDO_VRF18_CON0, 0, 1800000),
 	MT6366_REG_FIXED("ldo_vaud28", VAUD28,
 			 MT6358_LDO_VAUD28_CON0, 0, 2800000),
-	MT6366_LDO("ldo_vdram2", VDRAM2, vdram2_voltages, vdram2_idx,
+	MT6366_LDO("ldo_vdram2", VDRAM2, vdram2,
 		   MT6358_LDO_VDRAM2_CON0, 0, MT6358_LDO_VDRAM2_ELR0, 0x10),
-	MT6366_LDO("ldo_vsim1", VSIM1, vsim_voltages, vsim_idx,
+	MT6366_LDO("ldo_vsim1", VSIM1, vsim,
 		   MT6358_LDO_VSIM1_CON0, 0, MT6358_VSIM1_ANA_CON0, 0xf00),
-	MT6366_LDO("ldo_vibr", VIBR, vibr_voltages, vibr_idx,
+	MT6366_LDO("ldo_vibr", VIBR, vibr,
 		   MT6358_LDO_VIBR_CON0, 0, MT6358_VIBR_ANA_CON0, 0xf00),
-	MT6366_LDO("ldo_vusb", VUSB, vusb_voltages, vusb_idx,
+	MT6366_LDO("ldo_vusb", VUSB, vusb,
 		   MT6358_LDO_VUSB_CON0_0, 0, MT6358_VUSB_ANA_CON0, 0x700),
-	MT6366_LDO("ldo_vefuse", VEFUSE, vefuse_voltages, vefuse_idx,
+	MT6366_LDO("ldo_vefuse", VEFUSE, vefuse,
 		   MT6358_LDO_VEFUSE_CON0, 0, MT6358_VEFUSE_ANA_CON0, 0xf00),
-	MT6366_LDO("ldo_vmch", VMCH, vmch_vemc_voltages, vmch_vemc_idx,
+	MT6366_LDO("ldo_vmch", VMCH, vmch_vemc,
 		   MT6358_LDO_VMCH_CON0, 0, MT6358_VMCH_ANA_CON0, 0x700),
-	MT6366_LDO("ldo_vemc", VEMC, vmch_vemc_voltages, vmch_vemc_idx,
+	MT6366_LDO("ldo_vemc", VEMC, vmch_vemc,
 		   MT6358_LDO_VEMC_CON0, 0, MT6358_VEMC_ANA_CON0, 0x700),
-	MT6366_LDO("ldo_vcn33", VCN33, vcn33_voltages, vcn33_idx,
+	MT6366_LDO("ldo_vcn33", VCN33, vcn33,
 		   MT6358_LDO_VCN33_CON0_0, 0, MT6358_VCN33_ANA_CON0, 0x300),
-	MT6366_LDO("ldo_vmc", VMC, vmc_voltages, vmc_idx,
+	MT6366_LDO("ldo_vmc", VMC, vmc,
 		   MT6358_LDO_VMC_CON0, 0, MT6358_VMC_ANA_CON0, 0xf00),
-	MT6366_LDO("ldo_vsim2", VSIM2, vsim_voltages, vsim_idx,
+	MT6366_LDO("ldo_vsim2", VSIM2, vsim,
 		   MT6358_LDO_VSIM2_CON0, 0, MT6358_VSIM2_ANA_CON0, 0xf00),
 	MT6366_LDO1("ldo_vsram_proc11", VSRAM_PROC11, 500000, 1293750, 6250,
 		    MT6358_LDO_VSRAM_PROC11_DBG0, 0x7f00, MT6358_LDO_VSRAM_CON0, 0x7f),
Signature · 1 line
2.41.0.487.g6d72f3e995-goog
#11 lore raw

Re: [PATCH RESEND v2 6/7] regulator: mt6358: Add output voltage fine tuning to variable LDOs

kernel test robot noticed the following build errors:

Hi Chen-Yu,

kernel test robot noticed the following build errors:

[auto build test ERROR on broonie-regulator/for-next]
[also build test ERROR on lee-mfd/for-mfd-next lee-leds/for-leds-next linus/master v6.5-rc2 next-20230721] [cannot apply to lee-mfd/for-mfd-fixes]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Chen-Yu-Tsai/mfd-mt6358-Add-missing-registers-for-LDO-voltage-calibration/20230721-163236
base:   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-next
patch link:    https://lore.kernel.org/r/20230721082903.2038975-7-wenst%40chromium.org
patch subject: [PATCH RESEND v2 6/7] regulator: mt6358: Add output voltage fine tuning to variable LDOs
config: i386-randconfig-r013-20230720 (https://download.01.org/0day-ci/archive/20230722/[email protected]/config)
compiler: clang version 15.0.7 (https://github.com/llvm/llvm-project.git 8dfdcc7b7bf66834a761bd8de445840ef68e4d1a)
reproduce: (https://download.01.org/0day-ci/archive/20230722/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All errors (new ones prefixed by >>):

>> drivers/regulator/mt6358-regulator.c:492:2: error: field designator 'linear_range_selectors_bitfield' does not refer to any field in type 'struct regulator_desc'; did you mean 'linear_range_selectors'?
           MT6358_LDO("ldo_vdram2", VDRAM2, vdram2,
           ^
   drivers/regulator/mt6358-regulator.c:76:4: note: expanded from macro 'MT6358_LDO'
                   .linear_range_selectors_bitfield = volt_ranges##_selectors,     \
                    ^
   include/linux/regulator/driver.h:387:22: note: 'linear_range_selectors' declared here
           const unsigned int *linear_range_selectors;
                               ^
   drivers/regulator/mt6358-regulator.c:494:2: error: field designator 'linear_range_selectors_bitfield' does not refer to any field in type 'struct regulator_desc'; did you mean 'linear_range_selectors'?
           MT6358_LDO("ldo_vsim1", VSIM1, vsim,
           ^
   drivers/regulator/mt6358-regulator.c:76:4: note: expanded from macro 'MT6358_LDO'
                   .linear_range_selectors_bitfield = volt_ranges##_selectors,     \
                    ^
   include/linux/regulator/driver.h:387:22: note: 'linear_range_selectors' declared here
           const unsigned int *linear_range_selectors;
                               ^
   drivers/regulator/mt6358-regulator.c:496:2: error: field designator 'linear_range_selectors_bitfield' does not refer to any field in type 'struct regulator_desc'; did you mean 'linear_range_selectors'?
           MT6358_LDO("ldo_vibr", VIBR, vibr,
           ^
   drivers/regulator/mt6358-regulator.c:76:4: note: expanded from macro 'MT6358_LDO'
                   .linear_range_selectors_bitfield = volt_ranges##_selectors,     \
                    ^
   include/linux/regulator/driver.h:387:22: note: 'linear_range_selectors' declared here
           const unsigned int *linear_range_selectors;
                               ^
   drivers/regulator/mt6358-regulator.c:498:2: error: field designator 'linear_range_selectors_bitfield' does not refer to any field in type 'struct regulator_desc'; did you mean 'linear_range_selectors'?
           MT6358_LDO("ldo_vusb", VUSB, vusb,
           ^
   drivers/regulator/mt6358-regulator.c:76:4: note: expanded from macro 'MT6358_LDO'
                   .linear_range_selectors_bitfield = volt_ranges##_selectors,     \
                    ^
   include/linux/regulator/driver.h:387:22: note: 'linear_range_selectors' declared here
           const unsigned int *linear_range_selectors;
                               ^
   drivers/regulator/mt6358-regulator.c:500:2: error: field designator 'linear_range_selectors_bitfield' does not refer to any field in type 'struct regulator_desc'; did you mean 'linear_range_selectors'?
           MT6358_LDO("ldo_vcamd", VCAMD, vcamd,
           ^
   drivers/regulator/mt6358-regulator.c:76:4: note: expanded from macro 'MT6358_LDO'
                   .linear_range_selectors_bitfield = volt_ranges##_selectors,     \
                    ^
   include/linux/regulator/driver.h:387:22: note: 'linear_range_selectors' declared here
           const unsigned int *linear_range_selectors;
                               ^
   drivers/regulator/mt6358-regulator.c:502:2: error: field designator 'linear_range_selectors_bitfield' does not refer to any field in type 'struct regulator_desc'; did you mean 'linear_range_selectors'?
           MT6358_LDO("ldo_vefuse", VEFUSE, vefuse,
           ^
   drivers/regulator/mt6358-regulator.c:76:4: note: expanded from macro 'MT6358_LDO'
                   .linear_range_selectors_bitfield = volt_ranges##_selectors,     \
                    ^
   include/linux/regulator/driver.h:387:22: note: 'linear_range_selectors' declared here
           const unsigned int *linear_range_selectors;
                               ^
   drivers/regulator/mt6358-regulator.c:504:2: error: field designator 'linear_range_selectors_bitfield' does not refer to any field in type 'struct regulator_desc'; did you mean 'linear_range_selectors'?
           MT6358_LDO("ldo_vmch", VMCH, vmch_vemc,
           ^
   drivers/regulator/mt6358-regulator.c:76:4: note: expanded from macro 'MT6358_LDO'
                   .linear_range_selectors_bitfield = volt_ranges##_selectors,     \
                    ^
   include/linux/regulator/driver.h:387:22: note: 'linear_range_selectors' declared here
           const unsigned int *linear_range_selectors;
                               ^
   drivers/regulator/mt6358-regulator.c:506:2: error: field designator 'linear_range_selectors_bitfield' does not refer to any field in type 'struct regulator_desc'; did you mean 'linear_range_selectors'?
           MT6358_LDO("ldo_vcama1", VCAMA1, vcama,
           ^
   drivers/regulator/mt6358-regulator.c:76:4: note: expanded from macro 'MT6358_LDO'
                   .linear_range_selectors_bitfield = volt_ranges##_selectors,     \
                    ^
   include/linux/regulator/driver.h:387:22: note: 'linear_range_selectors' declared here
           const unsigned int *linear_range_selectors;
                               ^
   drivers/regulator/mt6358-regulator.c:508:2: error: field designator 'linear_range_selectors_bitfield' does not refer to any field in type 'struct regulator_desc'; did you mean 'linear_range_selectors'?
           MT6358_LDO("ldo_vemc", VEMC, vmch_vemc,
           ^
   drivers/regulator/mt6358-regulator.c:76:4: note: expanded from macro 'MT6358_LDO'
                   .linear_range_selectors_bitfield = volt_ranges##_selectors,     \
                    ^
   include/linux/regulator/driver.h:387:22: note: 'linear_range_selectors' declared here
           const unsigned int *linear_range_selectors;
                               ^
   drivers/regulator/mt6358-regulator.c:510:2: error: field designator 'linear_range_selectors_bitfield' does not refer to any field in type 'struct regulator_desc'; did you mean 'linear_range_selectors'?
           MT6358_LDO("ldo_vcn33", VCN33, vcn33,
           ^
   drivers/regulator/mt6358-regulator.c:76:4: note: expanded from macro 'MT6358_LDO'
                   .linear_range_selectors_bitfield = volt_ranges##_selectors,     \
                    ^
   include/linux/regulator/driver.h:387:22: note: 'linear_range_selectors' declared here
           const unsigned int *linear_range_selectors;
                               ^
   drivers/regulator/mt6358-regulator.c:512:2: error: field designator 'linear_range_selectors_bitfield' does not refer to any field in type 'struct regulator_desc'; did you mean 'linear_range_selectors'?
           MT6358_LDO("ldo_vcama2", VCAMA2, vcama,
           ^
   drivers/regulator/mt6358-regulator.c:76:4: note: expanded from macro 'MT6358_LDO'
                   .linear_range_selectors_bitfield = volt_ranges##_selectors,     \
                    ^
   include/linux/regulator/driver.h:387:22: note: 'linear_range_selectors' declared here
           const unsigned int *linear_range_selectors;
                               ^
   drivers/regulator/mt6358-regulator.c:514:2: error: field designator 'linear_range_selectors_bitfield' does not refer to any field in type 'struct regulator_desc'; did you mean 'linear_range_selectors'?
           MT6358_LDO("ldo_vmc", VMC, vmc,

vim +492 drivers/regulator/mt6358-regulator.c

452
453 /* The array is indexed by id(MT6358_ID_XXX) */
454 static const struct mt6358_regulator_info mt6358_regulators[] = {
455 MT6358_BUCK("buck_vdram1", VDRAM1, 500000, 2087500, 12500,
456 0x7f, MT6358_BUCK_VDRAM1_DBG0, 0x7f, MT6358_VDRAM1_ANA_CON0, 8),
457 MT6358_BUCK("buck_vcore", VCORE, 500000, 1293750, 6250,
458 0x7f, MT6358_BUCK_VCORE_DBG0, 0x7f, MT6358_VCORE_VGPU_ANA_CON0, 1),
459 MT6358_BUCK("buck_vpa", VPA, 500000, 3650000, 50000,
460 0x3f, MT6358_BUCK_VPA_DBG0, 0x3f, MT6358_VPA_ANA_CON0, 3),
461 MT6358_BUCK("buck_vproc11", VPROC11, 500000, 1293750, 6250,
462 0x7f, MT6358_BUCK_VPROC11_DBG0, 0x7f, MT6358_VPROC_ANA_CON0, 1),
463 MT6358_BUCK("buck_vproc12", VPROC12, 500000, 1293750, 6250,
464 0x7f, MT6358_BUCK_VPROC12_DBG0, 0x7f, MT6358_VPROC_ANA_CON0, 2),
465 MT6358_BUCK("buck_vgpu", VGPU, 500000, 1293750, 6250,
466 0x7f, MT6358_BUCK_VGPU_ELR0, 0x7f, MT6358_VCORE_VGPU_ANA_CON0, 2),
467 MT6358_BUCK("buck_vs2", VS2, 500000, 2087500, 12500,
468 0x7f, MT6358_BUCK_VS2_DBG0, 0x7f, MT6358_VS2_ANA_CON0, 8),
469 MT6358_BUCK("buck_vmodem", VMODEM, 500000, 1293750, 6250,
470 0x7f, MT6358_BUCK_VMODEM_DBG0, 0x7f, MT6358_VMODEM_ANA_CON0, 8),
471 MT6358_BUCK("buck_vs1", VS1, 1000000, 2587500, 12500,
472 0x7f, MT6358_BUCK_VS1_DBG0, 0x7f, MT6358_VS1_ANA_CON0, 8),
473 MT6358_REG_FIXED("ldo_vrf12", VRF12,
474 MT6358_LDO_VRF12_CON0, 0, 1200000),
475 MT6358_REG_FIXED("ldo_vio18", VIO18,
476 MT6358_LDO_VIO18_CON0, 0, 1800000),
477 MT6358_REG_FIXED("ldo_vcamio", VCAMIO,
478 MT6358_LDO_VCAMIO_CON0, 0, 1800000),
479 MT6358_REG_FIXED("ldo_vcn18", VCN18, MT6358_LDO_VCN18_CON0, 0, 1800000),
480 MT6358_REG_FIXED("ldo_vfe28", VFE28, MT6358_LDO_VFE28_CON0, 0, 2800000),
481 MT6358_REG_FIXED("ldo_vcn28", VCN28, MT6358_LDO_VCN28_CON0, 0, 2800000),
482 MT6358_REG_FIXED("ldo_vxo22", VXO22, MT6358_LDO_VXO22_CON0, 0, 2200000),
483 MT6358_REG_FIXED("ldo_vaux18", VAUX18,
484 MT6358_LDO_VAUX18_CON0, 0, 1800000),
485 MT6358_REG_FIXED("ldo_vbif28", VBIF28,
486 MT6358_LDO_VBIF28_CON0, 0, 2800000),
487 MT6358_REG_FIXED("ldo_vio28", VIO28, MT6358_LDO_VIO28_CON0, 0, 2800000),
488 MT6358_REG_FIXED("ldo_va12", VA12, MT6358_LDO_VA12_CON0, 0, 1200000),
489 MT6358_REG_FIXED("ldo_vrf18", VRF18, MT6358_LDO_VRF18_CON0, 0, 1800000),
490 MT6358_REG_FIXED("ldo_vaud28", VAUD28,
491 MT6358_LDO_VAUD28_CON0, 0, 2800000),

 > 492		MT6358_LDO("ldo_vdram2", VDRAM2, vdram2,

493 MT6358_LDO_VDRAM2_CON0, 0, MT6358_LDO_VDRAM2_ELR0, 0xf),
494 MT6358_LDO("ldo_vsim1", VSIM1, vsim,
495 MT6358_LDO_VSIM1_CON0, 0, MT6358_VSIM1_ANA_CON0, 0xf00),
496 MT6358_LDO("ldo_vibr", VIBR, vibr,
497 MT6358_LDO_VIBR_CON0, 0, MT6358_VIBR_ANA_CON0, 0xf00),
498 MT6358_LDO("ldo_vusb", VUSB, vusb,
499 MT6358_LDO_VUSB_CON0_0, 0, MT6358_VUSB_ANA_CON0, 0x700),
500 MT6358_LDO("ldo_vcamd", VCAMD, vcamd,
501 MT6358_LDO_VCAMD_CON0, 0, MT6358_VCAMD_ANA_CON0, 0xf00),
502 MT6358_LDO("ldo_vefuse", VEFUSE, vefuse,
503 MT6358_LDO_VEFUSE_CON0, 0, MT6358_VEFUSE_ANA_CON0, 0xf00),
504 MT6358_LDO("ldo_vmch", VMCH, vmch_vemc,
505 MT6358_LDO_VMCH_CON0, 0, MT6358_VMCH_ANA_CON0, 0x700),
506 MT6358_LDO("ldo_vcama1", VCAMA1, vcama,
507 MT6358_LDO_VCAMA1_CON0, 0, MT6358_VCAMA1_ANA_CON0, 0xf00),
508 MT6358_LDO("ldo_vemc", VEMC, vmch_vemc,
509 MT6358_LDO_VEMC_CON0, 0, MT6358_VEMC_ANA_CON0, 0x700),
510 MT6358_LDO("ldo_vcn33", VCN33, vcn33,
511 MT6358_LDO_VCN33_CON0_0, 0, MT6358_VCN33_ANA_CON0, 0x300),
512 MT6358_LDO("ldo_vcama2", VCAMA2, vcama,
513 MT6358_LDO_VCAMA2_CON0, 0, MT6358_VCAMA2_ANA_CON0, 0xf00),
514 MT6358_LDO("ldo_vmc", VMC, vmc,
515 MT6358_LDO_VMC_CON0, 0, MT6358_VMC_ANA_CON0, 0xf00),
516 MT6358_LDO("ldo_vldo28", VLDO28, vldo28,
517 MT6358_LDO_VLDO28_CON0_0, 0,
518 MT6358_VLDO28_ANA_CON0, 0x300),
519 MT6358_LDO("ldo_vsim2", VSIM2, vsim,
520 MT6358_LDO_VSIM2_CON0, 0, MT6358_VSIM2_ANA_CON0, 0xf00),
521 MT6358_LDO1("ldo_vsram_proc11", VSRAM_PROC11, 500000, 1293750, 6250,
522 MT6358_LDO_VSRAM_PROC11_DBG0, 0x7f00, MT6358_LDO_VSRAM_CON0, 0x7f),
523 MT6358_LDO1("ldo_vsram_others", VSRAM_OTHERS, 500000, 1293750, 6250,
524 MT6358_LDO_VSRAM_OTHERS_DBG0, 0x7f00, MT6358_LDO_VSRAM_CON2, 0x7f),
525 MT6358_LDO1("ldo_vsram_gpu", VSRAM_GPU, 500000, 1293750, 6250,
526 MT6358_LDO_VSRAM_GPU_DBG0, 0x7f00, MT6358_LDO_VSRAM_CON3, 0x7f),
527 MT6358_LDO1("ldo_vsram_proc12", VSRAM_PROC12, 500000, 1293750, 6250,
528 MT6358_LDO_VSRAM_PROC12_DBG0, 0x7f00, MT6358_LDO_VSRAM_CON1, 0x7f),
529 };
530

Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
#12 lore raw

Re: [PATCH RESEND v2 6/7] regulator: mt6358: Add output voltage fine tuning to variable LDOs

In reply to Chen-Yu Tsai
kernel test robot noticed the following build errors:

Hi Chen-Yu,

kernel test robot noticed the following build errors:

[auto build test ERROR on broonie-regulator/for-next]
[also build test ERROR on lee-mfd/for-mfd-next lee-leds/for-leds-next linus/master v6.5-rc2 next-20230721] [cannot apply to lee-mfd/for-mfd-fixes]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Chen-Yu-Tsai/mfd-mt6358-Add-missing-registers-for-LDO-voltage-calibration/20230721-163236
base:   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-next
patch link:    https://lore.kernel.org/r/20230721082903.2038975-7-wenst%40chromium.org
patch subject: [PATCH RESEND v2 6/7] regulator: mt6358: Add output voltage fine tuning to variable LDOs
config: loongarch-allyesconfig (https://download.01.org/0day-ci/archive/20230722/[email protected]/config)
compiler: loongarch64-linux-gcc (GCC) 12.3.0
reproduce: (https://download.01.org/0day-ci/archive/20230722/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All errors (new ones prefixed by >>):

>> drivers/regulator/mt6358-regulator.c:76:18: error: 'struct regulator_desc' has no member named 'linear_range_selectors_bitfield'; did you mean 'linear_range_selectors'?
      76 |                 .linear_range_selectors_bitfield = volt_ranges##_selectors,     \
         |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/regulator/mt6358-regulator.c:492:9: note: in expansion of macro 'MT6358_LDO'
     492 |         MT6358_LDO("ldo_vdram2", VDRAM2, vdram2,
         |         ^~~~~~~~~~
>> drivers/regulator/mt6358-regulator.c:76:18: error: 'struct regulator_desc' has no member named 'linear_range_selectors_bitfield'; did you mean 'linear_range_selectors'?
      76 |                 .linear_range_selectors_bitfield = volt_ranges##_selectors,     \
         |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/regulator/mt6358-regulator.c:494:9: note: in expansion of macro 'MT6358_LDO'
     494 |         MT6358_LDO("ldo_vsim1", VSIM1, vsim,
         |         ^~~~~~~~~~
>> drivers/regulator/mt6358-regulator.c:76:18: error: 'struct regulator_desc' has no member named 'linear_range_selectors_bitfield'; did you mean 'linear_range_selectors'?
      76 |                 .linear_range_selectors_bitfield = volt_ranges##_selectors,     \
         |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/regulator/mt6358-regulator.c:496:9: note: in expansion of macro 'MT6358_LDO'
     496 |         MT6358_LDO("ldo_vibr", VIBR, vibr,
         |         ^~~~~~~~~~
>> drivers/regulator/mt6358-regulator.c:76:18: error: 'struct regulator_desc' has no member named 'linear_range_selectors_bitfield'; did you mean 'linear_range_selectors'?
      76 |                 .linear_range_selectors_bitfield = volt_ranges##_selectors,     \
         |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/regulator/mt6358-regulator.c:498:9: note: in expansion of macro 'MT6358_LDO'
     498 |         MT6358_LDO("ldo_vusb", VUSB, vusb,
         |         ^~~~~~~~~~
>> drivers/regulator/mt6358-regulator.c:76:18: error: 'struct regulator_desc' has no member named 'linear_range_selectors_bitfield'; did you mean 'linear_range_selectors'?
      76 |                 .linear_range_selectors_bitfield = volt_ranges##_selectors,     \
         |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/regulator/mt6358-regulator.c:500:9: note: in expansion of macro 'MT6358_LDO'
     500 |         MT6358_LDO("ldo_vcamd", VCAMD, vcamd,
         |         ^~~~~~~~~~
>> drivers/regulator/mt6358-regulator.c:76:18: error: 'struct regulator_desc' has no member named 'linear_range_selectors_bitfield'; did you mean 'linear_range_selectors'?
      76 |                 .linear_range_selectors_bitfield = volt_ranges##_selectors,     \
         |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/regulator/mt6358-regulator.c:502:9: note: in expansion of macro 'MT6358_LDO'
     502 |         MT6358_LDO("ldo_vefuse", VEFUSE, vefuse,
         |         ^~~~~~~~~~
>> drivers/regulator/mt6358-regulator.c:76:18: error: 'struct regulator_desc' has no member named 'linear_range_selectors_bitfield'; did you mean 'linear_range_selectors'?
      76 |                 .linear_range_selectors_bitfield = volt_ranges##_selectors,     \
         |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/regulator/mt6358-regulator.c:504:9: note: in expansion of macro 'MT6358_LDO'
     504 |         MT6358_LDO("ldo_vmch", VMCH, vmch_vemc,
         |         ^~~~~~~~~~
>> drivers/regulator/mt6358-regulator.c:76:18: error: 'struct regulator_desc' has no member named 'linear_range_selectors_bitfield'; did you mean 'linear_range_selectors'?
      76 |                 .linear_range_selectors_bitfield = volt_ranges##_selectors,     \
         |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/regulator/mt6358-regulator.c:506:9: note: in expansion of macro 'MT6358_LDO'
     506 |         MT6358_LDO("ldo_vcama1", VCAMA1, vcama,
         |         ^~~~~~~~~~
>> drivers/regulator/mt6358-regulator.c:76:18: error: 'struct regulator_desc' has no member named 'linear_range_selectors_bitfield'; did you mean 'linear_range_selectors'?
      76 |                 .linear_range_selectors_bitfield = volt_ranges##_selectors,     \
         |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/regulator/mt6358-regulator.c:508:9: note: in expansion of macro 'MT6358_LDO'
     508 |         MT6358_LDO("ldo_vemc", VEMC, vmch_vemc,
         |         ^~~~~~~~~~
>> drivers/regulator/mt6358-regulator.c:76:18: error: 'struct regulator_desc' has no member named 'linear_range_selectors_bitfield'; did you mean 'linear_range_selectors'?
      76 |                 .linear_range_selectors_bitfield = volt_ranges##_selectors,     \
         |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/regulator/mt6358-regulator.c:510:9: note: in expansion of macro 'MT6358_LDO'
     510 |         MT6358_LDO("ldo_vcn33", VCN33, vcn33,
         |         ^~~~~~~~~~
>> drivers/regulator/mt6358-regulator.c:76:18: error: 'struct regulator_desc' has no member named 'linear_range_selectors_bitfield'; did you mean 'linear_range_selectors'?
      76 |                 .linear_range_selectors_bitfield = volt_ranges##_selectors,     \
         |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/regulator/mt6358-regulator.c:512:9: note: in expansion of macro 'MT6358_LDO'
     512 |         MT6358_LDO("ldo_vcama2", VCAMA2, vcama,
         |         ^~~~~~~~~~
>> drivers/regulator/mt6358-regulator.c:76:18: error: 'struct regulator_desc' has no member named 'linear_range_selectors_bitfield'; did you mean 'linear_range_selectors'?
      76 |                 .linear_range_selectors_bitfield = volt_ranges##_selectors,     \
         |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/regulator/mt6358-regulator.c:514:9: note: in expansion of macro 'MT6358_LDO'
     514 |         MT6358_LDO("ldo_vmc", VMC, vmc,
         |         ^~~~~~~~~~
>> drivers/regulator/mt6358-regulator.c:76:18: error: 'struct regulator_desc' has no member named 'linear_range_selectors_bitfield'; did you mean 'linear_range_selectors'?
      76 |                 .linear_range_selectors_bitfield = volt_ranges##_selectors,     \
         |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/regulator/mt6358-regulator.c:516:9: note: in expansion of macro 'MT6358_LDO'
     516 |         MT6358_LDO("ldo_vldo28", VLDO28, vldo28,
         |         ^~~~~~~~~~
>> drivers/regulator/mt6358-regulator.c:76:18: error: 'struct regulator_desc' has no member named 'linear_range_selectors_bitfield'; did you mean 'linear_range_selectors'?
      76 |                 .linear_range_selectors_bitfield = volt_ranges##_selectors,     \
         |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/regulator/mt6358-regulator.c:519:9: note: in expansion of macro 'MT6358_LDO'
     519 |         MT6358_LDO("ldo_vsim2", VSIM2, vsim,
         |         ^~~~~~~~~~
   drivers/regulator/mt6358-regulator.c:175:18: error: 'struct regulator_desc' has no member named 'linear_range_selectors_bitfield'; did you mean 'linear_range_selectors'?
     175 |                 .linear_range_selectors_bitfield = volt_ranges##_selectors,     \
         |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/regulator/mt6358-regulator.c:568:9: note: in expansion of macro 'MT6366_LDO'
     568 |         MT6366_LDO("ldo_vdram2", VDRAM2, vdram2,
         |         ^~~~~~~~~~
   drivers/regulator/mt6358-regulator.c:175:18: error: 'struct regulator_desc' has no member named 'linear_range_selectors_bitfield'; did you mean 'linear_range_selectors'?
     175 |                 .linear_range_selectors_bitfield = volt_ranges##_selectors,     \
         |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/regulator/mt6358-regulator.c:570:9: note: in expansion of macro 'MT6366_LDO'
     570 |         MT6366_LDO("ldo_vsim1", VSIM1, vsim,
         |         ^~~~~~~~~~
   drivers/regulator/mt6358-regulator.c:175:18: error: 'struct regulator_desc' has no member named 'linear_range_selectors_bitfield'; did you mean 'linear_range_selectors'?
     175 |                 .linear_range_selectors_bitfield = volt_ranges##_selectors,     \
         |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/regulator/mt6358-regulator.c:572:9: note: in expansion of macro 'MT6366_LDO'
     572 |         MT6366_LDO("ldo_vibr", VIBR, vibr,
         |         ^~~~~~~~~~
   drivers/regulator/mt6358-regulator.c:175:18: error: 'struct regulator_desc' has no member named 'linear_range_selectors_bitfield'; did you mean 'linear_range_selectors'?
     175 |                 .linear_range_selectors_bitfield = volt_ranges##_selectors,     \
         |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/regulator/mt6358-regulator.c:574:9: note: in expansion of macro 'MT6366_LDO'
     574 |         MT6366_LDO("ldo_vusb", VUSB, vusb,
         |         ^~~~~~~~~~
   drivers/regulator/mt6358-regulator.c:175:18: error: 'struct regulator_desc' has no member named 'linear_range_selectors_bitfield'; did you mean 'linear_range_selectors'?
     175 |                 .linear_range_selectors_bitfield = volt_ranges##_selectors,     \
         |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/regulator/mt6358-regulator.c:576:9: note: in expansion of macro 'MT6366_LDO'
     576 |         MT6366_LDO("ldo_vefuse", VEFUSE, vefuse,
         |         ^~~~~~~~~~
   drivers/regulator/mt6358-regulator.c:175:18: error: 'struct regulator_desc' has no member named 'linear_range_selectors_bitfield'; did you mean 'linear_range_selectors'?
     175 |                 .linear_range_selectors_bitfield = volt_ranges##_selectors,     \
         |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/regulator/mt6358-regulator.c:578:9: note: in expansion of macro 'MT6366_LDO'
     578 |         MT6366_LDO("ldo_vmch", VMCH, vmch_vemc,
         |         ^~~~~~~~~~
   drivers/regulator/mt6358-regulator.c:175:18: error: 'struct regulator_desc' has no member named 'linear_range_selectors_bitfield'; did you mean 'linear_range_selectors'?
     175 |                 .linear_range_selectors_bitfield = volt_ranges##_selectors,     \
         |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/regulator/mt6358-regulator.c:580:9: note: in expansion of macro 'MT6366_LDO'
     580 |         MT6366_LDO("ldo_vemc", VEMC, vmch_vemc,
         |         ^~~~~~~~~~
   drivers/regulator/mt6358-regulator.c:175:18: error: 'struct regulator_desc' has no member named 'linear_range_selectors_bitfield'; did you mean 'linear_range_selectors'?
     175 |                 .linear_range_selectors_bitfield = volt_ranges##_selectors,     \
         |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/regulator/mt6358-regulator.c:582:9: note: in expansion of macro 'MT6366_LDO'
     582 |         MT6366_LDO("ldo_vcn33", VCN33, vcn33,
         |         ^~~~~~~~~~
   drivers/regulator/mt6358-regulator.c:175:18: error: 'struct regulator_desc' has no member named 'linear_range_selectors_bitfield'; did you mean 'linear_range_selectors'?
     175 |                 .linear_range_selectors_bitfield = volt_ranges##_selectors,     \
         |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/regulator/mt6358-regulator.c:584:9: note: in expansion of macro 'MT6366_LDO'
     584 |         MT6366_LDO("ldo_vmc", VMC, vmc,
         |         ^~~~~~~~~~
   drivers/regulator/mt6358-regulator.c:175:18: error: 'struct regulator_desc' has no member named 'linear_range_selectors_bitfield'; did you mean 'linear_range_selectors'?
     175 |                 .linear_range_selectors_bitfield = volt_ranges##_selectors,     \
         |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/regulator/mt6358-regulator.c:586:9: note: in expansion of macro 'MT6366_LDO'
     586 |         MT6366_LDO("ldo_vsim2", VSIM2, vsim,
         |         ^~~~~~~~~~

vim +76 drivers/regulator/mt6358-regulator.c

    64	
    65	#define MT6358_LDO(match, vreg, volt_ranges, enreg, enbit, vosel, vosel_mask) \
    66	[MT6358_ID_##vreg] = {	\
    67		.desc = {	\
    68			.name = #vreg,	\
    69			.of_match = of_match_ptr(match),	\
    70			.ops = &mt6358_volt_table_ops,	\
    71			.type = REGULATOR_VOLTAGE,	\
    72			.id = MT6358_ID_##vreg,	\
    73			.owner = THIS_MODULE,	\
    74			.n_voltages = ARRAY_SIZE(volt_ranges##_ranges) * 11,	\
    75			.linear_ranges = volt_ranges##_ranges,		\
  > 76			.linear_range_selectors_bitfield = volt_ranges##_selectors,	\
    77			.n_linear_ranges = ARRAY_SIZE(volt_ranges##_ranges),	\
    78			.vsel_range_reg = vosel,	\
    79			.vsel_range_mask = vosel_mask,	\
    80			.vsel_reg = MT6358_##vreg##_ANA_CON0,	\
    81			.vsel_mask = GENMASK(3, 0),	\
    82			.enable_reg = enreg,	\
    83			.enable_mask = BIT(enbit),	\
    84		},	\
    85		.status_reg = MT6358_LDO_##vreg##_CON1,	\
    86		.qi = BIT(15),	\
    87	}
    88	
Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
#13 lore raw

PATCH RESEND v2 7/7 arm64: dts: mediatek: mt6358: Merge ldo_vcn33_* regulators

In reply to Chen-Yu Tsai

The ldo_vcn33_bt and ldo_vcn33_wifi regulators are actually the same regulator, having the same voltage setting and output pin. There are simply two enable bits that are ORed together to enable the regulator.

Having two regulators representing the same output pin is misleading from a design matching standpoint, and also error-prone in driver implementations.

Now that the bindings have these two merged, merge them in the device tree as well. Neither vcn33 regulators are referenced in upstream device trees. As far as hardware designs go, none of the Chromebooks using MT8183 w/ MT6358 use this output.

---
 arch/arm64/boot/dts/mediatek/mt6358.dtsi | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)
arch/arm64/boot/dts/mediatek/mt6358.dtsi +2 -9
index b605313bed99..186898f9384b 100644
@@ -304,15 +304,8 @@ mt6358_vrf18_reg: ldo_vrf18 {
 				regulator-enable-ramp-delay = <120>;
 			};
 
-			mt6358_vcn33_bt_reg: ldo_vcn33_bt {
-				regulator-name = "vcn33_bt";
-				regulator-min-microvolt = <3300000>;
-				regulator-max-microvolt = <3500000>;
-				regulator-enable-ramp-delay = <270>;
-			};
-
-			mt6358_vcn33_wifi_reg: ldo_vcn33_wifi {
-				regulator-name = "vcn33_wifi";
+			mt6358_vcn33_reg: ldo_vcn33 {
+				regulator-name = "vcn33";
 				regulator-min-microvolt = <3300000>;
 				regulator-max-microvolt = <3500000>;
 				regulator-enable-ramp-delay = <270>;
Signature · 1 line
2.41.0.487.g6d72f3e995-goog
maintainer Reviewed-by on v2 7/7
#14 lore raw

Re: [PATCH RESEND v2 7/7] arm64: dts: mediatek: mt6358: Merge ldo_vcn33_* regulators

Il 21/07/23 10:28, Chen-Yu Tsai ha scritto:

Quoted 8 lines

The ldo_vcn33_bt and ldo_vcn33_wifi regulators are actually the same regulator, having the same voltage setting and output pin. There are simply two enable bits that are ORed together to enable the regulator.

Having two regulators representing the same output pin is misleading from a design matching standpoint, and also error-prone in driver implementations.

Quoted 6 lines

Now that the bindings have these two merged, merge them in the device tree as well. Neither vcn33 regulators are referenced in upstream device trees. As far as hardware designs go, none of the Chromebooks using MT8183 w/ MT6358 use this output.

maintainer
#15 lore raw

Re: (subset) [PATCH RESEND v2 0/7] regulator: mt6358: Remove bogus regulators and improvements

In reply to Chen-Yu Tsai
Quoted 8 lines · Chen-Yu Tsai

(Resending with Lee added to recipients)

Hi,

This is v2 of the remainder of the MT6358 regulator driver cleanup and improvement series. v1 can be found here [1].

[...]

Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-next

Thanks!

[2/7] regulator: mt6358: Sync VCN33_* enable status after checking ID

      commit: 649fee5a17a7f96152fee2fb9111d9a4db535f35
[3/7] regulator: mt6358: Fix incorrect VCN33 sync error message
      commit: 67cb608838e0aac8efb48828b1165156f99c1af9

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark