Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1 | /* include/asm-arm/arch-msm/msm_adsp.h |
| 2 | * |
| 3 | * Copyright (C) 2008 Google, Inc. |
Duy Truong | 790f06d | 2013-02-13 16:38:12 -0800 | [diff] [blame] | 4 | * Copyright (c) 2009-2010, 2012 The Linux Foundation. All rights reserved. |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5 | * |
| 6 | * This software is licensed under the terms of the GNU General Public |
| 7 | * License version 2, as published by the Free Software Foundation, and |
| 8 | * may be copied, distributed, and modified under those terms. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. |
| 14 | * |
| 15 | */ |
| 16 | |
| 17 | #ifndef __ASM__ARCH_MSM_ADSP_H |
| 18 | #define __ASM__ARCH_MSM_ADSP_H |
| 19 | |
| 20 | struct msm_adsp_module; |
| 21 | |
| 22 | struct msm_adsp_ops { |
| 23 | /* event is called from interrupt context when a message |
| 24 | * arrives from the DSP. Use the provided function pointer |
| 25 | * to copy the message into a local buffer. Do NOT call |
| 26 | * it multiple times. |
| 27 | */ |
| 28 | void (*event)(void *driver_data, unsigned id, size_t len, |
| 29 | void (*getevent)(void *ptr, size_t len)); |
| 30 | }; |
| 31 | |
| 32 | /* Get, Put, Enable, and Disable are synchronous and must only |
| 33 | * be called from thread context. Enable and Disable will block |
| 34 | * up to one second in the event of a fatal DSP error but are |
| 35 | * much faster otherwise. |
| 36 | */ |
| 37 | int msm_adsp_get(const char *name, struct msm_adsp_module **module, |
| 38 | struct msm_adsp_ops *ops, void *driver_data); |
| 39 | void msm_adsp_put(struct msm_adsp_module *module); |
| 40 | int msm_adsp_enable(struct msm_adsp_module *module); |
| 41 | int msm_adsp_disable(struct msm_adsp_module *module); |
=Chaithanya Krishna Bacharaju | b5c4e98 | 2012-12-06 09:53:18 +0530 | [diff] [blame] | 42 | int msm_adsp_dump(struct msm_adsp_module *module); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 43 | int adsp_set_clkrate(struct msm_adsp_module *module, unsigned long clk_rate); |
| 44 | int msm_adsp_disable_event_rsp(struct msm_adsp_module *module); |
| 45 | int32_t get_adsp_resource(unsigned short client_idx, |
| 46 | void *cmd_buf, size_t cmd_size); |
| 47 | int32_t put_adsp_resource(unsigned short client_idx, |
| 48 | void *cmd_buf, size_t cmd_size); |
| 49 | |
| 50 | /* Write is safe to call from interrupt context. |
| 51 | */ |
| 52 | int msm_adsp_write(struct msm_adsp_module *module, |
| 53 | unsigned queue_id, |
| 54 | void *data, size_t len); |
| 55 | |
Manish Dewangan | 8e87bc1 | 2012-02-09 20:25:15 +0530 | [diff] [blame] | 56 | /*Explicitly gererate adsp event */ |
| 57 | int msm_adsp_generate_event(void *data, |
| 58 | struct msm_adsp_module *mod, |
| 59 | unsigned event_id, |
| 60 | unsigned event_length, |
| 61 | unsigned event_size, |
| 62 | void *msg); |
| 63 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 64 | #define ADSP_MESSAGE_ID 0xFFFF |
| 65 | |
| 66 | /* Command Queue Indexes */ |
| 67 | #define QDSP_lpmCommandQueue 0 |
| 68 | #define QDSP_mpuAfeQueue 1 |
| 69 | #define QDSP_mpuGraphicsCmdQueue 2 |
| 70 | #define QDSP_mpuModmathCmdQueue 3 |
| 71 | #define QDSP_mpuVDecCmdQueue 4 |
| 72 | #define QDSP_mpuVDecPktQueue 5 |
| 73 | #define QDSP_mpuVEncCmdQueue 6 |
| 74 | #define QDSP_rxMpuDecCmdQueue 7 |
| 75 | #define QDSP_rxMpuDecPktQueue 8 |
| 76 | #define QDSP_txMpuEncQueue 9 |
| 77 | #define QDSP_uPAudPPCmd1Queue 10 |
| 78 | #define QDSP_uPAudPPCmd2Queue 11 |
| 79 | #define QDSP_uPAudPPCmd3Queue 12 |
| 80 | #define QDSP_uPAudPlay0BitStreamCtrlQueue 13 |
| 81 | #define QDSP_uPAudPlay1BitStreamCtrlQueue 14 |
| 82 | #define QDSP_uPAudPlay2BitStreamCtrlQueue 15 |
| 83 | #define QDSP_uPAudPlay3BitStreamCtrlQueue 16 |
| 84 | #define QDSP_uPAudPlay4BitStreamCtrlQueue 17 |
| 85 | #define QDSP_uPAudPreProcCmdQueue 18 |
| 86 | #define QDSP_uPAudRecBitStreamQueue 19 |
| 87 | #define QDSP_uPAudRecCmdQueue 20 |
| 88 | #define QDSP_uPDiagQueue 21 |
| 89 | #define QDSP_uPJpegActionCmdQueue 22 |
| 90 | #define QDSP_uPJpegCfgCmdQueue 23 |
| 91 | #define QDSP_uPVocProcQueue 24 |
| 92 | #define QDSP_vfeCommandQueue 25 |
| 93 | #define QDSP_vfeCommandScaleQueue 26 |
| 94 | #define QDSP_vfeCommandTableQueue 27 |
| 95 | #define QDSP_vfeFtmCmdQueue 28 |
| 96 | #define QDSP_vfeFtmCmdScaleQueue 29 |
| 97 | #define QDSP_vfeFtmCmdTableQueue 30 |
| 98 | #define QDSP_uPJpegFtmCfgCmdQueue 31 |
| 99 | #define QDSP_uPJpegFtmActionCmdQueue 32 |
| 100 | #define QDSP_apuAfeQueue 33 |
| 101 | #define QDSP_mpuRmtQueue 34 |
| 102 | #define QDSP_uPAudPreProcAudRecCmdQueue 35 |
| 103 | #define QDSP_uPAudRec0BitStreamQueue 36 |
| 104 | #define QDSP_uPAudRec0CmdQueue 37 |
| 105 | #define QDSP_uPAudRec1BitStreamQueue 38 |
| 106 | #define QDSP_uPAudRec1CmdQueue 39 |
| 107 | #define QDSP_apuRmtQueue 40 |
| 108 | #define QDSP_uPAudRec2BitStreamQueue 41 |
| 109 | #define QDSP_uPAudRec2CmdQueue 42 |
| 110 | #define QDSP_MAX_NUM_QUEUES 43 |
| 111 | |
| 112 | #endif |