summaryrefslogtreecommitdiff
path: root/drivers/phy/st/phy-stih407-usb.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/phy/st/phy-stih407-usb.c')
-rw-r--r--drivers/phy/st/phy-stih407-usb.c32
1 files changed, 8 insertions, 24 deletions
diff --git a/drivers/phy/st/phy-stih407-usb.c b/drivers/phy/st/phy-stih407-usb.c
index b1f44ab669fb..7a3e4584895c 100644
--- a/drivers/phy/st/phy-stih407-usb.c
+++ b/drivers/phy/st/phy-stih407-usb.c
@@ -1,14 +1,10 @@
+// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (C) 2014 STMicroelectronics
*
* STMicroelectronics Generic PHY driver for STiH407 USB2.
*
* Author: Giuseppe Cavallaro <peppe.cavallaro@st.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2, as
- * published by the Free Software Foundation.
- *
*/
#include <linux/platform_device.h>
#include <linux/io.h>
@@ -22,8 +18,8 @@
#include <linux/mfd/syscon.h>
#include <linux/phy/phy.h>
-#define PHYPARAM_REG 1
-#define PHYCTRL_REG 2
+#define PHYPARAM_REG 0
+#define PHYCTRL_REG 1
/* Default PHY_SEL and REFCLKSEL configuration */
#define STIH407_USB_PICOPHY_CTRL_PORT_CONF 0x6
@@ -95,8 +91,8 @@ static int stih407_usb2_picophy_probe(struct platform_device *pdev)
struct device *dev = &pdev->dev;
struct device_node *np = dev->of_node;
struct phy_provider *phy_provider;
+ unsigned int syscon_args[2];
struct phy *phy;
- int ret;
phy_dev = devm_kzalloc(dev, sizeof(*phy_dev), GFP_KERNEL);
if (!phy_dev)
@@ -120,25 +116,15 @@ static int stih407_usb2_picophy_probe(struct platform_device *pdev)
/* Reset port by default: only deassert it in phy init */
reset_control_assert(phy_dev->rstport);
- phy_dev->regmap = syscon_regmap_lookup_by_phandle(np, "st,syscfg");
+ phy_dev->regmap = syscon_regmap_lookup_by_phandle_args(np, "st,syscfg",
+ 2, syscon_args);
if (IS_ERR(phy_dev->regmap)) {
dev_err(dev, "No syscfg phandle specified\n");
return PTR_ERR(phy_dev->regmap);
}
- ret = of_property_read_u32_index(np, "st,syscfg", PHYPARAM_REG,
- &phy_dev->param);
- if (ret) {
- dev_err(dev, "can't get phyparam offset (%d)\n", ret);
- return ret;
- }
-
- ret = of_property_read_u32_index(np, "st,syscfg", PHYCTRL_REG,
- &phy_dev->ctrl);
- if (ret) {
- dev_err(dev, "can't get phyctrl offset (%d)\n", ret);
- return ret;
- }
+ phy_dev->param = syscon_args[PHYPARAM_REG];
+ phy_dev->ctrl = syscon_args[PHYCTRL_REG];
phy = devm_phy_create(dev, NULL, &stih407_usb2_picophy_data);
if (IS_ERR(phy)) {
@@ -153,8 +139,6 @@ static int stih407_usb2_picophy_probe(struct platform_device *pdev)
if (IS_ERR(phy_provider))
return PTR_ERR(phy_provider);
- dev_info(dev, "STiH407 USB Generic picoPHY driver probed!");
-
return 0;
}