[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20251023-mt8196-ufs-v3-11-0f04b4a795ff@collabora.com>
Date: Thu, 23 Oct 2025 21:49:29 +0200
From: Nicolas Frattaroli <nicolas.frattaroli@...labora.com>
To: Alim Akhtar <alim.akhtar@...sung.com>,
Avri Altman <avri.altman@....com>, Bart Van Assche <bvanassche@....org>,
Rob Herring <robh@...nel.org>, Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>,
Matthias Brugger <matthias.bgg@...il.com>,
AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>,
Chunfeng Yun <chunfeng.yun@...iatek.com>, Vinod Koul <vkoul@...nel.org>,
Kishon Vijay Abraham I <kishon@...nel.org>,
Peter Wang <peter.wang@...iatek.com>, Stanley Jhu <chu.stanley@...il.com>,
"James E.J. Bottomley" <James.Bottomley@...senPartnership.com>,
"Martin K. Petersen" <martin.petersen@...cle.com>,
Philipp Zabel <p.zabel@...gutronix.de>, Liam Girdwood <lgirdwood@...il.com>,
Mark Brown <broonie@...nel.org>
Cc: Louis-Alexis Eyraud <louisalexis.eyraud@...labora.com>,
kernel@...labora.com, linux-scsi@...r.kernel.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-mediatek@...ts.infradead.org,
linux-phy@...ts.infradead.org,
Nicolas Frattaroli <nicolas.frattaroli@...labora.com>
Subject: [PATCH v3 11/24] scsi: ufs: mediatek: Remove vendor kernel quirks
cruft
Both ufs_mtk_vreg_fix_vcc and ufs_mtk_vreg_fix_vccqx look like they are
vendor kernel hacks to work around existing downstream device trees.
Mainline does not need or want them, so remove them.
Signed-off-by: Nicolas Frattaroli <nicolas.frattaroli@...labora.com>
---
drivers/ufs/host/ufs-mediatek.c | 69 -----------------------------------------
1 file changed, 69 deletions(-)
diff --git a/drivers/ufs/host/ufs-mediatek.c b/drivers/ufs/host/ufs-mediatek.c
index 889a1d58a041..6b26b952df42 100644
--- a/drivers/ufs/host/ufs-mediatek.c
+++ b/drivers/ufs/host/ufs-mediatek.c
@@ -1017,73 +1017,6 @@ static void ufs_mtk_init_clocks(struct ufs_hba *hba)
}
}
-#define MAX_VCC_NAME 30
-static int ufs_mtk_vreg_fix_vcc(struct ufs_hba *hba)
-{
- struct ufs_vreg_info *info = &hba->vreg_info;
- struct device_node *np = hba->dev->of_node;
- struct device *dev = hba->dev;
- char vcc_name[MAX_VCC_NAME];
- struct arm_smccc_res res;
- int err, ver;
-
- if (info->vcc)
- return 0;
-
- if (of_property_read_bool(np, "mediatek,ufs-vcc-by-num")) {
- ufs_mtk_get_vcc_num(res);
- if (res.a1 > UFS_VCC_NONE && res.a1 < UFS_VCC_MAX)
- snprintf(vcc_name, MAX_VCC_NAME, "vcc-opt%lu", res.a1);
- else
- return -ENODEV;
- } else if (of_property_read_bool(np, "mediatek,ufs-vcc-by-ver")) {
- ver = (hba->dev_info.wspecversion & 0xF00) >> 8;
- snprintf(vcc_name, MAX_VCC_NAME, "vcc-ufs%u", ver);
- } else {
- return 0;
- }
-
- err = ufshcd_populate_vreg(dev, vcc_name, &info->vcc, false);
- if (err)
- return err;
-
- err = ufshcd_get_vreg(dev, info->vcc);
- if (err)
- return err;
-
- err = regulator_enable(info->vcc->reg);
- if (!err) {
- info->vcc->enabled = true;
- dev_info(dev, "%s: %s enabled\n", __func__, vcc_name);
- }
-
- return err;
-}
-
-static void ufs_mtk_vreg_fix_vccqx(struct ufs_hba *hba)
-{
- struct ufs_vreg_info *info = &hba->vreg_info;
- struct ufs_vreg **vreg_on, **vreg_off;
-
- if (hba->dev_info.wspecversion >= 0x0300) {
- vreg_on = &info->vccq;
- vreg_off = &info->vccq2;
- } else {
- vreg_on = &info->vccq2;
- vreg_off = &info->vccq;
- }
-
- if (*vreg_on)
- (*vreg_on)->always_on = true;
-
- if (*vreg_off) {
- regulator_disable((*vreg_off)->reg);
- devm_kfree(hba->dev, (*vreg_off)->name);
- devm_kfree(hba->dev, *vreg_off);
- *vreg_off = NULL;
- }
-}
-
static void ufs_mtk_setup_clk_gating(struct ufs_hba *hba)
{
unsigned long flags;
@@ -1968,8 +1901,6 @@ static void ufs_mtk_fixup_dev_quirks(struct ufs_hba *hba)
hba->dev_quirks &= ~UFS_DEVICE_QUIRK_DELAY_BEFORE_LPM;
}
- ufs_mtk_vreg_fix_vcc(hba);
- ufs_mtk_vreg_fix_vccqx(hba);
ufs_mtk_fix_ahit(hba);
ufs_mtk_fix_clock_scaling(hba);
}
--
2.51.1.dirty
Powered by blists - more mailing lists