Пример #1
0
static int
uftdi_pwrlvl3(uftdi_state_t *uf)
{
	int rval;

	USB_DPRINTF_L4(DPRINT_PM, uf->uf_lh, "uftdi_pwrlvl3");

	switch (uf->uf_dev_state) {
	case USB_DEV_PWRED_DOWN:
		/* Issue USB D0 command to the device here */
		rval = usb_set_device_pwrlvl0(uf->uf_dip);
		ASSERT(rval == USB_SUCCESS);

		uf->uf_dev_state = USB_DEV_ONLINE;
		uf->uf_pm->pm_cur_power = USB_DEV_OS_FULL_PWR;

		/*FALLTHROUGH*/
	case USB_DEV_ONLINE:
		/* we are already in full power */

		/*FALLTHROUGH*/
	case USB_DEV_DISCONNECTED:
	case USB_DEV_SUSPENDED:
		return (USB_SUCCESS);
	default:
		USB_DPRINTF_L2(DPRINT_PM, uf->uf_lh,
		    "uftdi_pwrlvl3: illegal device state");
		return (USB_FAILURE);
	}
}
Пример #2
0
int
usba10_usb_set_device_pwrlvl0(dev_info_t *dip)
{
	return (usb_set_device_pwrlvl0(dip));
}