Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ddb495d4 authored by Felipe Balbi's avatar Felipe Balbi Committed by Greg Kroah-Hartman
Browse files

usb: musb: hsdma: use musb_read/writel



... and simplify the was we read/write from/to
DMA COUNT register.

Signed-off-by: default avatarFelipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent ca4b2532
Loading
Loading
Loading
Loading
+3 −13
Original line number Diff line number Diff line
@@ -102,26 +102,16 @@ static inline void musb_write_hsdma_addr(void __iomem *mbase,

static inline u32 musb_read_hsdma_count(void __iomem *mbase, u8 bchannel)
{
	u32 count = musb_readw(mbase,
	return musb_readl(mbase,
		MUSB_HSDMA_CHANNEL_OFFSET(bchannel, MUSB_HSDMA_COUNT_HIGH));

	count = count << 16;

	count |= musb_readw(mbase,
		MUSB_HSDMA_CHANNEL_OFFSET(bchannel, MUSB_HSDMA_COUNT_LOW));

	return count;
}

static inline void musb_write_hsdma_count(void __iomem *mbase,
				u8 bchannel, u32 len)
{
	musb_writew(mbase,
		MUSB_HSDMA_CHANNEL_OFFSET(bchannel, MUSB_HSDMA_COUNT_LOW),
		((u16)((u32) len & 0xFFFF)));
	musb_writew(mbase,
	musb_writel(mbase,
		MUSB_HSDMA_CHANNEL_OFFSET(bchannel, MUSB_HSDMA_COUNT_HIGH),
		((u16)(((u32) len >> 16) & 0xFFFF)));
		len);
}

#endif /* CONFIG_BLACKFIN */