+What: /sys/bus/platform/drivers/ufshcd/*/wb_toggle_buf_resize
+What: /sys/bus/platform/devices/*.ufs/wb_toggle_buf_resize
+Date: Qct 2024
+Contact: Huan Tang <tanghuan@xxxxxxxx>
+Description:
+ The host can decrease or increase the WriteBooster Buffer size by setting
+ this file.
+
+ ====== ======================================
+ 00h Idle (There is no resize operation)
+ 01h Decrease WriteBooster Buffer Size
+ 02h Increase WriteBooster Buffer Size
+ Others Reserved
+ ====== ======================================
+
+ The file is write only.
+
+What: /sys/bus/platform/drivers/ufshcd/*/attributes/wb_buf_resize_status
+What: /sys/bus/platform/devices/*.ufs/attributes/wb_buf_resize_status
+Date: Qct 2024
+Contact: Huan Tang <tanghuan@xxxxxxxx>
+Description:
+ The host can check the Resize operation status of the WriteBooster Buffer
+ by reading this file.
+
+ ====== ========================================
+ 00h Idle (resize operation is not issued)
+ 01h Resize operation in progress
+ 02h Resize operation completed successfully
+ 03h Resize operation general failure
+ Others Reserved
+ ====== ========================================
+static ssize_t wb_toggle_buf_resize_store(struct device *dev,
+ struct device_attribute *attr, const char *buf, size_t count)
+{
+ struct ufs_hba *hba = dev_get_drvdata(dev);
+ unsigned int wb_buf_resize_op;
+int ufshcd_wb_toggle_buf_resize(struct ufs_hba *hba, u32 op)
+{
+ int ret;
+ u8 index;
+
+ index = ufshcd_wb_get_query_index(hba);
+ ret = ufshcd_query_attr_retry(hba, UPIU_QUERY_OPCODE_WRITE_ATTR,
+ QUERY_ATTR_IDN_WB_BUF_RESIZE_EN, index, 0, &op);
+ if (ret)
+ dev_err(hba->dev, "%s: Enable WB buf resize operation failed %d\n",
+ __func__, ret);
+
+ return ret;
+}