staging: dwc2: use dwc2_hcd_get_frame_number where possible
Before, there were two places that manually read the FRNUM registers, while there is a function to do this. Signed-off-by: Matthijs Kooijman <matthijs@stdin.nl> Acked-by: Paul Zimmerman <paulz@synopsys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
929aea09da
commit
37e1dcc25f
@ -1146,16 +1146,10 @@ void dwc2_hc_cleanup(struct dwc2_hsotg *hsotg, struct dwc2_host_chan *chan)
|
|||||||
static void dwc2_hc_set_even_odd_frame(struct dwc2_hsotg *hsotg,
|
static void dwc2_hc_set_even_odd_frame(struct dwc2_hsotg *hsotg,
|
||||||
struct dwc2_host_chan *chan, u32 *hcchar)
|
struct dwc2_host_chan *chan, u32 *hcchar)
|
||||||
{
|
{
|
||||||
u32 hfnum, frnum;
|
|
||||||
|
|
||||||
if (chan->ep_type == USB_ENDPOINT_XFER_INT ||
|
if (chan->ep_type == USB_ENDPOINT_XFER_INT ||
|
||||||
chan->ep_type == USB_ENDPOINT_XFER_ISOC) {
|
chan->ep_type == USB_ENDPOINT_XFER_ISOC) {
|
||||||
hfnum = readl(hsotg->regs + HFNUM);
|
|
||||||
frnum = hfnum >> HFNUM_FRNUM_SHIFT &
|
|
||||||
HFNUM_FRNUM_MASK >> HFNUM_FRNUM_SHIFT;
|
|
||||||
|
|
||||||
/* 1 if _next_ frame is odd, 0 if it's even */
|
/* 1 if _next_ frame is odd, 0 if it's even */
|
||||||
if (frnum & 0x1)
|
if (dwc2_hcd_get_frame_number(hsotg) & 0x1)
|
||||||
*hcchar |= HCCHAR_ODDFRM;
|
*hcchar |= HCCHAR_ODDFRM;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -117,16 +117,13 @@ static void dwc2_sof_intr(struct dwc2_hsotg *hsotg)
|
|||||||
{
|
{
|
||||||
struct list_head *qh_entry;
|
struct list_head *qh_entry;
|
||||||
struct dwc2_qh *qh;
|
struct dwc2_qh *qh;
|
||||||
u32 hfnum;
|
|
||||||
enum dwc2_transaction_type tr_type;
|
enum dwc2_transaction_type tr_type;
|
||||||
|
|
||||||
#ifdef DEBUG_SOF
|
#ifdef DEBUG_SOF
|
||||||
dev_vdbg(hsotg->dev, "--Start of Frame Interrupt--\n");
|
dev_vdbg(hsotg->dev, "--Start of Frame Interrupt--\n");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
hfnum = readl(hsotg->regs + HFNUM);
|
hsotg->frame_number = dwc2_hcd_get_frame_number(hsotg);
|
||||||
hsotg->frame_number = hfnum >> HFNUM_FRNUM_SHIFT &
|
|
||||||
HFNUM_FRNUM_MASK >> HFNUM_FRNUM_SHIFT;
|
|
||||||
|
|
||||||
dwc2_track_missed_sofs(hsotg);
|
dwc2_track_missed_sofs(hsotg);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user