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

Commit 5378a494 authored by Mayank Rana's avatar Mayank Rana
Browse files

usb: qmp: phy: Add misc override QMP PHY configuration



To get required fine tuning of QMP PHY configuration on few platform
revision, add required configuration as misc override configuration.

This change enables the same misc configuration for 8996 v2 devices.

Change-Id: Id51474320dfb17ac9944aef8eb834ab23c9b0faa
Signed-off-by: default avatarMayank Rana <mrana@codeaurora.org>
parent 440a19dc
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -585,3 +585,7 @@
&mdss_hdmi_tx {
	status = "ok";
};

&ssphy {
	qcom,qmp-misc-config;
};
+12 −5
Original line number Diff line number Diff line
@@ -213,15 +213,11 @@ static const struct qmp_reg_val qmp_settings_rev2[] = {
	{0x174, 0x30}, /* QSERDES_COM_CLK_SELECT */
	{0x194, 0x06}, /* QSERDES_COM_CMN_CONFIG */
	{0x19C, 0x01}, /* QSERDES_COM_SVS_MODE_CLK_SEL */
	{0x178, 0x01}, /* QSERDES_COM_HSCLK_SEL */
	{0x178, 0x00}, /* QSERDES_COM_HSCLK_SEL */
	{0x70, 0x0F}, /* USB3PHY_QSERDES_COM_BG_TRIM */
	{0x48, 0x0F}, /* USB3PHY_QSERDES_COM_PLL_IVCO */
	{0x3C, 0x04}, /* QSERDES_COM_SYS_CLK_CTRL */

	/* Res_code settings */
	{0xC4, 0x15}, /* USB3PHY_QSERDES_COM_RESCODE_DIV_NUM */
	{0x1B8, 0x1F}, /* QSERDES_COM_CMN_MISC2 */

	/* PLL and Loop filter settings */
	{0xD0, 0x82}, /* QSERDES_COM_DEC_START_MODE0 */
	{0xDC, 0x55}, /* QSERDES_COM_DIV_FRAC_START1_MODE0 */
@@ -282,6 +278,16 @@ static const struct qmp_reg_val qmp_settings_rev2[] = {
	{-1, -1} /* terminating entry */
};

/* Override for QMP PHY revision 2 */
static const struct qmp_reg_val qmp_settings_rev2_misc[] = {
	{0x178, 0x01}, /* QSERDES_COM_HSCLK_SEL */

	/* Res_code settings */
	{0xC4, 0x15}, /* USB3PHY_QSERDES_COM_RESCODE_DIV_NUM */
	{0x1B8, 0x1F}, /* QSERDES_COM_CMN_MISC2 */
	{-1, -1} /* terminating entry */
};

/* Override PLL Calibration */
static const struct qmp_reg_val qmp_override_pll[] = {
	{0x04, 0xE1}, /* QSERDES_COM_PLL_VCOTAIL_EN */
@@ -536,6 +542,7 @@ static int msm_ssphy_qmp_init(struct usb_phy *uphy)
	case 0x20000000:
	case 0x20000001:
		reg = qmp_settings_rev2;
		misc = qmp_settings_rev2_misc;
		break;
	default:
		dev_err(uphy->dev, "Unknown revid 0x%x, cannot initialize PHY\n",