/* Checks the revision. We need to use the DMA register as 3.0 does not have correct versions for TUSB_PRCM_REV or TUSB_INT_CTRL_REV.  */
u8 tusb_get_revision(struct musb *musb)
/* Checks the revision. We need to use the DMA register as 3.0 does not have correct versions for TUSB_PRCM_REV or TUSB_INT_CTRL_REV.  */
u8 tusb_get_revision(struct musb *musb)
{
	void __iomem	*tbase = musb->ctrl_base;
	u32		die_id;
	u8		rev;
	rev = musb_readl(tbase, TUSB_DMA_CTRL_REV) & 0xff;
	if (TUSB_REV_MAJOR(rev) == 3) {
		die_id = TUSB_DIDR1_HI_CHIP_REV(musb_readl(tbase,
				TUSB_DIDR1_HI));
		if (die_id >= TUSB_DIDR1_HI_REV_31)
			rev |= 1;
	}
	return rev;
}