Re: [PATCH v7 10/23] scsi: ufs: mediatek: Handle misc host voltage regulators

From: AngeloGioacchino Del Regno

Date: Tue Feb 24 2026 - 07:42:12 EST


Il 24/02/26 13:38, Peter Wang (王信友) ha scritto:
On Mon, 2026-02-16 at 14:37 +0100, Nicolas Frattaroli wrote:
@@ -1188,8 +1190,21 @@ static int ufs_mtk_get_supplies(struct
ufs_mtk_host *host)
 {
  struct device *dev = host->hba->dev;
  const struct ufs_mtk_soc_data *data =
of_device_get_match_data(dev);
+ int ret;
+
+ if (!data)
+ return 0;
+
+ if (data->num_reg_names) {
+ ret = devm_regulator_bulk_get_enable(dev, data-
num_reg_names,
+      data-
reg_names);

Hi Nicolas,

If these regulators are only acquired and enabled once,
why not just set regulator-always-on in the device tree?


Because:
1. The UFS driver has to acquire the correct supplies regardless of them
being on, guaranteeing both a readable power tree (sysfs/debugfs) and
a correct hardware description in devicetree.
2. A future update might get those regulators disabled during deep sleep

Regards,
Angelo

Thanks
Peter