Skip to content
Permalink
Browse files

drivers: usb: Fix build error for intel_s1000.

As not all controllers using DW usb doesn't inherit
the qmsi related header, use of QM_USB_MAX_PACKET_SIZE,
QM_USB_IN_EP_NUM and QM_USB_OUT_EP_NUM break the build
for such platform. Hence defined new macros and corresponding
change done in driver.

Signed-off-by: Savinay Dharmappa <savinay.dharmappa@intel.com>
  • Loading branch information...
SavinayDharmappa authored and nashif committed Jun 18, 2018
1 parent fab8246 commit e682652d8c7fdd30ad90b72007035732e96e9ad5
Showing with 7 additions and 3 deletions.
  1. +3 −3 drivers/usb/device/usb_dc_dw.c
  2. +4 −0 drivers/usb/device/usb_dw_registers.h
@@ -826,19 +826,19 @@ int usb_dc_ep_check_cap(const struct usb_dc_ep_cfg_data * const cfg)
return -1;
}

if (cfg->ep_mps > QM_USB_MAX_PACKET_SIZE) {
if (cfg->ep_mps > DW_USB_MAX_PACKET_SIZE) {
SYS_LOG_WRN("unsupported packet size");
return -1;
}

if ((USB_DW_EP_ADDR2DIR(cfg->ep_addr) == USB_EP_DIR_OUT) &&
(ep_idx >= QM_USB_OUT_EP_NUM)) {
(ep_idx >= DW_USB_OUT_EP_NUM)) {
SYS_LOG_WRN("OUT endpoint address out of range");
return -1;
}

if ((USB_DW_EP_ADDR2DIR(cfg->ep_addr) == USB_EP_DIR_IN) &&
(ep_idx >= QM_USB_IN_EP_NUM)) {
(ep_idx >= DW_USB_IN_EP_NUM)) {
SYS_LOG_WRN("IN endpoint address out of range");
return -1;
}
@@ -201,6 +201,10 @@ struct usb_dw_reg {
/* USB register block base address */
#define USB_DW ((struct usb_dw_reg *)USB_DW_BASE)

#define DW_USB_IN_EP_NUM (6)
#define DW_USB_OUT_EP_NUM (4)
#define DW_USB_MAX_PACKET_SIZE (64)

#ifdef __cplusplus
}
#endif

0 comments on commit e682652

Please sign in to comment.
You can’t perform that action at this time.