projects
/
platform
/
kernel
/
u-boot.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Convert CONFIG_USB_OHCI_NEW et al to Kconfig
[platform/kernel/u-boot.git]
/
drivers
/
usb
/
host
/
ohci-generic.c
diff --git
a/drivers/usb/host/ohci-generic.c
b/drivers/usb/host/ohci-generic.c
index
5bdd799
..
5d23058
100644
(file)
--- a/
drivers/usb/host/ohci-generic.c
+++ b/
drivers/usb/host/ohci-generic.c
@@
-1,21
+1,19
@@
+// SPDX-License-Identifier: GPL-2.0+
/*
* Copyright (C) 2015 Alexey Brodkin <abrodkin@synopsys.com>
/*
* Copyright (C) 2015 Alexey Brodkin <abrodkin@synopsys.com>
- *
- * SPDX-License-Identifier: GPL-2.0+
*/
#include <common.h>
#include <clk.h>
#include <dm.h>
*/
#include <common.h>
#include <clk.h>
#include <dm.h>
+#include <log.h>
+#include <dm/device_compat.h>
+#include <dm/devres.h>
#include <dm/ofnode.h>
#include <generic-phy.h>
#include <reset.h>
#include "ohci.h"
#include <dm/ofnode.h>
#include <generic-phy.h>
#include <reset.h>
#include "ohci.h"
-#if !defined(CONFIG_USB_OHCI_NEW)
-# error "Generic OHCI driver requires CONFIG_USB_OHCI_NEW"
-#endif
-
struct generic_ohci {
ohci_t ohci;
struct clk *clocks; /* clock list */
struct generic_ohci {
ohci_t ohci;
struct clk *clocks; /* clock list */
@@
-39,13
+37,13
@@
static int ohci_setup_phy(struct udevice *dev, int index)
} else {
ret = generic_phy_init(&priv->phy);
if (ret) {
} else {
ret = generic_phy_init(&priv->phy);
if (ret) {
- dev_
err
(dev, "failed to init usb phy\n");
+ dev_
dbg
(dev, "failed to init usb phy\n");
return ret;
}
ret = generic_phy_power_on(&priv->phy);
if (ret) {
return ret;
}
ret = generic_phy_power_on(&priv->phy);
if (ret) {
- dev_
err
(dev, "failed to power on usb phy\n");
+ dev_
dbg
(dev, "failed to power on usb phy\n");
return generic_phy_exit(&priv->phy);
}
}
return generic_phy_exit(&priv->phy);
}
}
@@
-61,13
+59,13
@@
static int ohci_shutdown_phy(struct udevice *dev)
if (generic_phy_valid(&priv->phy)) {
ret = generic_phy_power_off(&priv->phy);
if (ret) {
if (generic_phy_valid(&priv->phy)) {
ret = generic_phy_power_off(&priv->phy);
if (ret) {
- dev_
err
(dev, "failed to power off usb phy\n");
+ dev_
dbg
(dev, "failed to power off usb phy\n");
return ret;
}
ret = generic_phy_exit(&priv->phy);
if (ret) {
return ret;
}
ret = generic_phy_exit(&priv->phy);
if (ret) {
- dev_
err
(dev, "failed to power off usb phy\n");
+ dev_
dbg
(dev, "failed to power off usb phy\n");
return ret;
}
}
return ret;
}
}
@@
-77,13
+75,14
@@
static int ohci_shutdown_phy(struct udevice *dev)
static int ohci_usb_probe(struct udevice *dev)
{
static int ohci_usb_probe(struct udevice *dev)
{
- struct ohci_regs *regs =
(struct ohci_regs *)devfdt_get_add
r(dev);
+ struct ohci_regs *regs =
dev_read_addr_pt
r(dev);
struct generic_ohci *priv = dev_get_priv(dev);
int i, err, ret, clock_nb, reset_nb;
err = 0;
priv->clock_count = 0;
struct generic_ohci *priv = dev_get_priv(dev);
int i, err, ret, clock_nb, reset_nb;
err = 0;
priv->clock_count = 0;
- clock_nb = dev_count_phandle_with_args(dev, "clocks", "#clock-cells");
+ clock_nb = dev_count_phandle_with_args(dev, "clocks", "#clock-cells",
+ 0);
if (clock_nb > 0) {
priv->clocks = devm_kcalloc(dev, clock_nb, sizeof(struct clk),
GFP_KERNEL);
if (clock_nb > 0) {
priv->clocks = devm_kcalloc(dev, clock_nb, sizeof(struct clk),
GFP_KERNEL);
@@
-96,7
+95,7
@@
static int ohci_usb_probe(struct udevice *dev)
break;
err = clk_enable(&priv->clocks[i]);
break;
err = clk_enable(&priv->clocks[i]);
- if (err) {
+ if (err
&& err != -ENOSYS
) {
dev_err(dev, "failed to enable clock %d\n", i);
clk_free(&priv->clocks[i]);
goto clk_err;
dev_err(dev, "failed to enable clock %d\n", i);
clk_free(&priv->clocks[i]);
goto clk_err;
@@
-109,7
+108,8
@@
static int ohci_usb_probe(struct udevice *dev)
}
priv->reset_count = 0;
}
priv->reset_count = 0;
- reset_nb = dev_count_phandle_with_args(dev, "resets", "#reset-cells");
+ reset_nb = dev_count_phandle_with_args(dev, "resets", "#reset-cells",
+ 0);
if (reset_nb > 0) {
priv->resets = devm_kcalloc(dev, reset_nb,
sizeof(struct reset_ctl),
if (reset_nb > 0) {
priv->resets = devm_kcalloc(dev, reset_nb,
sizeof(struct reset_ctl),
@@
-194,6
+194,6
@@
U_BOOT_DRIVER(ohci_generic) = {
.probe = ohci_usb_probe,
.remove = ohci_usb_remove,
.ops = &ohci_usb_ops,
.probe = ohci_usb_probe,
.remove = ohci_usb_remove,
.ops = &ohci_usb_ops,
- .priv_auto
_alloc_size
= sizeof(struct generic_ohci),
+ .priv_auto
= sizeof(struct generic_ohci),
.flags = DM_FLAG_ALLOC_PRIV_DMA,
};
.flags = DM_FLAG_ALLOC_PRIV_DMA,
};