Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9b0c05f1 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "scsi: ufs-qti: port UFS driver changes for QTI configuration"

parents 4837fa24 41029bb5
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@
#include <linux/io.h>
#include <linux/delay.h>
#include <linux/iopoll.h>
#include <linux/phy/phy-qcom-ufs.h>

#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);
+11 −10
Original line number Diff line number Diff line
@@ -489,22 +489,14 @@ 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);

void ufs_qcom_phy_save_controller_version(struct phy *generic_phy,
@@ -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 <ygardi@codeaurora.org>");
MODULE_AUTHOR("Vivek Gautam <vivek.gautam@codeaurora.org>");
MODULE_DESCRIPTION("Universal Flash Storage (UFS) QCOM PHY");
+1 −0
Original line number Diff line number Diff line
@@ -101,6 +101,7 @@ obj-$(CONFIG_MEGARAID_NEWGEN) += megaraid/
obj-$(CONFIG_MEGARAID_SAS)	+= megaraid/
obj-$(CONFIG_SCSI_MPT3SAS)	+= mpt3sas/
obj-$(CONFIG_SCSI_UFSHCD)	+= ufs/
obj-$(CONFIG_SCSI_UFSHCD_QTI)	+= ufs/
obj-$(CONFIG_SCSI_ACARD)	+= atp870u.o
obj-$(CONFIG_SCSI_SUNESP)	+= esp_scsi.o	sun_esp.o
obj-$(CONFIG_SCSI_GDTH)		+= gdth.o
+21 −3
Original line number Diff line number Diff line
@@ -50,6 +50,24 @@ config SCSI_UFSHCD
	  However, do not compile this as a module if your root file system
	  (the one containing the directory /) is located on a UFS device.

config SCSI_UFSHCD_QTI
	tristate "Universal Flash Storage Controller Driver Core QTI"
	depends on SCSI && SCSI_DMA && QGKI && !SCSI_UFSHCD
	select PM_DEVFREQ
	select DEVFREQ_GOV_SIMPLE_ONDEMAND
	select NLS
	help
	This selects the support for QTI UFS devices in Linux, say Y and make
	  sure that you know the name of your UFS host adapter (the card
	  inside your computer that "speaks" the UFS protocol, also
	  called UFS Host Controller), because you will be asked for it.
	  The module will be called ufshcd-qti.

	  To compile this driver as a module, choose M here and read
	  <file:Documentation/scsi/ufs.txt>.
	  However, do not compile this as a module if your root file system
	  (the one containing the directory /) is located on a UFS device.

config SCSI_UFSHCD_PCI
	tristate "PCI bus based UFS Controller support"
	depends on SCSI_UFSHCD && PCI
@@ -71,7 +89,7 @@ config SCSI_UFS_DWC_TC_PCI

config SCSI_UFSHCD_PLATFORM
	tristate "Platform bus based UFS Controller support"
	depends on SCSI_UFSHCD
	depends on (SCSI_UFSHCD || SCSI_UFSHCD_QTI)
	---help---
	This selects the UFS host controller support. Select this if
	you have an UFS controller on Platform bus.
@@ -98,7 +116,7 @@ config SCSI_UFS_DWC_TC_PLATFORM

config SCSI_UFS_QCOM
	tristate "QCOM specific hooks to UFS controller platform driver"
	depends on SCSI_UFSHCD_PLATFORM && ARCH_QCOM
	depends on SCSI_UFSHCD_PLATFORM && ARCH_QCOM && PHY_QCOM_UFS
	select RESET_CONTROLLER
	help
	  This selects the QCOM specific additions to UFSHCD platform driver.
@@ -134,7 +152,7 @@ config SCSI_UFS_HISI

config SCSI_UFS_BSG
	bool "Universal Flash Storage BSG device node"
	depends on SCSI_UFSHCD
	depends on (SCSI_UFSHCD || SCSI_UFSHCD_QTI)
	select BLK_DEV_BSGLIB
	help
	  Universal Flash Storage (UFS) is SCSI transport specification for
+3 −0
Original line number Diff line number Diff line
@@ -11,4 +11,7 @@ obj-$(CONFIG_SCSI_UFSHCD_PCI) += ufshcd-pci.o
obj-$(CONFIG_SCSI_UFSHCD_PLATFORM) += ufshcd-pltfrm.o
obj-$(CONFIG_SCSI_UFS_HISI) += ufs-hisi.o
obj-$(CONFIG_SCSI_UFS_MEDIATEK) += ufs-mediatek.o
obj-$(CONFIG_SCSI_UFSHCD_QTI) += ufshcd-qti-core.o
ufshcd-qti-core-y		+= ufshcd-qti.o ufs-sysfs.o
ufshcd-qti-core-$(CONFIG_SCSI_UFS_BSG)	+= ufs_bsg.o
ufshcd-core-$(CONFIG_SCSI_UFS_CRYPTO) += ufshcd-crypto.o
Loading