From: Ming Lei <tom.leiming@xxxxxxxxx> This patch introduces get_hw_revision callback in glue_ops, and implement it in tusb glue driver, so tusb dma code can get tusb revision via .get_hw_revision callback and we can make glue drivers built as module easyly in later patches. Signed-off-by: Ming Lei <tom.leiming@xxxxxxxxx> --- drivers/usb/musb/musb_core.h | 11 +++++++++++ drivers/usb/musb/tusb6010.c | 2 ++ drivers/usb/musb/tusb6010_omap.c | 2 +- 3 files changed, 14 insertions(+), 1 deletions(-) diff --git a/drivers/usb/musb/musb_core.h b/drivers/usb/musb/musb_core.h index d0c236f..2818057 100644 --- a/drivers/usb/musb/musb_core.h +++ b/drivers/usb/musb/musb_core.h @@ -259,6 +259,7 @@ enum musb_g_ep0_state { * @exit: undoes @init * @set_mode: forcefully changes operating mode * @try_ilde: tries to idle the IP + * @get_hw_revision: get hardware revision * @vbus_status: returns vbus status if possible * @set_vbus: forces vbus status */ @@ -272,6 +273,8 @@ struct musb_platform_ops { int (*set_mode)(struct musb *musb, u8 mode); void (*try_idle)(struct musb *musb, unsigned long timeout); + u8 (*get_hw_revision)(struct musb *musb); + int (*vbus_status)(struct musb *musb); void (*set_vbus)(struct musb *musb, int on); }; @@ -651,4 +654,12 @@ static inline int musb_platform_exit(struct musb *musb) return musb->ops->exit(musb); } +static inline u8 musb_platform_get_hw_revision(struct musb *musb) +{ + if (!musb->ops->get_hw_revision) + return 0; + + return musb->ops->get_hw_revision(musb); +} + #endif /* __MUSB_CORE_H__ */ diff --git a/drivers/usb/musb/tusb6010.c b/drivers/usb/musb/tusb6010.c index 2ba3b07..e3ec657 100644 --- a/drivers/usb/musb/tusb6010.c +++ b/drivers/usb/musb/tusb6010.c @@ -1173,6 +1173,8 @@ static const struct musb_platform_ops tusb_ops = { .set_mode = tusb_musb_set_mode, .try_idle = tusb_musb_try_idle, + .get_hw_revision = tusb_get_revision, + .vbus_status = tusb_musb_vbus_status, .set_vbus = tusb_musb_set_vbus, }; diff --git a/drivers/usb/musb/tusb6010_omap.c b/drivers/usb/musb/tusb6010_omap.c index c061a88..958391a 100644 --- a/drivers/usb/musb/tusb6010_omap.c +++ b/drivers/usb/musb/tusb6010_omap.c @@ -696,7 +696,7 @@ dma_controller_create(struct musb *musb, void __iomem *base) tusb_dma->controller.channel_program = tusb_omap_dma_program; tusb_dma->controller.channel_abort = tusb_omap_dma_abort; - if (tusb_get_revision(musb) >= TUSB_REV_30) + if(musb_platform_get_hw_revision(musb) >= TUSB_REV_30) tusb_dma->multichannel = 1; for (i = 0; i < MAX_DMAREQ; i++) { -- 1.7.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