^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: GPL-2.0 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) #ifndef _AM335x_PHY_CONTROL_H_
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) #define _AM335x_PHY_CONTROL_H_
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) struct phy_control {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) void (*phy_power)(struct phy_control *phy_ctrl, u32 id,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) enum usb_dr_mode dr_mode, bool on);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) void (*phy_wkup)(struct phy_control *phy_ctrl, u32 id, bool on);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) static inline void phy_ctrl_power(struct phy_control *phy_ctrl, u32 id,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) enum usb_dr_mode dr_mode, bool on)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) phy_ctrl->phy_power(phy_ctrl, id, dr_mode, on);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) static inline void phy_ctrl_wkup(struct phy_control *phy_ctrl, u32 id, bool on)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) phy_ctrl->phy_wkup(phy_ctrl, id, on);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) struct phy_control *am335x_get_phy_control(struct device *dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) #endif