Changeset fc46884 in mainline


Ignore:
Timestamp:
2006-10-16T21:34:33Z (18 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
d95f1e24
Parents:
5f9b4d9a
Message:

Support for grabbing and releasing z8530 keyboard for sparc64.
We might later add some locking.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/genarch/src/kbd/z8530.c

    r5f9b4d9a rfc46884  
    6363static irq_t z8530_irq;         /**< z8530's IRQ. */
    6464
     65static ipc_notif_cfg_t saved_notif_cfg;
     66
    6567static void z8530_suspend(chardev_t *);
    6668static void z8530_resume(chardev_t *);
     
    7577void z8530_grab(void)
    7678{
     79        (void) z8530_read_a(&z8530, RR8);
     80
     81        /*
     82         * Clear any pending TX interrupts or we never manage
     83         * to set FHC UART interrupt state to idle.
     84         */
     85        z8530_write_a(&z8530, WR0, WR0_TX_IP_RST);
     86
     87        z8530_write_a(&z8530, WR1, WR1_IARCSC);         /* interrupt on all characters */
     88
     89        /* 8 bits per character and enable receiver */
     90        z8530_write_a(&z8530, WR3, WR3_RX8BITSCH | WR3_RX_ENABLE);
     91       
     92        z8530_write_a(&z8530, WR9, WR9_MIE);            /* Master Interrupt Enable. */
     93       
     94        if (z8530_irq.notif_cfg.answerbox) {
     95                saved_notif_cfg = z8530_irq.notif_cfg;
     96                z8530_irq.notif_cfg.answerbox = NULL;
     97                z8530_irq.notif_cfg.code = NULL;
     98                z8530_irq.notif_cfg.method = 0;
     99                z8530_irq.notif_cfg.counter = 0;
     100        }
    77101}
    78102
     
    80104void z8530_release(void)
    81105{
     106        if (saved_notif_cfg.answerbox)
     107                z8530_irq.notif_cfg = saved_notif_cfg;
    82108}
    83109
     
    103129        sysinfo_set_item_val("kbd.address.virtual", NULL, vaddr);
    104130
    105         (void) z8530_read_a(&z8530, RR8);
    106 
    107         /*
    108          * Clear any pending TX interrupts or we never manage
    109          * to set FHC UART interrupt state to idle.
    110          */
    111         z8530_write_a(&z8530, WR0, WR0_TX_IP_RST);
    112 
    113         z8530_write_a(&z8530, WR1, WR1_IARCSC);         /* interrupt on all characters */
    114 
    115         /* 8 bits per character and enable receiver */
    116         z8530_write_a(&z8530, WR3, WR3_RX8BITSCH | WR3_RX_ENABLE);
    117        
    118         z8530_write_a(&z8530, WR9, WR9_MIE);            /* Master Interrupt Enable. */
     131        z8530_grab();
    119132}
    120133
Note: See TracChangeset for help on using the changeset viewer.