linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] usb: typec: tcpci_mt6360: Update for BMC PHY setting
@ 2022-05-10  1:44 cy_huang
  2022-05-10  3:36 ` Guenter Roeck
  0 siblings, 1 reply; 2+ messages in thread
From: cy_huang @ 2022-05-10  1:44 UTC (permalink / raw)
  To: linux, heikki.krogerus, gregkh, matthias.bgg
  Cc: cy_huang, bryan_huang, linux-usb, linux-arm-kernel,
	linux-mediatek, linux-kernel

From: ChiYuan Huang <cy_huang@richtek.com>

Update MT6360 BMC PHY Tx/Rx setting for the compatibility.

Signed-off-by: ChiYuan Huang <cy_huang@richtek.com>
---
Hi,

Recently, there's some USBPD MT6360 IOP issue from the user.
From our RD's comment, BMC PHY Tx/Rx setting need to be updated for
the compatibility issue.
---
 drivers/usb/typec/tcpm/tcpci_mt6360.c | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/drivers/usb/typec/tcpm/tcpci_mt6360.c b/drivers/usb/typec/tcpm/tcpci_mt6360.c
index f1bd9e0..8a952ea 100644
--- a/drivers/usb/typec/tcpm/tcpci_mt6360.c
+++ b/drivers/usb/typec/tcpm/tcpci_mt6360.c
@@ -15,6 +15,9 @@
 
 #include "tcpci.h"
 
+#define MT6360_REG_PHYCTRL1	0x80
+#define MT6360_REG_PHYCTRL3	0x82
+#define MT6360_REG_PHYCTRL7	0x86
 #define MT6360_REG_VCONNCTRL1	0x8C
 #define MT6360_REG_MODECTRL2	0x8F
 #define MT6360_REG_SWRESET	0xA0
@@ -22,6 +25,8 @@
 #define MT6360_REG_DRPCTRL1	0xA2
 #define MT6360_REG_DRPCTRL2	0xA3
 #define MT6360_REG_I2CTORST	0xBF
+#define MT6360_REG_PHYCTRL11	0xCA
+#define MT6360_REG_RXCTRL1	0xCE
 #define MT6360_REG_RXCTRL2	0xCF
 #define MT6360_REG_CTDCTRL2	0xEC
 
@@ -106,6 +111,27 @@ static int mt6360_tcpc_init(struct tcpci *tcpci, struct tcpci_data *tdata)
 	if (ret)
 		return ret;
 
+	/* BMC PHY */
+	ret = mt6360_tcpc_write16(regmap, MT6360_REG_PHYCTRL1, 0x3A70);
+	if (ret)
+		return ret;
+
+	ret = regmap_write(regmap, MT6360_REG_PHYCTRL3,  0x82);
+	if (ret)
+		return ret;
+
+	ret = regmap_write(regmap, MT6360_REG_PHYCTRL7, 0x36);
+	if (ret)
+		return ret;
+
+	ret = mt6360_tcpc_write16(regmap, MT6360_REG_PHYCTRL11, 0x3C60);
+	if (ret)
+		return ret;
+
+	ret = regmap_write(regmap, MT6360_REG_RXCTRL1, 0xE8);
+	if (ret)
+		return ret;
+
 	/* Set shipping mode off, AUTOIDLE on */
 	return regmap_write(regmap, MT6360_REG_MODECTRL2, 0x7A);
 }
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] usb: typec: tcpci_mt6360: Update for BMC PHY setting
  2022-05-10  1:44 [PATCH] usb: typec: tcpci_mt6360: Update for BMC PHY setting cy_huang
@ 2022-05-10  3:36 ` Guenter Roeck
  0 siblings, 0 replies; 2+ messages in thread
From: Guenter Roeck @ 2022-05-10  3:36 UTC (permalink / raw)
  To: cy_huang, heikki.krogerus, gregkh, matthias.bgg
  Cc: cy_huang, bryan_huang, linux-usb, linux-arm-kernel,
	linux-mediatek, linux-kernel

On 5/9/22 18:44, cy_huang wrote:
> From: ChiYuan Huang <cy_huang@richtek.com>
> 
> Update MT6360 BMC PHY Tx/Rx setting for the compatibility.
> 
> Signed-off-by: ChiYuan Huang <cy_huang@richtek.com>
> ---
> Hi,
> 
> Recently, there's some USBPD MT6360 IOP issue from the user.
>>From our RD's comment, BMC PHY Tx/Rx setting need to be updated for
> the compatibility issue.

I think this needs to be a bit more detailed. What compatibility issue ?
Compatibility with what ?

Thanks,
Guenter

> ---
>   drivers/usb/typec/tcpm/tcpci_mt6360.c | 26 ++++++++++++++++++++++++++
>   1 file changed, 26 insertions(+)
> 
> diff --git a/drivers/usb/typec/tcpm/tcpci_mt6360.c b/drivers/usb/typec/tcpm/tcpci_mt6360.c
> index f1bd9e0..8a952ea 100644
> --- a/drivers/usb/typec/tcpm/tcpci_mt6360.c
> +++ b/drivers/usb/typec/tcpm/tcpci_mt6360.c
> @@ -15,6 +15,9 @@
>   
>   #include "tcpci.h"
>   
> +#define MT6360_REG_PHYCTRL1	0x80
> +#define MT6360_REG_PHYCTRL3	0x82
> +#define MT6360_REG_PHYCTRL7	0x86
>   #define MT6360_REG_VCONNCTRL1	0x8C
>   #define MT6360_REG_MODECTRL2	0x8F
>   #define MT6360_REG_SWRESET	0xA0
> @@ -22,6 +25,8 @@
>   #define MT6360_REG_DRPCTRL1	0xA2
>   #define MT6360_REG_DRPCTRL2	0xA3
>   #define MT6360_REG_I2CTORST	0xBF
> +#define MT6360_REG_PHYCTRL11	0xCA
> +#define MT6360_REG_RXCTRL1	0xCE
>   #define MT6360_REG_RXCTRL2	0xCF
>   #define MT6360_REG_CTDCTRL2	0xEC
>   
> @@ -106,6 +111,27 @@ static int mt6360_tcpc_init(struct tcpci *tcpci, struct tcpci_data *tdata)
>   	if (ret)
>   		return ret;
>   
> +	/* BMC PHY */
> +	ret = mt6360_tcpc_write16(regmap, MT6360_REG_PHYCTRL1, 0x3A70);
> +	if (ret)
> +		return ret;
> +
> +	ret = regmap_write(regmap, MT6360_REG_PHYCTRL3,  0x82);
> +	if (ret)
> +		return ret;
> +
> +	ret = regmap_write(regmap, MT6360_REG_PHYCTRL7, 0x36);
> +	if (ret)
> +		return ret;
> +
> +	ret = mt6360_tcpc_write16(regmap, MT6360_REG_PHYCTRL11, 0x3C60);
> +	if (ret)
> +		return ret;
> +
> +	ret = regmap_write(regmap, MT6360_REG_RXCTRL1, 0xE8);
> +	if (ret)
> +		return ret;
> +
>   	/* Set shipping mode off, AUTOIDLE on */
>   	return regmap_write(regmap, MT6360_REG_MODECTRL2, 0x7A);
>   }


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-05-10  3:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-10  1:44 [PATCH] usb: typec: tcpci_mt6360: Update for BMC PHY setting cy_huang
2022-05-10  3:36 ` Guenter Roeck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).