Browse Source

Merge "asoc: wcd939x: Use local trim for version 2.0"

qctecmdr 1 year ago
parent
commit
069af6015e
1 changed files with 6 additions and 1 deletions
  1. 6 1
      asoc/codecs/wcd939x/wcd939x.c

+ 6 - 1
asoc/codecs/wcd939x/wcd939x.c

@@ -5173,7 +5173,7 @@ static void wcd939x_update_regmap_cache(struct wcd939x_priv *wcd939x)
 
 static int wcd939x_bind(struct device *dev)
 {
-	int ret = 0, i = 0;
+	int ret = 0, i = 0, val = 0;
 	struct wcd939x_pdata *pdata = dev_get_platdata(dev);
 	struct wcd939x_priv *wcd939x = dev_get_drvdata(dev);
 	u8 id1 = 0, status1 = 0;
@@ -5230,6 +5230,11 @@ static int wcd939x_bind(struct device *dev)
 				__func__);
 		goto err;
 	}
+#if IS_ENABLED(CONFIG_QCOM_WCD_USBSS_I2C)
+	regmap_read(wcd939x->regmap, WCD939X_EFUSE_REG_17, &val);
+	if (wcd939x_version == WCD939X_VERSION_2_0 && val < 3)
+		wcd_usbss_update_default_trim();
+#endif
 	wcd939x_update_regmap_cache(wcd939x);
 
 	/* Set all interupts as edge triggered */