Changeset 7de1988c in mainline for uspace/drv/char/i8042/main.c
- Timestamp:
- 2013-09-12T20:53:09Z (11 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- ddd0499d
- Parents:
- 8049b79
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/char/i8042/main.c
r8049b79 r7de1988c 49 49 * 50 50 * @param[in] dev Device asking for the addresses. 51 * @param[out] io_reg_address Base address of the memory range. 52 * @param[out] io_reg_size Size of the memory range. 51 * @param[out] p_io_reg Pointer to register range. 53 52 * @param[out] kbd_irq Primary port IRQ. 54 53 * @param[out] mouse_irq Auxiliary port IRQ. … … 57 56 * 58 57 */ 59 static int get_my_registers(ddf_dev_t *dev, uintptr_t *io_reg_address,60 size_t *io_reg_size,int *kbd_irq, int *mouse_irq)58 static int get_my_registers(ddf_dev_t *dev, addr_range_t *p_io_reg, 59 int *kbd_irq, int *mouse_irq) 61 60 { 62 61 assert(dev); … … 79 78 } 80 79 81 if (io_reg_address) 82 *io_reg_address = hw_resources.io_ranges.ranges[0].address; 83 84 if (io_reg_size) 85 *io_reg_size = hw_resources.io_ranges.ranges[0].size; 80 if (p_io_reg) 81 *p_io_reg = hw_resources.io_ranges.ranges[0]; 86 82 87 83 if (kbd_irq) … … 104 100 static int i8042_dev_add(ddf_dev_t *device) 105 101 { 106 uintptr_t io_regs = 0; 107 size_t io_size = 0; 102 addr_range_t io_regs; 108 103 int kbd = 0; 109 104 int mouse = 0; … … 113 108 return EINVAL; 114 109 115 rc = get_my_registers(device, &io_regs, & io_size, &kbd, &mouse);110 rc = get_my_registers(device, &io_regs, &kbd, &mouse); 116 111 if (rc != EOK) { 117 112 ddf_msg(LVL_ERROR, "Failed to get registers: %s.", … … 120 115 } 121 116 122 ddf_msg(LVL_DEBUG, "I/O regs at %p (size %zuB), IRQ kbd %d, IRQ mouse %d.", 123 (void *) io_regs, io_size, kbd, mouse); 117 ddf_msg(LVL_DEBUG, 118 "I/O regs at %p (size %zuB), IRQ kbd %d, IRQ mouse %d.", 119 RNGABSPTR(io_regs), RNGSZ(io_regs), kbd, mouse); 124 120 125 121 i8042_t *i8042 = ddf_dev_data_alloc(device, sizeof(i8042_t)); … … 129 125 } 130 126 131 rc = i8042_init(i8042, (void *) io_regs, io_size, kbd, mouse, device);127 rc = i8042_init(i8042, &io_regs, kbd, mouse, device); 132 128 if (rc != EOK) { 133 129 ddf_msg(LVL_ERROR, "Failed to initialize i8042 driver: %s.",
Note:
See TracChangeset
for help on using the changeset viewer.