diff --git a/drivers/phy/qualcomm/phy-qcom-ufs-i.h b/drivers/phy/qualcomm/phy-qcom-ufs-i.h index 9bf973a0d8c3..282afa4b5561 100644 --- a/drivers/phy/qualcomm/phy-qcom-ufs-i.h +++ b/drivers/phy/qualcomm/phy-qcom-ufs-i.h @@ -16,6 +16,7 @@ #include #include #include +#include #define UFS_QCOM_PHY_CAL_ENTRY(reg, val) \ { \ @@ -104,6 +105,8 @@ struct ufs_qcom_phy { * @set_tx_lane_enable: pointer to a function that enable tx lanes * @power_control: pointer to a function that controls analog rail of phy * and writes to QSERDES_RX_SIGDET_CNTRL attribute + * @ctrl_rx_linecfg: pointer to a function that controls the enable/disable of + * Rx line config */ struct ufs_qcom_phy_specific_ops { int (*calibrate)(struct ufs_qcom_phy *ufs_qcom_phy, bool is_rate_B); @@ -111,6 +114,7 @@ struct ufs_qcom_phy_specific_ops { int (*is_physical_coding_sublayer_ready)(struct ufs_qcom_phy *phy); void (*set_tx_lane_enable)(struct ufs_qcom_phy *phy, u32 val); void (*power_control)(struct ufs_qcom_phy *phy, bool val); + void (*ctrl_rx_linecfg)(struct ufs_qcom_phy *phy, bool ctrl); }; struct ufs_qcom_phy *get_ufs_qcom_phy(struct phy *generic_phy); diff --git a/drivers/phy/qualcomm/phy-qcom-ufs.c b/drivers/phy/qualcomm/phy-qcom-ufs.c index 6749b989038b..9194cf470509 100644 --- a/drivers/phy/qualcomm/phy-qcom-ufs.c +++ b/drivers/phy/qualcomm/phy-qcom-ufs.c @@ -489,21 +489,13 @@ static int ufs_qcom_phy_start_serdes(struct ufs_qcom_phy *ufs_qcom_phy) return ret; } -int ufs_qcom_phy_set_tx_lane_enable(struct phy *generic_phy, u32 tx_lanes) +void ufs_qcom_phy_set_tx_lane_enable(struct phy *generic_phy, u32 tx_lanes) { struct ufs_qcom_phy *ufs_qcom_phy = get_ufs_qcom_phy(generic_phy); - int ret = 0; - if (!ufs_qcom_phy->phy_spec_ops->set_tx_lane_enable) { - dev_err(ufs_qcom_phy->dev, "%s: set_tx_lane_enable() callback is not supported\n", - __func__); - ret = -ENOTSUPP; - } else { + if (ufs_qcom_phy->phy_spec_ops->set_tx_lane_enable) ufs_qcom_phy->phy_spec_ops->set_tx_lane_enable(ufs_qcom_phy, tx_lanes); - } - - return ret; } EXPORT_SYMBOL_GPL(ufs_qcom_phy_set_tx_lane_enable); @@ -642,6 +634,15 @@ int ufs_qcom_phy_power_off(struct phy *generic_phy) } EXPORT_SYMBOL_GPL(ufs_qcom_phy_power_off); +void ufs_qcom_phy_ctrl_rx_linecfg(struct phy *generic_phy, bool ctrl) +{ + struct ufs_qcom_phy *ufs_qcom_phy = get_ufs_qcom_phy(generic_phy); + + if (ufs_qcom_phy->phy_spec_ops->ctrl_rx_linecfg) + ufs_qcom_phy->phy_spec_ops->ctrl_rx_linecfg(ufs_qcom_phy, ctrl); +} +EXPORT_SYMBOL(ufs_qcom_phy_ctrl_rx_linecfg); + MODULE_AUTHOR("Yaniv Gardi "); MODULE_AUTHOR("Vivek Gautam "); MODULE_DESCRIPTION("Universal Flash Storage (UFS) QCOM PHY"); diff --git a/include/linux/phy/phy-qcom-ufs.h b/include/linux/phy/phy-qcom-ufs.h new file mode 100644 index 000000000000..222173bf683d --- /dev/null +++ b/include/linux/phy/phy-qcom-ufs.h @@ -0,0 +1,15 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* + * Copyright (c) 2013-2019, Linux Foundation. All rights reserved. + */ + +#ifndef PHY_QCOM_UFS_H_ +#define PHY_QCOM_UFS_H_ + +#include "phy.h" + +void ufs_qcom_phy_ctrl_rx_linecfg(struct phy *generic_phy, bool ctrl); +void ufs_qcom_phy_set_tx_lane_enable(struct phy *generic_phy, u32 tx_lanes); + +#endif /* PHY_QCOM_UFS_H_ */ +