Changeset 15d0046 in mainline for uspace/drv/audio/hdaudio/stream.h


Ignore:
Timestamp:
2014-09-12T13:22:33Z (10 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
9b20126
Parents:
8db09e4 (diff), 105d8d6 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes

File:
1 moved

Legend:

Unmodified
Added
Removed
  • uspace/drv/audio/hdaudio/stream.h

    r8db09e4 r15d0046  
    11/*
    2  * Copyright (c) 2003-2004 Jakub Jermar
     2 * Copyright (c) 2014 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    2727 */
    2828
    29 /** @addtogroup mips64mm
     29/** @addtogroup hdaudio
    3030 * @{
    3131 */
    32 /** @file
     32/** @file High Definition Audio stream
    3333 */
    3434
    35 #ifndef KERN_mips64_PAGE_H_
    36 #define KERN_mips64_PAGE_H_
     35#ifndef STREAM_H
     36#define STREAM_H
    3737
    38 #include <arch/mm/frame.h>
    39 #include <trace.h>
     38#include "hdaudio.h"
     39#include "spec/bdl.h"
    4040
    41 #define PAGE_WIDTH  FRAME_WIDTH
    42 #define PAGE_SIZE   FRAME_SIZE
     41typedef enum {
     42        /** Input Stream */
     43        sdir_input,
     44        /** Output Stream */
     45        sdir_output,
     46        /** Bidirectional Stream */
     47        sdir_bidi
     48} hda_stream_dir_t;
    4349
    44 #ifndef __ASM__
    45         #define KA2PA(addr)  (((uintptr_t) (addr)) - 0xffffffff80000000)
    46         #define PA2KA(addr)  (((uintptr_t) (addr)) + 0xffffffff80000000)
    47 #else
    48         #define KA2PA(addr)  ((addr) - 0xffffffff80000000)
    49         #define PA2KA(addr)  ((addr) + 0xffffffff80000000)
    50 #endif
     50typedef struct hda_stream {
     51        hda_t *hda;
     52        /** Stream ID */
     53        uint8_t sid;
     54        /** Stream descriptor index */
     55        uint8_t sdid;
     56        /** Direction */
     57        hda_stream_dir_t dir;
     58        /** Number of buffers */
     59        size_t nbuffers;
     60        /** Buffer size */
     61        size_t bufsize;
     62        /** Buffer Descriptor List */
     63        hda_buffer_desc_t *bdl;
     64        /** Physical address of BDL */
     65        uintptr_t bdl_phys;
     66        /** Buffers */
     67        void **buf;
     68        /** Physical addresses of buffers */
     69        uintptr_t *buf_phys;
     70        /** Stream format */
     71        uint32_t fmt;
     72} hda_stream_t;
    5173
    52 #ifndef __ASM__
    53 
    54 extern void page_arch_init(void);
    55 
    56 #endif /* __ASM__ */
     74extern hda_stream_t *hda_stream_create(hda_t *, hda_stream_dir_t, uint32_t);
     75extern void hda_stream_destroy(hda_stream_t *);
     76extern void hda_stream_start(hda_stream_t *);
     77extern void hda_stream_stop(hda_stream_t *);
     78extern void hda_stream_reset(hda_stream_t *);
    5779
    5880#endif
Note: See TracChangeset for help on using the changeset viewer.