From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5FBE8C88E73 for ; Mon, 14 Sep 2026 11:40:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=taomri6dujIHWUOhxvI0HA0J3JLodDZhCOWNksXk+Kg=; b=Sy55kGLbu44lvKBa/AOWFUQm2T tdMoLyKchPicQDTbQRWm4ycVMdRC+fmn+PRJx2q//zBoYWO6P88UZs3bnsfJXBcXAzsVBMTmNzsKh +a8ZA/IehlliIFzgXSJnR4Jf+JDDlQ8th83plVma4aWi1SB+tptttVlx+wCs/XTF3tWrTSG5zDwqP xTY1fF/FDctjIweDfT9nPi3a6w6EfGzm7ptpOfSNZOdfVYLYRTLip+Q3vgmUIXCQRsyQZ9LpI6k4B iHB2I/t567+VhT3tkxT9DBcRDO9UxeLm7Proqoibtj1FzKWj9U0VhTDomhNWyFFhkVj7vhSanteM0 diVq4RuA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1x653A-00000003JaH-0mHO; Mon, 14 Sep 2026 11:40:40 +0000 Received: from bali.collaboradmins.com ([148.251.105.195]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1x6525-00000003IdQ-3mlt; Mon, 14 Sep 2026 11:39:35 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1789385971; bh=GA7c4f91KW8+5zIpILZTonOY4WBGfqUUATxI9yPRkQs=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=UPRrCvHlBaTXt357FxIPaHaafhvXRGNmmyNsKaVDYZLf7Bivg+oZ3+wp9/Wvmxijf skWa/26Fr9zc4pFOj8Zi3O1Vkd9FdGrWVxGOKhDU6OI2RASJe2mgQc3+vPsdQJ84Er kq9HZJTqfXIaIn++gyLBeNzChgCqlHUDFVCaVJfU9wMQHD2We/JygsF+nQvcXHbQk4 N0HpskJQpNoyYhoaNZcFPnvrmTMRYznDdKUdXBTiBROGGuTuVEgbplbqtViTJn8vos t618cH71+JgBrcZOUkiESjDeAi54BvHD9GQ1uffkYiPDobKUnXMIoUhb292ix51fzS RZXR3tf5mzuaQ== Received: from yukiji.home (unknown [100.64.0.131]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: laeyraud) by bali.collaboradmins.com (Postfix) with ESMTPSA id EF92A17E0A32; Mon, 14 Sep 2026 13:39:29 +0200 (CEST) From: Louis-Alexis Eyraud Date: Mon, 14 Sep 2026 13:38:59 +0200 Subject: [PATCH v12 13/24] scsi: ufs: mediatek: Remove vendor kernel quirks cruft MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20260914-mt8196-ufs-v12-13-9279d7ef814d@collabora.com> References: <20260914-mt8196-ufs-v12-0-9279d7ef814d@collabora.com> In-Reply-To: <20260914-mt8196-ufs-v12-0-9279d7ef814d@collabora.com> To: Chunfeng Yun , Vinod Koul , Neil Armstrong , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , AngeloGioacchino Del Regno , Peter Wang , Chaotian Jing , Alim Akhtar , Avri Altman , Bart Van Assche , Stanley Jhu , "James E.J. Bottomley" , Philipp Zabel , Liam Girdwood , Mark Brown , Manivannan Sadhasivam , "Martin K. Petersen" Cc: kernel@collabora.com, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-phy@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, Nicolas Frattaroli , Krzysztof Kozlowski , Louis-Alexis Eyraud X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1789385943; l=3056; i=louisalexis.eyraud@collabora.com; s=20250113; h=from:subject:message-id; bh=7cmTWMq9J2ZZJyalBAME0IfxrGGo6X2/e51S+qvtg4s=; b=P0AZ9J11jnkgm8EyjIym7om1BgNrFfus93vJQF5WnsfllJ2wAn6X9COIns5n7iHuibVFCQsif YwiCmQDEtTtDGUXdPvicFwQ+Z8wRulLVSsxHk2QJGuQPwn9Mvmm8L8J X-Developer-Key: i=louisalexis.eyraud@collabora.com; a=ed25519; pk=CHFBDB2Kqh4EHc6JIqFn69GhxJJAzc0Zr4e8QxtumuM= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260914_043934_157540_2FE3EE84 X-CRM114-Status: GOOD ( 11.46 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Nicolas Frattaroli 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. Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Krzysztof Kozlowski Reviewed-by: Peter Wang Signed-off-by: Nicolas Frattaroli Signed-off-by: Louis-Alexis Eyraud --- 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 3d108a092920..3c10a9fd09df 100644 --- a/drivers/ufs/host/ufs-mediatek.c +++ b/drivers/ufs/host/ufs-mediatek.c @@ -1053,73 +1053,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; @@ -2040,8 +1973,6 @@ static void ufs_mtk_fixup_dev_quirks(struct ufs_hba *hba) host->ip_ver == IP_VER_MT6995_B0)) hba->quirks |= UFSHCD_QUIRK_VCC_ON_DELAY; - ufs_mtk_vreg_fix_vcc(hba); - ufs_mtk_vreg_fix_vccqx(hba); ufs_mtk_fix_ahit(hba); ufs_mtk_fix_clock_scaling(hba); } -- 2.55.0