diff options
author | Tom Rini <trini@konsulko.com> | 2020-08-23 16:06:38 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2020-08-23 16:06:38 -0400 |
commit | d584648dad691caec3ecc7777dbfa3f1936878e5 (patch) | |
tree | ee787f8204c917526859da55840f6f159a00b8ba /drivers/phy/sandbox-phy.c | |
parent | c84341f5acd6140f361300f02b354a7238f95b72 (diff) | |
parent | a4020350289c520e896fd6180e510be557ed3bf9 (diff) |
Merge tag 'dm-pull-22aug20' of https://gitlab.denx.de/u-boot/custodians/u-boot-dm
replace devfdt_get_addr_ptr() with dev_read_addr_ptr()
binman fixes for portage
various minor fixes
'bind' command improvements
Diffstat (limited to 'drivers/phy/sandbox-phy.c')
-rw-r--r-- | drivers/phy/sandbox-phy.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/drivers/phy/sandbox-phy.c b/drivers/phy/sandbox-phy.c index 84ff5c6275..5f36da7692 100644 --- a/drivers/phy/sandbox-phy.c +++ b/drivers/phy/sandbox-phy.c @@ -8,6 +8,8 @@ #include <dm.h> #include <generic-phy.h> +#define DRIVER_DATA 0x12345678 + struct sandbox_phy_priv { bool initialized; bool on; @@ -71,6 +73,14 @@ static int sandbox_phy_exit(struct phy *phy) return 0; } +static int sandbox_phy_bind(struct udevice *dev) +{ + if (dev_get_driver_data(dev) != DRIVER_DATA) + return -ENODATA; + + return 0; +} + static int sandbox_phy_probe(struct udevice *dev) { struct sandbox_phy_priv *priv = dev_get_priv(dev); @@ -90,13 +100,19 @@ static struct phy_ops sandbox_phy_ops = { }; static const struct udevice_id sandbox_phy_ids[] = { - { .compatible = "sandbox,phy" }, + { .compatible = "sandbox,phy_no_driver_data", + }, + + { .compatible = "sandbox,phy", + .data = DRIVER_DATA + }, { } }; U_BOOT_DRIVER(phy_sandbox) = { .name = "phy_sandbox", .id = UCLASS_PHY, + .bind = sandbox_phy_bind, .of_match = sandbox_phy_ids, .ops = &sandbox_phy_ops, .probe = sandbox_phy_probe, |