| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Lantiq XWAY SoC RCU module based USB 1.1/2.0 PHY driver |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright (C) 2016 Martin Blumenstingl <martin.blumenstingl@googlemail.com> |
|---|
| 5 | 6 | * Copyright (C) 2017 Hauke Mehrtens <hauke@hauke-m.de> |
|---|
| 6 | | - * |
|---|
| 7 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 8 | | - * it under the terms of the GNU General Public License version 2 as |
|---|
| 9 | | - * published by the Free Software Foundation. |
|---|
| 10 | 7 | */ |
|---|
| 11 | 8 | |
|---|
| 12 | 9 | #include <linux/clk.h> |
|---|
| .. | .. |
|---|
| 127 | 124 | reset_control_deassert(priv->phy_reset); |
|---|
| 128 | 125 | |
|---|
| 129 | 126 | ret = clk_prepare_enable(priv->phy_gate_clk); |
|---|
| 130 | | - if (ret) |
|---|
| 127 | + if (ret) { |
|---|
| 131 | 128 | dev_err(dev, "failed to enable PHY gate\n"); |
|---|
| 129 | + return ret; |
|---|
| 130 | + } |
|---|
| 131 | + |
|---|
| 132 | + /* |
|---|
| 133 | + * at least the xrx200 usb2 phy requires some extra time to be |
|---|
| 134 | + * operational after enabling the clock |
|---|
| 135 | + */ |
|---|
| 136 | + usleep_range(100, 200); |
|---|
| 132 | 137 | |
|---|
| 133 | 138 | return ret; |
|---|
| 134 | 139 | } |
|---|
| .. | .. |
|---|
| 144 | 149 | return 0; |
|---|
| 145 | 150 | } |
|---|
| 146 | 151 | |
|---|
| 147 | | -static struct phy_ops ltq_rcu_usb2_phy_ops = { |
|---|
| 152 | +static const struct phy_ops ltq_rcu_usb2_phy_ops = { |
|---|
| 148 | 153 | .init = ltq_rcu_usb2_phy_init, |
|---|
| 149 | 154 | .power_on = ltq_rcu_usb2_phy_power_on, |
|---|
| 150 | 155 | .power_off = ltq_rcu_usb2_phy_power_off, |
|---|
| .. | .. |
|---|
| 195 | 200 | } |
|---|
| 196 | 201 | |
|---|
| 197 | 202 | priv->phy_reset = devm_reset_control_get_optional(dev, "phy"); |
|---|
| 198 | | - if (IS_ERR(priv->phy_reset)) |
|---|
| 199 | | - return PTR_ERR(priv->phy_reset); |
|---|
| 200 | 203 | |
|---|
| 201 | | - return 0; |
|---|
| 204 | + return PTR_ERR_OR_ZERO(priv->phy_reset); |
|---|
| 202 | 205 | } |
|---|
| 203 | 206 | |
|---|
| 204 | 207 | static int ltq_rcu_usb2_phy_probe(struct platform_device *pdev) |
|---|