Lines Matching +full:wakeup +full:- +full:mode

1 // SPDX-License-Identifier: GPL-2.0
4 #include <linux/dma-mapping.h>
13 #include "phy-am335x-control.h"
14 #include "phy-generic.h"
25 struct am335x_phy *am_phy = dev_get_drvdata(phy->dev); in am335x_init()
27 phy_ctrl_power(am_phy->phy_ctrl, am_phy->id, am_phy->dr_mode, true); in am335x_init()
33 struct am335x_phy *am_phy = dev_get_drvdata(phy->dev); in am335x_shutdown()
35 phy_ctrl_power(am_phy->phy_ctrl, am_phy->id, am_phy->dr_mode, false); in am335x_shutdown()
41 struct device *dev = &pdev->dev; in am335x_phy_probe()
46 return -ENOMEM; in am335x_phy_probe()
48 am_phy->phy_ctrl = am335x_get_phy_control(dev); in am335x_phy_probe()
49 if (!am_phy->phy_ctrl) in am335x_phy_probe()
50 return -EPROBE_DEFER; in am335x_phy_probe()
52 am_phy->id = of_alias_get_id(pdev->dev.of_node, "phy"); in am335x_phy_probe()
53 if (am_phy->id < 0) { in am335x_phy_probe()
54 dev_err(&pdev->dev, "Missing PHY id: %d\n", am_phy->id); in am335x_phy_probe()
55 return am_phy->id; in am335x_phy_probe()
58 am_phy->dr_mode = of_usb_get_dr_mode_by_phy(pdev->dev.of_node, -1); in am335x_phy_probe()
60 ret = usb_phy_gen_create_phy(dev, &am_phy->usb_phy_gen); in am335x_phy_probe()
64 am_phy->usb_phy_gen.phy.init = am335x_init; in am335x_phy_probe()
65 am_phy->usb_phy_gen.phy.shutdown = am335x_shutdown; in am335x_phy_probe()
71 * If we leave PHY wakeup enabled then AM33XX wakes up in am335x_phy_probe()
72 * immediately from DS0. To avoid this we mark dev->power.can_wakeup in am335x_phy_probe()
74 * on whether to enable PHY wakeup or not. in am335x_phy_probe()
75 * PHY wakeup works fine in standby mode, there by allowing us to in am335x_phy_probe()
76 * handle remote wakeup, wakeup on disconnect and connect. in am335x_phy_probe()
80 phy_ctrl_power(am_phy->phy_ctrl, am_phy->id, am_phy->dr_mode, false); in am335x_phy_probe()
82 return usb_add_phy_dev(&am_phy->usb_phy_gen.phy); in am335x_phy_probe()
89 usb_remove_phy(&am_phy->usb_phy_gen.phy); in am335x_phy_remove()
98 * Enable phy wakeup only if dev->power.can_wakeup is true. in am335x_phy_suspend()
99 * Make sure to enable wakeup to support remote wakeup in in am335x_phy_suspend()
100 * standby mode ( same is not supported in OFF(DS0) mode). in am335x_phy_suspend()
102 * echo enabled > /sys/bus/platform/devices/<usb-phy-id>/power/wakeup in am335x_phy_suspend()
106 phy_ctrl_wkup(am_phy->phy_ctrl, am_phy->id, true); in am335x_phy_suspend()
108 phy_ctrl_power(am_phy->phy_ctrl, am_phy->id, am_phy->dr_mode, false); in am335x_phy_suspend()
117 phy_ctrl_power(am_phy->phy_ctrl, am_phy->id, am_phy->dr_mode, true); in am335x_phy_resume()
120 phy_ctrl_wkup(am_phy->phy_ctrl, am_phy->id, false); in am335x_phy_resume()
129 { .compatible = "ti,am335x-usb-phy" },
138 .name = "am335x-phy-driver",