From patchwork Wed Jun 12 07:43:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AngeloGioacchino Del Regno X-Patchwork-Id: 804067 Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 20AC33D388; Wed, 12 Jun 2024 07:43:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.227.194 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718178206; cv=none; b=U3K9EtEYSvOKWDqmeBLSGfYibntmHndvKiwPxMe99kMjqXZNCn3itpJmSDlW6P3TLfqQ3Jb45MxHhQfc1Cs0M/WWJB+Be+M3X5/3mJSu4xpmKwdgxI3U/lnA37XNaKAaDAmZxQueYS+rSizn9kuUuYvYGOSkkFdTgRCpdPZKbS0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718178206; c=relaxed/simple; bh=2rsptygWifRO/c0OTQta4XS0LqTtMDZVNSsQpMH8z8A=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=FLbK/IohmGW9z/Ofc+w2qoZJSqNuFQw1lFf4mC4Vkkc6SpDciC/nzlh7UA1oNTZ2cXtJgcbXeCVgItqj94CyFRsG/GtKF9eypB9J+qt1m9MTBY42jvV6wSUmvRGpPdj/K/e7oDVj8CiESZHyhnKDTJy2J2Itizjk0favBafzc/M= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=2D5ReFgC; arc=none smtp.client-ip=46.235.227.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="2D5ReFgC" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1718178203; bh=2rsptygWifRO/c0OTQta4XS0LqTtMDZVNSsQpMH8z8A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2D5ReFgCJ0rNdPab1qhWShJZEjGyFXubQVbypSqm26hV10K6fOnoNldYMD6Ir5B4l dhCMjArm9ltXzjdeHpguPw2v2UyAy76xgyegFOSHz/rdRkH8suCc5jghYAHa8w1ao6 ESRPhlV+Zt5W+60sq1HDzpbHxXor5LAsKO7NdV4F5zvlFqUvGdZ4VfqAqHi2aH8W6Y cbjJKL3Ft2B5QnPEaNz38u0AdIr6vNnW/0/sgY4+wg+aT9mbcPIWDWwJPsYg1+adMa LorIwLHrd+g4dbAxr+Kf6b35R4UPipa2nxO8g63zgDEsBdQjihbFcLpgOprtotdaao OF7sbDCP+beAQ== Received: from IcarusMOD.eternityproject.eu (cola.collaboradmins.com [195.201.22.229]) (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: kholk11) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 4E45437820A9; Wed, 12 Jun 2024 07:43:22 +0000 (UTC) From: AngeloGioacchino Del Regno To: linux-scsi@vger.kernel.org Cc: alim.akhtar@samsung.com, avri.altman@wdc.com, bvanassche@acm.org, robh@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, peter.wang@mediatek.com, jejb@linux.ibm.com, martin.petersen@oracle.com, lgirdwood@gmail.com, broonie@kernel.org, matthias.bgg@gmail.com, angelogioacchino.delregno@collabora.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, wenst@chromium.org, michael@walle.cc Subject: [PATCH v5 1/8] scsi: ufs: ufs-mediatek: Remove useless mediatek,ufs-support-va09 property Date: Wed, 12 Jun 2024 09:43:02 +0200 Message-ID: <20240612074309.50278-2-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240612074309.50278-1-angelogioacchino.delregno@collabora.com> References: <20240612074309.50278-1-angelogioacchino.delregno@collabora.com> Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Remove checking the mediatek,ufs-support-va09 property to decide whether to try to support the VA09 regulator handling and change the ufs_mtk_init_va09_pwr_ctrl() function to make it call devm_regulator_get_optional(): if the regulator is present, then we set the UFS_MTK_CAP_VA09_PWR_CTRL, effectively enabling the handling of the VA09 regulator based on that. Also, make sure to pass the return value of the call to devm_regulator_get_optional() to the probe function, so that if it returns a probe deferral, the appropriate action will be taken. While at it, remove the error print (disguised as info...) when the va09 regulator was not found. Fixes: ac8c2459091c ("scsi: ufs-mediatek: Decouple features from platform bindings") Signed-off-by: AngeloGioacchino Del Regno --- drivers/ufs/host/ufs-mediatek.c | 34 +++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/drivers/ufs/host/ufs-mediatek.c b/drivers/ufs/host/ufs-mediatek.c index c7a0ab9b1f59..47c7d34b9be9 100644 --- a/drivers/ufs/host/ufs-mediatek.c +++ b/drivers/ufs/host/ufs-mediatek.c @@ -623,27 +623,38 @@ static void ufs_mtk_init_boost_crypt(struct ufs_hba *hba) return; } -static void ufs_mtk_init_va09_pwr_ctrl(struct ufs_hba *hba) +static int ufs_mtk_init_va09_pwr_ctrl(struct ufs_hba *hba) { struct ufs_mtk_host *host = ufshcd_get_variant(hba); + int ret; - host->reg_va09 = regulator_get(hba->dev, "va09"); - if (IS_ERR(host->reg_va09)) - dev_info(hba->dev, "failed to get va09"); - else - host->caps |= UFS_MTK_CAP_VA09_PWR_CTRL; + host->reg_va09 = devm_regulator_get_optional(hba->dev, "va09"); + if (IS_ERR(host->reg_va09)) { + ret = PTR_ERR(host->reg_va09); + + /* Return an error only if this is a deferral */ + if (ret == -EPROBE_DEFER) + return ret; + + return 0; + } + + host->caps |= UFS_MTK_CAP_VA09_PWR_CTRL; + return 0; } -static void ufs_mtk_init_host_caps(struct ufs_hba *hba) +static int ufs_mtk_init_host_caps(struct ufs_hba *hba) { struct ufs_mtk_host *host = ufshcd_get_variant(hba); struct device_node *np = hba->dev->of_node; + int ret; if (of_property_read_bool(np, "mediatek,ufs-boost-crypt")) ufs_mtk_init_boost_crypt(hba); - if (of_property_read_bool(np, "mediatek,ufs-support-va09")) - ufs_mtk_init_va09_pwr_ctrl(hba); + ret = ufs_mtk_init_va09_pwr_ctrl(hba); + if (ret) + return ret; if (of_property_read_bool(np, "mediatek,ufs-disable-ah8")) host->caps |= UFS_MTK_CAP_DISABLE_AH8; @@ -664,6 +675,7 @@ static void ufs_mtk_init_host_caps(struct ufs_hba *hba) host->caps |= UFS_MTK_CAP_RTFF_MTCMOS; dev_info(hba->dev, "caps: 0x%x", host->caps); + return 0; } static void ufs_mtk_scale_perf(struct ufs_hba *hba, bool scale_up) @@ -986,7 +998,9 @@ static int ufs_mtk_init(struct ufs_hba *hba) } /* Initialize host capability */ - ufs_mtk_init_host_caps(hba); + err = ufs_mtk_init_host_caps(hba); + if (err) + goto out; ufs_mtk_init_mcq_irq(hba); From patchwork Wed Jun 12 07:43:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AngeloGioacchino Del Regno X-Patchwork-Id: 804066 Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CF33716C856; Wed, 12 Jun 2024 07:43:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.227.194 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718178209; cv=none; b=ghcsHofhxGtYOOpaJUO+YUFsvaSim+qYeCBaIpifqQJkJ61I0X0HeA9W1fpsTGBsbA+bmsDTbVdk6i28oqWqSuHzzWX77WrSMbdxp7fF1GcU+tDT/PFWYjNJtaLYoREMbrv8ktTX9kyytZmZ5FpOHWWCfJm9jZaNb/QnQoTmfKQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718178209; c=relaxed/simple; bh=XTxdq7yH2tRPSNAKGFLMAQfypYpTrjvxDfqFeM7tqxw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=WQApOQ2Sls11z1ub6C2ncKE3p872kzWWTAQq5m90Hsn3jaV8ra1rKIlaVWf53EA2lrUaXpFSIY8ioUik75632Q6bVnxUjUe004Ji9QPRQbpKAnBaHxNFywwNtQSNxZD6PVPp8O6yd9Zlc1mnelpVE/vfZOq1QMCTbftU1S6KwYk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=P64NqKUr; arc=none smtp.client-ip=46.235.227.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="P64NqKUr" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1718178206; bh=XTxdq7yH2tRPSNAKGFLMAQfypYpTrjvxDfqFeM7tqxw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=P64NqKUrOcVq8coM8pIRjnqWlRA1bH6e2k9eoFmEXtl9mxjWsCe86QTzUbCfoJZ/E FAMmjlSCeKlz09ggH9hgfJ3SASzr79ABe+Y8YD2t0cSZDHwtZGrGDgk/RUPVASa4yR rizTeMkgmSt7Mrf0/V1hDctVcCR8T61oA88lePsFzdLuz5Wai/qb7JJPq2uS/AF87W F81bJwdRQjb3JdTteRZV+q7osXRZ/aQiOi90Cp4WZ7xKg86hugUJwepcDCHakruuaI 8ag4Ttilq88EwFTgz9QT37tpvge10n3IuckBlYnuTsnFfG7PPq2NvMCNv55UJDxgxu IvFxRVDpzmJiw== Received: from IcarusMOD.eternityproject.eu (cola.collaboradmins.com [195.201.22.229]) (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: kholk11) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 0C8A7378219A; Wed, 12 Jun 2024 07:43:24 +0000 (UTC) From: AngeloGioacchino Del Regno To: linux-scsi@vger.kernel.org Cc: alim.akhtar@samsung.com, avri.altman@wdc.com, bvanassche@acm.org, robh@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, peter.wang@mediatek.com, jejb@linux.ibm.com, martin.petersen@oracle.com, lgirdwood@gmail.com, broonie@kernel.org, matthias.bgg@gmail.com, angelogioacchino.delregno@collabora.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, wenst@chromium.org, michael@walle.cc Subject: [PATCH v5 3/8] scsi: ufs: ufs-mediatek: Remove useless mediatek,ufs-boost-crypt property Date: Wed, 12 Jun 2024 09:43:04 +0200 Message-ID: <20240612074309.50278-4-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240612074309.50278-1-angelogioacchino.delregno@collabora.com> References: <20240612074309.50278-1-angelogioacchino.delregno@collabora.com> Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 There is no need to have a property that activates the inline crypto boost feature, as this needs many things: a regulator, three clocks, and the mediatek,boost-crypt-microvolt property to be set. If any one of these is missing, the feature won't be activated, hence, it is useless to have yet one more property to enable that. While at it, also address another two issues: 1. Give back the return value to the caller and make sure to fail probing if we get an -EPROBE_DEFER or -ENOMEM; and 2. Free the ufs_mtk_crypt_cfg structure allocated in the crypto boost function if said functionality could not be enabled because it's not supported, as that'd be only wasted memory. Last but not least, move the devm_kzalloc() call for ufs_mtk_crypt_cfg to after getting the dvfsrc-vcore regulator and the boost microvolt property, as if those fail there's no reason to even allocate that. Fixes: ac8c2459091c ("scsi: ufs-mediatek: Decouple features from platform bindings") Signed-off-by: AngeloGioacchino Del Regno --- drivers/ufs/host/ufs-mediatek.c | 55 ++++++++++++++++++--------------- 1 file changed, 30 insertions(+), 25 deletions(-) diff --git a/drivers/ufs/host/ufs-mediatek.c b/drivers/ufs/host/ufs-mediatek.c index 23271eb1a244..8d0e7ea52541 100644 --- a/drivers/ufs/host/ufs-mediatek.c +++ b/drivers/ufs/host/ufs-mediatek.c @@ -576,51 +576,55 @@ static int ufs_mtk_init_host_clk(struct ufs_hba *hba, const char *name, return ret; } -static void ufs_mtk_init_boost_crypt(struct ufs_hba *hba) +static int ufs_mtk_init_boost_crypt(struct ufs_hba *hba) { struct ufs_mtk_host *host = ufshcd_get_variant(hba); struct ufs_mtk_crypt_cfg *cfg; struct device *dev = hba->dev; struct regulator *reg; u32 volt; - - host->crypt = devm_kzalloc(dev, sizeof(*(host->crypt)), - GFP_KERNEL); - if (!host->crypt) - goto disable_caps; + int ret; reg = devm_regulator_get_optional(dev, "dvfsrc-vcore"); if (IS_ERR(reg)) { - dev_info(dev, "failed to get dvfsrc-vcore: %ld", - PTR_ERR(reg)); - goto disable_caps; + ret = PTR_ERR(reg); + if (ret == -EPROBE_DEFER) + return ret; + + return 0; } - if (of_property_read_u32(dev->of_node, "mediatek,boost-crypt-microvolt", - &volt)) { + ret = of_property_read_u32(dev->of_node, "mediatek,boost-crypt-microvolt", &volt); + if (ret) { dev_info(dev, "failed to get mediatek,boost-crypt-microvolt"); - goto disable_caps; + return 0; } + host->crypt = devm_kzalloc(dev, sizeof(*host->crypt), GFP_KERNEL); + if (!host->crypt) + return -ENOMEM; + cfg = host->crypt; - if (ufs_mtk_init_host_clk(hba, "crypt_mux", - &cfg->clk_crypt_mux)) - goto disable_caps; + ret = ufs_mtk_init_host_clk(hba, "crypt_mux", &cfg->clk_crypt_mux); + if (ret) + goto out; - if (ufs_mtk_init_host_clk(hba, "crypt_lp", - &cfg->clk_crypt_lp)) - goto disable_caps; + ret = ufs_mtk_init_host_clk(hba, "crypt_lp", &cfg->clk_crypt_lp); + if (ret) + goto out; - if (ufs_mtk_init_host_clk(hba, "crypt_perf", - &cfg->clk_crypt_perf)) - goto disable_caps; + ret = ufs_mtk_init_host_clk(hba, "crypt_perf", &cfg->clk_crypt_perf); + if (ret) + goto out; cfg->reg_vcore = reg; cfg->vcore_volt = volt; host->caps |= UFS_MTK_CAP_BOOST_CRYPT_ENGINE; -disable_caps: - return; +out: + if (ret) + devm_kfree(dev, host->crypt); + return 0; } static int ufs_mtk_init_va09_pwr_ctrl(struct ufs_hba *hba) @@ -649,8 +653,9 @@ static int ufs_mtk_init_host_caps(struct ufs_hba *hba) struct device_node *np = hba->dev->of_node; int ret; - if (of_property_read_bool(np, "mediatek,ufs-boost-crypt")) - ufs_mtk_init_boost_crypt(hba); + ret = ufs_mtk_init_boost_crypt(hba); + if (ret) + return ret; ret = ufs_mtk_init_va09_pwr_ctrl(hba); if (ret) From patchwork Wed Jun 12 07:43:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AngeloGioacchino Del Regno X-Patchwork-Id: 804065 Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8689C16D33D; Wed, 12 Jun 2024 07:43:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.227.194 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718178212; cv=none; b=HaXCYy4XsuPaVMphhziqtz1c8wlIDfdBCVSl9iPLx3WPJnqH1o9Qs1cn+5nTM0qt2yX1AVlaMx/idfszri5H2R88c9hmy5Q06vguhaMJfN8Lbr2avc1iChgOwZ2g8AcEc3lGYZrh/LO8103L5vqN/f2u7RVHzODMix+CoEVZKB8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718178212; c=relaxed/simple; bh=K3rrJEbp/p/hbKG0ZLHrE2fpo1wxhHU8XVuRFaDmjOY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=gX+ED+IT3x+cpfvqU7Hkhotx2JCXTFebJ40VZ3VnQj2H28t0C2Bo7lfl6pYhxiVe2CT1n4ScRuiljuAfOXdbF3QdncxP4W0ASOWLsKAL+5H/rVACilZx4ZJusA8O7spvONm2U/ChVx1VIru4Yup3uC5GJiANz3Kg1rGr8yaMmiQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=I3OdBZ2w; arc=none smtp.client-ip=46.235.227.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="I3OdBZ2w" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1718178208; bh=K3rrJEbp/p/hbKG0ZLHrE2fpo1wxhHU8XVuRFaDmjOY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=I3OdBZ2w/fBbDobKQTv1ae1lqa+mQz8L/SUhkySAJAy8RsWFdCKI8pDAAsDfsRaws rXgNa69ya52w59XML8sVH5uCNkN3Fa+aCa4JxiCZD0quikLsXqfsb8wTGseHgltn63 2biAdVUJxNfAVSAEOYDFi9afgOwJeGsHAYFnsyR0tgyQK4Vnc2MvCw3ddeROsyrLdz sRU5anUYuzeNzLmMpvjnK3QY9u9dB0h90uHjMuQ3NqwII+oQz3n2/J5o2uwB57Ibgx O7+lH+icpWBTMwa5zg+K8ZKacs/kxF0ER3kOL48FazOTtHivXhgJYETjkY6LXeb/FN N3Y/Agoe/sI8A== Received: from IcarusMOD.eternityproject.eu (cola.collaboradmins.com [195.201.22.229]) (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: kholk11) by madrid.collaboradmins.com (Postfix) with ESMTPSA id B2D3B378219E; Wed, 12 Jun 2024 07:43:27 +0000 (UTC) From: AngeloGioacchino Del Regno To: linux-scsi@vger.kernel.org Cc: alim.akhtar@samsung.com, avri.altman@wdc.com, bvanassche@acm.org, robh@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, peter.wang@mediatek.com, jejb@linux.ibm.com, martin.petersen@oracle.com, lgirdwood@gmail.com, broonie@kernel.org, matthias.bgg@gmail.com, angelogioacchino.delregno@collabora.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, wenst@chromium.org, michael@walle.cc, Conor Dooley Subject: [PATCH v5 5/8] dt-bindings: ufs: mediatek,ufs: Document MT8192 compatible with MT8183 Date: Wed, 12 Jun 2024 09:43:06 +0200 Message-ID: <20240612074309.50278-6-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240612074309.50278-1-angelogioacchino.delregno@collabora.com> References: <20240612074309.50278-1-angelogioacchino.delregno@collabora.com> Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The MT8192 UFS controller is compatible with the MT8183 one: document this by allowing to assign both compatible strings "mediatek,mt8192-ufshci", "mediatek,mt8183-ufshci" to the UFSHCI node. Moreover, since no MT8192 devicetree ever declared any UFSHCI node, disallow specifying only the MT8192 compatible. In preparation for adding MT8195 to the mix, the MT8192 compatible was added as enum instead of const. Also, while at it, replace Stanley Chu with me in the maintainers field, as he is unreachable and his email isn't active anymore. Acked-by: Conor Dooley Signed-off-by: AngeloGioacchino Del Regno --- .../devicetree/bindings/ufs/mediatek,ufs.yaml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Documentation/devicetree/bindings/ufs/mediatek,ufs.yaml b/Documentation/devicetree/bindings/ufs/mediatek,ufs.yaml index 32fd535a514a..f14887ea6fdc 100644 --- a/Documentation/devicetree/bindings/ufs/mediatek,ufs.yaml +++ b/Documentation/devicetree/bindings/ufs/mediatek,ufs.yaml @@ -7,16 +7,19 @@ $schema: http://devicetree.org/meta-schemas/core.yaml# title: Mediatek Universal Flash Storage (UFS) Controller maintainers: - - Stanley Chu + - AngeloGioacchino Del Regno allOf: - $ref: ufs-common.yaml properties: compatible: - enum: - - mediatek,mt8183-ufshci - - mediatek,mt8192-ufshci + oneOf: + - const: mediatek,mt8183-ufshci + - items: + - enum: + - mediatek,mt8192-ufshci + - const: mediatek,mt8183-ufshci clocks: maxItems: 1 From patchwork Wed Jun 12 07:43:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AngeloGioacchino Del Regno X-Patchwork-Id: 804064 Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3546316D9AA; Wed, 12 Jun 2024 07:43:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.227.194 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718178214; cv=none; b=pitdHOuNSsiQetG7R2MtsWCsz8V/rEkQML1JHH3R2IT8Kvl9VUm7cPje/qVekNm58RCdIvFkq8lB08uMUT7tUUgw+v3eTMrWshQacmkRUVm2bpBmfzOVI5lDYTnnKSY4dx9AIFfeUGTr5fJ07+Bx7+CRG5AyNGXQg+EjgM2hmD0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718178214; c=relaxed/simple; bh=TLELbug1XiDukFE3ghBiM2MHhoU3imk1/7ngSSox3e8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rlsUTLFhj0FMp1zyjHdk1Csq89/elpEEyFnr1gwAyVyF8WTovEkN8X42MMu1IHVGffCYa9CToUzYDBhhve3lmZ+f/BCIUPIZ3rPddZxxDoUVuRoKCAab7/9Nv2sEt6n4WU6VcTsNHHARo4WafcW/6VT2e+GN/24vE3JFjZcsuEQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=crdOBphH; arc=none smtp.client-ip=46.235.227.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="crdOBphH" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1718178211; bh=TLELbug1XiDukFE3ghBiM2MHhoU3imk1/7ngSSox3e8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=crdOBphHW1I1MSSEvItDPGKYnqKmhVSresrVQRvPCzFKRubdocG1dgao4P/A2ny1k vXepq99nP+SEGpD7u4Qe6ULgbJ65lPxx2kzIiwzlSeOLggycIyHHKIm60x9R2oN+8l Y1LIUyK4x1gK1VfoaS9C+BwpymsXZLDQdsqc55muwpFMjDJLhhflA9wbUCZgtbV9ch tUX/fiR9oCg4OeDMxloh6NL4bJ0Y5Dd3Wv2WjoaHfMHYEeFgSjvH11Z/fOrLPwcBqy RMGjrvraJLszwuX+cpDJzGtMon/AnmNN4Edi1x0sjUlYFo+RBGrQ4XZS9zjrk5IzyG 3pYC5M9LxIMew== Received: from IcarusMOD.eternityproject.eu (cola.collaboradmins.com [195.201.22.229]) (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: kholk11) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 878EF37821A0; Wed, 12 Jun 2024 07:43:30 +0000 (UTC) From: AngeloGioacchino Del Regno To: linux-scsi@vger.kernel.org Cc: alim.akhtar@samsung.com, avri.altman@wdc.com, bvanassche@acm.org, robh@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, peter.wang@mediatek.com, jejb@linux.ibm.com, martin.petersen@oracle.com, lgirdwood@gmail.com, broonie@kernel.org, matthias.bgg@gmail.com, angelogioacchino.delregno@collabora.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, wenst@chromium.org, michael@walle.cc, Conor Dooley Subject: [PATCH v5 7/8] dt-bindings: ufs: mediatek,ufs: Document additional clocks Date: Wed, 12 Jun 2024 09:43:08 +0200 Message-ID: <20240612074309.50278-8-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240612074309.50278-1-angelogioacchino.delregno@collabora.com> References: <20240612074309.50278-1-angelogioacchino.delregno@collabora.com> Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Add additional clocks, used on all MediaTek SoCs' UFSHCI controllers: some of these clocks are optional and used only for scaling purposes to save power, or to improve performance in the case of the crypt clocks. Acked-by: Conor Dooley Signed-off-by: AngeloGioacchino Del Regno --- .../devicetree/bindings/ufs/mediatek,ufs.yaml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/ufs/mediatek,ufs.yaml b/Documentation/devicetree/bindings/ufs/mediatek,ufs.yaml index 5728e750761f..1df8779ee902 100644 --- a/Documentation/devicetree/bindings/ufs/mediatek,ufs.yaml +++ b/Documentation/devicetree/bindings/ufs/mediatek,ufs.yaml @@ -23,11 +23,24 @@ properties: - const: mediatek,mt8183-ufshci clocks: - maxItems: 1 + minItems: 1 + maxItems: 12 clock-names: + minItems: 1 items: - const: ufs + - const: ufs-aes + - const: ufs-tick + - const: unipro-sys + - const: unipro-tick + - const: ufs-sap + - const: ufs-tx-symbol + - const: ufs-rx-symbol + - const: ufs-mem + - const: crypt-mux + - const: crypt-lp + - const: crypt-perf phys: maxItems: 1