Lines Matching defs:device
7 #include <ddk/device.h>
12 #include <ddk/protocol/platform-device.h>
382 i2c_dw_dev_t* device = &i2c->i2c_devs[index];
384 device->timeout = ZX_SEC(10);
387 &device->regs_iobuff);
393 status = pdev_map_interrupt(&i2c->pdev, index, &device->irq_handle);
398 status = zx_event_create(0, &device->event_handle);
404 status = i2c_dw_host_init(device);
411 thrd_create_with_name(&irq_thread, i2c_dw_irq_thread, device, "i2c_dw_irq_thread");
416 if (device) {
417 mmio_buffer_release(&device->regs_iobuff);
418 if (device->event_handle != ZX_HANDLE_INVALID) {
419 zx_handle_close(device->event_handle);
421 if (device->irq_handle != ZX_HANDLE_INVALID) {
422 zx_handle_close(device->irq_handle);
424 free(device);