Changeset b9cc81c6 in mainline


Ignore:
Timestamp:
2025-03-06T17:35:07Z (2 days ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master
Children:
797ab95
Parents:
870841cf
Message:

Implement quiesce in NS8250 and PC-LPT.

Location:
uspace/drv/char
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/char/ns8250/ns8250.c

    r870841cf rb9cc81c6  
    11/*
     2 * Copyright (c) 2025 Jiri Svoboda
    23 * Copyright (c) 2010 Lenka Trochtova
    3  * Copyright (c) 2017 Jiri Svoboda
    44 * All rights reserved.
    55 *
     
    327327
    328328static errno_t ns8250_dev_add(ddf_dev_t *dev);
     329static errno_t ns8250_dev_quiesce(ddf_dev_t *dev);
    329330static errno_t ns8250_dev_remove(ddf_dev_t *dev);
    330331
     
    332333static driver_ops_t ns8250_ops = {
    333334        .dev_add = &ns8250_dev_add,
    334         .dev_remove = &ns8250_dev_remove
     335        .dev_remove = &ns8250_dev_remove,
     336        .dev_quiesce = &ns8250_dev_quiesce
    335337};
    336338
     
    966968}
    967969
     970static errno_t ns8250_dev_quiesce(ddf_dev_t *dev)
     971{
     972        ns8250_t *ns = dev_ns8250(dev);
     973
     974        ns8250_port_interrupts_disable(ns->regs);
     975        return EOK;
     976}
     977
    968978/** Open the device.
    969979 *
  • uspace/drv/char/pc-lpt/main.c

    r870841cf rb9cc81c6  
    11/*
    2  * Copyright (c) 2018 Jiri Svoboda
     2 * Copyright (c) 2025 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    4646static errno_t pc_lpt_dev_remove(ddf_dev_t *dev);
    4747static errno_t pc_lpt_dev_gone(ddf_dev_t *dev);
     48static errno_t pc_lpt_dev_quiesce(ddf_dev_t *dev);
    4849static errno_t pc_lpt_fun_online(ddf_fun_t *fun);
    4950static errno_t pc_lpt_fun_offline(ddf_fun_t *fun);
     
    5354        .dev_remove = pc_lpt_dev_remove,
    5455        .dev_gone = pc_lpt_dev_gone,
     56        .dev_quiesce = pc_lpt_dev_quiesce,
    5557        .fun_online = pc_lpt_fun_online,
    5658        .fun_offline = pc_lpt_fun_offline
     
    140142}
    141143
     144static errno_t pc_lpt_dev_quiesce(ddf_dev_t *dev)
     145{
     146        pc_lpt_t *pc_lpt = (pc_lpt_t *)ddf_dev_data_get(dev);
     147
     148        ddf_msg(LVL_DEBUG, "pc_lpt_dev_quiesce(%p)", dev);
     149
     150        pc_lpt_quiesce(pc_lpt);
     151        return EOK;
     152}
     153
    142154static errno_t pc_lpt_fun_online(ddf_fun_t *fun)
    143155{
  • uspace/drv/char/pc-lpt/pc-lpt.c

    r870841cf rb9cc81c6  
    11/*
    2  * Copyright (c) 2018 Jiri Svoboda
     2 * Copyright (c) 2025 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    196196}
    197197
     198/** Quiesce pc-lpt device */
     199void pc_lpt_quiesce(pc_lpt_t *lpt)
     200{
     201        uint8_t control;
     202
     203        control = 0; /* nINIT=0, IRQ_ENABLE=0 */
     204        pio_write_8(&lpt->regs->control, control);
     205}
     206
    198207/** Write a single byte to the parallel port.
    199208 *
  • uspace/drv/char/pc-lpt/pc-lpt.h

    r870841cf rb9cc81c6  
    11/*
    2  * Copyright (c) 2018 Jiri Svoboda
     2 * Copyright (c) 2025 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    7474extern errno_t pc_lpt_remove(pc_lpt_t *);
    7575extern errno_t pc_lpt_gone(pc_lpt_t *);
     76extern void pc_lpt_quiesce(pc_lpt_t *);
    7677
    7778#endif
Note: See TracChangeset for help on using the changeset viewer.