summaryrefslogtreecommitdiff
path: root/drivers/usb/dwc3/host.c
blob: 281d016a86aaad66b33a0775b0664df2b73cb1ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// SPDX-License-Identifier: GPL-2.0-only
/**
 * host.c - DesignWare USB3 DRD Controller Host Glue
 *
 * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com
 *
 * Authors: Felipe Balbi <balbi@ti.com>,
 */

#include <common.h>
#include <driver.h>
#include <init.h>

#include "core.h"

int dwc3_host_init(struct dwc3 *dwc)
{
	struct resource *io;
	struct device *dev = dwc->dev;

	io = dev_get_resource(dev, IORESOURCE_MEM, 0);
	if (IS_ERR(io)) {
		dev_err(dev, "Failed to get IORESOURCE_MEM\n");
		return PTR_ERR(io);
	}

	dwc->xhci = add_child_device(dev, "xHCI", DEVICE_ID_DYNAMIC, NULL,
				     io->start, resource_size(io),
				     IORESOURCE_MEM, NULL);
	if (!dwc->xhci) {
		dev_err(dev, "Failed to register xHCI device\n");
		return -ENODEV;
	}

	return 0;
}

void dwc3_host_exit(struct dwc3 *dwc)
{
}