diff options
author | Mike Frysinger <vapier@gentoo.org> | 2010-03-12 03:27:21 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-03-19 10:24:13 -0400 |
commit | adb3ee421d6d39fbfadadf7093a587461ac4597e (patch) | |
tree | a18470962165dce6d448128a96f1404480c37f8e | |
parent | 9957dd97ec5e98dd334f87ade1d9a0b24d1f86eb (diff) |
usb: musb: abstract out ULPI_BUSCONTROL register reads/writes
The USB PHY on current Blackfin processors is a UTMI+ level 2 PHY.
However, it has no ULPI support - so there are no registers at all.
That means accesses to ULPI_BUSCONTROL have to be abstracted away
like other MUSB registers.
This fixes building for Blackfin parts again.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Acked-by: Anand Gadiyar <gadiyar@ti.com>
Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | drivers/usb/musb/musb_core.c | 5 | ||||
-rw-r--r-- | drivers/usb/musb/musb_regs.h | 19 |
2 files changed, 21 insertions, 3 deletions
diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c index b4bbf8f2c238..e54e468c5672 100644 --- a/drivers/usb/musb/musb_core.c +++ b/drivers/usb/musb/musb_core.c | |||
@@ -2007,7 +2007,6 @@ bad_config: | |||
2007 | /* host side needs more setup */ | 2007 | /* host side needs more setup */ |
2008 | if (is_host_enabled(musb)) { | 2008 | if (is_host_enabled(musb)) { |
2009 | struct usb_hcd *hcd = musb_to_hcd(musb); | 2009 | struct usb_hcd *hcd = musb_to_hcd(musb); |
2010 | u8 busctl; | ||
2011 | 2010 | ||
2012 | otg_set_host(musb->xceiv, &hcd->self); | 2011 | otg_set_host(musb->xceiv, &hcd->self); |
2013 | 2012 | ||
@@ -2018,9 +2017,9 @@ bad_config: | |||
2018 | 2017 | ||
2019 | /* program PHY to use external vBus if required */ | 2018 | /* program PHY to use external vBus if required */ |
2020 | if (plat->extvbus) { | 2019 | if (plat->extvbus) { |
2021 | busctl = musb_readb(musb->mregs, MUSB_ULPI_BUSCONTROL); | 2020 | u8 busctl = musb_read_ulpi_buscontrol(musb->mregs); |
2022 | busctl |= MUSB_ULPI_USE_EXTVBUS; | 2021 | busctl |= MUSB_ULPI_USE_EXTVBUS; |
2023 | musb_writeb(musb->mregs, MUSB_ULPI_BUSCONTROL, busctl); | 2022 | musb_write_ulpi_buscontrol(musb->mregs, busctl); |
2024 | } | 2023 | } |
2025 | } | 2024 | } |
2026 | 2025 | ||
diff --git a/drivers/usb/musb/musb_regs.h b/drivers/usb/musb/musb_regs.h index 8d8062b10e2f..327d0edd210e 100644 --- a/drivers/usb/musb/musb_regs.h +++ b/drivers/usb/musb/musb_regs.h | |||
@@ -326,6 +326,11 @@ static inline void musb_write_rxfifoadd(void __iomem *mbase, u16 c_off) | |||
326 | musb_writew(mbase, MUSB_RXFIFOADD, c_off); | 326 | musb_writew(mbase, MUSB_RXFIFOADD, c_off); |
327 | } | 327 | } |
328 | 328 | ||
329 | static inline void musb_write_ulpi_buscontrol(void __iomem *mbase, u8 val) | ||
330 | { | ||
331 | musb_writeb(mbase, MUSB_ULPI_BUSCONTROL, val); | ||
332 | } | ||
333 | |||
329 | static inline u8 musb_read_txfifosz(void __iomem *mbase) | 334 | static inline u8 musb_read_txfifosz(void __iomem *mbase) |
330 | { | 335 | { |
331 | return musb_readb(mbase, MUSB_TXFIFOSZ); | 336 | return musb_readb(mbase, MUSB_TXFIFOSZ); |
@@ -346,6 +351,11 @@ static inline u16 musb_read_rxfifoadd(void __iomem *mbase) | |||
346 | return musb_readw(mbase, MUSB_RXFIFOADD); | 351 | return musb_readw(mbase, MUSB_RXFIFOADD); |
347 | } | 352 | } |
348 | 353 | ||
354 | static inline u8 musb_read_ulpi_buscontrol(void __iomem *mbase) | ||
355 | { | ||
356 | return musb_readb(mbase, MUSB_ULPI_BUSCONTROL); | ||
357 | } | ||
358 | |||
349 | static inline u8 musb_read_configdata(void __iomem *mbase) | 359 | static inline u8 musb_read_configdata(void __iomem *mbase) |
350 | { | 360 | { |
351 | musb_writeb(mbase, MUSB_INDEX, 0); | 361 | musb_writeb(mbase, MUSB_INDEX, 0); |
@@ -510,6 +520,10 @@ static inline void musb_write_rxfifoadd(void __iomem *mbase, u16 c_off) | |||
510 | { | 520 | { |
511 | } | 521 | } |
512 | 522 | ||
523 | static inline void musb_write_ulpi_buscontrol(void __iomem *mbase, u8 val) | ||
524 | { | ||
525 | } | ||
526 | |||
513 | static inline u8 musb_read_txfifosz(void __iomem *mbase) | 527 | static inline u8 musb_read_txfifosz(void __iomem *mbase) |
514 | { | 528 | { |
515 | } | 529 | } |
@@ -526,6 +540,11 @@ static inline u16 musb_read_rxfifoadd(void __iomem *mbase) | |||
526 | { | 540 | { |
527 | } | 541 | } |
528 | 542 | ||
543 | static inline u8 musb_read_ulpi_buscontrol(void __iomem *mbase) | ||
544 | { | ||
545 | return 0; | ||
546 | } | ||
547 | |||
529 | static inline u8 musb_read_configdata(void __iomem *mbase) | 548 | static inline u8 musb_read_configdata(void __iomem *mbase) |
530 | { | 549 | { |
531 | return 0; | 550 | return 0; |