.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * Meson GXL and GXM USB2 PHY driver |
---|
3 | 4 | * |
---|
4 | 5 | * Copyright (C) 2017 Martin Blumenstingl <martin.blumenstingl@googlemail.com> |
---|
5 | | - * |
---|
6 | | - * This program is free software; you can redistribute it and/or modify |
---|
7 | | - * it under the terms of the GNU General Public License version 2 as |
---|
8 | | - * published by the Free Software Foundation. |
---|
9 | | - * |
---|
10 | | - * You should have received a copy of the GNU General Public License |
---|
11 | | - * along with this program. If not, see <http://www.gnu.org/licenses/>. |
---|
12 | 6 | */ |
---|
13 | 7 | |
---|
14 | 8 | #include <linux/clk.h> |
---|
.. | .. |
---|
152 | 146 | return 0; |
---|
153 | 147 | } |
---|
154 | 148 | |
---|
155 | | -static int phy_meson_gxl_usb2_set_mode(struct phy *phy, enum phy_mode mode) |
---|
| 149 | +static int phy_meson_gxl_usb2_set_mode(struct phy *phy, |
---|
| 150 | + enum phy_mode mode, int submode) |
---|
156 | 151 | { |
---|
157 | 152 | struct phy_meson_gxl_usb2_priv *priv = phy_get_drvdata(phy); |
---|
158 | 153 | |
---|
.. | .. |
---|
209 | 204 | /* power on the PHY by taking it out of reset mode */ |
---|
210 | 205 | regmap_update_bits(priv->regmap, U2P_R0, U2P_R0_POWER_ON_RESET, 0); |
---|
211 | 206 | |
---|
212 | | - ret = phy_meson_gxl_usb2_set_mode(phy, priv->mode); |
---|
| 207 | + ret = phy_meson_gxl_usb2_set_mode(phy, priv->mode, 0); |
---|
213 | 208 | if (ret) { |
---|
214 | 209 | phy_meson_gxl_usb2_power_off(phy); |
---|
215 | 210 | |
---|
.. | .. |
---|
260 | 255 | if (IS_ERR(priv->regmap)) |
---|
261 | 256 | return PTR_ERR(priv->regmap); |
---|
262 | 257 | |
---|
263 | | - priv->clk = devm_clk_get(dev, "phy"); |
---|
264 | | - if (IS_ERR(priv->clk)) { |
---|
265 | | - ret = PTR_ERR(priv->clk); |
---|
266 | | - if (ret == -ENOENT) |
---|
267 | | - priv->clk = NULL; |
---|
268 | | - else |
---|
269 | | - return ret; |
---|
270 | | - } |
---|
| 258 | + priv->clk = devm_clk_get_optional(dev, "phy"); |
---|
| 259 | + if (IS_ERR(priv->clk)) |
---|
| 260 | + return PTR_ERR(priv->clk); |
---|
271 | 261 | |
---|
272 | 262 | priv->reset = devm_reset_control_get_optional_shared(dev, "phy"); |
---|
273 | 263 | if (IS_ERR(priv->reset)) |
---|