1 /* 2 * io.h 3 * 4 * DSP-BIOS Bridge driver support functions for TI OMAP processors. 5 * 6 * The io module manages IO between CHNL and msg_ctrl. 7 * 8 * Copyright (C) 2005-2006 Texas Instruments, Inc. 9 * 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. 13 * 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. 17 */ 18 19 #ifndef IO_ 20 #define IO_ 21 22 #include <dspbridge/cfgdefs.h> 23 #include <dspbridge/devdefs.h> 24 25 /* IO Objects: */ 26 struct io_mgr; 27 28 /* IO manager attributes: */ 29 struct io_attrs { 30 u8 birq; /* Channel's I/O IRQ number. */ 31 bool irq_shared; /* TRUE if the IRQ is shareable. */ 32 u32 word_size; /* DSP Word size. */ 33 u32 shm_base; /* Physical base address of shared memory. */ 34 u32 sm_length; /* Size (in bytes) of shared memory. */ 35 }; 36 37 38 /* 39 * ======== io_create ======== 40 * Purpose: 41 * Create an IO manager object, responsible for managing IO between 42 * CHNL and msg_ctrl. 43 * Parameters: 44 * channel_mgr: Location to store a channel manager object on 45 * output. 46 * hdev_obj: Handle to a device object. 47 * mgr_attrts: IO manager attributes. 48 * mgr_attrts->birq: I/O IRQ number. 49 * mgr_attrts->irq_shared: TRUE if the IRQ is shareable. 50 * mgr_attrts->word_size: DSP Word size in equivalent PC bytes.. 51 * Returns: 52 * 0: Success; 53 * -ENOMEM: Insufficient memory for requested resources. 54 * -EIO: Unable to plug channel ISR for configured IRQ. 55 * -EINVAL: Invalid DSP word size (must be > 0). 56 * Invalid base address for DSP communications. 57 * Requires: 58 * io_man != NULL. 59 * mgr_attrts != NULL. 60 * Ensures: 61 */ 62 extern int io_create(struct io_mgr **io_man, 63 struct dev_object *hdev_obj, 64 const struct io_attrs *mgr_attrts); 65 66 /* 67 * ======== io_destroy ======== 68 * Purpose: 69 * Destroy the IO manager. 70 * Parameters: 71 * hio_mgr: IOmanager object. 72 * Returns: 73 * 0: Success. 74 * -EFAULT: hio_mgr was invalid. 75 * Requires: 76 * Ensures: 77 */ 78 extern int io_destroy(struct io_mgr *hio_mgr); 79 80 #endif /* CHNL_ */ 81