Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
*/
/dts-v1/;
#include "zynq.dtsi"
#include <dt-bindings/gpio/gpio.h>

/ {
model = "Analog Devices ADRV9361-Z7035";
Expand Down Expand Up @@ -53,7 +54,7 @@
};

&usb0 {
xlnx,phy-reset-gpio = <&gpio0 7 0>;
xlnx,phy-reset-gpio = <&gpio0 7 GPIO_ACTIVE_LOW>;
};

&qspi {
Expand Down
3 changes: 2 additions & 1 deletion arch/arm/boot/dts/xilinx/zynq-adrv9361-z7035.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*/
#include "zynq.dtsi"

#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/interrupt-controller/irq.h>

/ {
Expand Down Expand Up @@ -64,7 +65,7 @@
};

&usb0 {
xlnx,phy-reset-gpio = <&gpio0 7 0>;
xlnx,phy-reset-gpio = <&gpio0 7 GPIO_ACTIVE_LOW>;
};

&qspi {
Expand Down Expand Up @@ -130,10 +131,10 @@
#address-cells = <1>;
#size-cells = <0>;

adm1166: adm1166@68 {
compatible = "adi,adm1166";
reg = <0x68>;
};

Check warning on line 137 in arch/arm/boot/dts/xilinx/zynq-adrv9361-z7035.dtsi

View workflow job for this annotation

GitHub Actions / build_gcc_arm / build

(i2c_bus_reg): /fpga-axi@0/i2c@41600000/adm1166@68: I2C bus unit address format error, expected "6a"

Check warning on line 137 in arch/arm/boot/dts/xilinx/zynq-adrv9361-z7035.dtsi

View workflow job for this annotation

GitHub Actions / build_gcc_arm / build

(i2c_bus_reg): /fpga-axi@0/i2c@41600000/adm1166@68: I2C bus unit address format error, expected "6a"
};

rx_dma: dma-controller@7c400000 {
Expand Down
3 changes: 2 additions & 1 deletion arch/arm/boot/dts/xilinx/zynq-adrv9364-z7020.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*/
#include "zynq.dtsi"

#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/interrupt-controller/irq.h>

/ {
Expand Down Expand Up @@ -57,7 +58,7 @@
};

&usb0 {
xlnx,phy-reset-gpio = <&gpio0 7 0>;
xlnx,phy-reset-gpio = <&gpio0 7 GPIO_ACTIVE_LOW>;
};

&qspi {
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/boot/dts/xilinx/zynq-e310.dts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
};

&usb0 {
xlnx,phy-reset-gpio = <&gpio0 7 0>;
xlnx,phy-reset-gpio = <&gpio0 7 GPIO_ACTIVE_LOW>;
};

&sdhci0 {
Expand Down
3 changes: 2 additions & 1 deletion arch/arm/boot/dts/xilinx/zynq-m2k.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*/
#include "zynq.dtsi"

#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/interrupt-controller/irq.h>

/ {
Expand Down Expand Up @@ -42,7 +43,7 @@
};

&usb0 {
xlnx,phy-reset-gpio = <&gpio0 52 0>;
xlnx,phy-reset-gpio = <&gpio0 52 GPIO_ACTIVE_LOW>;
dr_mode = "otg";
status = "okay";
};
Expand Down
3 changes: 2 additions & 1 deletion arch/arm/boot/dts/xilinx/zynq-microzed.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
/* Copyright (C) 2024 Analog Devices Inc. */

#include "zynq.dtsi"
#include <dt-bindings/gpio/gpio.h>

/ {
model = "Avnet MicroZed";
Expand Down Expand Up @@ -34,7 +35,7 @@
};

&usb0 {
xlnx,phy-reset-gpio = <&gpio0 7 0>;
xlnx,phy-reset-gpio = <&gpio0 7 GPIO_ACTIVE_LOW>;
};

&qspi {
Expand Down
3 changes: 2 additions & 1 deletion arch/arm/boot/dts/xilinx/zynq-pluto-sdr.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*/
#include "zynq.dtsi"

#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/interrupt-controller/irq.h>

/ {
Expand Down Expand Up @@ -41,7 +42,7 @@
};

&usb0 {
xlnx,phy-reset-gpio = <&gpio0 52 0>;
xlnx,phy-reset-gpio = <&gpio0 52 GPIO_ACTIVE_LOW>;
dr_mode = "otg";
status = "okay";
};
Expand Down
3 changes: 2 additions & 1 deletion arch/arm/boot/dts/xilinx/zynq-zc702.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#include "zynq.dtsi"

#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/interrupt-controller/irq.h>

/ {
Expand Down Expand Up @@ -129,7 +130,7 @@
};

&usb0 {
xlnx,phy-reset-gpio = <&gpio0 7 0>;
xlnx,phy-reset-gpio = <&gpio0 7 GPIO_ACTIVE_LOW>;
};

&qspi {
Expand Down
3 changes: 2 additions & 1 deletion arch/arm/boot/dts/xilinx/zynq-zc706.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#include "zynq.dtsi"

#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/interrupt-controller/irq.h>

/ {
Expand Down Expand Up @@ -77,7 +78,7 @@
};

&usb0 {
xlnx,phy-reset-gpio = <&gpio0 7 0>;
xlnx,phy-reset-gpio = <&gpio0 7 GPIO_ACTIVE_LOW>;
};

&qspi {
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/boot/dts/xilinx/zynq-zed-adv7511.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -326,5 +326,5 @@
};

&usb0 {
xlnx,phy-reset-gpio = <&gpio0 85 GPIO_ACTIVE_HIGH>;
xlnx,phy-reset-gpio = <&gpio0 85 GPIO_ACTIVE_LOW>;
};
29 changes: 15 additions & 14 deletions drivers/usb/chipidea/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include <linux/device.h>
#include <linux/dma-mapping.h>
#include <linux/extcon.h>
#include <linux/gpio.h>
#include <linux/gpio/consumer.h>
#include <linux/phy/phy.h>
#include <linux/platform_device.h>
#include <linux/module.h>
Expand All @@ -36,7 +36,6 @@
#include <linux/usb/of.h>
#include <linux/usb/ulpi.h>
#include <linux/of.h>
#include <linux/of_gpio.h>
#include <linux/phy.h>
#include <linux/regulator/consumer.h>
#include <linux/usb/ehci_def.h>
Expand Down Expand Up @@ -993,20 +992,22 @@ static void ci_get_otg_capable(struct ci_hdrc *ci)
static int ci_hdrc_create_ulpi_phy(struct device *dev, struct ci_hdrc *ci)
{
struct usb_phy *ulpi;
int reset_gpio;
int ret;
struct gpio_desc *reset_gpio;

reset_gpio = of_get_named_gpio(dev->parent->of_node, "xlnx,phy-reset-gpio", 0);
if (gpio_is_valid(reset_gpio)) {
ret = devm_gpio_request_one(dev, reset_gpio,
GPIOF_OUT_INIT_LOW, "ulpi resetb");
if (ret) {
dev_err(dev, "Failed to request ULPI reset gpio: %d\n", ret);
reset_gpio = devm_gpiod_get_optional(dev->parent, "xlnx,phy-reset-gpio",
GPIOD_OUT_HIGH);
if (IS_ERR(reset_gpio))
return dev_err_probe(dev, PTR_ERR(reset_gpio), "Failed to get ULPI reset gpio\n");
if (reset_gpio) {
int ret;

ret = gpiod_set_consumer_name(reset_gpio, "ulpi resetb");
if (ret)
return ret;
}
msleep(5);
gpio_set_value_cansleep(reset_gpio, 1);
msleep(1);

fsleep(5);
gpiod_set_value_cansleep(reset_gpio, 0);
fsleep(1);
}

ulpi = otg_ulpi_create(&ulpi_viewport_access_ops,
Expand Down
Loading