mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-10 21:07:02 +09:00
Revert "phy: phy-rockchip-usb: add support of rk33 usb phy"
This reverts commit 6d91a06b4e.
Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
Conflicts:
arch/arm64/configs/rockchip_defconfig
This commit is contained in:
@@ -21,7 +21,6 @@
|
||||
#include <linux/mutex.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/of_address.h>
|
||||
#include <linux/of_platform.h>
|
||||
#include <linux/phy/phy.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/regulator/consumer.h>
|
||||
@@ -42,34 +41,22 @@ struct rockchip_usb_phy {
|
||||
struct regmap *reg_base;
|
||||
struct clk *clk;
|
||||
struct phy *phy;
|
||||
int (*rk_usb_phy_power)(struct rockchip_usb_phy *phy, bool on);
|
||||
};
|
||||
|
||||
static int rk32_usb_phy_power(struct rockchip_usb_phy *phy,
|
||||
bool on)
|
||||
static int rockchip_usb_phy_power(struct rockchip_usb_phy *phy,
|
||||
bool siddq)
|
||||
{
|
||||
/* Power down usb phy analog blocks by set siddq 1 */
|
||||
bool siddq = !on;
|
||||
|
||||
return regmap_write(phy->reg_base, phy->reg_offset,
|
||||
SIDDQ_WRITE_ENA | (siddq ? SIDDQ_ON : SIDDQ_OFF));
|
||||
}
|
||||
|
||||
static int rk33_usb_phy_power(struct rockchip_usb_phy *phy,
|
||||
bool on)
|
||||
{
|
||||
if (on)
|
||||
return regmap_write(phy->reg_base, phy->reg_offset, 0xffff0000);
|
||||
else
|
||||
return regmap_write(phy->reg_base, phy->reg_offset, 0xffff01d5);
|
||||
}
|
||||
|
||||
static int rockchip_usb_phy_power_off(struct phy *_phy)
|
||||
{
|
||||
struct rockchip_usb_phy *phy = phy_get_drvdata(_phy);
|
||||
int ret = 0;
|
||||
|
||||
ret = phy->rk_usb_phy_power(phy, 0);
|
||||
/* Power down usb phy analog blocks by set siddq 1 */
|
||||
ret = rockchip_usb_phy_power(phy, 1);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
@@ -90,7 +77,7 @@ static int rockchip_usb_phy_power_on(struct phy *_phy)
|
||||
return ret;
|
||||
|
||||
/* Power up usb phy analog blocks by set siddq 0 */
|
||||
ret = phy->rk_usb_phy_power(phy, 1);
|
||||
ret = rockchip_usb_phy_power(phy, 0);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
@@ -103,18 +90,6 @@ static struct phy_ops ops = {
|
||||
.owner = THIS_MODULE,
|
||||
};
|
||||
|
||||
static const struct of_device_id rockchip_usb_phy_dt_ids[] = {
|
||||
{
|
||||
.compatible = "rockchip,rk3288-usb-phy",
|
||||
.data = (void *)rk32_usb_phy_power
|
||||
},
|
||||
{
|
||||
.compatible = "rockchip,rk3368-usb-phy",
|
||||
.data = (void *)rk33_usb_phy_power
|
||||
},
|
||||
{}
|
||||
};
|
||||
|
||||
static int rockchip_usb_phy_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct device *dev = &pdev->dev;
|
||||
@@ -122,9 +97,7 @@ static int rockchip_usb_phy_probe(struct platform_device *pdev)
|
||||
struct phy_provider *phy_provider;
|
||||
struct device_node *child;
|
||||
struct regmap *grf;
|
||||
const struct of_device_id *match;
|
||||
unsigned int reg_offset;
|
||||
int (*rk_usb_phy_power)(struct rockchip_usb_phy *phy, bool siddq);
|
||||
|
||||
grf = syscon_regmap_lookup_by_phandle(dev->of_node, "rockchip,grf");
|
||||
if (IS_ERR(grf)) {
|
||||
@@ -132,12 +105,6 @@ static int rockchip_usb_phy_probe(struct platform_device *pdev)
|
||||
return PTR_ERR(grf);
|
||||
}
|
||||
|
||||
match = of_match_device(rockchip_usb_phy_dt_ids, &pdev->dev);
|
||||
if (match && match->data)
|
||||
rk_usb_phy_power = match->data;
|
||||
else
|
||||
return PTR_ERR(match);
|
||||
|
||||
for_each_available_child_of_node(dev->of_node, child) {
|
||||
rk_phy = devm_kzalloc(dev, sizeof(*rk_phy), GFP_KERNEL);
|
||||
if (!rk_phy)
|
||||
@@ -149,7 +116,6 @@ static int rockchip_usb_phy_probe(struct platform_device *pdev)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
rk_phy->rk_usb_phy_power = rk_usb_phy_power;
|
||||
rk_phy->reg_offset = reg_offset;
|
||||
rk_phy->reg_base = grf;
|
||||
|
||||
@@ -166,12 +132,17 @@ static int rockchip_usb_phy_probe(struct platform_device *pdev)
|
||||
}
|
||||
|
||||
phy_provider = devm_of_phy_provider_register(dev, of_phy_simple_xlate);
|
||||
if (IS_ERR(phy_provider))
|
||||
if (PTR_ERR(phy_provider))
|
||||
return (long)phy_provider;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct of_device_id rockchip_usb_phy_dt_ids[] = {
|
||||
{ .compatible = "rockchip,rk3288-usb-phy" },
|
||||
{}
|
||||
};
|
||||
|
||||
MODULE_DEVICE_TABLE(of, rockchip_usb_phy_dt_ids);
|
||||
|
||||
static struct platform_driver rockchip_usb_driver = {
|
||||
|
||||
Reference in New Issue
Block a user