diff mbox series

phy: omap-usb2-phy: Drop usage of "ti, dis-chg-det-quirk" DT property

Message ID 20201008092838.5152-1-vigneshr@ti.com
State Accepted
Commit 555ee3949307648d6c40081b30e212af075ab8a8
Delegated to: Lokesh Vutla
Headers show
Series phy: omap-usb2-phy: Drop usage of "ti, dis-chg-det-quirk" DT property | expand

Commit Message

Raghavendra, Vignesh Oct. 8, 2020, 9:28 a.m. UTC
"ti,dis-chg-det-quirk" property is not part of Linux kernel DT binding
documentation.  Therefore drop this and instead use soc_device_match()
to distinguish b/w AM654 SR1.0 and SR2.0 devices similar to Linux kernel
driver.

Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
---
 drivers/phy/omap-usb2-phy.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

Comments

Lokesh Vutla Oct. 12, 2020, 9:09 a.m. UTC | #1
On 08/10/20 2:58 pm, Vignesh Raghavendra wrote:
> "ti,dis-chg-det-quirk" property is not part of Linux kernel DT binding
> documentation.  Therefore drop this and instead use soc_device_match()
> to distinguish b/w AM654 SR1.0 and SR2.0 devices similar to Linux kernel
> driver.
> 
> Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>


Applied to u-boot-ti.

Thanks and regards,
Lokesh
diff mbox series

Patch

diff --git a/drivers/phy/omap-usb2-phy.c b/drivers/phy/omap-usb2-phy.c
index adc454ddd4..a981cb2f8d 100644
--- a/drivers/phy/omap-usb2-phy.c
+++ b/drivers/phy/omap-usb2-phy.c
@@ -12,6 +12,7 @@ 
 #include <errno.h>
 #include <generic-phy.h>
 #include <regmap.h>
+#include <soc.h>
 #include <syscon.h>
 #include <linux/bitops.h>
 #include <linux/err.h>
@@ -196,6 +197,11 @@  struct phy_ops omap_usb2_phy_ops = {
 	.exit = omap_usb2_phy_exit,
 };
 
+static const struct soc_attr am65x_sr10_soc_devices[] = {
+	{ .family = "AM65X", .revision = "SR1.0" },
+	{ /* sentinel */ }
+};
+
 int omap_usb2_phy_probe(struct udevice *dev)
 {
 	int rc;
@@ -222,10 +228,9 @@  int omap_usb2_phy_probe(struct udevice *dev)
 	 * Disabling the USB2_PHY Charger Detect function will put D+
 	 * into the normal state.
 	 *
-	 * Using property "ti,dis-chg-det-quirk" in the DT usb2-phy node
-	 * to enable this workaround for AM654x PG1.0.
+	 * Enable this workaround for AM654x PG1.0.
 	 */
-	if (dev_read_bool(dev, "ti,dis-chg-det-quirk"))
+	if (soc_device_match(am65x_sr10_soc_devices))
 		priv->flags |= OMAP_USB2_DISABLE_CHG_DET;
 
 	regmap = syscon_regmap_lookup_by_phandle(dev, "syscon-phy-power");