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

Commit 41f158e5 authored by Yaniv Gardi's avatar Yaniv Gardi Committed by Gerrit - the friendly Code Review server
Browse files

scsi: ufs: enable ufs driver to support generic PHY framework



In this change, ufs driver is using the generic PHY framework,
by calling the API "devm_phy_get" that returns handle to a generic
PHY driver.

In this change "__maybe_unused" flag of a few callbacks is removed
since those callbacks are now hooked to generic PHY driver APIs that
were added.

This change also includes the required DT changes as in this case,
the driver changes derived from the DT changes and therefor must
be placed within the same change.

Change-Id: I10e15e25d050bedca55a058b79240360564aebcd
Signed-off-by: default avatarYaniv Gardi <ygardi@codeaurora.org>
parent 21bd073f
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -10,6 +10,8 @@ Required properties:

Optional properties:
- phys                  : phandle to UFS PHY node
- phy-names		: the string "ufs_msm_phy" when is found in a node, along
			  with "phys" attribute, provides phandle to UFS PHY node
- vdd-hba-supply        : phandle to UFS host controller supply regulator node
- vcc-supply            : phandle to VCC supply regulator node
- vccq-supply           : phandle to VCCQ supply regulator node
+1 −0
Original line number Diff line number Diff line
@@ -4674,6 +4674,7 @@
		reg = <0xfc594000 0x800>;
		interrupts = <0 28 0>;
		phys = <&ufsphy1>;
		phy-names = "ufs_msm_phy";
		vcc-supply = <&pma8084_l19>;
		vccq-supply = <&pma8084_l4>;
		vccq2-supply = <&pma8084_s4>;
+1 −0
Original line number Diff line number Diff line
@@ -975,6 +975,7 @@
			reg = <0xfc594000 0x2500>;
			interrupts = <0 265 0>;
			phys = <&ufsphy1>;
			phy-names = "ufs_msm_phy";
			vdd-hba-supply = <&gdsc_ufs>;
			vdd-hba-fixed-regulator;
			vcc-supply = <&pm8994_l20>;
+4 −4
Original line number Diff line number Diff line
@@ -158,8 +158,7 @@ static int ufs_msm_phy_qmp_20nm_is_pcs_ready(struct ufs_msm_phy *phy_common)
	return err;
}

static void __maybe_unused
ufs_msm_phy_qmp_20nm_advertise_quirks(struct phy *generic_phy)
static void ufs_msm_phy_qmp_20nm_advertise_quirks(struct phy *generic_phy)
{
	struct ufs_msm_phy_qmp_20nm *phy =  phy_get_drvdata(generic_phy);
	struct ufs_msm_phy *phy_common = &(phy->common_cfg);
@@ -173,6 +172,7 @@ struct phy_ops ufs_msm_phy_qmp_20nm_phy_ops = {
	.exit		= ufs_msm_phy_exit,
	.power_on	= ufs_msm_phy_power_on,
	.power_off	= ufs_msm_phy_power_off,
	.advertise_quirks = ufs_msm_phy_qmp_20nm_advertise_quirks,
	.owner		= THIS_MODULE,
};

+7 −7
Original line number Diff line number Diff line
@@ -209,8 +209,7 @@ ufs_msm_phy_qmp_28nm_write_attr(struct phy *generic_phy, u32 attr, u32 val)
	writel_relaxed(0x00, phy_common->mmio + UFS_PHY_RMMI_ATTR_CTRL);
}

static void __maybe_unused
ufs_msm_phy_qmp_28nm_restore_attrs(struct phy *generic_phy)
static void ufs_msm_phy_qmp_28nm_restore_attrs(struct phy *generic_phy)
{
	int i;

@@ -233,9 +232,7 @@ static int ufs_msm_phy_qmp_28nm_is_pcs_ready(struct ufs_msm_phy *phy_common)
	return err;
}

static
void __maybe_unused
ufs_msm_phy_qmp_28nm_advertise_quirks(struct phy *generic_phy)
static void ufs_msm_phy_qmp_28nm_advertise_quirks(struct phy *generic_phy)
{
	struct ufs_msm_phy_qmp_28nm *phy =  phy_get_drvdata(generic_phy);
	struct ufs_msm_phy *phy_common = &(phy->common_cfg);
@@ -244,7 +241,7 @@ ufs_msm_phy_qmp_28nm_advertise_quirks(struct phy *generic_phy)
				| MSM_UFS_PHY_DIS_SIGDET_BEFORE_PWR_COLLAPSE;
}

static int __maybe_unused ufs_msm_phy_qmp_28nm_suspend(struct phy *generic_phy)
static int ufs_msm_phy_qmp_28nm_suspend(struct phy *generic_phy)
{
	struct ufs_msm_phy_qmp_28nm *phy =  phy_get_drvdata(generic_phy);
	struct ufs_msm_phy *phy_common = &(phy->common_cfg);
@@ -258,7 +255,7 @@ static int __maybe_unused ufs_msm_phy_qmp_28nm_suspend(struct phy *generic_phy)
	return 0;
}

static int __maybe_unused ufs_msm_phy_qmp_28nm_resume(struct phy *generic_phy)
static int ufs_msm_phy_qmp_28nm_resume(struct phy *generic_phy)
{
	struct ufs_msm_phy_qmp_28nm *phy = phy_get_drvdata(generic_phy);
	struct ufs_msm_phy *phy_common = &phy->common_cfg;
@@ -281,6 +278,9 @@ struct phy_ops ufs_msm_phy_qmp_28nm_phy_ops = {
	.exit		= ufs_msm_phy_exit,
	.power_on	= ufs_msm_phy_power_on,
	.power_off	= ufs_msm_phy_power_off,
	.advertise_quirks = ufs_msm_phy_qmp_28nm_advertise_quirks,
	.suspend	= ufs_msm_phy_qmp_28nm_suspend,
	.resume		= ufs_msm_phy_qmp_28nm_resume,
	.owner		= THIS_MODULE,
};

Loading