Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 7de5f12 in mainline for uspace/drv/char/msim-con/msim-con.c


Ignore:
Timestamp:
2017-11-15T20:23:50Z (4 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master
Children:
6ac1243d, 7f4937e
Parents:
e7a8bd2
Message:

MSIM console driver can use hw_res instead of sysinfo for configuration.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/char/msim-con/msim-con.c

    re7a8bd2 r7de5f12  
    3838#include <errno.h>
    3939#include <ipc/char.h>
    40 #include <sysinfo.h>
    4140
    4241#include "msim-con.h"
     
    8483
    8584/** Add msim console device. */
    86 int msim_con_add(msim_con_t *con)
     85int msim_con_add(msim_con_t *con, msim_con_res_t *res)
    8786{
    8887        ddf_fun_t *fun = NULL;
    8988        bool subscribed = false;
    9089        int rc;
     90
     91        con->res = *res;
    9192
    9293        fun = ddf_fun_create(con->dev, fun_exposed, "a");
     
    99100        ddf_fun_set_conn_handler(fun, msim_con_connection);
    100101
    101         sysarg_t paddr;
    102         if (sysinfo_get_value("kbd.address.physical", &paddr) != EOK) {
    103                 rc = ENOENT;
    104                 goto error;
    105         }
    106 
    107         sysarg_t inr;
    108         if (sysinfo_get_value("kbd.inr", &inr) != EOK) {
    109                 rc = ENOENT;
    110                 goto error;
    111         }
    112 
    113         msim_ranges[0].base = paddr;
    114         msim_cmds[0].addr = (void *) paddr;
    115         async_irq_subscribe(inr, msim_irq_handler, con, &msim_kbd);
     102        msim_ranges[0].base = res->base;
     103        msim_cmds[0].addr = (void *) res->base;
     104        async_irq_subscribe(res->irq, msim_irq_handler, con, &msim_kbd);
    116105        subscribed = true;
    117106
     
    125114error:
    126115        if (subscribed)
    127                 async_irq_unsubscribe(inr);
     116                async_irq_unsubscribe(res->irq);
    128117        if (fun != NULL)
    129118                ddf_fun_destroy(fun);
Note: See TracChangeset for help on using the changeset viewer.