Kaynağa Gözat

pinctrl: starfive: Set up usb overcurrent signal

For devkit HW design, there is not GPIO specific
for the usb controller overcurrent signal.
Config the sys iomux register to hardwire this
signal, so that the usb controller can work normally.

Signed-off-by: Mason Huo <mason.huo@starfivetech.com>
Mason Huo 1 yıl önce
ebeveyn
işleme
9572aaa976
1 değiştirilmiş dosya ile 14 ekleme ve 1 silme
  1. 14 1
      drivers/pinctrl/starfive/pinctrl-jh7110-sys.c

+ 14 - 1
drivers/pinctrl/starfive/pinctrl-jh7110-sys.c

@@ -376,10 +376,23 @@ const struct starfive_pinctrl_soc_info jh7110_sys_pinctrl_info = {
 
 static int jh7110_sys_pinctrl_probe(struct udevice *dev)
 {
+	u32 value;
+	int ret;
 	struct starfive_pinctrl_soc_info *info =
 		(struct starfive_pinctrl_soc_info *)dev_get_driver_data(dev);
+	struct starfive_pinctrl_priv *priv = dev_get_priv(dev);
+
+	ret = starfive_pinctrl_probe(dev, info);
+
+	/* Set up the usb controller overcurrent signal. */
+	if (!ret) {
+		value = readl(priv->base + JH7110_SYS_GPI);
+		value &= ~(0x7f << 16);
+		value |= BIT(16);
+		writel(value, priv->base + JH7110_SYS_GPI);
+	}
 
-	return starfive_pinctrl_probe(dev, info);
+	return ret;
 }
 
 static const struct udevice_id jh7110_sys_pinctrl_ids[] = {