@@ -210,6 +210,17 @@ static void ufshcd_init_lanes_per_dir(struct ufs_hba *hba)
}
}
+/**
+ * ufshcd_parse_lpm_support - read from DT whether LPM modes should be disabled.
+ * @hba: host controller instance
+ */
+static void ufshcd_parse_lpm_support(struct ufs_hba *hba)
+{
+ struct device *dev = hba->dev;
+
+ hba->disable_lpm = of_property_read_bool(dev->of_node, "disable-lpm");
+}
+
/**
* ufshcd_parse_clock_min_max_freq - Parse MIN and MAX clocks freq
* @hba: per adapter instance
@@ -495,6 +506,8 @@ int ufshcd_pltfrm_init(struct platform_device *pdev,
ufshcd_init_lanes_per_dir(hba);
+ ufshcd_parse_lpm_support(hba);
+
err = ufshcd_parse_operating_points(hba);
if (err) {
dev_err(dev, "%s: OPP parse failed %d\n", __func__, err);
@@ -1143,6 +1143,7 @@ struct ufs_hba {
int critical_health_count;
atomic_t dev_lvl_exception_count;
u64 dev_lvl_exception_id;
+ bool disable_lpm;
};
/**
There are emulation FPGA platforms or other platforms where UFS low power mode is either unsupported or power efficiency is not a critical requirement. Add support for parsing disable LPM property from device tree . The disable lpm support in devicetree is added through the "disable-lpm" property for such platforms. Disabling LPM ensure stable operation and compatibility with these environments, where power management features might interfere with performance or functionality. Signed-off-by: Nitin Rawat <quic_nitirawa@quicinc.com> --- drivers/ufs/host/ufshcd-pltfrm.c | 13 +++++++++++++ include/ufs/ufshcd.h | 1 + 2 files changed, 14 insertions(+) -- 2.48.1