diff options
author | Ajay Kumar Gupta <ajay.gupta@ti.com> | 2010-01-21 08:33:52 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-03-02 17:54:38 -0500 |
commit | 4f712e010b2da1cc01c178922f2eb5aaeae461b6 (patch) | |
tree | 4341a8c4f1e8184b0a727a9746be74267d20f68f /drivers/usb/musb/musb_regs.h | |
parent | 8af6096caf8b3fb7ee33e636c44a29f373d27df5 (diff) |
usb: musb: Add context save and restore support
Adding support for MUSB register save and restore during system
suspend and resume.
Changes:
- Added musb_save/restore_context() functions
- Added platform specific musb_platform_save/restore_context()
to handle platform specific jobs.
- Maintaining BlackFin compatibility by adding read/write
functions for registers which are not available in BlackFin
Tested system suspend and resume on OMAP3EVM board.
Signed-off-by: Anand Gadiyar <gadiyar@ti.com>
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/musb/musb_regs.h')
-rw-r--r-- | drivers/usb/musb/musb_regs.h | 90 |
1 files changed, 90 insertions, 0 deletions
diff --git a/drivers/usb/musb/musb_regs.h b/drivers/usb/musb/musb_regs.h index 9a8621ac5ac2..895fb057e443 100644 --- a/drivers/usb/musb/musb_regs.h +++ b/drivers/usb/musb/musb_regs.h | |||
@@ -326,6 +326,26 @@ 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 u8 musb_read_txfifosz(void __iomem *mbase) | ||
330 | { | ||
331 | return musb_readb(mbase, MUSB_TXFIFOSZ); | ||
332 | } | ||
333 | |||
334 | static inline u16 musb_read_txfifoadd(void __iomem *mbase) | ||
335 | { | ||
336 | return musb_readw(mbase, MUSB_TXFIFOADD); | ||
337 | } | ||
338 | |||
339 | static inline u8 musb_read_rxfifosz(void __iomem *mbase) | ||
340 | { | ||
341 | return musb_readb(mbase, MUSB_RXFIFOSZ); | ||
342 | } | ||
343 | |||
344 | static inline u16 musb_read_rxfifoadd(void __iomem *mbase) | ||
345 | { | ||
346 | return musb_readw(mbase, MUSB_RXFIFOADD); | ||
347 | } | ||
348 | |||
329 | static inline u8 musb_read_configdata(void __iomem *mbase) | 349 | static inline u8 musb_read_configdata(void __iomem *mbase) |
330 | { | 350 | { |
331 | musb_writeb(mbase, MUSB_INDEX, 0); | 351 | musb_writeb(mbase, MUSB_INDEX, 0); |
@@ -381,6 +401,36 @@ static inline void musb_write_txhubport(void __iomem *mbase, u8 epnum, | |||
381 | qh_h_port_reg); | 401 | qh_h_port_reg); |
382 | } | 402 | } |
383 | 403 | ||
404 | static inline u8 musb_read_rxfunaddr(void __iomem *mbase, u8 epnum) | ||
405 | { | ||
406 | return musb_readb(mbase, MUSB_BUSCTL_OFFSET(epnum, MUSB_RXFUNCADDR)); | ||
407 | } | ||
408 | |||
409 | static inline u8 musb_read_rxhubaddr(void __iomem *mbase, u8 epnum) | ||
410 | { | ||
411 | return musb_readb(mbase, MUSB_BUSCTL_OFFSET(epnum, MUSB_RXHUBADDR)); | ||
412 | } | ||
413 | |||
414 | static inline u8 musb_read_rxhubport(void __iomem *mbase, u8 epnum) | ||
415 | { | ||
416 | return musb_readb(mbase, MUSB_BUSCTL_OFFSET(epnum, MUSB_RXHUBPORT)); | ||
417 | } | ||
418 | |||
419 | static inline u8 musb_read_txfunaddr(void __iomem *mbase, u8 epnum) | ||
420 | { | ||
421 | return musb_readb(mbase, MUSB_BUSCTL_OFFSET(epnum, MUSB_TXFUNCADDR)); | ||
422 | } | ||
423 | |||
424 | static inline u8 musb_read_txhubaddr(void __iomem *mbase, u8 epnum) | ||
425 | { | ||
426 | return musb_readb(mbase, MUSB_BUSCTL_OFFSET(epnum, MUSB_TXHUBADDR)); | ||
427 | } | ||
428 | |||
429 | static inline u8 musb_read_txhubport(void __iomem *mbase, u8 epnum) | ||
430 | { | ||
431 | return musb_readb(mbase, MUSB_BUSCTL_OFFSET(epnum, MUSB_TXHUBPORT)); | ||
432 | } | ||
433 | |||
384 | #else /* CONFIG_BLACKFIN */ | 434 | #else /* CONFIG_BLACKFIN */ |
385 | 435 | ||
386 | #define USB_BASE USB_FADDR | 436 | #define USB_BASE USB_FADDR |
@@ -460,6 +510,22 @@ static inline void musb_write_rxfifoadd(void __iomem *mbase, u16 c_off) | |||
460 | { | 510 | { |
461 | } | 511 | } |
462 | 512 | ||
513 | static inline u8 musb_read_txfifosz(void __iomem *mbase) | ||
514 | { | ||
515 | } | ||
516 | |||
517 | static inline u16 musb_read_txfifoadd(void __iomem *mbase) | ||
518 | { | ||
519 | } | ||
520 | |||
521 | static inline u8 musb_read_rxfifosz(void __iomem *mbase) | ||
522 | { | ||
523 | } | ||
524 | |||
525 | static inline u16 musb_read_rxfifoadd(void __iomem *mbase) | ||
526 | { | ||
527 | } | ||
528 | |||
463 | static inline u8 musb_read_configdata(void __iomem *mbase) | 529 | static inline u8 musb_read_configdata(void __iomem *mbase) |
464 | { | 530 | { |
465 | return 0; | 531 | return 0; |
@@ -505,6 +571,30 @@ static inline void musb_write_txhubport(void __iomem *mbase, u8 epnum, | |||
505 | { | 571 | { |
506 | } | 572 | } |
507 | 573 | ||
574 | static inline u8 musb_read_rxfunaddr(void __iomem *mbase, u8 epnum) | ||
575 | { | ||
576 | } | ||
577 | |||
578 | static inline u8 musb_read_rxhubaddr(void __iomem *mbase, u8 epnum) | ||
579 | { | ||
580 | } | ||
581 | |||
582 | static inline u8 musb_read_rxhubport(void __iomem *mbase, u8 epnum) | ||
583 | { | ||
584 | } | ||
585 | |||
586 | static inline u8 musb_read_txfunaddr(void __iomem *mbase, u8 epnum) | ||
587 | { | ||
588 | } | ||
589 | |||
590 | static inline u8 musb_read_txhubaddr(void __iomem *mbase, u8 epnum) | ||
591 | { | ||
592 | } | ||
593 | |||
594 | static inline void musb_read_txhubport(void __iomem *mbase, u8 epnum) | ||
595 | { | ||
596 | } | ||
597 | |||
508 | #endif /* CONFIG_BLACKFIN */ | 598 | #endif /* CONFIG_BLACKFIN */ |
509 | 599 | ||
510 | #endif /* __MUSB_REGS_H__ */ | 600 | #endif /* __MUSB_REGS_H__ */ |