#include <linux/pm.h>
#include "arche_platform.h"
+#include <linux/usb/usb3613.h>
+
struct arche_platform_drvdata {
/* Control GPIO signals to and from AP <=> SVC */
int svc_reset_gpio;
/* re-assert wake_detect to confirm SVC WAKE_OUT */
gpio_direction_output(arche_pdata->wake_detect_gpio, 1);
+
+ /* Enable HUB3613 into HUB mode. */
+ if (usb3613_hub_mode_ctrl(true))
+ dev_warn(arche_pdata->dev, "failed to control hub device\n");
}
static int arche_platform_coldboot_seq(struct arche_platform_drvdata *arche_pdata)
device_for_each_child(arche_pdata->dev, NULL, apb_poweroff);
arche_platform_poweroff_seq(arche_pdata);
+
+ ret = usb3613_hub_mode_ctrl(false);
+ if (ret)
+ dev_warn(arche_pdata->dev, "failed to control hub device\n");
+ /* TODO: Should we do anything more here ?? */
} else if (sysfs_streq(buf, "active")) {
if (arche_pdata->state == ARCHE_PLATFORM_STATE_ACTIVE)
return count;
arche_platform_poweroff_seq(arche_pdata);
+ ret = usb3613_hub_mode_ctrl(false);
+ if (ret)
+ dev_warn(arche_pdata->dev, "failed to control hub device\n");
+ /* TODO: Should we do anything more here ?? */
+
arche_platform_fw_flashing_seq(arche_pdata);
device_for_each_child(arche_pdata->dev, NULL, apb_fw_flashing_state);
arche_platform_poweroff_seq(arche_pdata);
platform_set_drvdata(pdev, NULL);
+ if (usb3613_hub_mode_ctrl(false))
+ dev_warn(arche_pdata->dev, "failed to control hub device\n");
+ /* TODO: Should we do anything more here ?? */
return 0;
}