hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/phy/amlogic/phy-meson-gxl-usb2.c
....@@ -1,14 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Meson GXL and GXM USB2 PHY driver
34 *
45 * 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/>.
126 */
137
148 #include <linux/clk.h>
....@@ -152,7 +146,8 @@
152146 return 0;
153147 }
154148
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)
156151 {
157152 struct phy_meson_gxl_usb2_priv *priv = phy_get_drvdata(phy);
158153
....@@ -209,7 +204,7 @@
209204 /* power on the PHY by taking it out of reset mode */
210205 regmap_update_bits(priv->regmap, U2P_R0, U2P_R0_POWER_ON_RESET, 0);
211206
212
- ret = phy_meson_gxl_usb2_set_mode(phy, priv->mode);
207
+ ret = phy_meson_gxl_usb2_set_mode(phy, priv->mode, 0);
213208 if (ret) {
214209 phy_meson_gxl_usb2_power_off(phy);
215210
....@@ -260,14 +255,9 @@
260255 if (IS_ERR(priv->regmap))
261256 return PTR_ERR(priv->regmap);
262257
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);
271261
272262 priv->reset = devm_reset_control_get_optional_shared(dev, "phy");
273263 if (IS_ERR(priv->reset))