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

Commit 8bd4723a authored by Jack Pham's avatar Jack Pham
Browse files

usb: pd: pdphy: Update Tx Trim setting



HW recommendation is to set the TX_TRIM_3 value to 0x2 for
a steeper slope. This improves eye diagram testing result.
This register is secure access so write to the SEC_ACCESS
prior to setting this.

Change-Id: I80b0a02feb0e4d1fb382407087fa30f390641ccb
Signed-off-by: default avatarJack Pham <jackp@codeaurora.org>
parent 1526cac8
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -71,6 +71,9 @@

#define USB_PDPHY_RX_BUFFER		0x80

#define USB_PDPHY_SEC_ACCESS		0xD0
#define USB_PDPHY_TRIM_3		0xF3

/* VDD regulator */
#define VDD_PDPHY_VOL_MIN		3088000 /* uV */
#define VDD_PDPHY_VOL_MAX		3088000 /* uV */
@@ -806,6 +809,14 @@ static int pdphy_probe(struct platform_device *pdev)
	if (ret < 0)
		return ret;

	ret = pdphy_reg_write(pdphy, USB_PDPHY_SEC_ACCESS, 0xA5);
	if (ret)
		return ret;

	ret = pdphy_reg_write(pdphy, USB_PDPHY_TRIM_3, 0x2);
	if (ret)
		return ret;

	/* usbpd_create() could call back to us, so have __pdphy ready */
	__pdphy = pdphy;