4 * DSP-BIOS Bridge driver support functions for TI OMAP processors.
6 * IO manager interface: Manages IO between CHNL and msg_ctrl.
8 * Copyright (C) 2005-2006 Texas Instruments, Inc.
10 * This package is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
14 * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
15 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
16 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
18 #include <linux/types.h>
20 /* ----------------------------------- Host OS */
21 #include <dspbridge/host_os.h>
23 /* ----------------------------------- DSP/BIOS Bridge */
24 #include <dspbridge/dbdefs.h>
26 /* ----------------------------------- Platform Manager */
27 #include <dspbridge/dev.h>
29 /* ----------------------------------- This */
31 #include <dspbridge/io.h>
34 * ======== io_create ========
36 * Create an IO manager object, responsible for managing IO between
39 int io_create(struct io_mgr **io_man, struct dev_object *hdev_obj,
40 const struct io_attrs *mgr_attrts)
42 struct bridge_drv_interface *intf_fxns;
43 struct io_mgr *hio_mgr = NULL;
44 struct io_mgr_ *pio_mgr = NULL;
49 /* A memory base of 0 implies no memory base: */
50 if ((mgr_attrts->shm_base != 0) && (mgr_attrts->sm_length == 0))
53 if (mgr_attrts->word_size == 0)
57 dev_get_intf_fxns(hdev_obj, &intf_fxns);
59 /* Let Bridge channel module finish the create: */
60 status = (*intf_fxns->io_create) (&hio_mgr, hdev_obj,
64 pio_mgr = (struct io_mgr_ *)hio_mgr;
65 pio_mgr->intf_fxns = intf_fxns;
66 pio_mgr->dev_obj = hdev_obj;
68 /* Return the new channel manager handle: */
77 * ======== io_destroy ========
81 int io_destroy(struct io_mgr *hio_mgr)
83 struct bridge_drv_interface *intf_fxns;
84 struct io_mgr_ *pio_mgr = (struct io_mgr_ *)hio_mgr;
87 intf_fxns = pio_mgr->intf_fxns;
89 /* Let Bridge channel module destroy the io_mgr: */
90 status = (*intf_fxns->io_destroy) (hio_mgr);