Deleted Added
full compact
atmegadci.c (227309) atmegadci.c (228483)
1#include <sys/cdefs.h>
1#include <sys/cdefs.h>
2__FBSDID("$FreeBSD: head/sys/dev/usb/controller/atmegadci.c 227309 2011-11-07 15:43:11Z ed $");
2__FBSDID("$FreeBSD: head/sys/dev/usb/controller/atmegadci.c 228483 2011-12-14 00:28:54Z hselasky $");
3
4/*-
5 * Copyright (c) 2009 Hans Petter Selasky. All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 * 1. Redistributions of source code must retain the above copyright

--- 1336 unchanged lines hidden (view full) ---

1347 atmegadci_clocks_off(sc);
1348
1349 /* disable USB PAD regulator */
1350 ATMEGA_WRITE_1(sc, ATMEGA_UHWCON, 0);
1351
1352 USB_BUS_UNLOCK(&sc->sc_bus);
1353}
1354
3
4/*-
5 * Copyright (c) 2009 Hans Petter Selasky. All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 * 1. Redistributions of source code must retain the above copyright

--- 1336 unchanged lines hidden (view full) ---

1347 atmegadci_clocks_off(sc);
1348
1349 /* disable USB PAD regulator */
1350 ATMEGA_WRITE_1(sc, ATMEGA_UHWCON, 0);
1351
1352 USB_BUS_UNLOCK(&sc->sc_bus);
1353}
1354
1355void
1355static void
1356atmegadci_suspend(struct atmegadci_softc *sc)
1357{
1356atmegadci_suspend(struct atmegadci_softc *sc)
1357{
1358 return;
1358 /* TODO */
1359}
1360
1359}
1360
1361void
1361static void
1362atmegadci_resume(struct atmegadci_softc *sc)
1363{
1362atmegadci_resume(struct atmegadci_softc *sc)
1363{
1364 return;
1364 /* TODO */
1365}
1366
1367static void
1368atmegadci_do_poll(struct usb_bus *bus)
1369{
1370 struct atmegadci_softc *sc = ATMEGA_BUS2SC(bus);
1371
1372 USB_BUS_LOCK(&sc->sc_bus);

--- 748 unchanged lines hidden (view full) ---

2121 }
2122 if ((edesc->bmAttributes & UE_XFERTYPE) == UE_ISOCHRONOUS)
2123 ep->methods = &atmegadci_device_isoc_fs_methods;
2124 else
2125 ep->methods = &atmegadci_device_non_isoc_methods;
2126 }
2127}
2128
1365}
1366
1367static void
1368atmegadci_do_poll(struct usb_bus *bus)
1369{
1370 struct atmegadci_softc *sc = ATMEGA_BUS2SC(bus);
1371
1372 USB_BUS_LOCK(&sc->sc_bus);

--- 748 unchanged lines hidden (view full) ---

2121 }
2122 if ((edesc->bmAttributes & UE_XFERTYPE) == UE_ISOCHRONOUS)
2123 ep->methods = &atmegadci_device_isoc_fs_methods;
2124 else
2125 ep->methods = &atmegadci_device_non_isoc_methods;
2126 }
2127}
2128
2129static void
2130atmegadci_set_hw_power_sleep(struct usb_bus *bus, uint32_t state)
2131{
2132 struct atmegadci_softc *sc = ATMEGA_BUS2SC(bus);
2133
2134 switch (state) {
2135 case USB_HW_POWER_SUSPEND:
2136 atmegadci_suspend(sc);
2137 break;
2138 case USB_HW_POWER_SHUTDOWN:
2139 atmegadci_uninit(sc);
2140 break;
2141 case USB_HW_POWER_RESUME:
2142 atmegadci_resume(sc);
2143 break;
2144 default:
2145 break;
2146 }
2147}
2148
2129struct usb_bus_methods atmegadci_bus_methods =
2130{
2131 .endpoint_init = &atmegadci_ep_init,
2132 .xfer_setup = &atmegadci_xfer_setup,
2133 .xfer_unsetup = &atmegadci_xfer_unsetup,
2134 .get_hw_ep_profile = &atmegadci_get_hw_ep_profile,
2135 .set_stall = &atmegadci_set_stall,
2136 .clear_stall = &atmegadci_clear_stall,
2137 .roothub_exec = &atmegadci_roothub_exec,
2138 .xfer_poll = &atmegadci_do_poll,
2149struct usb_bus_methods atmegadci_bus_methods =
2150{
2151 .endpoint_init = &atmegadci_ep_init,
2152 .xfer_setup = &atmegadci_xfer_setup,
2153 .xfer_unsetup = &atmegadci_xfer_unsetup,
2154 .get_hw_ep_profile = &atmegadci_get_hw_ep_profile,
2155 .set_stall = &atmegadci_set_stall,
2156 .clear_stall = &atmegadci_clear_stall,
2157 .roothub_exec = &atmegadci_roothub_exec,
2158 .xfer_poll = &atmegadci_do_poll,
2159 .set_hw_power_sleep = &atmegadci_set_hw_power_sleep,
2139};
2160};