Revert "usb: dwc_otg: Set extcon state for usb cable as always true" 27/318827/1
authorMarek Szyprowski <m.szyprowski@samsung.com>
Wed, 9 Oct 2024 10:31:34 +0000 (12:31 +0200)
committerMarek Szyprowski <m.szyprowski@samsung.com>
Wed, 9 Oct 2024 10:32:34 +0000 (12:32 +0200)
Since adding a standalone Tizen-specific kernel extcon-usb-fixed module,
which reports USB cable as always connected, the extcon hack/workaround
in the DWC OTG driver is no longer needed.

This reverts commit 8d39ff3b7c4a5170061cd4930387a4f351ea04f2.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: I0add9a4747863090a84e543126df6c96ed810d15

drivers/amlogic/usb/dwc_otg/310/dwc_otg_driver.c

index df2746f82451aac90a91dd59abba149b0fa912a1..263ed2c1938fbd091b7a1e0ddafc68de95f1e981 100644 (file)
@@ -75,7 +75,6 @@
 #ifdef CONFIG_AMLOGIC_LEGACY_EARLY_SUSPEND
 #include <linux/amlogic/pm.h>
 #endif
-#include <linux/extcon.h>
 
 #define DWC_DRIVER_VERSION     "3.10a 12-MAY-2014"
 #define DWC_DRIVER_DESC                "HS OTG USB Controller driver"
@@ -969,9 +968,6 @@ static int dwc_otg_driver_probe(struct platform_device *pdev)
        struct dwc_otg_driver_module_params *pcore_para;
        static int dcount;
        int controller_type = USB_NORMAL;
-#if IS_ENABLED(CONFIG_EXTCON)
-       bool g_extcon_always_on = false;
-#endif
 
        dev_dbg(&pdev->dev, "dwc_otg_driver_probe(%p)\n", pdev);
 
@@ -1073,11 +1069,6 @@ static int dwc_otg_driver_probe(struct platform_device *pdev)
                                        phy_interface = 2;
                        }
 
-#if IS_ENABLED(CONFIG_EXTCON)
-                       g_extcon_always_on =
-                               of_property_read_bool(of_node, "g-extcon-always-on");
-#endif
-
                        dwc_otg_module_params.host_rx_fifo_size = dwc_otg_module_params.data_fifo_size / 2;
                        DWC_PRINTF("dwc_otg: %s: type: %d speed: %d, ",
                                s_clock_name, port_type, port_speed);
@@ -1108,26 +1099,6 @@ static int dwc_otg_driver_probe(struct platform_device *pdev)
        memset(dwc_otg_device, 0, sizeof(*dwc_otg_device));
        dwc_otg_device->os_dep.reg_offset = 0xFFFFFFFF;
 
-#if IS_ENABLED(CONFIG_EXTCON)
-       if (g_extcon_always_on) {
-               struct extcon_dev *edev;
-               static const unsigned int supported_cable[] = {
-                       EXTCON_USB,
-                       EXTCON_NONE,
-               };
-
-               edev = devm_extcon_dev_allocate(&pdev->dev, supported_cable);
-               if (IS_ERR(edev))
-                       return PTR_ERR(edev);
-
-               retval = devm_extcon_dev_register(&pdev->dev, edev);
-               if (retval)
-                       return retval;
-
-               extcon_set_cable_state_(edev, EXTCON_USB, true);
-       }
-#endif
-
        /*
        * Map the DWC_otg Core memory into virtual address space.
        */