[PATCH] otg/ulpi.c : fix register write

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* drivers/usb/otg/ulpi.c :
ulpi_set_vbus and ulpi_set_flags are using ULPI_SET(register) to write
to the PHY's registers, which means we can only set bits in the PHY's
register and not clear them.
By directly using the address of the register without any offset, we
now get the expected behaviour for these functions.

* this patch also keep usage of otg_io_write & ulpi parameters coherent
as in include/linux/usb/otg.h we have :
otg_io_write(struct otg_transceiver *otg, u32 reg, u32 val)
so keep the same parameters order in drivers/usb/otg/ulpi.c and
arch/arm/plat-mxc/ulpi.c.

Signed-off-by: Eric Bénard <eric@xxxxxxxxxx>
Cc: Daniel Mack <daniel@xxxxxxxx>
Cc: linux-usb@xxxxxxxxxxxxxxx
Cc: linux-arm-kernel@xxxxxxxxxxxxxxxxxxx
Cc: Sascha Hauer <kernel@xxxxxxxxxxxxxx>
---
 arch/arm/plat-mxc/ulpi.c |    2 +-
 drivers/usb/otg/ulpi.c   |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm/plat-mxc/ulpi.c b/arch/arm/plat-mxc/ulpi.c
index 582c6df..84eb5c7 100644
--- a/arch/arm/plat-mxc/ulpi.c
+++ b/arch/arm/plat-mxc/ulpi.c
@@ -83,7 +83,7 @@ static int ulpi_read(struct otg_transceiver *otg, u32 reg)
 	return (__raw_readl(view) >> ULPIVW_RDATA_SHIFT) & ULPIVW_RDATA_MASK;
 }
 
-static int ulpi_write(struct otg_transceiver *otg, u32 val, u32 reg)
+static int ulpi_write(struct otg_transceiver *otg, u32 reg, u32 val)
 {
 	int ret;
 	void __iomem *view = otg->io_priv;
diff --git a/drivers/usb/otg/ulpi.c b/drivers/usb/otg/ulpi.c
index b1b3469..f6048ca 100644
--- a/drivers/usb/otg/ulpi.c
+++ b/drivers/usb/otg/ulpi.c
@@ -54,7 +54,7 @@ static int ulpi_set_flags(struct otg_transceiver *otg)
 	if (otg->flags & USB_OTG_EXT_VBUS_INDICATOR)
 		flags |= ULPI_OTG_CTRL_EXTVBUSIND;
 
-	return otg_io_write(otg, flags, ULPI_SET(ULPI_OTG_CTRL));
+	return otg_io_write(otg, ULPI_OTG_CTRL, flags);
 }
 
 static int ulpi_init(struct otg_transceiver *otg)
@@ -90,7 +90,7 @@ static int ulpi_set_vbus(struct otg_transceiver *otg, bool on)
 			flags |= ULPI_OTG_CTRL_DRVVBUS_EXT;
 	}
 
-	return otg_io_write(otg, flags, ULPI_SET(ULPI_OTG_CTRL));
+	return otg_io_write(otg, ULPI_OTG_CTRL, flags);
 }
 
 struct otg_transceiver *
-- 
1.6.3.3

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux