Changeset a35b458 in mainline for uspace/drv/char/i8042/main.c
- Timestamp:
- 2018-03-02T20:10:49Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f1380b7
- Parents:
- 3061bc1
- git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-02-28 17:38:31)
- git-committer:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-03-02 20:10:49)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/char/i8042/main.c
r3061bc1 ra35b458 59 59 { 60 60 assert(dev); 61 61 62 62 async_sess_t *parent_sess = ddf_dev_parent_sess_get(dev); 63 63 if (parent_sess == NULL) 64 64 return ENOMEM; 65 65 66 66 hw_res_list_parsed_t hw_resources; 67 67 hw_res_list_parsed_init(&hw_resources); … … 69 69 if (ret != EOK) 70 70 return ret; 71 71 72 72 if ((hw_resources.irqs.count != 2) || 73 73 (hw_resources.io_ranges.count != 1)) { … … 75 75 return EINVAL; 76 76 } 77 77 78 78 if (p_io_reg) 79 79 *p_io_reg = hw_resources.io_ranges.ranges[0]; 80 80 81 81 if (kbd_irq) 82 82 *kbd_irq = hw_resources.irqs.irqs[0]; 83 83 84 84 if (mouse_irq) 85 85 *mouse_irq = hw_resources.irqs.irqs[1]; 86 86 87 87 hw_res_list_parsed_clean(&hw_resources); 88 88 return EOK; … … 102 102 int mouse = 0; 103 103 errno_t rc; 104 104 105 105 if (!device) 106 106 return EINVAL; 107 107 108 108 rc = get_my_registers(device, &io_regs, &kbd, &mouse); 109 109 if (rc != EOK) { … … 112 112 return rc; 113 113 } 114 114 115 115 ddf_msg(LVL_DEBUG, 116 116 "I/O regs at %p (size %zuB), IRQ kbd %d, IRQ mouse %d.", 117 117 RNGABSPTR(io_regs), RNGSZ(io_regs), kbd, mouse); 118 118 119 119 i8042_t *i8042 = ddf_dev_data_alloc(device, sizeof(i8042_t)); 120 120 if (i8042 == NULL) { … … 122 122 return ENOMEM; 123 123 } 124 124 125 125 rc = i8042_init(i8042, &io_regs, kbd, mouse, device); 126 126 if (rc != EOK) { … … 129 129 return rc; 130 130 } 131 131 132 132 ddf_msg(LVL_NOTE, "Controlling '%s' (%" PRIun ").", 133 133 ddf_dev_get_name(device), ddf_dev_get_handle(device)); … … 150 150 printf("%s: HelenOS PS/2 driver.\n", NAME); 151 151 ddf_log_init(NAME); 152 152 153 153 return ddf_driver_main(&i8042_driver); 154 154 }
Note:
See TracChangeset
for help on using the changeset viewer.