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 3BC26D6ACFB for ; Thu, 18 Dec 2025 12:57:09 +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=FpYHnYT8+dCzPC5cciqsXS2D6Lrb8PyAkQbxhD7vyq4=; b=CM1RNQ4h0r4OCE yJsoKFw167fE4xBWOsSMqZZheqtaf4jv7+wcysoqntK8wPWZsIxcGFbHUVyY5kyALeIrfca9A0Abp M5ea/H9x3FT7tkSeQtvuka/fLryLfzaHE/D0OExLz4nGeLqNTie1s49XyfmC7I5sRahnDA+K/8CPL SBhwCNPD5iRDjbTGJxa7COu5+0rWmCyZvXYomoles10TiRN4ufXoNd6xZejULn3gEJnWqPrcG0mOj T10WG8o8Mv8vf814fFhwLRW9BiVhnXDvclqLr3V70UWghUckASnxy4mHR+XR6kC/3kuIZVPzZrzVq RDcvDgrmcj7YtIhebOgg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1vWDZ6-00000008Sl4-3G5T; Thu, 18 Dec 2025 12:57:08 +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 1vWDYv-00000008SYF-3KHz; Thu, 18 Dec 2025 12:57:06 +0000 ARC-Seal: i=1; a=rsa-sha256; t=1766062608; cv=none; d=zohomail.com; s=zohoarc; b=XCTIj5jr/MbEG7Nxrk2UEXMjAt1VO2AQtnfvLPHQdHcEEWzlqs2FpuA9PGWkbKqjLdxMqV3z25VZlIUBzQZ0Sg1gd7gR6mYsdHyRXGnbHGP4VWrq6NPSNCLmv3OVmTHLeY4mNGAZyG3jqoZZmt6Jo3vASQNWeF7Xsey3C8BvqDU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1766062608; 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=jJiFeoZ/M5Al7+1C6wVPCkiJYqI4sv3GjNFC8VaIeWs=; b=CBwFv4tlCkVPn9bQ2DyEOdtiFC8YAowE0ckX8wg7wq+l8RB+E0U2jete70c1ucxanh0YjvNn3Nk8ZvuQp8/jXCkohf/G0uSKVdkHIw4MP4LHN4Ym056g7Kx7DokLb9890t1Vb5Rd1T/1QrsTpglC3imbHw7pJRzJCtpa1CUlr/k= 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=1766062608; 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=jJiFeoZ/M5Al7+1C6wVPCkiJYqI4sv3GjNFC8VaIeWs=; b=et3HgHL3NIg5fcxAeQCq/Zwb8Y0klAB1VbDOy/AHmJKPTzpU/0lEQ/yfdpWx0ASJ dmNO6WT8m7Hh45wu6U34XNmhJNBO23vhSEbQ3upnfw1x/GsLyAvuKk2bMJshUYHE4tJ QDwaS3fS58Fk1rDlGnZZINr8y21WEybNZpSo6VZc= Received: by mx.zohomail.com with SMTPS id 1766062607674226.3438815292385; Thu, 18 Dec 2025 04:56:47 -0800 (PST) From: Nicolas Frattaroli Date: Thu, 18 Dec 2025 13:55:02 +0100 Subject: [PATCH v4 12/25] scsi: ufs: mediatek: Remove vendor kernel quirks cruft MIME-Version: 1.0 Message-Id: <20251218-mt8196-ufs-v4-12-ddec7a369dd2@collabora.com> References: <20251218-mt8196-ufs-v4-0-ddec7a369dd2@collabora.com> In-Reply-To: <20251218-mt8196-ufs-v4-0-ddec7a369dd2@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 , Chaotian Jing , Neil Armstrong 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-20251218_045657_941820_35416354 X-CRM114-Status: GOOD ( 11.00 ) 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 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 cc6a3a4c9704..6385ebcc9142 100644 --- a/drivers/ufs/host/ufs-mediatek.c +++ b/drivers/ufs/host/ufs-mediatek.c @@ -1019,73 +1019,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; @@ -2005,8 +1938,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.52.0 -- linux-phy mailing list linux-phy@lists.infradead.org https://lists.infradead.org/mailman/listinfo/linux-phy