]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
usb: isp1760: use dr_mode binding
authorRui Miguel Silva <rui.silva@linaro.org>
Thu, 13 May 2021 08:47:14 +0000 (09:47 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 21 May 2021 18:05:32 +0000 (20:05 +0200)
There is already a binding to describe the dual role mode (dr_mode),
use that instead of defining a new one (port1-otg).

Update driver code and devicetree files that use that port1-otg
binding.

Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
Link: https://lore.kernel.org/r/20210513084717.2487366-7-rui.silva@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/arm/boot/dts/arm-realview-eb.dtsi
arch/arm/boot/dts/arm-realview-pb1176.dts
arch/arm/boot/dts/arm-realview-pb11mp.dts
arch/arm/boot/dts/arm-realview-pbx.dtsi
arch/arm/boot/dts/vexpress-v2m-rs1.dtsi
arch/arm/boot/dts/vexpress-v2m.dtsi
drivers/usb/isp1760/isp1760-core.c
drivers/usb/isp1760/isp1760-core.h
drivers/usb/isp1760/isp1760-if.c

index a534a8e444d9dbda7313a5a51a2414d80889a708..04e8a27ba1eb534145b51d6290e0b167786111a5 100644 (file)
        usb: usb@4f000000 {
                compatible = "nxp,usb-isp1761";
                reg = <0x4f000000 0x20000>;
-               port1-otg;
+               dr_mode = "peripheral";
        };
 
        bridge {
index f925782f8560407139b1d5a666e5cfbe3928e2ab..366687fb1ee3935997ab944d1197dfc4a2228ad4 100644 (file)
                reg = <0x3b000000 0x20000>;
                interrupt-parent = <&intc_fpga1176>;
                interrupts = <0 11 IRQ_TYPE_LEVEL_HIGH>;
-               port1-otg;
+               dr_mode = "peripheral";
        };
 
        bridge {
index 0c7dabef4a5f72e89a6ce6e6515a2d74af5ee040..228a51a38f95e928a803a3af3fea87e98ad38245 100644 (file)
                        reg = <0x4f000000 0x20000>;
                        interrupt-parent = <&intc_tc11mp>;
                        interrupts = <0 3 IRQ_TYPE_LEVEL_HIGH>;
-                       port1-otg;
+                       dr_mode = "peripheral";
                };
        };
 };
index ac95667ed7812948f6528265163fc1bf5bc824d1..ccf6f756b6ed198ada6053d54f89cffa14539b52 100644 (file)
        usb: usb@4f000000 {
                compatible = "nxp,usb-isp1761";
                reg = <0x4f000000 0x20000>;
-               port1-otg;
+               dr_mode = "peripheral";
        };
 
        bridge {
index 4f7220b11f2d7a9376fc9e6ed32039eddf2a57e7..2ad9fd7c94ecce45e437b3d96fc2fc6a8f72bb45 100644 (file)
                                compatible = "nxp,usb-isp1761";
                                reg = <2 0x03000000 0x20000>;
                                interrupts = <16>;
-                               port1-otg;
+                               dr_mode = "peripheral";
                        };
 
                        iofpga-bus@300000000 {
index 2ac41ed3a57c7d6bc2c28df8d05c6850e27022b6..ec13ceb9ed362263fb7bd4428f75616d75f25384 100644 (file)
@@ -62,7 +62,7 @@
                                compatible = "nxp,usb-isp1761";
                                reg = <3 0x03000000 0x20000>;
                                interrupts = <16>;
-                               port1-otg;
+                               dr_mode = "peripheral";
                        };
 
                        iofpga@7,00000000 {
index 35a7667e411c7257a24f9d94bc662c16af3dbf72..0aeeb12d3bfe5fbd92ac4eb5ac3b4af2f0531e93 100644 (file)
@@ -73,10 +73,9 @@ static void isp1760_init_core(struct isp1760_device *isp)
         * on ISP1761.
         *
         * TODO: Really support OTG. For now we configure port 1 in device mode
-        * when OTG is requested.
         */
        if ((isp->devflags & ISP1760_FLAG_ISP1761) &&
-           (isp->devflags & ISP1760_FLAG_OTG_EN)) {
+           (isp->devflags & ISP1760_FLAG_PERIPHERAL_EN)) {
                isp1760_field_set(hcd->fields, HW_DM_PULLDOWN);
                isp1760_field_set(hcd->fields, HW_DP_PULLDOWN);
                isp1760_field_set(hcd->fields, HW_OTG_DISABLE);
index 8fec6395f19f01ee453818d73cad5f3c8338154d..7a6755d68d41a25e647fe7f1d4c18d849f77357a 100644 (file)
@@ -28,7 +28,7 @@ struct gpio_desc;
  * a sane default configuration.
  */
 #define ISP1760_FLAG_BUS_WIDTH_16      0x00000002 /* 16-bit data bus width */
-#define ISP1760_FLAG_OTG_EN            0x00000004 /* Port 1 supports OTG */
+#define ISP1760_FLAG_PERIPHERAL_EN     0x00000004 /* Port 1 supports Peripheral mode*/
 #define ISP1760_FLAG_ANALOG_OC         0x00000008 /* Analog overcurrent */
 #define ISP1760_FLAG_DACK_POL_HIGH     0x00000010 /* DACK active high */
 #define ISP1760_FLAG_DREQ_POL_HIGH     0x00000020 /* DREQ active high */
index fb6701608cd87f7ac0ca4dd1982822be1995a04f..cb3e4d78231591d95ffe9c59bd64a457d71a7df9 100644 (file)
@@ -17,6 +17,7 @@
 #include <linux/platform_device.h>
 #include <linux/slab.h>
 #include <linux/usb/hcd.h>
+#include <linux/usb/otg.h>
 
 #include "isp1760-core.h"
 #include "isp1760-regs.h"
@@ -213,8 +214,8 @@ static int isp1760_plat_probe(struct platform_device *pdev)
                if (bus_width == 16)
                        devflags |= ISP1760_FLAG_BUS_WIDTH_16;
 
-               if (of_property_read_bool(dp, "port1-otg"))
-                       devflags |= ISP1760_FLAG_OTG_EN;
+               if (usb_get_dr_mode(&pdev->dev) == USB_DR_MODE_PERIPHERAL)
+                       devflags |= ISP1760_FLAG_PERIPHERAL_EN;
 
                if (of_property_read_bool(dp, "analog-oc"))
                        devflags |= ISP1760_FLAG_ANALOG_OC;