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 4737FC624D3 for ; Tue, 1 Sep 2026 15:39:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :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=I5UCZQnuHAGi/3T1Zom6IeQGNgDwMWgNlMCn5Wwsveg=; b=UmM1ic9vuMVduQ Kz7LUSUercbOcjB8UsoM5w8ESaZEH1gArE+tAz0ODsWUWhw383vVZ1GDaCj83RQJNJC96mbXZqzZ3 yepSIjx7ke1qDORkQthk1iQl8g9bg3h+Ssvm3Niw8/F1tGl+OdmrjVJcNBU2FIobDfFjaOi5ckXWD pAqXai2FjcdFZdMRE0L+8270izHdKnh2yK6leFM6mqIZWHdW6qCddIqmzdp5AWIHzQSRDkuYXbwCx +txVThcmo7rCpR7XoDdEuCXUW7M01x4Ko8W8jVs6jTHxSQogbhcbum7XlXP4CNueCVyOXiCTRLXCc aMo7+xap1mhPhu1LDq/Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1x1QaU-0000000CXcC-3gEv; Tue, 01 Sep 2026 15:39:50 +0000 Received: from bali.collaboradmins.com ([2a01:4f8:201:9162::2]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1x1QaL-0000000CX6o-1FD9; Tue, 01 Sep 2026 15:39:42 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1788277179; bh=eZ7s20l0CuLrp7v/QhML2YKsFqgzCxZkDfgniCxnCs4=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=qYXhnFhhdBqX01Th+6Cnba7QYA3oLPmI+tnH7qpOin08CuVSwWtXRb8noMRvN/k3M JYiVgyOLgg5Ye9AjkG6p3j8uwlNhZ2Yg9j1bUdqzmBAuQhtgE/jEXXsJ7OGiMZKlCN Y5QDGOkcKbCOBK9WnuWGCTeQekX1NVx+lg3+oncXMOQ+YAdGRGmGZmuGHeRF/kgKIN uWZFw/YrSm07xB21/GVzTcIem8xXhaT5eQT6QnaI68MSIfDFwyocBNF1zsL1fD3IF8 6k08a7v/T/KLiWitx5m6Hn5Bn9oJGrVuCdWc7ET26VIZ5JK0jO0guvcxvCRQSOH7Xq Ic06uovT4L+bg== 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 5372517E080A; Tue, 01 Sep 2026 17:39:38 +0200 (CEST) From: Louis-Alexis Eyraud Date: Tue, 01 Sep 2026 17:39:01 +0200 Subject: [PATCH v11 13/24] scsi: ufs: mediatek: Remove vendor kernel quirks cruft MIME-Version: 1.0 Message-Id: <20260901-mt8196-ufs-v11-13-dbd007704490@collabora.com> References: <20260901-mt8196-ufs-v11-0-dbd007704490@collabora.com> In-Reply-To: <20260901-mt8196-ufs-v11-0-dbd007704490@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" , "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=1788277163; l=3056; i=louisalexis.eyraud@collabora.com; s=20250113; h=from:subject:message-id; bh=f4axdRSq5pcbpsFxO3oN+7YJzgLHRhwPFuOIqwFRnMo=; b=5K4XxKuVKYFXY+3L1sgqwmDYGUEWLcj4lvUXs5vQZMkWPhaOSBL6xpxqAfyjVMBavTJpMfCnm UfpJX2nPMLeAfLz9biyzE5j29jsYlpvP6yhPDn+sEwlrWV8pHcMqc2O 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-20260901_083941_691789_2BB1ADF6 X-CRM114-Status: GOOD ( 12.02 ) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=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 b01fc37bd259..ae053f40aaf4 100644 --- a/drivers/ufs/host/ufs-mediatek.c +++ b/drivers/ufs/host/ufs-mediatek.c @@ -1046,73 +1046,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; @@ -2031,8 +1964,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 -- linux-phy mailing list linux-phy@lists.infradead.org https://lists.infradead.org/mailman/listinfo/linux-phy