The code snippet implementing CyU3PUsbLPMDisable() API is correct.
There is no need to use CyU3PUsbLPMEnable() during normal operation unless you want the device to pass USB compliance tests.
If you want the device to go to low power mode, you will have to use CyU3PUsbLPMEnable() to handle the low power requests from host in the CyFxApplnLPMRqtCB() function in the firmware and register a callback for the same.
Thanks for the response.
If I want to run compliance test also in same FW and also overcome the Cypress errata regarding LPM. How it can be handled ?
Thanks & Regards
If your end application is based on UVC, the device can have LPM enabled as soon as DMA channels are created using CyU3PUsbLPMEnable() to save power and use CyU3PUsbLPMDisable() before starting streaming and transferring data.
The device should also enter LPM when the streaming stops to save power or when the host sends LPM requests to the device to go into LPM.
You can go through the example firmware from AN75779 from the link: https://www.cypress.com/file/123501/download
If the end application is not UVC, you can go through UsbBulkSrcSink example from the SDK path: C:\Program Files (x86)\Cypress\EZ-USB FX3 SDK\1.3\firmware\basic_examples\cyfxbulksrcsink
This example frimware also has an implementation of LPMEnable and LPMDisable which puts the device in LPM when a timer expires.
Both of these firmwares can pass the compliance tests and similar implementation can be used.