This node is used for usb controller test application to enum usb
devices plugin and disconnect.
struct device_attribute *attr,
const char *buf, size_t count)
{
-
dwc_otg_device_t *otg_dev = _dev->platform_data;
+ struct dwc_otg_platform_data *pldata = otg_dev->pldata;
uint32_t on = simple_strtoul(buf, NULL, 16);
+
+ if (on != 0 && on != 1)
+ return -EINVAL;
+
dwc_otg_set_prtpower(otg_dev->core_if, on);
+ pldata->power_enable(on);
return count;
}
{
if (0 == enable) {
/* disable host_drv power */
- /* do not disable power in default */
+ if (gpio_is_valid(control_usb->host_gpios->gpio))
+ gpio_set_value(control_usb->host_gpios->gpio, 0);
} else if (1 == enable) {
/* enable host_drv power */
if (gpio_is_valid(control_usb->host_gpios->gpio))