Michael Walle | 87a381e | 2011-03-07 23:32:37 +0100 | [diff] [blame] | 1 | /* |
| 2 | * QEMU model of the Milkymist SoftUSB block. |
| 3 | * |
| 4 | * Copyright (c) 2010 Michael Walle <michael@walle.cc> |
| 5 | * |
| 6 | * This library is free software; you can redistribute it and/or |
| 7 | * modify it under the terms of the GNU Lesser General Public |
| 8 | * License as published by the Free Software Foundation; either |
| 9 | * version 2 of the License, or (at your option) any later version. |
| 10 | * |
| 11 | * This library is distributed in the hope that it will be useful, |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 14 | * Lesser General Public License for more details. |
| 15 | * |
| 16 | * You should have received a copy of the GNU Lesser General Public |
| 17 | * License along with this library; if not, see <http://www.gnu.org/licenses/>. |
| 18 | * |
| 19 | * |
| 20 | * Specification available at: |
| 21 | * not available yet |
| 22 | */ |
| 23 | |
Paolo Bonzini | 83c9f4c | 2013-02-04 15:40:22 +0100 | [diff] [blame] | 24 | #include "hw/hw.h" |
| 25 | #include "hw/sysbus.h" |
Michael Walle | 87a381e | 2011-03-07 23:32:37 +0100 | [diff] [blame] | 26 | #include "trace.h" |
Paolo Bonzini | 28ecbae | 2012-11-28 12:06:30 +0100 | [diff] [blame] | 27 | #include "ui/console.h" |
Paolo Bonzini | 0d09e41 | 2013-02-05 17:06:20 +0100 | [diff] [blame] | 28 | #include "hw/input/hid.h" |
Paolo Bonzini | 1de7afc | 2012-12-17 18:20:00 +0100 | [diff] [blame] | 29 | #include "qemu/error-report.h" |
Michael Walle | 87a381e | 2011-03-07 23:32:37 +0100 | [diff] [blame] | 30 | |
| 31 | enum { |
| 32 | R_CTRL = 0, |
| 33 | R_MAX |
| 34 | }; |
| 35 | |
| 36 | enum { |
| 37 | CTRL_RESET = (1<<0), |
| 38 | }; |
| 39 | |
| 40 | #define COMLOC_DEBUG_PRODUCE 0x1000 |
| 41 | #define COMLOC_DEBUG_BASE 0x1001 |
| 42 | #define COMLOC_MEVT_PRODUCE 0x1101 |
| 43 | #define COMLOC_MEVT_BASE 0x1102 |
| 44 | #define COMLOC_KEVT_PRODUCE 0x1142 |
| 45 | #define COMLOC_KEVT_BASE 0x1143 |
| 46 | |
Andreas Färber | 2a052f6 | 2013-07-26 18:37:02 +0200 | [diff] [blame] | 47 | #define TYPE_MILKYMIST_SOFTUSB "milkymist-softusb" |
| 48 | #define MILKYMIST_SOFTUSB(obj) \ |
| 49 | OBJECT_CHECK(MilkymistSoftUsbState, (obj), TYPE_MILKYMIST_SOFTUSB) |
| 50 | |
Michael Walle | 87a381e | 2011-03-07 23:32:37 +0100 | [diff] [blame] | 51 | struct MilkymistSoftUsbState { |
Andreas Färber | 2a052f6 | 2013-07-26 18:37:02 +0200 | [diff] [blame] | 52 | SysBusDevice parent_obj; |
| 53 | |
Michael Walle | 4c15ba9 | 2011-08-09 23:54:55 +0200 | [diff] [blame] | 54 | HIDState hid_kbd; |
| 55 | HIDState hid_mouse; |
Michael Walle | 87a381e | 2011-03-07 23:32:37 +0100 | [diff] [blame] | 56 | |
Avi Kivity | 5105ed3 | 2011-08-08 21:40:35 +0300 | [diff] [blame] | 57 | MemoryRegion regs_region; |
| 58 | MemoryRegion pmem; |
| 59 | MemoryRegion dmem; |
Michael Walle | 87a381e | 2011-03-07 23:32:37 +0100 | [diff] [blame] | 60 | qemu_irq irq; |
| 61 | |
Peter Maydell | c34e120 | 2013-03-15 14:34:22 +0000 | [diff] [blame] | 62 | void *pmem_ptr; |
| 63 | void *dmem_ptr; |
| 64 | |
Michael Walle | 87a381e | 2011-03-07 23:32:37 +0100 | [diff] [blame] | 65 | /* device properties */ |
Michael Walle | 87a381e | 2011-03-07 23:32:37 +0100 | [diff] [blame] | 66 | uint32_t pmem_size; |
Michael Walle | 87a381e | 2011-03-07 23:32:37 +0100 | [diff] [blame] | 67 | uint32_t dmem_size; |
| 68 | |
| 69 | /* device registers */ |
| 70 | uint32_t regs[R_MAX]; |
| 71 | |
| 72 | /* mouse state */ |
Michael Walle | 4c15ba9 | 2011-08-09 23:54:55 +0200 | [diff] [blame] | 73 | uint8_t mouse_hid_buffer[4]; |
Michael Walle | 87a381e | 2011-03-07 23:32:37 +0100 | [diff] [blame] | 74 | |
| 75 | /* keyboard state */ |
Michael Walle | 4c15ba9 | 2011-08-09 23:54:55 +0200 | [diff] [blame] | 76 | uint8_t kbd_hid_buffer[8]; |
Michael Walle | 87a381e | 2011-03-07 23:32:37 +0100 | [diff] [blame] | 77 | }; |
| 78 | typedef struct MilkymistSoftUsbState MilkymistSoftUsbState; |
| 79 | |
Avi Kivity | a8170e5 | 2012-10-23 12:30:10 +0200 | [diff] [blame] | 80 | static uint64_t softusb_read(void *opaque, hwaddr addr, |
Avi Kivity | 5105ed3 | 2011-08-08 21:40:35 +0300 | [diff] [blame] | 81 | unsigned size) |
Michael Walle | 87a381e | 2011-03-07 23:32:37 +0100 | [diff] [blame] | 82 | { |
| 83 | MilkymistSoftUsbState *s = opaque; |
| 84 | uint32_t r = 0; |
| 85 | |
| 86 | addr >>= 2; |
| 87 | switch (addr) { |
| 88 | case R_CTRL: |
| 89 | r = s->regs[addr]; |
| 90 | break; |
| 91 | |
| 92 | default: |
| 93 | error_report("milkymist_softusb: read access to unknown register 0x" |
| 94 | TARGET_FMT_plx, addr << 2); |
| 95 | break; |
| 96 | } |
| 97 | |
| 98 | trace_milkymist_softusb_memory_read(addr << 2, r); |
| 99 | |
| 100 | return r; |
| 101 | } |
| 102 | |
| 103 | static void |
Avi Kivity | a8170e5 | 2012-10-23 12:30:10 +0200 | [diff] [blame] | 104 | softusb_write(void *opaque, hwaddr addr, uint64_t value, |
Avi Kivity | 5105ed3 | 2011-08-08 21:40:35 +0300 | [diff] [blame] | 105 | unsigned size) |
Michael Walle | 87a381e | 2011-03-07 23:32:37 +0100 | [diff] [blame] | 106 | { |
| 107 | MilkymistSoftUsbState *s = opaque; |
| 108 | |
| 109 | trace_milkymist_softusb_memory_write(addr, value); |
| 110 | |
| 111 | addr >>= 2; |
| 112 | switch (addr) { |
| 113 | case R_CTRL: |
| 114 | s->regs[addr] = value; |
| 115 | break; |
| 116 | |
| 117 | default: |
| 118 | error_report("milkymist_softusb: write access to unknown register 0x" |
| 119 | TARGET_FMT_plx, addr << 2); |
| 120 | break; |
| 121 | } |
| 122 | } |
| 123 | |
Avi Kivity | 5105ed3 | 2011-08-08 21:40:35 +0300 | [diff] [blame] | 124 | static const MemoryRegionOps softusb_mmio_ops = { |
| 125 | .read = softusb_read, |
| 126 | .write = softusb_write, |
| 127 | .endianness = DEVICE_NATIVE_ENDIAN, |
| 128 | .valid = { |
| 129 | .min_access_size = 4, |
| 130 | .max_access_size = 4, |
| 131 | }, |
Michael Walle | 87a381e | 2011-03-07 23:32:37 +0100 | [diff] [blame] | 132 | }; |
| 133 | |
| 134 | static inline void softusb_read_dmem(MilkymistSoftUsbState *s, |
| 135 | uint32_t offset, uint8_t *buf, uint32_t len) |
| 136 | { |
| 137 | if (offset + len >= s->dmem_size) { |
| 138 | error_report("milkymist_softusb: read dmem out of bounds " |
Markus Armbruster | 6daf194 | 2011-06-22 14:03:54 +0200 | [diff] [blame] | 139 | "at offset 0x%x, len %d", offset, len); |
Peter Maydell | c31bc98 | 2013-03-28 18:43:04 +0000 | [diff] [blame] | 140 | memset(buf, 0, len); |
Michael Walle | 87a381e | 2011-03-07 23:32:37 +0100 | [diff] [blame] | 141 | return; |
| 142 | } |
| 143 | |
Peter Maydell | c34e120 | 2013-03-15 14:34:22 +0000 | [diff] [blame] | 144 | memcpy(buf, s->dmem_ptr + offset, len); |
Michael Walle | 87a381e | 2011-03-07 23:32:37 +0100 | [diff] [blame] | 145 | } |
| 146 | |
| 147 | static inline void softusb_write_dmem(MilkymistSoftUsbState *s, |
| 148 | uint32_t offset, uint8_t *buf, uint32_t len) |
| 149 | { |
| 150 | if (offset + len >= s->dmem_size) { |
| 151 | error_report("milkymist_softusb: write dmem out of bounds " |
Markus Armbruster | 6daf194 | 2011-06-22 14:03:54 +0200 | [diff] [blame] | 152 | "at offset 0x%x, len %d", offset, len); |
Michael Walle | 87a381e | 2011-03-07 23:32:37 +0100 | [diff] [blame] | 153 | return; |
| 154 | } |
| 155 | |
Peter Maydell | c34e120 | 2013-03-15 14:34:22 +0000 | [diff] [blame] | 156 | memcpy(s->dmem_ptr + offset, buf, len); |
Michael Walle | 87a381e | 2011-03-07 23:32:37 +0100 | [diff] [blame] | 157 | } |
| 158 | |
Michael Walle | 87a381e | 2011-03-07 23:32:37 +0100 | [diff] [blame] | 159 | static void softusb_mouse_changed(MilkymistSoftUsbState *s) |
| 160 | { |
| 161 | uint8_t m; |
Michael Walle | 87a381e | 2011-03-07 23:32:37 +0100 | [diff] [blame] | 162 | |
| 163 | softusb_read_dmem(s, COMLOC_MEVT_PRODUCE, &m, 1); |
| 164 | trace_milkymist_softusb_mevt(m); |
Michael Walle | 4c15ba9 | 2011-08-09 23:54:55 +0200 | [diff] [blame] | 165 | softusb_write_dmem(s, COMLOC_MEVT_BASE + 4 * m, s->mouse_hid_buffer, 4); |
Michael Walle | 87a381e | 2011-03-07 23:32:37 +0100 | [diff] [blame] | 166 | m = (m + 1) & 0xf; |
| 167 | softusb_write_dmem(s, COMLOC_MEVT_PRODUCE, &m, 1); |
| 168 | |
| 169 | trace_milkymist_softusb_pulse_irq(); |
| 170 | qemu_irq_pulse(s->irq); |
| 171 | } |
| 172 | |
| 173 | static void softusb_kbd_changed(MilkymistSoftUsbState *s) |
| 174 | { |
| 175 | uint8_t m; |
| 176 | |
| 177 | softusb_read_dmem(s, COMLOC_KEVT_PRODUCE, &m, 1); |
| 178 | trace_milkymist_softusb_kevt(m); |
Michael Walle | 4c15ba9 | 2011-08-09 23:54:55 +0200 | [diff] [blame] | 179 | softusb_write_dmem(s, COMLOC_KEVT_BASE + 8 * m, s->kbd_hid_buffer, 8); |
Michael Walle | 87a381e | 2011-03-07 23:32:37 +0100 | [diff] [blame] | 180 | m = (m + 1) & 0x7; |
| 181 | softusb_write_dmem(s, COMLOC_KEVT_PRODUCE, &m, 1); |
| 182 | |
| 183 | trace_milkymist_softusb_pulse_irq(); |
| 184 | qemu_irq_pulse(s->irq); |
| 185 | } |
| 186 | |
Michael Walle | 4c15ba9 | 2011-08-09 23:54:55 +0200 | [diff] [blame] | 187 | static void softusb_kbd_hid_datain(HIDState *hs) |
Michael Walle | 87a381e | 2011-03-07 23:32:37 +0100 | [diff] [blame] | 188 | { |
Michael Walle | 4c15ba9 | 2011-08-09 23:54:55 +0200 | [diff] [blame] | 189 | MilkymistSoftUsbState *s = container_of(hs, MilkymistSoftUsbState, hid_kbd); |
| 190 | int len; |
Michael Walle | 87a381e | 2011-03-07 23:32:37 +0100 | [diff] [blame] | 191 | |
| 192 | /* if device is in reset, do nothing */ |
| 193 | if (s->regs[R_CTRL] & CTRL_RESET) { |
| 194 | return; |
| 195 | } |
| 196 | |
Michael Walle | 857ccca | 2014-10-04 20:00:07 +0200 | [diff] [blame] | 197 | while (hid_has_events(hs)) { |
| 198 | len = hid_keyboard_poll(hs, s->kbd_hid_buffer, |
| 199 | sizeof(s->kbd_hid_buffer)); |
Michael Walle | 87a381e | 2011-03-07 23:32:37 +0100 | [diff] [blame] | 200 | |
Michael Walle | 857ccca | 2014-10-04 20:00:07 +0200 | [diff] [blame] | 201 | if (len == 8) { |
| 202 | softusb_kbd_changed(s); |
| 203 | } |
Michael Walle | 4c15ba9 | 2011-08-09 23:54:55 +0200 | [diff] [blame] | 204 | } |
Michael Walle | 87a381e | 2011-03-07 23:32:37 +0100 | [diff] [blame] | 205 | } |
| 206 | |
Michael Walle | 4c15ba9 | 2011-08-09 23:54:55 +0200 | [diff] [blame] | 207 | static void softusb_mouse_hid_datain(HIDState *hs) |
Michael Walle | 87a381e | 2011-03-07 23:32:37 +0100 | [diff] [blame] | 208 | { |
Michael Walle | 4c15ba9 | 2011-08-09 23:54:55 +0200 | [diff] [blame] | 209 | MilkymistSoftUsbState *s = |
| 210 | container_of(hs, MilkymistSoftUsbState, hid_mouse); |
| 211 | int len; |
Michael Walle | 87a381e | 2011-03-07 23:32:37 +0100 | [diff] [blame] | 212 | |
Michael Walle | 4c15ba9 | 2011-08-09 23:54:55 +0200 | [diff] [blame] | 213 | /* if device is in reset, do nothing */ |
| 214 | if (s->regs[R_CTRL] & CTRL_RESET) { |
| 215 | return; |
| 216 | } |
Michael Walle | 87a381e | 2011-03-07 23:32:37 +0100 | [diff] [blame] | 217 | |
Michael Walle | 857ccca | 2014-10-04 20:00:07 +0200 | [diff] [blame] | 218 | while (hid_has_events(hs)) { |
| 219 | len = hid_pointer_poll(hs, s->mouse_hid_buffer, |
| 220 | sizeof(s->mouse_hid_buffer)); |
Michael Walle | 87a381e | 2011-03-07 23:32:37 +0100 | [diff] [blame] | 221 | |
Michael Walle | 857ccca | 2014-10-04 20:00:07 +0200 | [diff] [blame] | 222 | if (len == 4) { |
| 223 | softusb_mouse_changed(s); |
| 224 | } |
Michael Walle | 4c15ba9 | 2011-08-09 23:54:55 +0200 | [diff] [blame] | 225 | } |
Michael Walle | 87a381e | 2011-03-07 23:32:37 +0100 | [diff] [blame] | 226 | } |
| 227 | |
Michael Walle | 87a381e | 2011-03-07 23:32:37 +0100 | [diff] [blame] | 228 | static void milkymist_softusb_reset(DeviceState *d) |
| 229 | { |
Andreas Färber | 2a052f6 | 2013-07-26 18:37:02 +0200 | [diff] [blame] | 230 | MilkymistSoftUsbState *s = MILKYMIST_SOFTUSB(d); |
Michael Walle | 87a381e | 2011-03-07 23:32:37 +0100 | [diff] [blame] | 231 | int i; |
| 232 | |
| 233 | for (i = 0; i < R_MAX; i++) { |
| 234 | s->regs[i] = 0; |
| 235 | } |
Michael Walle | 4c15ba9 | 2011-08-09 23:54:55 +0200 | [diff] [blame] | 236 | memset(s->kbd_hid_buffer, 0, sizeof(s->kbd_hid_buffer)); |
| 237 | memset(s->mouse_hid_buffer, 0, sizeof(s->mouse_hid_buffer)); |
| 238 | |
| 239 | hid_reset(&s->hid_kbd); |
| 240 | hid_reset(&s->hid_mouse); |
Michael Walle | 87a381e | 2011-03-07 23:32:37 +0100 | [diff] [blame] | 241 | |
| 242 | /* defaults */ |
| 243 | s->regs[R_CTRL] = CTRL_RESET; |
| 244 | } |
| 245 | |
| 246 | static int milkymist_softusb_init(SysBusDevice *dev) |
| 247 | { |
Andreas Färber | 2a052f6 | 2013-07-26 18:37:02 +0200 | [diff] [blame] | 248 | MilkymistSoftUsbState *s = MILKYMIST_SOFTUSB(dev); |
Michael Walle | 87a381e | 2011-03-07 23:32:37 +0100 | [diff] [blame] | 249 | |
| 250 | sysbus_init_irq(dev, &s->irq); |
| 251 | |
Paolo Bonzini | 1437c94 | 2013-06-06 21:25:08 -0400 | [diff] [blame] | 252 | memory_region_init_io(&s->regs_region, OBJECT(s), &softusb_mmio_ops, s, |
Avi Kivity | 5105ed3 | 2011-08-08 21:40:35 +0300 | [diff] [blame] | 253 | "milkymist-softusb", R_MAX * 4); |
Avi Kivity | 750ecd4 | 2011-11-27 11:38:10 +0200 | [diff] [blame] | 254 | sysbus_init_mmio(dev, &s->regs_region); |
Michael Walle | 87a381e | 2011-03-07 23:32:37 +0100 | [diff] [blame] | 255 | |
| 256 | /* register pmem and dmem */ |
Paolo Bonzini | 1437c94 | 2013-06-06 21:25:08 -0400 | [diff] [blame] | 257 | memory_region_init_ram(&s->pmem, OBJECT(s), "milkymist-softusb.pmem", |
Markus Armbruster | f8ed85a | 2015-09-11 16:51:43 +0200 | [diff] [blame] | 258 | s->pmem_size, &error_fatal); |
Avi Kivity | c5705a7 | 2011-12-20 15:59:12 +0200 | [diff] [blame] | 259 | vmstate_register_ram_global(&s->pmem); |
Peter Maydell | c34e120 | 2013-03-15 14:34:22 +0000 | [diff] [blame] | 260 | s->pmem_ptr = memory_region_get_ram_ptr(&s->pmem); |
| 261 | sysbus_init_mmio(dev, &s->pmem); |
Paolo Bonzini | 1437c94 | 2013-06-06 21:25:08 -0400 | [diff] [blame] | 262 | memory_region_init_ram(&s->dmem, OBJECT(s), "milkymist-softusb.dmem", |
Markus Armbruster | f8ed85a | 2015-09-11 16:51:43 +0200 | [diff] [blame] | 263 | s->dmem_size, &error_fatal); |
Avi Kivity | c5705a7 | 2011-12-20 15:59:12 +0200 | [diff] [blame] | 264 | vmstate_register_ram_global(&s->dmem); |
Peter Maydell | c34e120 | 2013-03-15 14:34:22 +0000 | [diff] [blame] | 265 | s->dmem_ptr = memory_region_get_ram_ptr(&s->dmem); |
| 266 | sysbus_init_mmio(dev, &s->dmem); |
Michael Walle | 87a381e | 2011-03-07 23:32:37 +0100 | [diff] [blame] | 267 | |
Michael Walle | 4c15ba9 | 2011-08-09 23:54:55 +0200 | [diff] [blame] | 268 | hid_init(&s->hid_kbd, HID_KEYBOARD, softusb_kbd_hid_datain); |
| 269 | hid_init(&s->hid_mouse, HID_MOUSE, softusb_mouse_hid_datain); |
Michael Walle | 87a381e | 2011-03-07 23:32:37 +0100 | [diff] [blame] | 270 | |
| 271 | return 0; |
| 272 | } |
| 273 | |
| 274 | static const VMStateDescription vmstate_milkymist_softusb = { |
| 275 | .name = "milkymist-softusb", |
| 276 | .version_id = 1, |
| 277 | .minimum_version_id = 1, |
Juan Quintela | 35d0845 | 2014-04-16 16:01:33 +0200 | [diff] [blame] | 278 | .fields = (VMStateField[]) { |
Michael Walle | 87a381e | 2011-03-07 23:32:37 +0100 | [diff] [blame] | 279 | VMSTATE_UINT32_ARRAY(regs, MilkymistSoftUsbState, R_MAX), |
Michael Walle | 4c15ba9 | 2011-08-09 23:54:55 +0200 | [diff] [blame] | 280 | VMSTATE_HID_KEYBOARD_DEVICE(hid_kbd, MilkymistSoftUsbState), |
| 281 | VMSTATE_HID_POINTER_DEVICE(hid_mouse, MilkymistSoftUsbState), |
| 282 | VMSTATE_BUFFER(kbd_hid_buffer, MilkymistSoftUsbState), |
| 283 | VMSTATE_BUFFER(mouse_hid_buffer, MilkymistSoftUsbState), |
Michael Walle | 87a381e | 2011-03-07 23:32:37 +0100 | [diff] [blame] | 284 | VMSTATE_END_OF_LIST() |
| 285 | } |
| 286 | }; |
| 287 | |
Anthony Liguori | 999e12b | 2012-01-24 13:12:29 -0600 | [diff] [blame] | 288 | static Property milkymist_softusb_properties[] = { |
Anthony Liguori | 999e12b | 2012-01-24 13:12:29 -0600 | [diff] [blame] | 289 | DEFINE_PROP_UINT32("pmem_size", MilkymistSoftUsbState, pmem_size, 0x00001000), |
Anthony Liguori | 999e12b | 2012-01-24 13:12:29 -0600 | [diff] [blame] | 290 | DEFINE_PROP_UINT32("dmem_size", MilkymistSoftUsbState, dmem_size, 0x00002000), |
| 291 | DEFINE_PROP_END_OF_LIST(), |
| 292 | }; |
| 293 | |
| 294 | static void milkymist_softusb_class_init(ObjectClass *klass, void *data) |
| 295 | { |
Anthony Liguori | 39bffca | 2011-12-07 21:34:16 -0600 | [diff] [blame] | 296 | DeviceClass *dc = DEVICE_CLASS(klass); |
Anthony Liguori | 999e12b | 2012-01-24 13:12:29 -0600 | [diff] [blame] | 297 | SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass); |
| 298 | |
| 299 | k->init = milkymist_softusb_init; |
Anthony Liguori | 39bffca | 2011-12-07 21:34:16 -0600 | [diff] [blame] | 300 | dc->reset = milkymist_softusb_reset; |
| 301 | dc->vmsd = &vmstate_milkymist_softusb; |
| 302 | dc->props = milkymist_softusb_properties; |
Anthony Liguori | 999e12b | 2012-01-24 13:12:29 -0600 | [diff] [blame] | 303 | } |
| 304 | |
Andreas Färber | 8c43a6f | 2013-01-10 16:19:07 +0100 | [diff] [blame] | 305 | static const TypeInfo milkymist_softusb_info = { |
Andreas Färber | 2a052f6 | 2013-07-26 18:37:02 +0200 | [diff] [blame] | 306 | .name = TYPE_MILKYMIST_SOFTUSB, |
Anthony Liguori | 39bffca | 2011-12-07 21:34:16 -0600 | [diff] [blame] | 307 | .parent = TYPE_SYS_BUS_DEVICE, |
| 308 | .instance_size = sizeof(MilkymistSoftUsbState), |
| 309 | .class_init = milkymist_softusb_class_init, |
Michael Walle | 87a381e | 2011-03-07 23:32:37 +0100 | [diff] [blame] | 310 | }; |
| 311 | |
Andreas Färber | 83f7d43 | 2012-02-09 15:20:55 +0100 | [diff] [blame] | 312 | static void milkymist_softusb_register_types(void) |
Michael Walle | 87a381e | 2011-03-07 23:32:37 +0100 | [diff] [blame] | 313 | { |
Anthony Liguori | 39bffca | 2011-12-07 21:34:16 -0600 | [diff] [blame] | 314 | type_register_static(&milkymist_softusb_info); |
Michael Walle | 87a381e | 2011-03-07 23:32:37 +0100 | [diff] [blame] | 315 | } |
| 316 | |
Andreas Färber | 83f7d43 | 2012-02-09 15:20:55 +0100 | [diff] [blame] | 317 | type_init(milkymist_softusb_register_types) |