usb: gadget: renesas_usbhs: add platform power control function
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
This commit is contained in:
parent
a49a88f108
commit
f1ee56a000
|
@ -291,18 +291,25 @@ static u32 usbhsc_default_pipe_type[] = {
|
||||||
*/
|
*/
|
||||||
static void usbhsc_power_ctrl(struct usbhs_priv *priv, int enable)
|
static void usbhsc_power_ctrl(struct usbhs_priv *priv, int enable)
|
||||||
{
|
{
|
||||||
|
struct platform_device *pdev = usbhs_priv_to_pdev(priv);
|
||||||
struct device *dev = usbhs_priv_to_dev(priv);
|
struct device *dev = usbhs_priv_to_dev(priv);
|
||||||
|
|
||||||
if (enable) {
|
if (enable) {
|
||||||
/* enable PM */
|
/* enable PM */
|
||||||
pm_runtime_get_sync(dev);
|
pm_runtime_get_sync(dev);
|
||||||
|
|
||||||
|
/* enable platform power */
|
||||||
|
usbhs_platform_call(priv, power_ctrl, pdev, priv->base, enable);
|
||||||
|
|
||||||
/* USB on */
|
/* USB on */
|
||||||
usbhs_sys_clock_ctrl(priv, enable);
|
usbhs_sys_clock_ctrl(priv, enable);
|
||||||
} else {
|
} else {
|
||||||
/* USB off */
|
/* USB off */
|
||||||
usbhs_sys_clock_ctrl(priv, enable);
|
usbhs_sys_clock_ctrl(priv, enable);
|
||||||
|
|
||||||
|
/* disable platform power */
|
||||||
|
usbhs_platform_call(priv, power_ctrl, pdev, priv->base, enable);
|
||||||
|
|
||||||
/* disable PM */
|
/* disable PM */
|
||||||
pm_runtime_put_sync(dev);
|
pm_runtime_put_sync(dev);
|
||||||
}
|
}
|
||||||
|
|
|
@ -64,6 +64,14 @@ struct renesas_usbhs_platform_callback {
|
||||||
*/
|
*/
|
||||||
void (*hardware_exit)(struct platform_device *pdev);
|
void (*hardware_exit)(struct platform_device *pdev);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* option:
|
||||||
|
*
|
||||||
|
* for board specific clock control
|
||||||
|
*/
|
||||||
|
void (*power_ctrl)(struct platform_device *pdev,
|
||||||
|
void __iomem *base, int enable);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* option:
|
* option:
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue