summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorSven Schwermer <sven@svenschwermer.de>2018-11-21 08:43:56 +0100
committerMarek Vasut <marex@denx.de>2018-11-26 21:19:03 +0100
commitfd09c205fc57b90a782cac33449ef172575d0a8c (patch)
treeb23d462a78db88ec589c50d769fa6522b3f16c63 /common
parentab5817027f9b4fce25f5f2a3e20577ac55bbd7e0 (diff)
downloadu-boot-fd09c205fc57b90a782cac33449ef172575d0a8c.tar.gz
u-boot-fd09c205fc57b90a782cac33449ef172575d0a8c.tar.bz2
u-boot-fd09c205fc57b90a782cac33449ef172575d0a8c.zip
usb: s/CONFIG_DM_USB/CONFIG_IS_ENABLED(DM_USB)/
This allows to disable the USB driver model in SPL because it checks the CONFIG_SPL_DM_USB variable for SPL builds. Nothing changes for regular non-SPL builds. Signed-off-by: Sven Schwermer <sven@svenschwermer.de>
Diffstat (limited to 'common')
-rw-r--r--common/usb.c14
-rw-r--r--common/usb_hub.c16
-rw-r--r--common/usb_kbd.c4
-rw-r--r--common/usb_storage.c6
4 files changed, 20 insertions, 20 deletions
diff --git a/common/usb.c b/common/usb.c
index 78178c54c8..b70f614d24 100644
--- a/common/usb.c
+++ b/common/usb.c
@@ -42,7 +42,7 @@
static int asynch_allowed;
char usb_started; /* flag for the started/stopped USB status */
-#ifndef CONFIG_DM_USB
+#if !CONFIG_IS_ENABLED(DM_USB)
static struct usb_device usb_dev[USB_MAX_DEVICE];
static int dev_index;
@@ -183,7 +183,7 @@ int usb_disable_asynch(int disable)
asynch_allowed = !disable;
return old_value;
}
-#endif /* !CONFIG_DM_USB */
+#endif /* !CONFIG_IS_ENABLED(DM_USB) */
/*-------------------------------------------------------------------
@@ -849,7 +849,7 @@ int usb_string(struct usb_device *dev, int index, char *buf, size_t size)
* the USB device are static allocated [USB_MAX_DEVICE].
*/
-#ifndef CONFIG_DM_USB
+#if !CONFIG_IS_ENABLED(DM_USB)
/* returns a pointer to the device with the index [index].
* if the device is not assigned (dev->devnum==-1) returns NULL
@@ -906,7 +906,7 @@ __weak int usb_alloc_device(struct usb_device *udev)
{
return 0;
}
-#endif /* !CONFIG_DM_USB */
+#endif /* !CONFIG_IS_ENABLED(DM_USB) */
static int usb_hub_port_reset(struct usb_device *dev, struct usb_device *hub)
{
@@ -1166,7 +1166,7 @@ int usb_setup_device(struct usb_device *dev, bool do_read,
return ret;
}
-#ifndef CONFIG_DM_USB
+#if !CONFIG_IS_ENABLED(DM_USB)
/*
* By the time we get here, the device has gotten a new device ID
* and is in the default state. We need to identify the thing and
@@ -1215,14 +1215,14 @@ int board_usb_cleanup(int index, enum usb_init_type init)
bool usb_device_has_child_on_port(struct usb_device *parent, int port)
{
-#ifdef CONFIG_DM_USB
+#if CONFIG_IS_ENABLED(DM_USB)
return false;
#else
return parent->children[port] != NULL;
#endif
}
-#ifdef CONFIG_DM_USB
+#if CONFIG_IS_ENABLED(DM_USB)
void usb_find_usb2_hub_address_port(struct usb_device *udev,
uint8_t *hub_address, uint8_t *hub_port)
{
diff --git a/common/usb_hub.c b/common/usb_hub.c
index e1d93b8333..33aaeb8e44 100644
--- a/common/usb_hub.c
+++ b/common/usb_hub.c
@@ -64,7 +64,7 @@ static inline bool usb_hub_is_superspeed(struct usb_device *hdev)
return hdev->descriptor.bDeviceProtocol == 3;
}
-#ifdef CONFIG_DM_USB
+#if CONFIG_IS_ENABLED(DM_USB)
bool usb_hub_is_root_hub(struct udevice *hub)
{
if (device_get_uclass_id(hub->parent) != UCLASS_USB_HUB)
@@ -125,7 +125,7 @@ int usb_get_port_status(struct usb_device *dev, int port, void *data)
USB_REQ_GET_STATUS, USB_DIR_IN | USB_RT_PORT, 0, port,
data, sizeof(struct usb_port_status), USB_CNTL_TIMEOUT);
-#ifdef CONFIG_DM_USB
+#if CONFIG_IS_ENABLED(DM_USB)
if (ret < 0)
return ret;
@@ -209,7 +209,7 @@ static void usb_hub_power_on(struct usb_hub_device *hub)
max(100, (int)pgood_delay) + 1000);
}
-#ifndef CONFIG_DM_USB
+#if !CONFIG_IS_ENABLED(DM_USB)
static struct usb_hub_device hub_dev[USB_MAX_HUB];
static int usb_hub_index;
@@ -273,7 +273,7 @@ static int usb_hub_port_reset(struct usb_device *dev, int port,
unsigned short portstatus, portchange;
int delay = HUB_SHORT_RESET_TIME; /* start with short reset delay */
-#ifdef CONFIG_DM_USB
+#if CONFIG_IS_ENABLED(DM_USB)
debug("%s: resetting '%s' port %d...\n", __func__, dev->dev->name,
port + 1);
#else
@@ -394,7 +394,7 @@ int usb_hub_port_connect_change(struct usb_device *dev, int port)
break;
}
-#ifdef CONFIG_DM_USB
+#if CONFIG_IS_ENABLED(DM_USB)
struct udevice *child;
ret = usb_scan_device(dev->dev, port + 1, speed, &child);
@@ -604,7 +604,7 @@ static struct usb_hub_device *usb_get_hub_device(struct usb_device *dev)
{
struct usb_hub_device *hub;
-#ifndef CONFIG_DM_USB
+#if !CONFIG_IS_ENABLED(DM_USB)
/* "allocate" Hub device */
hub = usb_hub_allocate();
#else
@@ -788,7 +788,7 @@ static int usb_hub_configure(struct usb_device *dev)
(le16_to_cpu(hubsts->wHubStatus) & HUB_STATUS_OVERCURRENT) ? \
"" : "no ");
-#ifdef CONFIG_DM_USB
+#if CONFIG_IS_ENABLED(DM_USB)
/*
* Update USB host controller's internal representation of this hub
* after the hub descriptor is fetched.
@@ -930,7 +930,7 @@ int usb_hub_probe(struct usb_device *dev, int ifnum)
return ret;
}
-#ifdef CONFIG_DM_USB
+#if CONFIG_IS_ENABLED(DM_USB)
int usb_hub_scan(struct udevice *hub)
{
struct usb_device *udev = dev_get_parent_priv(hub);
diff --git a/common/usb_kbd.c b/common/usb_kbd.c
index fdeb2aed24..020f0d4117 100644
--- a/common/usb_kbd.c
+++ b/common/usb_kbd.c
@@ -539,7 +539,7 @@ static int probe_usb_keyboard(struct usb_device *dev)
return 0;
}
-#ifndef CONFIG_DM_USB
+#if !CONFIG_IS_ENABLED(DM_USB)
/* Search for keyboard and register it if found. */
int drv_usb_kbd_init(void)
{
@@ -602,7 +602,7 @@ int usb_kbd_deregister(int force)
#endif
-#ifdef CONFIG_DM_USB
+#if CONFIG_IS_ENABLED(DM_USB)
static int usb_kbd_probe(struct udevice *dev)
{
diff --git a/common/usb_storage.c b/common/usb_storage.c
index 560d60538b..c9a99b1ca2 100644
--- a/common/usb_storage.c
+++ b/common/usb_storage.c
@@ -299,7 +299,7 @@ int usb_stor_scan(int mode)
if (mode == 1)
printf(" scanning usb for storage devices... ");
-#ifndef CONFIG_DM_USB
+#if !CONFIG_IS_ENABLED(DM_USB)
unsigned char i;
usb_disable_asynch(1); /* asynch transfer not allowed */
@@ -942,7 +942,7 @@ static void usb_stor_set_max_xfer_blk(struct usb_device *udev,
size_t __maybe_unused size;
int __maybe_unused ret;
-#ifndef CONFIG_DM_USB
+#if !CONFIG_IS_ENABLED(DM_USB)
#ifdef CONFIG_USB_EHCI_HCD
/*
* The U-Boot EHCI driver can handle any transfer length as long as
@@ -1495,7 +1495,7 @@ int usb_stor_get_info(struct usb_device *dev, struct us_data *ss,
return 1;
}
-#ifdef CONFIG_DM_USB
+#if CONFIG_IS_ENABLED(DM_USB)
static int usb_mass_storage_probe(struct udevice *dev)
{