Ignore:
Timestamp:
2013-08-19T17:23:31Z (11 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
4da8fdb
Parents:
2921602 (diff), 4a9728ec (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 audio support.

Includes audio server and sb16 driver.

Tested on ia32 and amd64 (qemu).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/drv/generic/remote_hw_res.c

    r2921602 rab92305  
    11/*
    22 * Copyright (c) 2010 Lenka Trochtova
     3 * Copyright (c) 2011 Jan Vesely
    34 * All rights reserved.
    45 *
     
    4344static void remote_hw_res_enable_interrupt(ddf_fun_t *, void *, ipc_callid_t,
    4445    ipc_call_t *);
     46static void remote_hw_res_dma_channel_setup(ddf_fun_t *, void *, ipc_callid_t,
     47    ipc_call_t *);
     48static void remote_hw_res_dma_channel_remain(ddf_fun_t *, void *, ipc_callid_t,
     49    ipc_call_t *);
    4550
    4651static remote_iface_func_ptr_t remote_hw_res_iface_ops [] = {
    47         &remote_hw_res_get_resource_list,
    48         &remote_hw_res_enable_interrupt
     52        [HW_RES_GET_RESOURCE_LIST] = &remote_hw_res_get_resource_list,
     53        [HW_RES_ENABLE_INTERRUPT] = &remote_hw_res_enable_interrupt,
     54        [HW_RES_DMA_CHANNEL_SETUP] = &remote_hw_res_dma_channel_setup,
     55        [HW_RES_DMA_CHANNEL_REMAIN] = &remote_hw_res_dma_channel_remain,
    4956};
    5057
     
    94101}
    95102
     103static void remote_hw_res_dma_channel_setup(ddf_fun_t *fun, void *ops,
     104    ipc_callid_t callid, ipc_call_t *call)
     105{
     106        hw_res_ops_t *hw_res_ops = ops;
     107
     108        if (hw_res_ops->dma_channel_setup == NULL) {
     109                async_answer_0(callid, ENOTSUP);
     110                return;
     111        }
     112        const unsigned channel = DEV_IPC_GET_ARG1(*call) & 0xffff;
     113        const uint8_t  mode = DEV_IPC_GET_ARG1(*call) >> 16;
     114        const uint32_t address = DEV_IPC_GET_ARG2(*call);
     115        const uint32_t size = DEV_IPC_GET_ARG3(*call);
     116
     117        const int ret = hw_res_ops->dma_channel_setup(
     118            fun, channel, address, size, mode);
     119        async_answer_0(callid, ret);
     120}
     121
     122static void remote_hw_res_dma_channel_remain(ddf_fun_t *fun, void *ops,
     123    ipc_callid_t callid, ipc_call_t *call)
     124{
     125        hw_res_ops_t *hw_res_ops = ops;
     126
     127        if (hw_res_ops->dma_channel_setup == NULL) {
     128                async_answer_0(callid, ENOTSUP);
     129                return;
     130        }
     131        const unsigned channel = DEV_IPC_GET_ARG1(*call);
     132        size_t remain = 0;
     133        const int ret = hw_res_ops->dma_channel_remain(fun, channel, &remain);
     134        async_answer_1(callid, ret, remain);
     135}
    96136/**
    97137 * @}
Note: See TracChangeset for help on using the changeset viewer.