usb: dwc_otg_310: pcd: fix force device mode issue
When tested usb device through force device mode method,
we found that usb device failed to connect to usb host
in the following case.
1. Use micro usb 2.0 OTG interface.
2. Plug in otg cable, and the id pin was pulled down
to Ground.
3. User space force usb to enter device mode through
'echo 2 > /sys/bus/platform/drivers/usb20_otg/force_usb_mode'
4. Use usb 2.0 Standard-A to Standard-A cable assembly,
plug into otg cable receptor on one side, and connect
to PC on the other side.
5. PC fail to enumerate our device, because of usb driver
logical issue.
This is because that the dwc_otg_pcd_check_vbus_work()
only enable usb to start connecting if check the bvalid
and iddig is high. But in the above test case, the iddig
is low, so fail to start connection work. In this patch,
we enable usb to connect if iddig is high or usb is in
force device mode.
In addition, fix some coding style to increase the readability.
Change-Id: I08f1a4e6e7e5fb246b1716a20d4572d8b866f238
Signed-off-by: William Wu <william.wu@rock-chips.com>