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 513E6CCF9E3 for ; Thu, 23 Oct 2025 19:51: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=1GZIjhOXMFgw2wm5k6PRrTOSuSUNAdLH8Bv7e6b5Eq8=; b=B7BnU/mdar3UPFiCJGAubFYWRM nI3dTRuKYtgqGLJq6CSpfV5OHYKa9LjSEsvAeIaVcOTaahU0+IXl8I+F3cq0BezPjn2nHy/W9KB6L RnP5v/YBYEyhZPFwA5RdLajmTo9YgGFg3RBGoD0FwxlQ8pzoh/Kp7ynIRRMbwhmpn9y57HIX09p2v 91xXcsecGLSUksJuNwVu5aW3gNGn5/aBahwpWOGFzrezJ6Mbb+Kygpu4AWj1MFnXzxJlNB33Zxrp8 uSl15zq1+r2bGJgy4UP+9Z0gk0da0VetLq0iWw5ssgSeXaeRQMu0QrMlfgvjP3GTbRepgnG2XsqgX yAPuEmPw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1vC1LZ-00000007QNr-49ip; Thu, 23 Oct 2025 19:51:41 +0000 Received: from sender4-pp-f112.zoho.com ([136.143.188.112]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1vC1LS-00000007QF5-3AJB; Thu, 23 Oct 2025 19:51:36 +0000 ARC-Seal: i=1; a=rsa-sha256; t=1761249082; cv=none; d=zohomail.com; s=zohoarc; b=g0+HrGzukyTNmfv9iajcoUKvtb68rR4ixxbSLax5eFWGM0nALrQVoJwHJyIo8DZsI/ereeIdf2f4Rx5x9hqScS2zJcnd6IkjcNpnxafSh33ZAIEZzBSWYdJFNIYwciBNI+Z9aAJqLu640gVTcn+Yg4spIscNCRiriIa6VcpyktE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761249082; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; bh=1GZIjhOXMFgw2wm5k6PRrTOSuSUNAdLH8Bv7e6b5Eq8=; b=WRmNZCcSQVV6WhWdUzX+dvPLG7yE/y2DYYxmBsvpMzImgEkeIBkwXAiLZ3Udn2LDJ5M6/0rVlg1QmZvGcVBCoQipBai4tgglWsaUPRmFaqnXDOHuMeK945BGuaHCPIoengE/+kG7eKidnWFOfRD6VW/xLx88QG9Q2p7k+GJ2+YQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=collabora.com; spf=pass smtp.mailfrom=nicolas.frattaroli@collabora.com; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1761249082; s=zohomail; d=collabora.com; i=nicolas.frattaroli@collabora.com; h=From:From:Date:Date:Subject:Subject:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-Id:Message-Id:References:In-Reply-To:To:To:Cc:Cc:Reply-To; bh=1GZIjhOXMFgw2wm5k6PRrTOSuSUNAdLH8Bv7e6b5Eq8=; b=aIq5dM6r/xVPFyAgI+pLZOneGyLiE1ymzzjblBmCJ/BY8Bm5a1nfqfgsBaPMFQzb nws7K5YU2Fd42xaMSDoaBh+x8CH1IaZJj7oYsz/6PvG7IkMTgek/EpoRseQ+IoATuId VSPrpsYyDWmrN+09+6/l88JeGBaAqI2EbA7XrzA0= Received: by mx.zohomail.com with SMTPS id 1761249081608317.81143627241147; Thu, 23 Oct 2025 12:51:21 -0700 (PDT) From: Nicolas Frattaroli Date: Thu, 23 Oct 2025 21:49:29 +0200 Subject: [PATCH v3 11/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: <20251023-mt8196-ufs-v3-11-0f04b4a795ff@collabora.com> References: <20251023-mt8196-ufs-v3-0-0f04b4a795ff@collabora.com> In-Reply-To: <20251023-mt8196-ufs-v3-0-0f04b4a795ff@collabora.com> To: Alim Akhtar , Avri Altman , Bart Van Assche , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , AngeloGioacchino Del Regno , Chunfeng Yun , Vinod Koul , Kishon Vijay Abraham I , Peter Wang , Stanley Jhu , "James E.J. Bottomley" , "Martin K. Petersen" , Philipp Zabel , Liam Girdwood , Mark Brown Cc: Louis-Alexis Eyraud , kernel@collabora.com, linux-scsi@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-phy@lists.infradead.org, Nicolas Frattaroli X-Mailer: b4 0.14.3 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20251023_125134_893016_30294C40 X-CRM114-Status: GOOD ( 11.06 ) 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 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 --- 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