1 // SPDX-License-Identifier: GPL-1.0+
3 * Renesas USB driver R-Car Gen. 2 initialization and power control
5 * Copyright (C) 2014 Ulrich Hecht
8 #include <linux/gpio.h>
9 #include <linux/of_gpio.h>
10 #include <linux/phy/phy.h>
14 static int usbhs_rcar2_hardware_init(struct platform_device
*pdev
)
16 struct usbhs_priv
*priv
= usbhs_pdev_to_priv(pdev
);
18 if (IS_ENABLED(CONFIG_GENERIC_PHY
)) {
19 struct phy
*phy
= phy_get(&pdev
->dev
, "usb");
31 static int usbhs_rcar2_hardware_exit(struct platform_device
*pdev
)
33 struct usbhs_priv
*priv
= usbhs_pdev_to_priv(pdev
);
43 static int usbhs_rcar2_power_ctrl(struct platform_device
*pdev
,
44 void __iomem
*base
, int enable
)
46 struct usbhs_priv
*priv
= usbhs_pdev_to_priv(pdev
);
51 retval
= phy_init(priv
->phy
);
54 retval
= phy_power_on(priv
->phy
);
56 phy_power_off(priv
->phy
);
65 static int usbhs_rcar2_get_id(struct platform_device
*pdev
)
70 const struct renesas_usbhs_platform_callback usbhs_rcar2_ops
= {
71 .hardware_init
= usbhs_rcar2_hardware_init
,
72 .hardware_exit
= usbhs_rcar2_hardware_exit
,
73 .power_ctrl
= usbhs_rcar2_power_ctrl
,
74 .get_id
= usbhs_rcar2_get_id
,