Skip to content

Commit 3f33b10

Browse files
author
Josuah Demangeon
committed
move the channel-specific ISR to a dedicated function
Signed-off-by: Josuah Demangeon <[email protected]>
1 parent 4acd04e commit 3f33b10

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

drivers/usb/uhc/uhc_dwc2.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -818,6 +818,7 @@ static enum uhc_dwc2_chan_event uhc_dwc2_hal_chan_decode_intr(const struct devic
818818
{
819819
const struct uhc_dwc2_config *const config = dev->config;
820820
struct usb_dwc2_reg *const dwc2 = config->base;
821+
struct uhc_dwc2_data *priv = uhc_get_private(dev);
821822
const struct usb_dwc2_host_chan *chan_regs = UHC_DWC2_CHAN_REG(dwc2, chan->chan_idx);
822823
enum uhc_dwc2_chan_event chan_event;
823824
uint32_t hcint;
@@ -863,6 +864,13 @@ static enum uhc_dwc2_chan_event uhc_dwc2_hal_chan_decode_intr(const struct devic
863864
chan_event = DWC2_CHAN_EVENT_NONE;
864865
}
865866

867+
if (chan_event == DWC2_CHAN_EVENT_CPLT && !uhc_dwc2_buffer_is_done(chan)) {
868+
uhc_dwc2_buffer_exec_proceed(dev, chan);
869+
} else {
870+
atomic_set_bit(&chan->event, chan_event);
871+
k_event_set(&priv->event, BIT(UHC_DWC2_EVENT_CHAN0 + chan->chan_idx));
872+
}
873+
866874
return chan_event;
867875
}
868876

@@ -913,13 +921,6 @@ static void uhc_dwc2_isr_handler(const struct device *dev)
913921
uhc_dwc2_hal_chan_decode_intr(dev, chan);
914922

915923
LOG_DBG("Channel event: 0x%08x", chan_event);
916-
917-
if (chan_event == DWC2_CHAN_EVENT_CPLT && !uhc_dwc2_buffer_is_done(chan)) {
918-
uhc_dwc2_buffer_exec_proceed(dev, chan);
919-
} else {
920-
atomic_set_bit(&chan->event, chan_event);
921-
k_event_set(&priv->event, BIT(UHC_DWC2_EVENT_CHAN0 + i - 1));
922-
}
923924
}
924925
}
925926

0 commit comments

Comments
 (0)