// SPDX-License-Identifier: GPL-2.0+ /* * USB cluster support for Armada 375 platform. * * Copyright (C) 2014 Marvell * * Gregory CLEMENT <gregory.clement@free-electrons.com> * * Armada 375 comes with an USB2 host and device controller and an * USB3 controller. The USB cluster control register allows to manage * common features of both USB controllers.
*/
/* * Only one controller can use this PHY. We shouldn't have the case * when two controllers want to use this PHY. But if this case occurs * then we provide a phy to the first one and return an error for the * next one. This error has also to be an error returned by * devm_phy_optional_get() so different from ENODEV for USB2. In the * USB3 case it still optional and we use ENODEV.
*/ staticstruct phy *armada375_usb_phy_xlate(struct device *dev, conststruct of_phandle_args *args)
{ struct armada375_cluster_phy *cluster_phy = dev_get_drvdata(dev);
if (!cluster_phy) return ERR_PTR(-ENODEV);
/* * Either the phy had never been requested and then the first * usb claiming it can get it, or it had already been * requested in this case, we only allow to use it with the * same configuration.
*/ if (WARN_ON((cluster_phy->phy_provided != PHY_NONE) &&
(cluster_phy->phy_provided != args->args[0]))) {
dev_err(dev, "This PHY has already been provided!\n");
dev_err(dev, "Check your device tree, only one controller can use it\n."); if (args->args[0] == PHY_TYPE_USB2) return ERR_PTR(-EBUSY); else return ERR_PTR(-ENODEV);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.