+#ifdef CONFIG_PM
+
+static int jz4740_udc_suspend(struct device *dev)
+{
+ struct jz4740_udc *udc = dev_get_drvdata(dev);
+
+ if (udc->state == UDC_STATE_ENABLE)
+ udc_disable(udc);
+
+ return 0;
+}
+
+static int jz4740_udc_resume(struct device *dev)
+{
+ struct jz4740_udc *udc = dev_get_drvdata(dev);
+
+ if (udc->state == UDC_STATE_ENABLE)
+ udc_enable(udc);
+
+ return 0;
+}
+
+static struct dev_pm_ops jz4740_udc_pm_ops = {
+ .suspend = jz4740_udc_suspend,
+ .resume = jz4740_udc_resume,
+};
+
+#define JZ4740_UDC_PM_OPS (&jz4740_udc_pm_ops)
+
+#else
+
+#define JZ4740_UDC_PM_OPS NULL
+
+#endif
+